CN117675926A - Nacos-based full-link gray level release method and device - Google Patents

Nacos-based full-link gray level release method and device Download PDF

Info

Publication number
CN117675926A
CN117675926A CN202311618774.6A CN202311618774A CN117675926A CN 117675926 A CN117675926 A CN 117675926A CN 202311618774 A CN202311618774 A CN 202311618774A CN 117675926 A CN117675926 A CN 117675926A
Authority
CN
China
Prior art keywords
request
request message
application
gray
forwarding
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.)
Pending
Application number
CN202311618774.6A
Other languages
Chinese (zh)
Inventor
苏祺云
张端锋
黄楚恩
金志�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Kaidisi Intelligent Technology Co ltd
Original Assignee
Shenzhen Kaidisi Intelligent Technology Co ltd
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 Shenzhen Kaidisi Intelligent Technology Co ltd filed Critical Shenzhen Kaidisi Intelligent Technology Co ltd
Priority to CN202311618774.6A priority Critical patent/CN117675926A/en
Publication of CN117675926A publication Critical patent/CN117675926A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a Nacos-based full-link gray level publishing method and device, comprising the following steps: acquiring a registration request from a first electronic device; storing the gray scale identification and gray scale rule into a database of a Nacos server according to the registration request; acquiring a first request message from second electronic equipment; analyzing the first request message to obtain a request application and a request identifier; determining whether the requesting application is a target application; if the request application is the target application, determining whether the second electronic equipment accords with the gray rule or not according to the request identification, and forwarding the first request message to a gray environment or a production environment where the target application is located; if the request application is not the target application, forwarding the first request message to the production environment where the application corresponding to the request identification is located according to the request identification. The gray level release cost can be reduced, and the accuracy and timeliness can be improved.

Description

