WO2020140663A1 - 微服务灰度发布方法、装置、计算机设备和存储介质 - Google Patents
微服务灰度发布方法、装置、计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2020140663A1 WO2020140663A1 PCT/CN2019/122346 CN2019122346W WO2020140663A1 WO 2020140663 A1 WO2020140663 A1 WO 2020140663A1 CN 2019122346 W CN2019122346 W CN 2019122346W WO 2020140663 A1 WO2020140663 A1 WO 2020140663A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- microservice
- grayscale
- request
- information
- business
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- the present application relates to a microservice gray-scale distribution method, device, computer equipment and storage medium.
- Grayscale release (also known as canary release) refers to a release method that can smoothly transition between black and white. A/B testing can be conducted on it, that is, let some users continue to use product feature A, and some users start to use product feature B. If users have no objection to B, then gradually expand the scope and migrate all users to B. Come. Grayscale release can ensure the stability of the overall system. At the initial grayscale, problems can be found and adjusted to ensure the impact of the product and the stability of the function, reduce the impact of product upgrades on users, and reduce the downtime of the production release system. Seamless production environment switching can be achieved. Developers and testers do not need to verify production functions online in the middle of the night, and certain bugs that need to be discovered the next day can be discovered early.
- a microservice grayscale distribution method device, computer device, and storage medium are provided.
- a microservice grayscale publishing method including:
- a micro-service grayscale publishing device including:
- a request receiving module used to receive an encrypted service request, decrypt the encrypted service request, and obtain a service request
- the identification generation module is used to analyze the business request to obtain an analysis result, match the analysis result with a preset grayscale rule, and generate a corresponding grayscale when the analysis result matches the preset grayscale rule successfully logo
- a mark writing module used to write the gray scale mark into the business request to obtain a business request with a gray scale mark
- a microservice acquiring module configured to acquire a microservice identifier corresponding to the business request, and obtain corresponding microservice information according to the microservice identifier;
- a first request sending module configured to send the grayscale service request to the grayscale microservice information according to the grayscale microservice address when the grayscale microservice information exists in the microservice information Grayscale microservice server;
- the result returning module is used to obtain the business result corresponding to the business request with gray mark and return the business result.
- a computer device includes a memory and one or more processors.
- the memory stores computer-readable instructions.
- the processor executes the following steps.
- One or more non-volatile storage media storing computer readable instructions.
- the computer readable instructions When executed by one or more processors, the one or more processors execute the following steps. :
- FIG. 1 is an application scenario diagram of a microservice grayscale publishing method according to one or more embodiments.
- FIG. 2 is a schematic flowchart of a microservice grayscale publishing method according to one or more embodiments.
- FIG. 3 is a schematic flowchart of microservice registration according to one or more embodiments.
- FIG. 4 is an application scenario diagram of a microservice grayscale publishing method in another embodiment.
- FIG. 5 is a block diagram of a micro-service grayscale publishing device according to one or more embodiments.
- Figure 6 is a block diagram of a computer device in accordance with one or more embodiments.
- the microservice grayscale distribution method provided by this application can be applied to the application environment shown in FIG. 1.
- the terminal 102 communicates with the gateway server 104 via the network, and the gateway server 104 and the microservice server 106 communicate via the network.
- the gateway server 104 receives the encrypted service request sent by the terminal 102, decrypts the encrypted service request to obtain a business request; analyzes the service request to obtain an analysis result, matches the analysis result with the preset grayscale rule, and when the analysis result matches the preset grayscale rule When the match is successful, the corresponding grayscale mark is generated; the grayscale mark is written into the business request to obtain the business request with the grayscale mark; the microservice mark corresponding to the business request is obtained, and the corresponding microservice information is obtained according to the microservice mark ; When the grayscale microservice information exists in the microservice information, according to the grayscale microservice information grayscale microservice address will send a grayscale service request to the grayscale microservice server 106; obtain the grayscale logo The business result corresponding to the business request of
- a microservice grayscale publishing method is provided.
- the method is applied to the gateway server in FIG. 1 as an example for illustration, including the following steps:
- S202 Receive the encrypted service request, decrypt the encrypted service request, and obtain the service request.
- the gateway server receives the encrypted service request, and the gateway server decrypts the encrypted service request by using a preset decryption method.
- the decrypted business request is obtained.
- the business request refers to a request sent by the terminal corresponding to the business function to be processed, which may be a payment request, a transaction request, and so on.
- S204 Parse the service request to obtain a parsing result, match the parsing result with the preset grayscale rule, and generate a corresponding grayscale mark when the parsing result matches the preset grayscale rule successfully.
- the preset grayscale rules are preset rules for distinguishing whether a business request is a grayscale business request. For example, the ID number, mobile phone number, and name for issuing grayscales can be preset.
- the grayscale mark is used to write in the business request and is used to indicate that the business request is processed by the grayscale microservice.
- the gateway server parses the service request to obtain a parsed result, and matches the obtained parsed result with preset grayscale rules. When the matching is successful, the gateway server generates a grayscale mark corresponding to the service request.
- the gateway server writes the generated gray mark to the service request to obtain a service request with a gray mark.
- the gray mark is a "GRAY" mark, and the mark is written to httpHeader (hypertext In the transfer protocol header message).
- S208 Obtain the microservice identifier corresponding to the service request, and obtain corresponding microservice information according to the microservice identifier.
- microservice identifier is used to identify the microservice, which can be the name of the microservice and so on.
- Microservice information refers to the specific information of the microservice, including microservice instance, microservice location information, microservice service type, etc.
- the gateway service obtains the microservice identifier required for completion of the business request, and obtains corresponding microservice information according to the microservice identifier.
- the gateway server sends the business request with the gray mark to the gray micro service server according to the gray micro service address.
- the server of the grayscale microservice receives the business request with the grayscale logo
- the service microservice is processed according to the business request, and when the business result of the business request is obtained, the service request is returned to the gateway server Business results.
- the microservice identification required to complete the business request is retrieved to obtain the microservice information.
- the business request with the grayscale identification is sent
- the server for the grayscale microservice will return the business result to the gateway server until the business result of the business request is obtained.
- the gateway server obtains the business result corresponding to the business request with the gray mark, and returns the business result to the terminal for display.
- the encrypted service request is decrypted to decrypt the encrypted service request to obtain a business request; the business request is parsed to obtain a parsed result, and the parsed result is matched with a preset grayscale rule when the When the parsing result matches the preset grayscale rule successfully, a corresponding grayscale mark is generated; the grayscale mark is written into the business request to obtain a business request with a grayscale mark; and the business is acquired Request the corresponding microservice ID and obtain corresponding microservice information according to the microservice ID; when grayscale microservice information exists in the microservice information, according to the grayscale microservice address in the grayscale microservice information
- the business request with the grayscale mark is sent to the grayscale microservice server; the business result corresponding to the business request with the grayscale mark is obtained, the business result is returned, and the business request is generated by generating the grayscale mark
- Carrying the grayscale logo enables subsequent microservices to select grayscale microservices for processing according to the grayscale logo when processing the business request, which can improve the efficiency of
- step S210 when grayscale microservice information exists in the microservice information, a business request with grayscale identification is sent to the grayscale microservice according to the grayscale microservice address in the grayscale microservice information Server, including steps:
- the service request with the grayscale mark is sent to the corresponding microservice server according to the microservice address in the microservice information.
- the microservice is obtained according to the microservice location information in the microservice information Address, according to the obtained microservice address, the business request with the gray mark is sent to the corresponding microservice server according to the preset rule.
- the preset rule is that when there are multiple microservices, the microservice address of a microservice is selected according to random, polling and processing time, and the business request with the gray mark is sent to the selected microservice.
- the microservice server performs business microservice processing when receiving the business request, when the business result is obtained, returns the business result to the gateway terminal, and when the business result is not obtained, the server of the microservice obtains and completes the business request
- the required microservice ID obtain the microservice information according to the microservice ID, when there is grayscale microservice information in the microservice information, according to the microservice address in the grayscale microservice information, the unfinished
- the business request sends the grayscale microservice server until the business result of the business request is obtained, and returns the business result to the gateway server, and the gateway server returns the business result to the terminal.
- the service request with the gray mark is sent to the corresponding gray service server according to the micro service address in the micro service information.
- the business request requires multiple microservices to be completed in sequence, you can send the business request with the grayscale logo to the microservice server that is part of the grayscale microservices in the multiple microservices, complete the grayscale release, and can The business results are returned normally, which improves the flexibility of microservice grayscale publishing.
- step S204 is to match the analysis result with the preset grayscale rule.
- generating a corresponding grayscale mark includes the steps of:
- the gateway server parses the preset grayscale rules to obtain multiple target grayscale rules.
- the gateway server generates the grayscale identification of the service request.
- multiple target grayscale rules are obtained by parsing the preset grayscale rules, and the analysis results are matched with the target grayscale rules.
- the analysis results match the target grayscale rules successfully, a corresponding grayscale mark is generated , Can get the grayscale corresponding to the business request, and pass the grayscale logo along with the business request, so that the subsequent microservice server can also get the grayscale logo and send it to the grayscale microservice server, which improves the grayscale distribution of microservices. Flexibility.
- step S208 that is, acquiring the microservice identifier corresponding to the business request, and obtaining the corresponding microservice information according to the microservice identifier, includes:
- microservice identifier corresponding to the business request, and obtain the corresponding microservice information from the microservice registration center according to the microservice identifier.
- the service registration center is used to provide service registration and discovery.
- each microservice identifier corresponding to the business request is obtained, and the corresponding microserver information is obtained from the microservice registration center according to the microservice identifier, where the microservice registration center may be Eureka (a part of Spring Cloud Netflix microservice suite).
- the corresponding microservice information can be obtained, which is convenient for use and improves the efficiency of processing the business request.
- step S208 that is, before obtaining the microservice identifier corresponding to the business request, and before obtaining the corresponding microservice information from the microservice registration center according to the microservice identifier, the method further includes the following steps:
- S302 start the microservice corresponding to the microservice identifier, and send a registration request to the microservice registration center.
- the registration request carries the microservice information corresponding to the microservice, so that the microservice registration center saves the microservice information corresponding to the microservice according to the registration request .
- the microservice server when starting the microservice corresponding to the microservice identifier, the microservice server sends a registration request to the microservice registration center.
- the registration request carries the microservice information corresponding to the microservice.
- the microservice information includes the parent instance and the microservice information. Service type and microservice instance.
- the microservice registration center saves the corresponding microservice information according to the registration request and provides it to microservice consumers.
- S304 Obtain the registration success prompt returned by the microservice registration center, and enable the microservice and the microservice registration center to save the heartbeat connection.
- the microservice server obtains the registration success prompt returned by the microservice registration center, and the successfully registered microservice and the microservice registration center save the heartbeat connection to ensure that the microservice consumer can discover the registered microservice.
- the microservice corresponding to the microservice identifier is started, and a registration request is sent to the microservice registration center, and the registration request carries the microservice information corresponding to the microservice, so that the microservice registration center corresponds the microservice according to the registration request Save the microservice information, get the registration success prompt returned by the microservice registration center, and make the microservice and the microservice registration center save the heartbeat connection, register the microservice in the microservice registration center in advance, and use it directly from the microservice registration center Obtain, convenient and fast, improve efficiency.
- step S210 that is, when there is grayscale microservice information in the microservice information, according to the grayscale microservice information in the grayscale microservice information, the grayscale service address request is sent to the grayscale microservice Service server, including steps:
- the priority of the business request with the grayscale mark is obtained, and the business request with the reply mark is sequentially sent to the grayscale according to the priority of the business request with the grayscale mark Degree micro service server.
- the gateway server obtains the service with the grayscale mark
- the priority of the request according to the order of priority, the business request with the gray mark is sent to the gray micro service server in order from high to low, that is, the business request with the gray mark with high priority is processed first, Meet user needs.
- step S212 that is, after obtaining the business result corresponding to the business request with the gray mark and returning the business result, the steps include:
- the gray mark is deleted.
- the gateway server when the gateway server obtains the business result corresponding to the service request with the gray mark, it means that the service request with the gray mark has been processed. At this time, the gateway server will save the service request Corresponding gray mark is deleted to ensure the security of the gray mark.
- steps in the flowcharts of FIGS. 2-3 are displayed in order according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in FIG. 2-3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages The execution order of is not necessarily sequential, but may be executed in turn or alternately with at least a part of other steps or sub-steps or stages of other steps.
- the terminal 102 sends an encrypted service request to the gateway server 104, and the gateway server 104 decrypts the encrypted service request after receiving the encrypted service request, and judges according to the preset grayscale rules Whether the service request is a gray-scale service request, when the gray-scale rule matches successfully, a gray-scale logo is generated, and the gray-scale logo is written into the business request.
- the gateway server can request the service Convert messages and protocols, and encrypt the converted results.
- the gateway server 104 obtains the microservice information corresponding to the service request, including the server address information of the microservice server 106 and the microservice server 112, each microservice corresponds to a microservice server, and obtains the microservice according to the service type of the microservice information Neither service 106 nor microservice 112 is a grayscale microservice, but both are production microservices. That is, the microservice 106 and the microservice 112 are microservices in the production environment A, and are stable version microservices.
- the gateway server 104 sends the service request with the gray mark to the micro service server 106.
- the micro service server 106 receives the encrypted service request, decrypts it first, and then analyzes it to obtain the gray mark, and then processes the service request. .
- the microservice information still needed to obtain the completion of the business request includes the information of the microservice 108 and the information of the microservice 108a.
- the microservice 108a is a grayscale microservice, that is, the microservice 108a is in the production environment B, which is new
- the version of the microservice, that is, the microservice issued by grayscale the microservice server 106 passes the business request to the grayscale microservice server 108a, and the grayscale microservice server 108a also decrypts and parses to obtain the grayscale logo and performs Business request processing.
- the grayscale microservice server 110a sends the business request to the grayscale microservice server 110a, the grayscale microservice server 110a also processes the business request, and then the business request It is sent to the microservice 116 to obtain the result corresponding to the business request, and the result corresponding to the business request is returned to the gateway server 104, and the gateway server 104 displays the business result to the terminal 102.
- a microservice grayscale publishing device 500 including: a request receiving module 502, an identification generating module 504, an identification writing module 506, a microservice acquiring module 508, and A request sending module 510 and a result returning module 512, in which:
- the request receiving module 502 is used to receive the encrypted service request, decrypt the encrypted service request, and obtain the service request;
- the mark generation module 504 is used to parse the business request to obtain the analysis result, match the analysis result with the preset grayscale rule, and generate a corresponding grayscale mark when the analysis result matches the preset grayscale rule successfully;
- the mark writing module 506 is used to write the gray mark to the business request to obtain the business request with the gray mark;
- the microservice obtaining module 508 is used to obtain a microservice identifier corresponding to a business request, and obtain corresponding microservice information according to the microservice identifier;
- the first request sending module 510 when grayscale microservice information exists in the microservice information, sends a business request with grayscale identification to the grayscale microservice server according to the grayscale microservice address in the grayscale microservice information;
- the result returning module 512 obtains the business result corresponding to the business request with the gray mark, and returns the business result.
- the first request sending module 510 includes:
- the second request sending module is used to send a service request with a gray mark to the corresponding micro service server according to the micro service address in the micro service information when there is no gray scale micro service information in the micro service information.
- the identification generation module 504 includes:
- the target rule matching module is used to analyze the preset grayscale rules to obtain multiple target grayscale rules, match the analysis results with the target grayscale rules, and generate a corresponding grayscale when the analysis results match the target grayscale rules successfully Logo.
- the microservice acquisition module 508 includes:
- the information obtaining module is used to obtain the microservice identifier corresponding to the business request, and obtain the corresponding microservice information from the microservice registration center according to the microservice identifier.
- the microservice grayscale publishing device 500 further includes:
- the micro service registration module is used to start the micro service corresponding to the micro service identifier, and send a registration request to the micro service registration center.
- the registration request carries the micro service information corresponding to the micro service, so that the micro service registration center corresponds the micro service according to the registration request Of microservice information preservation;
- the heartbeat connection module is used to obtain a registration success prompt returned by the microservice registration center, and enable the microservice and the microservice registration center to save the heartbeat connection.
- the first request sending module 510 includes:
- the priority obtaining module is used to obtain the priority of the business request with the gray mark when there is grayscale microservice information in the microservice information, and the reply mark will be provided according to the priority of the business request with the gray mark
- the business request is sent to the grayscale microservice server in turn.
- the microservice grayscale publishing device 500 includes:
- the mark deletion module is used to delete the gray mark when the business result corresponding to the business request with the gray mark is obtained.
- microservice grayscale distribution device For the specific definition of the microservice grayscale distribution device, please refer to the above definition of the microservice grayscale distribution method, which will not be repeated here.
- Each module in the above microservice grayscale distribution device may be implemented in whole or in part by software, hardware, and a combination thereof.
- the above modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory in the computer device in the form of software so that the processor can call and execute the operations corresponding to the above modules.
- a computer device is provided.
- the computer device may be a server, and its internal structure may be as shown in FIG. 6.
- the computer device includes a processor, memory, network interface, and database connected by a system bus. Among them, the processor of the computer device is used to provide computing 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, computer-readable instructions, and a database.
- the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
- the database of the computer device is used to store business request data.
- the network interface of the computer device is used to communicate with external terminals through a network connection.
- FIG. 6 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied.
- the specific computer equipment may Include more or less components than shown in the figure, or combine certain components, or have a different arrangement of components.
- a computer device includes a memory and one or more processors.
- the memory stores computer-readable instructions.
- the steps of the microservice publishing method provided in any embodiment of the present application are implemented.
- One or more non-volatile storage media storing computer-readable instructions.
- the computer-readable instructions When executed by one or more processors, the one or more processors implement the microcomputer provided in any of the embodiments of the present application. The steps of the service publishing method.
- Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory can include random access memory (RAM) or external cache memory.
- RAM random access memory
- DRAM dynamic RAM
- SDRAM synchronous DRAM
- DDRSDRAM double data rate SDRAM
- ESDRAM enhanced SDRAM
- SLDRAM synchronous chain (Synchlink) DRAM
- RDRAM direct RAM
- DRAM direct memory bus dynamic RAM
- RDRAM memory bus dynamic RAM
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
一种微服务灰度发布方法,包括:接收加密业务请求,对加密业务请求进行解密,得到业务请求;解析业务请求得到解析结果,将解析结果与预设灰度规则匹配,当解析结果与预设灰度规则匹配成功时,生成对应的灰度标识;将灰度标识写入业务请求中,得到带有灰度标识的业务请求;获取业务请求对应的微服务标识,根据微服务标识获取对应的微服务信息;当微服务信息中存在灰度微服务信息时,根据灰度微服务信息中灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务服务器;获取业务结果,将业务结果返回。
Description
相关申请的交叉引用
本申请要求于2019年01月04日提交中国专利局,申请号为2019100070469,申请名称为“微服务灰度发布方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及一种微服务灰度发布方法、装置、计算机设备和存储介质。
灰度发布(又名金丝雀发布)是指在黑与白之间,能够平滑过渡的一种发布方式。在其上可以进行A/B testing,即让一部分用户继续用产品特性A,一部分用户开始用产品特性B,如果用户对B没有什么反对意见,那么逐步扩大范围,把所有用户都迁移到B上面来。灰度发布可以保证整体系统的稳定,在初始灰度的时候就可以发现、调整问题,以保证其影响度提升产品及功能的稳定性,降低产品升级对用户的影响降低生产发布系统停机时长,可做到无缝生产环境切换,开发测试人员无需半夜对生产功能进行在线验证,对某些需隔日发现的bug可提早发现。而现有产品的业务线都是需要多个微服务进行协作才能进行业务处理,然而现有产品的业务线中的微服务进行灰度发布时,都需要明确的标识每个微服务为生产微服务或者灰度微服务,然后才能进行灰度发布,导致灰度发布的效率低下。
发明内容
根据本申请公开的各种实施例,提供一种微服务灰度发布方法、装置、计算机设备和存储介质。
一种微服务灰度发布方法,包括:
接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;
解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;
将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;
获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;
当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及
获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
一种微服务灰度发布装置,包括:
请求接收模块,用于接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;
标识生成模块,用于解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;
标识写入模块,用于将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;
微服务获取模块,用于获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;
第一请求发送模块,用于当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及
结果返回模块,用于获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤计算机可读指令计算机可读指令:
接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;
解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;
将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;
获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;
当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及
获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤计算机可读指令计算机可读指令:
接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;
解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;
将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;
获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;
当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及
获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返 回。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中微服务灰度发布方法的应用场景图。
图2为根据一个或多个实施例中微服务灰度发布方法的流程示意图。
图3为根据一个或多个实施例中微服务注册的流程示意图。
图4为另一个实施例中微服务灰度发布方法的应用场景图。
图5为根据一个或多个实施例中微服务灰度发布装置的框图。
图6为根据一个或多个实施例中计算机设备的框图。
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的微服务灰度发布方法,可以应用于如图1所示的应用环境中。终端102通过网络与网关服务器104进行通信,网关服务器104与微服务服务器106通过网络进行通信。网关服务器104接收终端102发送的加密业务请求,对加密业务请求进行解密,得到业务请求;解析业务请求得到解析结果,将解析结果与预设灰度规则匹配,当解析结果与预设灰度规则匹配成功时,生成对应的灰度标识;将灰度标识写入业务请求中,得到带有灰度标识的业务请求;获取业务请求对应的微服务标识,根据微服务标识获取对 应的微服务信息;当微服务信息中存在灰度微服务信息时,根据灰度微服务信息中灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务服务器106;获取带有灰度标识的业务请求对应的业务结果,将业务结果返回。终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在其中一个实施例中,如图2所示,提供了一种微服务灰度发布方法,以该方法应用于图1中的网关服务器为例进行说明,包括以下步骤:
S202,接收加密业务请求,对加密业务请求进行解密,得到业务请求。
具体地,网关服务器接收到加密的业务请求,网关服务器利用预先设置好解密方式对加密的业务请求进行解密。得到解密后的业务请求,该业务请求是指终端发送的需要处理的业务功能对应的请求,可以是支付请求,交易请求等等。
S204,解析业务请求得到解析结果,将解析结果与预设灰度规则匹配,当解析结果与预设灰度规则匹配成功时,生成对应的灰度标识。
预设灰度规则是预先设置好的用来区分业务请求是否为灰度业务请求的规则,比如,可以是预先设置好发布灰度的身份证号、手机号和姓名等。灰度标识用于写入业务请求中,用于表示该业务请求是由灰度微服务处理的。
具体地,网关服务器解析该业务请求,得到解析结果,将得到的解析结果与预先设置好的灰度规则进行匹配,当匹配成功时,网关服务器生成该业务请求对应的灰度标识。
S206,将灰度标识写入业务请求中,得到带有灰度标识的业务请求。
具体地,网关服务器将生成的灰度标识写入到该业务请求中,得到带有灰度标识的业务请求,比如,灰度标识为“GRAY”标识,将该标识写入到httpHeader(超文本传输协议头消息中)上。
S208,获取业务请求对应的微服务标识,根据微服务标识获取对应的微服务信息。
微服务标识用来标识微服务,可以是微服务的名称等等。微服务信息是指该微服务的具体信息,包括微服务实例、微服务位置信息和微服务服务类型等等。
具体地,网关服务获取到该业务请求完成所需要的微服务标识,根据微服务标识获取到对应的微服务信息。
S210,当微服务信息中存在灰度微服务信息时,根据灰度微服务信息中灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务服务器。
具体地,当微服务信息中存在灰度微服务信息时,即微服务信息中的微服务类型为灰度类型时,得到该灰度类型的微服务信息中的微服务位置信息,得到灰度微服务地址,网关服务器根据灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务的服务器。
S212,获取带有灰度标识的业务请求对应的业务结果,将业务结果返回。
具体地,当灰度微服务的服务器接收到带有灰度标识的业务请求时,根据该业务请求进行业务微服务处理,当得到该业务请求的业务结果时,向网关服务器返回该业务请求的业务结果。当未得到该业务请求的业务结果时,重新获取完成该业务请求需要的微服务标识,得到微服务信息,当微服务信息中有灰度微服务时,将带有灰度标识的业务请求发送给灰度微服务的服务器,直到得到该业务请求的业务结果,将业务结果返回给网关服务器。网关服务器获取到带有灰度标识的业务请求对应的业务结果,将该业务结果返回给终端进行显示。
在上述实施例中,通过将接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到 灰度微服务服务器;获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回,通过生成灰度标识,使业务请求携带灰度标识,使得后续微服务处理该业务请求时,根据灰度标识选择灰度微服务进行处理,能够提高微服务发布的效率并提高微服务灰度发布灵活性。
在其中一个实施例中,步骤S210,当微服务信息中存在灰度微服务信息时,根据灰度微服务信息中灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务服务器,包括步骤:
当微服务信息未存在灰度微服务信息时,根据微服务信息中微服务地址将带有灰度标识的业务请求发送对应的微服务服务器。
具体地,当微服务器信息中为未存在灰度微服务信息时,即微服务信息中的微服务类型没有灰度类型,全为生产类型时,根据微服务信息中微服务位置信息得到微服务地址,根据得到的微服务地址将带有灰度标识的业务请求按照预设规则发送对应的微服务服务器。预设规则是指当有多个微服务时,按照随机、轮询和处理时效等选择一个微服务的微服务地址,将带有灰度标识的业务请求发送到选择的该微服务的微服务服务器,该微服务服务器接收到该业务请求时进行业务微服务处理,当得到业务结果时,向网关终端返回该业务结果,当未得到该业务结果时,该微服务的服务器获取完成该业务请求需要的微服务标识,根据微服务标识获取微服务信息,当微服务信息中存在灰度微服务信息时,根据该灰度微服务信息中的微服务地址将未完成的带有灰度标识的业务请求发送该灰度微服务的服务器,直到得到该业务请求的业务结果,将业务结果返回给网关服务器,网关服务器将业务结果返回终端。
在上述实施例中,当微服务信息未存在灰度微服务信息时,根据微服务信息中微服务地址将带有灰度标识的业务请求发送对应的灰度微服务服务器。当该业务请求需要多个微服务依次进行完成时,可以将带有灰度标识的业务请求发送到多个微服务中部分为灰度微服务的微服务服务器中,完成灰度发布,并能够正常返回业务结果,提高了微服务灰度发布灵活性。
在其中一个实施例中,步骤S204,即将解析结果与预设灰度规则匹配, 当解析结果与预设灰度规则匹配成功时,生成对应的灰度标识,包括步骤:
解析预设灰度规则,得到多个目标灰度规则,将解析结果与目标灰度规则进行匹配,当解析结果与目标灰度规则匹配成功时,生成对应的灰度标识。
具体地,网关服务器解析预设灰度规则,得到多个目标灰度规则,比如,配置的灰度规则为“idNo=522200193902108730 or memberNo=10000000007825 and acctId=123;acctId=456”。进行分号解析得到“idNo=522200193902108730 or memberNo=10000000007825 and acctId=123”和“acctId=456”。进行and或者or关系解析得到“idNo=522200193902108730 or memberNo=10000000007825”和“acctId=123”。得到目标灰度规则1:“(idNo=522200193902108730 or memberNo=10000000007825)and acctId=123”和目标灰度规则2:“acctId=456”。将得到的业务请求的解析结果与每一个目标灰度规则进行匹配,当能够与任意一个目标灰度规则匹配成功时,网关服务器生成该业务请求的灰度标识。
在上述实施例中,通过解析预设灰度规则得到多个目标灰度规则,将解析结果与目标灰度规则进行匹配,当解析结果与目标灰度规则匹配成功时,生成对应的灰度标识,能够得到业务请求对应的灰度标识,并将灰度标识与业务请求一起传递,使后续微服务服务器也能够得到灰度标识并向灰度微服务的服务器发送,提高了微服务灰度发布的灵活性。
在其中一个实施例中,步骤S208,即获取业务请求对应的微服务标识,根据微服务标识获取对应的微服务信息,包括:
获取业务请求对应的微服务标识,根据微服务标识从微服务注册中心获取对应的微服务信息。
服务注册中心用于提供服务的注册与发现。
具体地,获取业务请求对应的各个微服务标识,根据微服务标识从微服务注册中心获取对应的微服务器信息,其中,微服务注册中心可以是Eureka(Spring Cloud Netflix微服务套件中的一部分)。
在上述实施例中,通过获取业务请求对应的微服务标识,根据微服务标 识从微服务注册中心获取对应的微服务信息,可以得到对应的微服务信息,方便使用,提高业务请求的处理效率。
在其中一个实施例中,如图3所示,在步骤S208之前,即在获取业务请求对应的微服务标识,根据微服务标识从微服务注册中心获取对应的微服务信息之前,还包括步骤:
S302,启动微服务标识对应的微服务,向微服务注册中心发送注册请求,注册请求携带有微服务对应的微服务信息,以使微服务注册中心根据注册请求将微服务对应的微服务信息保存。
具体地,微服务服务器在启动微服务标识对应的微服务时,向微服务注册中心发送注册请求,该注册请求携带有微服务对应的微服务信息,该微服务信息中包括为父实例、微服务类型和微服务实例。微服务注册中心根据注册请求将对应的微服务信息进行保存,提供给微服务消费者使用。
S304,获取微服务注册中心返回的注册成功提示,并使微服务与微服务注册中心保存心跳连接。
具体地,微服务服务器获取到微服务注册中心返回的注册成功提示,并且,注册成功的微服务与微服务注册中心保存心跳连接,保证微服务消费者能够发现该注册的微服务。
上述实施例中,通过将启动微服务标识对应的微服务,向微服务注册中心发送注册请求,注册请求携带有微服务对应的微服务信息,以使微服务注册中心根据注册请求将微服务对应的微服务信息保存,获取微服务注册中心返回的注册成功提示,并使微服务与微服务注册中心保存心跳连接,预先将微服务注册到微服务注册中心中,使用时直接从微服务注册中心获取,方便快捷,提高效率。
在其中一个实施例中,步骤S210,即当微服务信息中存在灰度微服务信息时,根据灰度微服务信息中灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务服务器,包括步骤:
当微服务信息中存在灰度微服务信息时,获取带有灰度标识的业务请求 的优先级,根据带有灰度标识的业务请求的优先级将带有回复标识的业务请求依次发送到灰度微服务服务器。
具体地,当微服务信息中存在微服务类型为灰度类型的微服务信息时,且当网关服务器中有多个带有灰度标识的业务请求时,网关服务器获取带有灰度标识的业务请求的优先级,根据优先级的顺序由高到低依次将带有灰度标识的业务请求的发送到灰度微服务服务器中,即将优先级高的带有灰度标识的业务请求优先处理,满足用户需要。
在其中一个实施例中,在步骤S212之后,即在获取带有灰度标识的业务请求对应的业务结果,将业务结果返回之后,包括步骤:
当获取到带有灰度标识的业务请求对应的业务结果时,将灰度标识删除。
具体地,当网关服务器获取到带有灰度标识的业务请求对应的业务结果时,此时说明该带有灰度标识的业务请求已处理完成,此时,网关服务器会将保存的该业务请求对应的灰度标识进行删除,保证灰度标识的安全性。
应该理解的是,虽然图2-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个具体的实施例中,如图4所示,终端102向网关服务器104发送加密的业务请求,网关服务器104接收到该加密的业务请求后进行解密,并根据预先设置好的灰度规则判断该业务请求是否是灰度业务请求,当灰度规则匹配成功时,生成灰度标识,并将灰度标识写入该业务请求中,此时,网关服务器可以对带有灰度标识的业务请求进行报文和协议转换,并将转换后的结果进行加密。此时网关服务器104获取该业务请求对应的微服务信息, 包括微服务服务器106和微服务服务器112的服务器地址信息,每个微服务对应一个微服务服务器,根据微服务信息的服务类型得到该微服务106和微服务112都不是灰度微服务,都是生产微服务。即微服务106和微服务112是在生产环境A中的微服务,是稳定版本的微服务。此时网关服务器104将带有灰度标识的业务请求发送的微服务服务器106中,微服务服务器106接收加密的业务请求,先进行解密,在进行解析,得到灰度标识,并进行业务请求处理。此时,获取该业务请求完成仍然需要的微服务信息包括微服务108的信息和微服务108a的信息,得到微服务108a是灰度微服务,即微服务108a是在生产环境B,也就是新版本的微服务,即灰度发布的微服务,则微服务服务器106将该业务请求传递到灰度微服务服务器108a,灰度微服务服务器108a同样进行解密和解析,得到灰度标识,并进行业务请求处理。然后获取完成该业务请求完成仍然需要的微服务信息包括灰度微服务110a,将该业务请求发送到灰度微服务服务器110a,灰度微服务服务器110a同样对业务请求进行处理,然后将业务请求发送到微服务116中,得到业务请求对应的结果,将业务请求对应的结果返回给网关服务器104,网关服务器104将业务结果到终端102进行显示。
在其中一个实施例中,如图5所示,提供了一种微服务灰度发布装置500,包括:请求接收模块502、标识生成模块504、标识写入模块506、微服务获取模块508,第一请求发送模块510和结果返回模块512,其中:
请求接收模块502,用于接收加密业务请求,对加密业务请求进行解密,得到业务请求;
标识生成模块504,用于解析业务请求得到解析结果,将解析结果与预设灰度规则匹配,当解析结果与预设灰度规则匹配成功时,生成对应的灰度标识;
标识写入模块506,用于将灰度标识写入业务请求中,得到带有灰度标识的业务请求;
微服务获取模块508,用于获取业务请求对应的微服务标识,根据微服 务标识获取对应的微服务信息;
第一请求发送模块510,当微服务信息中存在灰度微服务信息时,根据灰度微服务信息中灰度微服务地址将带有灰度标识的业务请求发送到灰度微服务服务器;
结果返回模块512,获取带有灰度标识的业务请求对应的业务结果,将业务结果返回。
在其中一个实施例中,第一请求发送模块510,包括:
第二请求发送模块,用于当微服务信息未存在灰度微服务信息时,根据微服务信息中微服务地址将带有灰度标识的业务请求发送对应的微服务服务器。
在其中一个实施例中,标识生成模块504,包括:
目标规则匹配模块,用于解析预设灰度规则,得到多个目标灰度规则,将解析结果与目标灰度规则进行匹配,当解析结果与目标灰度规则匹配成功时,生成对应的灰度标识。
在一个实施例中,微服务获取模块508,包括:
信息获取模块,用于获取业务请求对应的微服务标识,根据微服务标识从微服务注册中心获取对应的微服务信息。
在其中一个实施例中,微服务灰度发布装置500,还包括:
微服务注册模块,用于启动微服务标识对应的微服务,向微服务注册中心发送注册请求,注册请求携带有微服务对应的微服务信息,以使微服务注册中心根据注册请求将微服务对应的微服务信息保存;
心跳连接模块,用于获取微服务注册中心返回的注册成功提示,并使微服务与微服务注册中心保存心跳连接。
在其中一个实施例中,第一请求发送模块510,包括:
优先级获取模块,用于当微服务信息中存在灰度微服务信息时,获取带有灰度标识的业务请求的优先级,根据带有灰度标识的业务请求的优先级将带有回复标识的业务请求依次发送到灰度微服务服务器。
在其中一个实施例中,微服务灰度发布装置500,包括:
标识删除模块,用于当获取到带有灰度标识的业务请求对应的业务结果时,将灰度标识删除。
关于微服务灰度发布装置的具体限定可以参见上文中对于微服务灰度发布方法的限定,在此不再赘述。上述微服务灰度发布装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储业务请求数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种微服务灰度发布方法。
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时实现本申请任意一个实施例中提供的微服务发布方法的步骤。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的微服务发布方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (20)
- 一种微服务灰度发布方法,包括:接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
- 根据权利要求1所述的方法,其特征在于,所述当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器,包括:当所述微服务信息未存在灰度微服务信息时,根据所述微服务信息中微服务地址将所述带有灰度标识的业务请求发送对应的微服务服务器。
- 根据权利要求1所述的方法,其特征在于,所述将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识,包括:解析所述预设灰度规则,得到各个目标灰度规则,将所述解析结果与所述各个目标灰度规则进行匹配,当所述解析结果与至少一个目标灰度规则匹配成功时,生成对应的灰度标识。
- 根据权利要求1所述的方法,其特征在于,所述获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息,包括:获取所述业务请求对应的微服务标识,根据所述微服务标识从微服务注 册中心获取对应的微服务信息。
- 根据权利要求4所述的方法,其特征在于,在获取所述业务请求对应的微服务标识,根据所述微服务标识从微服务注册中心获取对应的微服务信息之前,还包括:启动微服务标识对应的微服务,向所述微服务注册中心发送注册请求,所述注册请求携带有所述微服务对应的微服务信息,以使所述微服务注册中心根据所述注册请求将所述微服务对应的微服务信息保存;及获取所述微服务注册中心返回的注册成功提示,并使所述微服务与所述微服务注册中心保存心跳连接。
- 根据权利要求1所述的方法,其特征在于,当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器,包括:当所述微服务信息中存在灰度微服务信息时,获取所述带有灰度标识的业务请求的优先级,根据所述带有灰度标识的业务请求的优先级将所述带有回复标识的业务请求依次发送到灰度微服务服务器。
- 根据权利要求1所述的方法,其特征在于,在所述获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回之后,包括:当获取到所述带有灰度标识的业务请求对应的业务结果时,将所述灰度标识删除。
- 一种微服务灰度发布装置,其特征在于,所述装置包括:请求接收模块,用于接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;标识生成模块,用于解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;标识写入模块,用于将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;微服务获取模块,用于获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;第一请求发送模块,用于当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及结果返回模块,用于获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
- 根据权利要求8所述的方法,其特征在于,第一请求发送模块,包括:第二请求发送模块,用于当所述微服务信息未存在灰度微服务信息时,根据所述微服务信息中微服务地址将所述带有灰度标识的业务请求发送对应的微服务服务器。
- 根据权利要求8所述的方法,其特征在于,标识生成模块,包括:目标规则匹配模块,用于解析所述预设灰度规则,得到各个目标灰度规则,将所述解析结果与所述各个目标灰度规则进行匹配,当所述解析结果与至少一个目标灰度规则匹配成功时,生成对应的灰度标识。
- 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配,当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
- 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:当所述微服务信息未存在灰度微服务信息时,根据所述微服务信息中微服务地址将所述带有灰度标识的业务请求发送对应的微服务服务器。
- 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:解析所述预设灰度规则,得到各个目标灰度规则,将所述解析结果与所述各个目标灰度规则进行匹配,当所述解析结果与至少一个目标灰度规则匹配成功时,生成对应的灰度标识。
- 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:获取所述业务请求对应的微服务标识,根据所述微服务标识从微服务注册中心获取对应的微服务信息。
- 根据权利要求14所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:启动微服务标识对应的微服务,向所述微服务注册中心发送注册请求,所述注册请求携带有所述微服务对应的微服务信息,以使所述微服务注册中心根据所述注册请求将所述微服务对应的微服务信息保存;及获取所述微服务注册中心返回的注册成功提示,并使所述微服务与所述微服务注册中心保存心跳连接。
- 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:接收加密业务请求,对所述加密业务请求进行解密,得到业务请求;解析所述业务请求得到解析结果,将所述解析结果与预设灰度规则匹配, 当所述解析结果与所述预设灰度规则匹配成功时,生成对应的灰度标识;将所述灰度标识写入所述业务请求中,得到带有灰度标识的业务请求;获取所述业务请求对应的微服务标识,根据所述微服务标识获取对应的微服务信息;当所述微服务信息中存在灰度微服务信息时,根据所述灰度微服务信息中灰度微服务地址将所述带有灰度标识的业务请求发送到灰度微服务服务器;及获取所述带有灰度标识的业务请求对应的业务结果,将所述业务结果返回。
- 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:当所述微服务信息未存在灰度微服务信息时,根据所述微服务信息中微服务地址将所述带有灰度标识的业务请求发送对应的微服务服务器。
- 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:解析所述预设灰度规则,得到各个目标灰度规则,将所述解析结果与所述各个目标灰度规则进行匹配,当所述解析结果与至少一个目标灰度规则匹配成功时,生成对应的灰度标识。
- 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:获取所述业务请求对应的微服务标识,根据所述微服务标识从微服务注册中心获取对应的微服务信息。
- 根据权利要求19所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:启动微服务标识对应的微服务,向所述微服务注册中心发送注册请求,所述注册请求携带有所述微服务对应的微服务信息,以使所述微服务注册中心根据所述注册请求将所述微服务对应的微服务信息保存;及获取所述微服务注册中心返回的注册成功提示,并使所述微服务与所述微服务注册中心保存心跳连接。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910007046.9A CN109739552A (zh) | 2019-01-04 | 2019-01-04 | 微服务灰度发布方法、装置、计算机设备和存储介质 |
| CN201910007046.9 | 2019-01-04 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020140663A1 true WO2020140663A1 (zh) | 2020-07-09 |
Family
ID=66363418
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/122346 Ceased WO2020140663A1 (zh) | 2019-01-04 | 2019-12-02 | 微服务灰度发布方法、装置、计算机设备和存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109739552A (zh) |
| WO (1) | WO2020140663A1 (zh) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112130892A (zh) * | 2020-09-23 | 2020-12-25 | 平安科技(深圳)有限公司 | 产品灰度发布方法、装置、设备及存储介质 |
| CN112445510A (zh) * | 2020-11-30 | 2021-03-05 | 中国人寿保险股份有限公司 | 客户端应用功能热更新文件的灰度发布方法及相关设备 |
| CN112685060A (zh) * | 2020-12-24 | 2021-04-20 | 深圳前海微众银行股份有限公司 | 灰度发布方法、装置,终端设备及计算机存储介质 |
| CN113778491A (zh) * | 2021-09-16 | 2021-12-10 | 山东亿云信息技术有限公司 | 一种容器化应用灰度升级方法、系统、存储介质及设备 |
| CN115480824A (zh) * | 2021-05-31 | 2022-12-16 | 腾讯科技(深圳)有限公司 | 业务逻辑灰度控制方法、装置、设备及存储介质 |
| CN115665230A (zh) * | 2022-10-17 | 2023-01-31 | 上海浦东发展银行股份有限公司 | 一种无侵入应用灰度发布控制方法 |
Families Citing this family (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109739552A (zh) * | 2019-01-04 | 2019-05-10 | 深圳壹账通智能科技有限公司 | 微服务灰度发布方法、装置、计算机设备和存储介质 |
| CN110224998B (zh) * | 2019-05-20 | 2023-04-07 | 平安普惠企业管理有限公司 | 一种微服务注册方法及装置 |
| CN110958314A (zh) * | 2019-11-28 | 2020-04-03 | 盛业信息科技服务(深圳)有限公司 | 服务的灰度发布方法、装置和计算机设备 |
| CN111124431A (zh) * | 2019-12-31 | 2020-05-08 | 贵阳货车帮科技有限公司 | 服务回调方法、业务处理方法、装置、设备及存储介质 |
| CN111352654B (zh) * | 2020-03-10 | 2023-08-15 | 中国工商银行股份有限公司 | 用于实现灰度发布的系统和方法 |
| CN111586095B (zh) * | 2020-03-26 | 2023-09-19 | 中国平安财产保险股份有限公司 | 基于微服务灰度发布方法、装置、计算机设备及存储介质 |
| CN111443941A (zh) * | 2020-03-27 | 2020-07-24 | 中国平安财产保险股份有限公司 | 灰度发布的方法及装置 |
| CN111786885B (zh) * | 2020-06-23 | 2022-07-05 | 中国工商银行股份有限公司 | 分布式全链路灰度路由方法及装置 |
| CN111865683B (zh) * | 2020-07-17 | 2023-07-14 | 北京百度网讯科技有限公司 | 虚拟网关版本灰度发布方法、装置、设备以及存储介质 |
| CN112000348B (zh) * | 2020-07-28 | 2024-07-19 | 金医慧通科技有限公司 | 服务灰度发布的控制方法、装置、计算机设备 |
| CN111953780B (zh) * | 2020-08-13 | 2022-10-21 | 中国工商银行股份有限公司 | 微服务灰度发布方法、装置、设备、系统及存储介质 |
| CN112181458B (zh) * | 2020-09-25 | 2024-10-25 | 中国建设银行股份有限公司 | 灰度规则的配置、灰度路由方法、装置、设备及存储介质 |
| CN112202929B (zh) * | 2020-12-01 | 2021-03-26 | 湖南新云网科技有限公司 | 一种微服务架构中的服务访问方法、装置、设备 |
| CN113055492A (zh) * | 2021-03-25 | 2021-06-29 | 深圳云之家网络有限公司 | 服务灰度链路的控制方法、装置、计算机设备和存储介质 |
| CN113867782A (zh) * | 2021-09-30 | 2021-12-31 | 平安普惠企业管理有限公司 | 灰度发布方法、装置、计算机设备和存储介质 |
| CN113918193A (zh) * | 2021-10-29 | 2022-01-11 | 平安普惠企业管理有限公司 | 适用于微服务的灰度调用方法、装置、设备及存储介质 |
| CN114268665B (zh) * | 2021-12-28 | 2023-11-21 | 中国农业银行股份有限公司 | 微服务系统发布方法、装置、设备及可读存储介质 |
| CN114428927B (zh) * | 2021-12-30 | 2025-11-04 | 中和农信农业集团有限公司 | 全链路灰度发布方法、装置、微服务、网关及介质 |
| CN115729762B (zh) * | 2022-12-01 | 2025-10-28 | 浪潮卓数大数据产业发展有限公司 | 用于微服务的多测试环境管理方法、装置、设备及介质 |
| CN116346893B (zh) * | 2023-02-14 | 2025-12-12 | 智业互联(厦门)健康科技有限公司 | 一种基于微服务的全链路灰度发布方法、装置及存储介质 |
| CN116233260A (zh) * | 2023-03-09 | 2023-06-06 | 平安科技(深圳)有限公司 | 基于标签技术的灰度方法、系统及计算机设备 |
| CN116418874A (zh) * | 2023-04-07 | 2023-07-11 | 平安银行股份有限公司 | 在金融场景下新旧应用并行灰度分流的方法及计算机设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107341008A (zh) * | 2017-06-22 | 2017-11-10 | 上海艾融软件股份有限公司 | 微服务灰度发布方法 |
| CN107872334A (zh) * | 2016-09-23 | 2018-04-03 | 中兴通讯股份有限公司 | 一种微服务架构系统中灰度升级的方法及装置 |
| CN108574601A (zh) * | 2018-03-27 | 2018-09-25 | 无锡华云数据技术服务有限公司 | 一种灰度发布方法及系统 |
| CN109739552A (zh) * | 2019-01-04 | 2019-05-10 | 深圳壹账通智能科技有限公司 | 微服务灰度发布方法、装置、计算机设备和存储介质 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105791344B (zh) * | 2014-12-22 | 2019-03-19 | 华为软件技术有限公司 | 灰度发布业务处理的方法、系统、负载均衡器及服务总线装置 |
| CN105515759B (zh) * | 2015-11-27 | 2018-11-09 | 国网信息通信产业集团有限公司 | 一种微服务注册方法及系统 |
| US10411973B2 (en) * | 2017-03-20 | 2019-09-10 | Red Hat, Inc. | Automatic microservice problem detection in enterprise applications |
| CN108418862B (zh) * | 2018-01-31 | 2021-01-22 | 金蝶软件(中国)有限公司 | 基于人工智能服务云平台的微服务管理方法和系统 |
| CN108494867B (zh) * | 2018-04-04 | 2021-05-14 | 广州方硅信息技术有限公司 | 服务灰度处理的方法、装置、系统以及路由服务器 |
| CN108848092B (zh) * | 2018-06-20 | 2021-02-26 | 中国联合网络通信集团有限公司 | 基于调用链的微服务灰度发布的处理方法及装置 |
-
2019
- 2019-01-04 CN CN201910007046.9A patent/CN109739552A/zh active Pending
- 2019-12-02 WO PCT/CN2019/122346 patent/WO2020140663A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107872334A (zh) * | 2016-09-23 | 2018-04-03 | 中兴通讯股份有限公司 | 一种微服务架构系统中灰度升级的方法及装置 |
| CN107341008A (zh) * | 2017-06-22 | 2017-11-10 | 上海艾融软件股份有限公司 | 微服务灰度发布方法 |
| CN108574601A (zh) * | 2018-03-27 | 2018-09-25 | 无锡华云数据技术服务有限公司 | 一种灰度发布方法及系统 |
| CN109739552A (zh) * | 2019-01-04 | 2019-05-10 | 深圳壹账通智能科技有限公司 | 微服务灰度发布方法、装置、计算机设备和存储介质 |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112130892A (zh) * | 2020-09-23 | 2020-12-25 | 平安科技(深圳)有限公司 | 产品灰度发布方法、装置、设备及存储介质 |
| CN112445510A (zh) * | 2020-11-30 | 2021-03-05 | 中国人寿保险股份有限公司 | 客户端应用功能热更新文件的灰度发布方法及相关设备 |
| CN112685060A (zh) * | 2020-12-24 | 2021-04-20 | 深圳前海微众银行股份有限公司 | 灰度发布方法、装置,终端设备及计算机存储介质 |
| CN115480824A (zh) * | 2021-05-31 | 2022-12-16 | 腾讯科技(深圳)有限公司 | 业务逻辑灰度控制方法、装置、设备及存储介质 |
| CN113778491A (zh) * | 2021-09-16 | 2021-12-10 | 山东亿云信息技术有限公司 | 一种容器化应用灰度升级方法、系统、存储介质及设备 |
| CN115665230A (zh) * | 2022-10-17 | 2023-01-31 | 上海浦东发展银行股份有限公司 | 一种无侵入应用灰度发布控制方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109739552A (zh) | 2019-05-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020140663A1 (zh) | 微服务灰度发布方法、装置、计算机设备和存储介质 | |
| CN109474578B (zh) | 报文消息校验方法、装置、计算机设备和存储介质 | |
| CN108268375A (zh) | 应用程序测试方法、装置、计算机设备和存储介质 | |
| CN110543510B (zh) | 票据数据处理方法、装置、存储介质和计算机设备 | |
| CN107392766A (zh) | 业务处理方法、适配器及计算机可读存储介质 | |
| CN110750222A (zh) | 打印方法、装置、计算机设备和存储介质 | |
| CN108734028A (zh) | 基于区块链的数据管理方法、区块链节点及存储介质 | |
| CN110908778B (zh) | 任务部署方法、系统和存储介质 | |
| CN111753318A (zh) | 私有数据的多方安全计算方法、装置及系统 | |
| CN108846753A (zh) | 用于处理数据的方法和装置 | |
| CN112241298A (zh) | 页面显示方法及装置、存储介质、电子装置 | |
| CN111178840A (zh) | 业务处理方法及装置、系统、电子设备、存储介质 | |
| CN109992730B (zh) | 活动页面url生成方法、装置、计算机设备和存储介质 | |
| CN111597567A (zh) | 数据处理方法、装置、节点设备及存储介质 | |
| CN113609147B (zh) | 数据共享方法、装置及电子设备 | |
| WO2021012903A1 (zh) | 数据存储方法、装置、计算机设备和存储介质 | |
| CN108052550B (zh) | 年金数据接收方法、装置、计算机设备和存储介质 | |
| CN114238585A (zh) | 基于5g消息的查询方法、装置、计算机设备和存储介质 | |
| CN115361164A (zh) | 账户申请请求的处理方法、装置、计算机设备、存储介质 | |
| US12348637B2 (en) | Using virtual objects on different platforms | |
| CN119782430A (zh) | 数据批同步方法、装置和计算机设备 | |
| US20240202744A1 (en) | Using blockchain technology to determine authenticity of items | |
| CN118656860A (zh) | 一种数据脱敏处理方法、系统、设备及存储介质 | |
| CN116150188A (zh) | 信息查询方法、装置、计算机设备和存储介质 | |
| CN116562862A (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: 19907126 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/10/2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19907126 Country of ref document: EP Kind code of ref document: A1 |