Nacos-based full-link gray level release method and device
Technical Field
The application relates to the technical field of computers, in particular to a Nacos-based full-link gray level release method and device.
Background
Greyscale release refers to the process of smoothly transitioning an old version of service to a new version of service in an iteration of a software product.
The existing gray level release method generally needs to participate in manually, errors and delays occur in the release process easily caused by human factors, and release strategies cannot be dynamically adjusted according to actual operation conditions. The gray level release method has high cost, low accuracy and low timeliness.
Disclosure of Invention
The application provides a Nacos-based full-link gray level release method and device, which are used for solving the problems of high cost, low accuracy and low timeliness without artificial participation in the existing gray level release method. Nacos is an acronym for dynamic naming and configuration service (Dynamic Naming and Configuration Service), and is a set of simple and easy-to-use feature sets provided by a dynamic service registration and discovery, configuration management and service management platform which is easier to construct a cloud native application, and helps a user to quickly realize dynamic service discovery, service configuration, service metadata and traffic management.
In a first aspect, an embodiment of the present application provides a full-link gray scale publishing method based on a Nacos, which is applied to a Nacos server of a gray scale publishing system, where the gray scale publishing system includes the Nacos server, a first electronic device at a developing end, and a second electronic device at a client, and the method includes:
Acquiring a registration request from the first electronic equipment, wherein the registration request comprises a target application needing gray release, a gray scale identifier of the target application and a gray scale rule;
storing the gray scale identification and the gray scale rule into a database of the Nacos server according to the registration request;
acquiring a first request message from the second electronic equipment;
analyzing the first request message to obtain a request application and a request identifier;
determining whether the requesting application is the target application;
if the request application is the target application, determining whether the second electronic equipment accords with the gray scale rule according to the request identification; if the gray level rule is met, forwarding the first request message to a gray level environment where the target application is located; if the gray level rule is not met, forwarding the first request message to a production environment where the target application is located;
and if the request application is not the target application, forwarding the first request message to a production environment where the application corresponding to the request identifier is located according to the request identifier.
In a second aspect, an embodiment of the present application provides a device for full-link gray scale publishing based on a Nacos, which is applied to a Nacos server of a gray scale publishing system, where the gray scale publishing system includes the Nacos server, a first electronic device at a developing end, and a second electronic device at a client end, and the device includes:
A first obtaining unit, configured to obtain a registration request from the first electronic device, where the registration request includes a target application that needs to perform gray release, a gray identifier of the target application, and a gray rule;
the storage unit is used for storing the gray scale identification and the gray scale rule into a database of the Nacos server according to the registration request;
the second acquisition unit is used for acquiring a first request message from the second electronic equipment;
the analyzing unit is used for analyzing the first request message and acquiring a request application and a request identifier;
a determining unit configured to determine whether the request application is the target application;
the first execution unit is used for determining whether the second electronic equipment accords with the gray rule according to the request identifier if the request application is the target application; if the gray level rule is met, forwarding the first request message to a gray level environment where the target application is located; if the gray level rule is not met, forwarding the first request message to a production environment where the target application is located;
and the second execution unit is used for forwarding the first request message to the production environment where the application corresponding to the request identifier is located according to the request identifier if the request application is not the target application.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the processor, the one or more programs comprising instructions for performing the steps of the methods described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program/instructions for execution by a processor to perform the steps of the above-described method.
It can be seen that, in this example, the Nacos server first obtains a registration request from the first electronic device, where the registration request includes a target application that needs to perform gray release, a gray identifier of the target application, and a gray rule; then, according to the registration request, storing the gray scale identification and gray scale rule into a database of the Nacos server; then obtaining a first request message from second electronic equipment; then analyzing the first request message to obtain a request application and a request identifier; finally, determining whether the request application is a target application; if the request application is the target application, determining whether the second electronic equipment accords with the gray rule according to the request identification; if the gray rule is met, forwarding the first request message to a gray environment where the target application is located; if the gray rule is not met, forwarding the first request message to a production environment where the target application is located; if the request application is not the target application, forwarding the first request message to the production environment where the application corresponding to the request identification is located according to the request identification.
In this way, the method uses Nacos as a service registration and discovery center, registers a target application, a gray scale identifier and a gray scale rule corresponding to a registration request into a server, sends a first request message into the server, acquires the corresponding request application and the request identifier, firstly judges whether the request application is the target application, if the request application is not the target application, forwards the request message to a production environment, and if the request application is the target application, judges whether a second electronic device accords with the gray scale rule according to the request identifier, so as to forward the first request message to the gray scale environment/the production environment. Therefore, artificial participation is not needed in the gray level release process, the cost is reduced, the accuracy is improved, and the gray level release efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a gray scale distribution system according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a full-link gray level publishing method based on Nacos according to the embodiment of the present application;
FIG. 4 is a schematic flow chart of a new version service construction provided in an embodiment of the present application;
fig. 5 is a functional unit composition block diagram of a full-link gray level publishing device based on Nacos according to the embodiment of the present application;
fig. 6 is a functional unit composition block diagram of another full-link gray-scale issuing device based on Nacos according to the embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In the embodiment of the application, "and/or", the association relation of the association objects is described, which means that three relations can exist. For example, a and/or B may represent three cases: a alone; both A and B are present; b alone. Wherein A, B can be singular or plural.
In the embodiment of the present application, the symbol "/" may indicate that the associated object is an or relationship. In addition, the symbol "/" may also denote a divisor, i.e. performing a division operation. For example, A/B may represent A divided by B.
The existing gray level release method generally needs to participate in manually, errors and delays occur in the release process easily caused by human factors, and release strategies cannot be dynamically adjusted according to actual operation conditions. The gray level release method has high cost, low accuracy and low timeliness.
In view of the above problems, an embodiment of the present application provides a method and an apparatus for full-link gray level distribution based on Nacos, and the following detailed description of the embodiment of the present application is provided with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a gray scale distribution system according to an embodiment of the present disclosure. As shown in fig. 1, the gray scale publishing system 10 includes a first electronic device 101, a second electronic device 102 and a Nacos server 103, where the first electronic device 101 is an electronic device at an originating end, the second electronic device 102 is an electronic device at a client end, the Nacos server 103 is communicatively connected to the first electronic device 101, for acquiring a registration request from the first electronic device 101, and the second electronic device 102 is communicatively connected to the Nacos server 103, for sending a request packet to the Nacos server 103. In particular, the Nacos server may contain multiple components, such as, for example, service Discovery (Nacos Discovery), service registration (Nacos Naming), configuration service (Nacos Config), and the like.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As illustrated in fig. 2, the electronic device 20 may be the Naocs server 103 illustrated in fig. 1. The electronic device 20 may be a computing-capable electronic device, and the electronic device 20 may include various other processing devices, as well as various forms of personal computers (personal computer), servers, network devices (networkdevices), and the like. The electronic device 20 comprises a processor 201, a memory 202, a communication interface 203, and one or more programs 204, the one or more programs 204 being stored in the memory 202 and configured to be executed by the processor 201, the one or more programs 204 comprising instructions for performing any of the following. In a specific implementation, the processor 201 is configured to perform any step performed by the electronic device in the method embodiment described below, and when performing data transmission such as sending, the communication interface 203 is optionally invoked to complete a corresponding operation.
Referring to fig. 3, fig. 3 is a flow chart of a full-link gray level publishing method based on Nacos according to an embodiment of the present application. As shown in fig. 3, the method includes the following steps.
Step S301, a registration request from the first electronic device is obtained, where the registration request includes a target application that needs to perform gray release, a gray identifier of the target application, and a gray rule.
Step S302, storing the gray scale identification and the gray scale rule into a database of the Nacos server according to the registration request.
The method is characterized in that a new version service can be constructed and started through Jenkins, jenkins is an open source software project, is a continuous integration tool based on Java development and is used for monitoring continuous repeated work, and aims to provide an open and easy-to-use software platform so that continuous integration of software becomes possible. Java virtual machine (Java Virtual Machine, JVM) parameters may be used to control the behavior of an application. For example, some switches may be set by system attributes or environment variables to enable or disable certain functions dynamically at run-time.
The first electronic device at the development end needs to send a registration request to the Naocs server, and the gray identifier may be metadata (metadata) with a value of "true" because the gray identifier may be registered in a database in the Nacos server after the new version service of the gray environment is started, and the new version service released to the production environment may not carry such gray identifier. Referring to fig. 4, fig. 4 is a schematic flow chart of a new version service construction according to an embodiment of the present application. As shown in fig. 4, the process is constructed by Jenkins, firstly, a release version of a target application is selected, whether the release version of the target application is gray release is judged, if the release version of the target application is determined to be gray release, the gray identification is determined, the gray identification, the target application and a gray rule are stored in a database of a server together, and the target application is deployed in the server, or if the release version of the target application is determined not to be gray release, the target application is deployed in the server, so that the construction is completed. Therefore, by constructing the new version service, the gray rule corresponding to the gray release can be stored in the database in the server, thereby enriching the database in the server.
Step S303, obtaining a first request packet from the second electronic device.
Step S304, analyzing the first request message to obtain the request application and the request identification.
The request application may be the same as or different from the target application, and in particular, the request application may be a micro service, a stand-alone application, an interactive application, or an embedded application.
The parsing of the first request message may be implemented by zuul, luajit. In particular, luagit is an interpreter of lua code written in the C language, which runs very fast. In particular, zuul is the front gate for all requests from devices and websites to the back end of an application, and may contain both functions of routing and filtering requests.
Step S305, determining whether the requested application is the target application.
Step S306, if the request application is the target application, determining whether the second electronic device accords with the gray rule according to the request identification; if the gray level rule is met, forwarding the first request message to a gray level environment where the target application is located; and if the gray level rule is not met, forwarding the first request message to a production environment where the target application is located.
Step S307, if the requested application is not the target application, forwarding the first request packet to a production environment where the application corresponding to the request identifier is located according to the request identifier.
In this example, the Nacos server uses the database of the Nacos server as a registration center through communication connection with the electronic device at the development end, and registers the gray scale identifier and the gray scale rule into the database of the Nacos server, thereby realizing service registration in gray scale release; the Nacos server obtains a first request message through communication connection with a second electronic device of the client, uses the Naocs server as a discovery center, and determines to forward the first request message to a production environment or a gray scale environment according to a request application and a request identifier obtained by analyzing the first request message. In the gray level release process, no human participation is needed, the cost is reduced, and the gray level release efficiency is improved.
In one possible embodiment, the first request message includes a header file, and parsing the first request message includes: determining whether target information for indicating a request identifier exists in the header file; if yes, determining a request identifier according to the target information; if the first request message does not exist, the first request message is recorded in a log, and prompt information is output, wherein the prompt information is used for indicating that the first request message is in error.
Wherein, the first request message header file can be read by using zuul to obtain target information from the header file, the target information can represent the content or format of the request identifier, if the target information exists, the content or format of the request identifier can be obtained; if the target information does not exist, the content or the format of the request identification is not clear, the error of the request message is judged, the request message is recorded in a log, prompt information is output to inform the second electronic equipment of the client that the request message is not available, and the prompt information can be informed in the forms of mail, short message and the like.
It can be seen that in this example, whether the request message is available is determined according to the header file in the first request message, and if it is not available, the situation is recorded and notified to the second electronic device of the client. Therefore, the gray level release can be stopped when the first request message is analyzed, and the gray level release efficiency is effectively improved.
In one possible embodiment, the gray rule includes a target request frequency and a target region, and determining whether the second electronic device meets the gray rule according to the request identifier includes: determining the user request frequency of the second electronic equipment requesting the request application according to the request identification; determining a user address of the second electronic device according to the request identification; determining whether the user request frequency is greater than the target request frequency and whether the user address belongs to the target area; if yes, the second electronic device is determined to accord with the gray scale rule.
The target request frequency may be a frequency threshold set by the client according to actual situations, and the target request frequency may be once per second, twice per minute, ten times per hour, and so on. The target request frequency may represent the frequency with which clients send requests to the Nacos server. The target area is the IP address of the second electronic device of the client, and the target area may be the IP address filled in when the user registers, or may be the actual IP address of the second electronic device.
When the user request frequency is greater than the target request frequency, the request frequency of gray level release is indicated to be satisfied, and the user address is required to satisfy the address of gray level release after the request frequency of gray level release is satisfied, so that the second electronic device can be determined to conform to the gray level rule under the condition that the user request frequency is greater than the target request frequency and the user address belongs to the target region.
Therefore, whether the second electronic equipment accords with the gray scale rule can be determined through the user request frequency and the user address of the second electronic equipment, so that when a plurality of request messages appear, whether the second electronic equipment accords with the gray scale rule can be rapidly determined according to two aspects, and the gray scale release efficiency is improved.
In one possible embodiment, before determining whether the second electronic device meets the gray rule according to the request identification, the method includes: determining a history request message according to the request application, wherein the history request message is a request message aiming at the request application and sent to a Nacos server by the second electronic equipment for the last time; determining the acquisition time of a history request message; determining a registration time of the registration request; when the time difference between the acquisition time and the registration time is smaller than a preset time period, acquiring a forwarding path of the historical request message, wherein the forwarding path comprises forwarding the request message to a production environment or forwarding the request message to a gray scale environment; forwarding the first request message according to the forwarding path; and when the time difference between the acquisition time and the registration time is larger than a preset period, determining whether the second electronic equipment accords with the gray scale rule.
The history request message is a request message sent to the Nacos server last time by the second electronic device. The preset time period is a time period set by a user according to actual conditions, and the preset time period may be 10 seconds, 30 seconds or 1 minute. Specifically, whether a gray rule is required is determined according to a time difference between the acquisition time of the history request message and the registration time of the registration request. In particular, when the acquisition time of the history request message is very short, i.e. less than the preset time period, for example, the acquisition time of the history request message is 1 minute earlier or 1 minute later than the registration time of the registration request, the gray rule is not needed, the first request message may be forwarded according to the forwarding path of the history request message, for example, the forwarding path of the history request message is used for forwarding the history request message to the gray environment, and the first request message is forwarded to the gray environment; and if the forwarding path of the history request message is used for forwarding the history request message to the production environment, forwarding the first request message to the production environment. The difference between the acquisition time of the history request message and the registration time of the registration request is larger, that is, the acquisition time is larger than or equal to a preset time period, and the gray rule is needed to determine whether the first request message is issued in gray.
It can be seen that, in this example, the acquisition time of the last request message may be determined before the gray rule is used, and if the acquisition time is close to the registration time, the forwarding condition of the current request message is determined according to the forwarding condition of the last request message. Therefore, under the condition that the Nacos server acquires the request messages very densely, the forwarding condition of the request message can be determined according to the forwarding condition of the last request message, the gray scale rule is not required to be used for determining and forwarding to the production environment/gray scale environment each time the request message is acquired, and the gray scale release efficiency is improved.
In one possible embodiment, after forwarding the first request packet according to the forwarding path, the method further includes: marking the second electronic equipment according to the forwarding path, wherein the marking is used for indicating the current forwarding path of the second electronic equipment; acquiring a second request message of the second electronic equipment, wherein the second request message corresponds to the same request application as the first request message; and determining a forwarding path of the second request message according to the forwarding mark.
The marking of the second electronic device is to indicate a current forwarding path of the second electronic device, so that when the request application in the second request message sent by the second electronic device is the same, the second request message may be forwarded to a production environment/a gray scale environment according to the forwarding mark, for example, if the current forwarding path is to forward the first request message to the gray scale environment, the second request message is forwarded to the gray scale environment; and if the current forwarding path is used for forwarding the first request message to the production environment, forwarding the second request message to the production environment.
In this example, the forwarding path is marked without using the gray rule, so that when the Naocs server obtains the next request message of which the request application is the same as that in the previous request message, the next request message can be forwarded to the gray environment/production environment according to the previous forwarding path, thereby reducing the cost and improving the efficiency of gray release.
In one possible embodiment, after forwarding the request message to the gray scale environment where the target application is located, the method further includes: acquiring monitoring data from a gray environment where a target application is located; acquiring a monitoring report according to monitoring data, wherein the monitoring data is used for indicating the state of the gray environment; and sending the monitoring report to the first electronic device, so that the development end user updates the request application according to the monitoring report.
The monitoring data can represent the state of the gray scale environment, and when the monitoring data is abnormal, the abnormal gray scale environment is indicated.
In this example, after forwarding the request message to the gray scale environment, the Nacos server may then generate a monitoring report by monitoring data in the gray scale environment, and finally send the monitoring report to the first electronic device of the originating terminal, so that the user of the originating terminal may update the request application in time according to the monitoring report. Therefore, the request dynamic state can be monitored in real time, the request application can be updated in time according to the monitoring condition, and the accuracy of gray level release is improved.
In one possible embodiment, the monitoring data includes an error rate of the request message and a response time of the request application, and the obtaining the monitoring report according to the monitoring data includes: determining the response speed of the request application according to the response time; and when the response time and/or the error rate are/is larger than a preset value, updating the gray rule so that the first request message is forwarded to the production environment where the request application is located.
The monitoring data may be an error rate of the request message and a response time of the request application, and the preset value is a value set by a development end user according to actual conditions, and may represent that the error rate is 20% or the response time is 20 seconds, etc. When the error rate and/or response time are abnormal, the Nacos server can modify the gray rule, and the request message exits the gray environment and is forwarded to the production environment. For example, when the error rate of the request message is 25%, the request message may be returned to the last request message, or the processing time of the request message may be prolonged.
It can be seen that in this example, the Nacos server may determine that the gray environment state is abnormal according to whether an error occurs in the content of the request message and whether the response time of the request application is abnormal, thereby generating a monitoring report that proposes a solution for the occurring abnormality. Therefore, the request application can be updated in time according to the monitoring condition, and the accuracy of gray level release is improved.
Referring to fig. 5, fig. 5 is a functional unit block diagram of a full-link gray level publishing device based on Nacos according to an embodiment of the present application. The Nacos-based full-link gray scale release device is applied to a Nacos server of a gray scale release system, wherein the gray scale release system comprises the Nacos server, a first electronic device of a development end and a second electronic device of a client, and as shown in fig. 5, the Nacos-based full-link gray scale release device comprises: a first obtaining unit 501, configured to obtain a registration request from a first electronic device, where the registration request includes a target application that needs to perform gray release, a gray identifier of the target application, and a gray rule; a storage unit 502, configured to store the gray identification and the gray rule into a database of the Nacos server according to the registration request; a second obtaining unit 503, configured to obtain a request packet from a second electronic device; the parsing unit 504 is configured to parse the request packet, and obtain a request application and a request identifier; a determining unit 505, configured to determine whether the requested application is a target application; a first execution unit 506, configured to determine, if the request application is a target application, whether the second electronic device meets a gray rule according to the request identifier; if the gray rule is met, forwarding the request message to a gray environment where the target application is located; if the gray rule is not met, forwarding the request message to a production environment where the target application is located; and the second execution unit 507 is configured to forward, if the request application is not the target application, the request packet to a production environment where the application corresponding to the request identifier is located according to the request identifier.
In one possible embodiment, the first request packet includes a header file, and in terms of parsing the first request packet, the parsing unit 504 is specifically configured to: determining whether target information for indicating a request identifier exists in the header file; if yes, determining a request identifier according to the target information; if the first request message does not exist, the first request message is recorded in a log, and prompt information is output, wherein the prompt information is used for indicating that the first request message is in error.
In one possible embodiment, the gray rule includes a target request frequency and a target region, and the first execution unit 506 is specifically configured to: determining the user request frequency of the second electronic equipment requesting the request application according to the request identification; determining a user address of the second electronic device according to the request identification; determining whether the user request frequency is greater than the target request frequency and whether the user address belongs to the target area; if yes, the second electronic device is determined to accord with the gray scale rule.
In one possible embodiment, the full-link gray publishing device based on Nacos may further include a third execution unit, where before determining whether the second electronic device meets the gray rule according to the request identifier, the third execution unit is specifically configured to: determining a history request message according to the request application, wherein the history request message is a request message aiming at the request application and sent to a Nacos server by the second electronic equipment for the last time; determining the acquisition time of a history request message; determining a registration time of the registration request; when the time difference between the acquisition time and the registration time is smaller than a preset time period, acquiring a forwarding path of the history request message, wherein the forwarding path comprises forwarding the history request message to a production environment or forwarding the history request message to a gray scale environment; forwarding the first request message according to the forwarding path; and when the time difference between the acquisition time and the registration time is larger than a preset period, determining whether the second electronic equipment accords with the gray scale rule.
In one possible embodiment, the Nacos-based full-link gray-scale issuing device may further include a marking unit, where the marking unit is specifically configured to, after forwarding the first request packet according to the forwarding path: marking the second electronic equipment according to the forwarding path, wherein the marking is used for indicating the current forwarding path of the second electronic equipment; acquiring a second request message of the second electronic equipment, wherein the second request message corresponds to the same request application as the first request message; and determining a forwarding path of the second request message according to the forwarding mark.
In one possible embodiment, the full-link gray-scale publishing device based on Nacos may further include a monitoring unit, where the monitoring unit is specifically configured to: acquiring monitoring data from a gray environment where a target application is located; acquiring a monitoring report according to monitoring data, wherein the monitoring data is used for indicating the state of the gray environment; and sending the monitoring report to the first electronic device, so that the development end user updates the request application according to the monitoring report.
In one possible embodiment, the monitoring data includes an error rate of the request message and a response time of the request application, and the monitoring unit is specifically configured to, in acquiring the monitoring report according to the monitoring data: determining the response speed of the request application according to the response time; and when the response time and/or the error rate are/is larger than a preset value, updating the gray rule so that the first request message is forwarded to the production environment where the request application is located.
It can be understood that, since the method embodiment and the apparatus embodiment are in different presentation forms of the same technical concept, the content of the method embodiment portion in the present application should be adapted to the apparatus embodiment portion synchronously, which is not described herein.
In the case of using integrated units, please refer to fig. 6, fig. 6 is a block diagram of functional units of another full-link gray scale issuing device based on Nacos according to an embodiment of the present application. As shown in fig. 6, the Nacos-based full-link gradation distribution apparatus includes: a processing module 512 and a communication module 511. The processing module 512 is configured to perform control management based on actions of the Nacos full-link gray scale distribution device, for example, executing a first acquisition unit, a storage unit, a second acquisition unit, a parsing unit, a determining unit, a first execution unit, a second execution unit, a third execution unit, a marking unit, a monitoring unit, and/or other processes for performing the techniques described herein. The communication module 511 is used for interaction between the Nacos-based full-link gray scale distribution device and other devices. As shown in fig. 6, the Nacos-based full-link gray scale distribution device may further include a storage module 513, where the storage module 513 is configured to store program codes and data of the Nacos-based full-link gray scale distribution device.
The processing module 512 may be a processor or controller, such as a central processing unit (Central Processing Unit, CPU), a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor may also be a combination that performs the function of a computation, e.g., a combination comprising one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 511 may be a transceiver, an RF circuit, a communication interface, or the like. The memory module 513 may be a memory.
All relevant contents of each scenario related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein. The Nacos-based full-link gray scale distribution device may perform the Nacos-based full-link gray scale distribution method shown in FIG. 3.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that, in order to achieve the above-described functions, the electronic device includes a hardware structure and a software module for performing the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application may divide the functional units of the electronic device according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program makes a computer execute part or all of the steps of any one of the above method embodiments, and the computer includes an electronic device.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of embodiments of the present application, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, the above examples being provided solely to assist in the understanding of the methods of the present application and the core ideas thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Although the present application is disclosed above, the present application is not limited thereto. Variations and modifications may be readily apparent to those skilled in the art without departing from the spirit and scope of the present application, and it is intended that all such variations and modifications include the combination of the various functions and steps of the above-described embodiments, including software and hardware, be within the scope of the present application.

Claims (10)

1. The Nacos-based full-link gray level release method is characterized by being applied to a Nacos server of a gray level release system, wherein the gray level release system comprises the Nacos server, a first electronic device of a development end and a second electronic device of a client end, and the method comprises the following steps:
acquiring a registration request from the first electronic equipment, wherein the registration request comprises a target application needing gray release, a gray scale identifier of the target application and a gray scale rule;
storing the gray scale identification and the gray scale rule into a database of the Nacos server according to the registration request;
acquiring a first request message from the second electronic equipment;
analyzing the first request message to obtain a request application and a request identifier;
determining whether the requesting application is the target application;
if the request application is the target application, determining whether the second electronic equipment accords with the gray scale rule according to the request identification; if the gray level rule is met, forwarding the first request message to a gray level environment where the target application is located; if the gray level rule is not met, forwarding the first request message to a production environment where the target application is located;
And if the request application is not the target application, forwarding the first request message to a production environment where the application corresponding to the request identifier is located according to the request identifier.
2. The method of claim 1, wherein the first request message includes a header file, and wherein the parsing the first request message includes:
determining whether target information for indicating a request identifier exists in the header file;
if yes, determining the request identification according to the target information;
if the first request message does not exist, the first request message is recorded in a log, and prompt information is output, wherein the prompt information is used for indicating that the first request message is in error.
3. The method according to claim 1 or 2, wherein the gray scale rule includes a target request frequency and a target region, and the determining whether the second electronic device meets the gray scale rule according to the request identifier includes:
determining the user request frequency of the second electronic equipment for requesting the request application according to the request identification;
determining a user address of the second electronic device according to the request identifier;
determining whether the user request frequency is greater than the target request frequency and whether the user address belongs to the target region;
If yes, determining that the second electronic equipment accords with the gray scale rule.
4. The method of claim 1, wherein prior to determining from the request identification whether the second electronic device meets the gray scale rule, the method comprises:
determining a history request message according to the request application, wherein the history request message is a request message aiming at the request application and sent to the Nacos server by the second electronic equipment last time;
determining the acquisition time of the history request message;
determining a registration time of the registration request;
when the time difference between the acquisition time and the registration time is smaller than a preset time period, acquiring a forwarding path of the history request message, wherein the forwarding path comprises forwarding the history request message to the production environment or forwarding the history request message to the gray scale environment; forwarding the first request message according to the forwarding path; and when the time difference between the acquisition time and the registration time is larger than the preset period, determining whether the second electronic equipment accords with the gray scale rule.
5. The method of claim 4, wherein after forwarding the first request message according to the forwarding path, the method further comprises:
Marking the second electronic equipment according to the forwarding path, wherein the marking is used for indicating the current forwarding path of the second electronic equipment;
acquiring a second request message of the second electronic equipment, wherein the second request message corresponds to the same request application as the first request message;
and determining a forwarding path of the second request message according to the forwarding mark.
6. The method according to any one of claims 1-5, wherein after forwarding the request message to the gray scale environment in which the target application is located, the method further comprises:
acquiring monitoring data from a gray scale environment where the target application is located;
acquiring a monitoring report according to the monitoring data, wherein the monitoring data is used for indicating the state of the gray environment;
and sending the monitoring report to the first electronic equipment, so that the development end user updates the request application according to the monitoring report.
7. The method of claim 6, wherein the monitoring data includes an error rate of the request message and a response time of the requesting application, and wherein obtaining the monitoring report based on the monitoring data comprises:
Determining the response speed of the request application according to the response time;
and when the response time and/or the error rate are/is larger than a preset value, updating the gray rule so that the first request message is forwarded to the production environment where the request application is located.
8. A Nacos-based full-link gray scale distribution device, characterized by being applied to a Nacos server of a gray scale distribution system, wherein the gray scale distribution system comprises the Nacos server, a first electronic device of a development terminal and a second electronic device of a client terminal, and the device comprises:
a first obtaining unit, configured to obtain a registration request from the first electronic device, where the registration request includes a target application that needs to perform gray release, a gray identifier of the target application, and a gray rule;
the storage unit is used for storing the gray scale identification and the gray scale rule into a database of the Nacos server according to the registration request;
the second acquisition unit is used for acquiring a first request message from the second electronic equipment;
the analyzing unit is used for analyzing the first request message and acquiring a request application and a request identifier;
a determining unit configured to determine whether the request application is the target application;
The first execution unit is used for determining whether the second electronic equipment accords with the gray rule according to the request identifier if the request application is the target application; if the gray level rule is met, forwarding the first request message to a gray level environment where the target application is located; if the gray level rule is not met, forwarding the first request message to a production environment where the target application is located;
and the second execution unit is used for forwarding the first request message to the production environment where the application corresponding to the request identifier is located according to the request identifier if the request application is not the target application.
9. An electronic device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the processor, the one or more programs comprising instructions for performing the steps of the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program/instructions, characterized in that the computer program/instructions are executed by a processor to implement the steps of the method of any of claims 1-7.
CN202311618774.6A 2023-11-29 2023-11-29 Nacos-based full-link gray level release method and device Pending CN117675926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311618774.6A CN117675926A (en) 2023-11-29 2023-11-29 Nacos-based full-link gray level release method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311618774.6A CN117675926A (en) 2023-11-29 2023-11-29 Nacos-based full-link gray level release method and device

Publications (1)

Publication Number Publication Date
CN117675926A true CN117675926A (en) 2024-03-08

Family

ID=90076320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311618774.6A Pending CN117675926A (en) 2023-11-29 2023-11-29 Nacos-based full-link gray level release method and device

Country Status (1)

Country Link
CN (1) CN117675926A (en)

Similar Documents

Publication Publication Date Title
CN112306881B (en) Analog data generation method, device, equipment and storage medium
CN109756566B (en) Block chain based data storage method, related equipment and storage medium
CN108259618A (en) The data interactive processing method and device of a kind of synchronization
CN112114869A (en) Server, gray level publishing method, device and medium
CN113382048A (en) Message pushing method, system, equipment and storage medium
CN109542963B (en) Hospital data processing method and related device based on big data
CN113067802B (en) User identification method, device, equipment and computer readable storage medium
CN114138325A (en) Gray scale publishing method and device
CN113407823A (en) IOS message pushing method and system
CN106716974A (en) Access distribution method, device and system
CN110445658B (en) Message processing method and system
CN117675926A (en) Nacos-based full-link gray level release method and device
CN111800491A (en) Data transmission method, system, computing device and storage medium
CN113746851B (en) Proxy system and method supporting real-time analysis of GRPC request
CN110471922B (en) Content extension method and device for accounting node and computer readable storage medium
CN111858100A (en) BMC message transmission method and related device
CN115297179B (en) Data transmission method and device
CN115333954B (en) False address cloud analysis system
CN111158928B (en) Distributed system and communication method
CN114124754B (en) Method for processing media data packets in a multimedia network and related products
CN114710692B (en) Multimedia file processing method and device
CN112054916B (en) Method and system for automatic event conversion
CN116112465A (en) Distributed ID generation method and device
CN107634875B (en) Method and device for discrete communication of game data
CN107066444B (en) Corpus generation method and apparatus based on multi-round interaction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination