CN115955506A - Micro-service publishing method, device, system and computer readable storage medium - Google Patents
Micro-service publishing method, device, system and computer readable storage medium Download PDFInfo
- Publication number
- CN115955506A CN115955506A CN202211091371.6A CN202211091371A CN115955506A CN 115955506 A CN115955506 A CN 115955506A CN 202211091371 A CN202211091371 A CN 202211091371A CN 115955506 A CN115955506 A CN 115955506A
- Authority
- CN
- China
- Prior art keywords
- service
- micro
- client
- target
- file
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 82
- 230000015654 memory Effects 0.000 claims description 34
- 238000012795 verification Methods 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 9
- 238000001514 detection method Methods 0.000 claims description 7
- 238000007726 management method Methods 0.000 description 133
- 230000006870 function Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 7
- 238000012217 deletion Methods 0.000 description 6
- 230000037430 deletion Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000003068 static effect Effects 0.000 description 3
- 238000012384 transportation and delivery Methods 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000005096 rolling process Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a micro-service publishing method, a device and a system and a computer readable storage medium, wherein the method is applied to a micro-service publishing system, and the micro-service publishing system comprises a management terminal and at least one client terminal; the management terminal responds to a micro-service issuing instruction which is generated on a management interface and aims at a target client, and sends a micro-service issuing request to the client corresponding to the target client, wherein the micro-service issuing request comprises file storage information of the target micro-service to be issued; and after receiving the micro-service release request, the client acquires a target micro-service file according to the file storage information of the target micro-service and executes service release operation based on the target micro-service file. Therefore, service release to different clients can be managed in a unified mode, one-key release of micro services can be achieved, resource consumption is reduced, and the operation is simple and convenient.
Description
Technical Field
The present invention relates to the field of micro-service technologies, and in particular, to a method, an apparatus, a system, and a computer-readable storage medium for publishing a micro-service.
Background
The micro-service architecture is split according to the service functions, the same service functions are placed in a micro-service project, the coupling of services is reduced, and development and maintenance of developers are facilitated. Microservice delivery approaches can be generally divided into two categories: one is that a micro-service file generated locally is manually uploaded to a server by people, and the micro-service is started and stopped by a command line; and the other method is to consume extra resources to deploy a set of service release tools, pull the latest code based on code warehouse branches, execute a series of service release intermediate processes such as code specification, code vulnerability scanning, unit testing and the like, then execute a compiling and packaging command to obtain a target file, then execute a corresponding service starting command, back up the target file and the like, and finally complete service release.
However, since many small projects may be based on partial functions of a larger project to deploy a set of services individually, the server resources are often limited and only enough to deploy application services on a cloud environment or a client company server, and a code warehouse is an intranet server, at this time, the release of the services is often performed by a special developer or an operation and maintenance person through a command line, the version of the service is inconvenient to view, the version rollback operation is not intuitive, and misoperation is easy. Moreover, the number of developers is often small for some small projects hatched from large projects, and if the deployment personnel and the developers are separated, links of issuing one version each time are increased, communication cost is increased, and efficiency is reduced. In addition, if the developer is allowed to operate, the requirement on the developer is higher, the authority is not easy to control, and the possibility of errors is increased. Therefore, the existing micro-service distribution method has the problems of high resource consumption, complex operation and the like.
Disclosure of Invention
The application aims to provide a micro-service publishing method, device and system and a computer readable storage medium, which can uniformly manage service publishing to different clients, realize one-key publishing of micro-services, reduce resource consumption and have simple and convenient operation.
In order to achieve the above purpose:
in a first aspect, an embodiment of the present application provides a micro-service publishing method, which is applied to a micro-service publishing system, where the micro-service publishing system includes a management end and at least one client end, and the method includes the following steps:
the management terminal responds to a micro-service issuing instruction which is generated on a management interface and aims at a target client, and sends a micro-service issuing request to the client corresponding to the target client, wherein the micro-service issuing request comprises file storage information of a target micro-service to be issued;
and after receiving the micro-service release request, the client acquires a target micro-service file according to the file storage information of the target micro-service, and executes service release operation based on the target micro-service file.
Optionally, before the micro service for the target client generated at the management interface issues the instruction, the method further includes:
and the management terminal acquires user login information and displays service operation items with operation authority of the user on the management interface according to the user login information.
Optionally, before the client receives the microservice publishing request, the method further includes:
the client receives the target micro service file sent by the management terminal, carries out authority verification based on a key pair issued by the management terminal in advance, stores the target micro service file if the verification is passed, and sends file storage information of the target micro service file to the management terminal;
and the management terminal receives and records the file storage information of the target micro-service file.
Optionally, the method further comprises:
the client executes the prepositive operation and/or the postpositive operation of service release aiming at the target microservice; the pre-operation comprises at least one of: backing up a current micro-service file corresponding to the target micro-service, stopping the target micro-service and emptying cache data; the post-operation comprises at least one of: the output service issues a reminding message; and refreshing the cached data.
Optionally, the method further comprises:
and the management terminal periodically sends heartbeat packets to the client terminal and carries out abnormity detection on the client terminal according to the receiving condition of the heartbeat packets.
In a second aspect, an embodiment of the present application provides a method for publishing a micro service, where the method is applied to a management side, and the method includes:
issuing an instruction in response to the micro-service for the target customer generated at the management interface;
and sending a micro-service publishing request to a client corresponding to the target client, wherein the micro-service publishing request comprises file storage information of the target micro-service to be published.
Optionally, the method further comprises: and acquiring user login information, and displaying service operation items with operation authority of the user on the management interface according to the user login information.
Optionally, the method further comprises:
sending the target micro service file to the client;
and receiving and recording file storage information of the target micro-service file sent by the client.
Optionally, the method further comprises:
and periodically sending heartbeat packets to the client, and performing anomaly detection on the client according to the receiving condition of the heartbeat response packets.
In a third aspect, an embodiment of the present application provides a micro service publishing method, which is applied to a client, and the method includes:
receiving a micro-service release request sent by a management terminal; the micro-service publishing request comprises file storage information of a target micro-service to be published;
and acquiring a target micro-service file according to the file storage information of the target micro-service, and executing service release operation based on the target micro-service file.
Optionally, the method further comprises:
and receiving the target micro service file sent by the management terminal, carrying out authority verification based on a key pair issued by the management terminal in advance, if the verification is passed, storing the target micro service file, and sending file storage information of the target micro service file to the management terminal.
Optionally, the method further comprises:
executing a pre-operation and/or a post-operation for service publishing aiming at the target micro-service; the pre-operation comprises at least one of: backing up a current micro service file corresponding to the target micro service, stopping the target micro service and emptying cache data; the post-operation comprises at least one of: the output service issues a reminding message; and refreshing the cached data.
In a fourth aspect, an embodiment of the present application provides a micro-service publishing system, including a management end and at least one client; the management end and the client end are respectively used for executing the corresponding micro-service publishing method of any one of the second aspect and the third aspect.
In a fifth aspect, an embodiment of the present application provides a micro service distribution device, including: the micro-service distribution method comprises a processor and a memory storing a computer program, and the steps of the micro-service distribution method are realized when the processor runs the computer program.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the above-mentioned micro-service distribution method.
The method is applied to a micro-service publishing system, and the micro-service publishing system comprises a management end and at least one client end; the management terminal responds to a micro-service issuing instruction which is generated on a management interface and aims at a target client, and sends a micro-service issuing request to the client corresponding to the target client, wherein the micro-service issuing request comprises file storage information of the target micro-service to be issued; and after receiving the micro-service release request, the client acquires a target micro-service file according to the file storage information of the target micro-service, and executes service release operation based on the target micro-service file. Therefore, service release to different clients can be managed in a unified mode, one-key release of micro services can be achieved, resource consumption is reduced, and the operation is simple and convenient.
Drawings
Fig. 1 is a first schematic flow chart of a method for publishing a micro service according to an embodiment of the present invention;
fig. 2 is a schematic flow chart diagram of a micro-service publishing method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a third method for publishing microservice according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a microservice issuing system according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a user privilege hierarchy according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a microservice publishing device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, a reference to an element identified by the phrase "comprising one of 82308230a of 82303030, or an element defined by the phrase" comprising another identical element does not exclude the presence of the same element in a process, method, article, or apparatus comprising the element, and elements having the same designation may or may not have the same meaning in different embodiments of the application, the particular meaning being determined by its interpretation in the particular embodiment or by further reference to the context of the particular embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning any one or any combination. Thus, "a, B or C" or "a, B and/or C" means "any of the following: a; b; c; a and B; a and C; b and C; A. b and C ". An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless otherwise indicated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or at least partially with respect to other steps or sub-steps of other steps.
It should be noted that step numbers such as S101 and S102 are used herein for the purpose of more clearly and briefly describing the corresponding contents, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform S102 first and then S101 in specific implementations, but these steps should be within the scope of the present application.
It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
In the following description, suffixes such as "module", "component", or "unit" used to indicate elements are used only for facilitating the description of the present application, and have no particular meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
Referring to fig. 1, a micro-service publishing method provided in the embodiment of the present application is applied to a micro-service publishing system, where the micro-service publishing system includes a management end and at least one client end; the method for releasing the micro-services provided by the embodiment of the application comprises the following steps:
step S101: the management terminal responds to a micro-service issuing instruction which is generated on a management interface and aims at a target client, and sends a micro-service issuing request to the client corresponding to the target client, wherein the micro-service issuing request comprises file storage information of the target micro-service to be issued.
Optionally, the management end may be a computer or other intelligent terminal used by a manager or a technician, and the management end may provide and display a management interface through which micro services corresponding to different customers may be managed, such as micro service release, micro service deletion, and the like. The client can be a computer or other intelligent terminals on the client side. It can be understood that, based on the demands of different customers, small projects hatched from large projects can be correspondingly deployed to corresponding customers in a micro-service manner, and meanwhile, corresponding menus can be displayed on the management interface according to the number of projects and the number of micro-services deployed to the customers. For example, if customer a has two items, and each item has two micro-services, then customer a information may be displayed in the customer menu, and the two micro-services may be displayed in the item menu of customer a. It should be noted that the management interface may provide an operation menu for different microservices of different clients, and the operation menu may include service operation items such as release (or modification) and deletion. When a user inputs operation on a management interface to select to issue a certain micro service of a target client, the management terminal acquires a micro service issuing instruction which is generated on the management interface and aims at the target client, and sends a micro service issuing request to a client corresponding to the target client, wherein the micro service issuing request comprises file storage information of the target micro service to be issued. Optionally, the target client is a client to which the micro service to be published belongs, and the management end may determine the registration address of the client corresponding to the target client according to the identification information such as the name of the target client and the registration address of each client at the management end, and further send the micro service publishing request to the client corresponding to the target client. It should be noted that micro-service distribution in this embodiment may also be referred to as service distribution.
In an embodiment, before the management terminal responds to the micro-service issuing instruction generated in the management interface and aiming at the target client, the method further comprises the following steps: and the management terminal acquires user login information and displays service operation items with operation authority of the user on the management interface according to the user login information. It can be understood that different operation rights can be set for different users, the operation rights can be classified according to clients, projects, services and operations, and if the client rights are assigned, all services and all operations under the client rights are authorized. For example, some users can only manage all services under customer a and other users can only manage all services under customer B, or some users can only manage item C of customer a and other users can only manage item D of customer a; alternatively, some users may only view micro-services, and other users may only publish micro-services. Optionally, after obtaining the user login information, the management terminal may determine the operation authority of the user according to the user login information, and further display the service operation items of which the user has the operation authority on the management interface. For example, assuming that it is determined that the user has only an operation right to the client a according to the user login information, only service operation items, such as release, deletion, and the like, for the client a may be displayed on the management interface. Therefore, the service operation items displayed on the management interface are determined according to the operation authority of the user, the management safety is improved, and the resource consumption is further reduced.
In an embodiment, before the client receives the microservice publishing request, the method further includes:
the client receives the target micro service file sent by the management terminal, carries out authority verification based on a key pair issued by the management terminal in advance, stores the target micro service file if the verification is passed, and sends file storage information of the target micro service file to the management terminal;
and the management terminal records the file storage information of the target micro-service file.
Optionally, after determining a file corresponding to a target micro service to be published, that is, a target micro service file, the management terminal may first send the target micro service file to a client corresponding to the target client, and correspondingly, the client receives the target micro service file sent by the management terminal, performs permission verification based on a key pair issued in advance by the management terminal, and if the verification is passed, stores the target micro service file, and sends file storage information of the target micro service file to the management terminal. Optionally, the target micro service file is sent after being encrypted by the management terminal, the client performs permission verification on the target micro service file by using the key, and if the verification is passed, the target micro service file is decrypted and stored according to the item, the service name, the receiving time, the remark and the like to which the target micro service belongs. And the key pair is issued to the client by the management terminal according to a preset rule when the client registers to the management terminal. Optionally, the client may store the target micro-service file in a local disk, or store the target micro-service file in an object storage server such as an NFS file server or an AWS server, that is, the storage address and the storage manner of the target micro-service file may be set according to an actual situation. Meanwhile, the file storage information may include, but is not limited to, an item, a service name, a receiving time, a remark, a storage address, a storage mode, and the like to which the target micro service belongs. And after receiving the file storage information of the target micro-service file sent by the client, the management terminal records the file storage information of the target micro-service file so as to inform the client of the file storage information when the target micro-service is required to be issued subsequently, and simultaneously realizes unified information management by the management terminal. Therefore, after the permission verification is passed, the client stores the target micro-service file and uploads the corresponding file storage information to the management terminal, so that the safety of micro-service release is improved, and the convenience of information management is improved.
Step S102: and after receiving the micro-service release request, the client acquires a target micro-service file according to the file storage information of the target micro-service and executes service release operation based on the target micro-service file.
Optionally, after receiving the micro-service publishing request sent by the management end, the client may obtain the target micro-service file according to the file storage information of the target micro-service in the micro-service publishing request, and execute a service publishing operation based on the target micro-service file, thereby implementing publishing the target micro-service.
In summary, in the method for publishing the micro service provided by the embodiment, different clients can be managed in a unified manner through the management terminal, and each client side can achieve the effect of managing service publishing only by deploying the micro service, so that the resource cost is greatly reduced, service publishing to different clients can be managed in a unified manner, one-key publishing of the micro service can be realized, the resource consumption is reduced, and the operation is simple and convenient.
In an embodiment, the method further comprises:
the client executes the prepositive operation and/or the postpositive operation of service release aiming at the target microservice; the pre-operation comprises at least one of: backing up a current micro service file corresponding to the target micro service, stopping the target micro service and emptying cache data; the post-operation comprises at least one of: the output service issues a reminding message; and refreshing the cached data.
Optionally, before performing a service publishing operation based on the target micro service file, the client may perform a pre-operation of performing service publishing on the target micro service, such as backing up a current micro service file corresponding to the target micro service, stopping the target micro service, emptying cache data, and the like. After the client executes service publishing operation based on the target micro-service file, the client can execute post operation of service publishing aiming at the target micro-service, such as outputting service publishing reminding message; flush cache data, etc. Optionally, the backing up the current micro service file corresponding to the target micro service is to ensure that a history service version rollback can be realized subsequently, that is, after the management end executes a service publishing operation based on the target micro service file, if the management end needs to reuse the current micro service file corresponding to the target micro service for service publishing subsequently, the management end may realize a corresponding operation through the backed up current micro service file corresponding to the target micro service. Therefore, the convenience of publishing the micro service is improved by executing the prepositive operation and/or the postpositive operation for publishing the service aiming at the target micro service.
In an embodiment, the method further comprises:
the management terminal periodically sends heartbeat packets to the client terminal and carries out abnormity detection on the client terminal according to the receiving condition of the heartbeat packets.
Optionally, in order to maintain a healthy client list, and meanwhile, early warning may be performed when there is an anomaly, the management terminal may periodically send a heartbeat packet to the client based on a registered address of the client, and perform anomaly detection on the client according to a reception condition of the heartbeat packet. Optionally, the heartbeat packet receiving condition may include whether a heartbeat response packet fed back by the client is received, whether an interval duration of the received heartbeat response packet fed back by the client meets a preset duration requirement, and the like. Optionally, when the client is detected to be abnormal, alarm information can be output, and a user can be informed to process the abnormal information. Therefore, convenience and timeliness of management of the micro-services of different clients are improved.
Referring to fig. 2, for a micro-service publishing method provided in the embodiment of the present application, the micro-service publishing method may be executed by a micro-service publishing device provided in the embodiment of the present application, and the micro-service publishing device may be implemented in a software and/or hardware manner, in this embodiment, the micro-service publishing device is taken as a management end as an example, and the micro-service publishing method provided in this embodiment includes:
step S201: the instructions are issued in response to the microservice for the target customer generated at the management interface.
Optionally, the management end may be a computer or other intelligent terminal used by a manager or a technician, and the management end may provide and display a management interface through which micro services corresponding to different customers may be managed, such as micro service release, micro service deletion, and the like. Based on the requirements of different customers, small projects hatched from large projects can be correspondingly deployed to corresponding customers in a micro-service mode, and meanwhile, corresponding menus can be displayed on a management interface according to the number of the projects and the number of the micro-services deployed to the customers. For example, if customer a has two items, and each item has two micro-services, then customer a information may be displayed in the customer menu, and the two micro-services may be displayed in the item menu of customer a. It should be noted that the management interface may provide an operation menu for different microservices of different clients, and the operation menu may include service operation items such as release (or modification), deletion, and the like. When a user inputs operation on the management interface to select to issue a certain micro service of a target client, the management terminal obtains a micro service issuing instruction which is generated on the management interface and aims at the target client.
In one embodiment, the method further comprises: and acquiring user login information, and displaying service operation items with operation authority of the user on the management interface according to the user login information. It can be understood that different operation rights can be set for different users, the operation rights can be classified according to clients, projects, services and operations, and if the client rights are allocated, the rights are provided for all services and all operations under the client. For example, some users can only manage all services under customer a and other users can only manage all services under customer B, or some users can only manage item C of customer a and other users can only manage item D of customer a; alternatively, some users may only view micro-services, and other users may only publish micro-services. Optionally, after obtaining the user login information, the management end may determine the operation authority of the user according to the user login information, and then display, on the management interface, the service operation item that the user has the operation authority. For example, assuming that it is determined that the user has only the operation right to the client a based on the user login information, only service operation items, such as release, deletion, and the like, for the client a may be displayed on the management interface. Therefore, the service operation items displayed on the management interface are determined according to the operation authority of the user, the management safety is improved, and the resource consumption is further reduced.
In an embodiment, the method further comprises:
sending the target micro service file to the client;
and receiving and recording file storage information of the target micro-service file sent by the client.
Optionally, after determining that a file corresponding to a target micro service to be published is a target micro service file, the management end may send the target micro service file to a client corresponding to the target client. And after receiving the file storage information of the target micro-service file sent by the client, the management terminal records the file storage information of the target micro-service file so as to inform the client of the file storage information when the target micro-service is required to be issued subsequently, and simultaneously realizes unified information management by the management terminal. The file storage information may include, but is not limited to, an item to which the target micro service belongs, a service name, a receiving time, a remark, a storage address, a storage mode, and the like. Therefore, convenience of information management is improved.
Step S202: and sending a micro-service publishing request to a client corresponding to the target client, wherein the micro-service publishing request comprises file storage information of the target micro-service to be published.
Optionally, the management end sends a micro-service publishing request to the client corresponding to the target client, where the micro-service publishing request includes file storage information of the target micro-service to be published. Optionally, the target client is a client to which the micro service to be published belongs, and the management end may determine the registration address of the client corresponding to the target client according to the identification information such as the name of the target client and the registration address of each client at the management end, and further send the micro service publishing request to the client corresponding to the target client.
In summary, in the method for publishing the micro service provided by the embodiment, different clients can be managed in a unified manner through the management terminal, and each client side can achieve the effect of managing service publishing only by deploying the micro service, so that the resource cost is greatly reduced, service publishing to different clients can be managed in a unified manner, one-key publishing of the micro service can be realized, the resource consumption is reduced, and the operation is simple and convenient.
In an embodiment, the method further comprises:
and periodically sending heartbeat packets to the client, and carrying out anomaly detection on the client according to the receiving condition of the heartbeat packets.
Optionally, in order to maintain a healthy client list, and meanwhile, early warning may be performed when there is an anomaly, the management terminal may periodically send a heartbeat packet to the client based on a registered address of the client, and perform anomaly detection on the client according to a reception condition of the heartbeat packet. Optionally, the heartbeat packet receiving condition may include whether a heartbeat response packet is received, whether an interval duration of receiving the heartbeat response packet meets a preset duration requirement, and the like. Optionally, when the client is detected to be abnormal, alarm information can be output, and a user can be informed to process the abnormal information. Therefore, convenience and timeliness for managing the micro-services of different clients are improved.
Referring to fig. 3, for a micro-service publishing method provided in the embodiment of the present application, the micro-service publishing method may be executed by a micro-service publishing device provided in the embodiment of the present application, and the micro-service publishing device may be implemented in a software and/or hardware manner, in this embodiment, the micro-service publishing device is taken as a client, and the micro-service publishing method provided in this embodiment includes:
step S301: receiving a micro-service release request sent by a management end; the micro-service publishing request comprises file storage information of a target micro-service to be published.
Alternatively, the client may be a computer or other intelligent terminal on the client side.
In one embodiment, the method further comprises:
and receiving the target micro service file sent by the management terminal, verifying the authority based on a key pair issued by the management terminal in advance, if the authority passes the verification, storing the target micro service file, and sending the file storage information of the target micro service file to the management terminal.
Optionally, after determining a file corresponding to a target micro service to be published, that is, a target micro service file, the management terminal may first send the target micro service file to a client corresponding to the target client, and correspondingly, the client receives the target micro service file sent by the management terminal, performs permission verification based on a key pair issued in advance by the management terminal, and if the verification is passed, stores the target micro service file, and sends file storage information of the target micro service file to the management terminal. Optionally, the target micro service file is sent after being encrypted by the management terminal, the client performs permission verification on the target micro service file by using the key, and if the verification is passed, the target micro service file is decrypted and stored according to the item, the service name, the receiving time, the remark and the like to which the target micro service belongs. And the key pair is issued to the client by the management terminal according to a preset rule when the client registers to the management terminal. Optionally, the client may store the target micro-service file in a local disk, or store the target micro-service file in an object storage server such as an NFS file server or an AWS server, that is, the storage address and the storage manner of the target micro-service file may be set according to an actual situation. Meanwhile, the file storage information may include, but is not limited to, an item to which the target micro service belongs, a service name, a receiving time, a remark, a storage address, a storage mode, and the like. Therefore, after the authority verification is passed, the client stores the target micro-service file and uploads corresponding file storage information to the management terminal, so that the safety of micro-service release is improved, and the convenience of information management is improved.
Step S302: and acquiring a target micro-service file according to the file storage information of the target micro-service, and executing service release operation based on the target micro-service file.
Optionally, after receiving the micro-service publishing request sent by the management end, the client may obtain the target micro-service file according to the file storage information of the target micro-service in the micro-service publishing request, and perform a service publishing operation based on the target micro-service file, thereby implementing publishing the target micro-service.
In summary, in the micro-service publishing method provided by the embodiment, different clients can be managed in a unified manner through the management terminal, and each client side can achieve the management service publishing effect only by deploying the micro-service, so that the resource cost is greatly reduced, the service publishing to different clients can be managed in a unified manner, the one-key publishing of the micro-service can be realized, the resource consumption is reduced, and the operation is simple and convenient.
In an embodiment, the method further comprises:
executing a pre-operation and/or a post-operation for service publishing aiming at the target micro-service; the pre-operation comprises at least one of: backing up a current micro service file corresponding to the target micro service, stopping the target micro service and emptying cache data; the post-operation comprises at least one of: the output service issues a reminding message; and refreshing the cached data.
Optionally, before performing a service publishing operation based on the target micro service file, the client may perform a pre-operation of performing service publishing on the target micro service, such as backing up a current micro service file corresponding to the target micro service, stopping the target micro service, emptying cache data, and the like. After executing service publishing operation based on the target micro service file, the client can execute post operation of service publishing aiming at the target micro service, such as outputting service publishing reminding message; flush cache data, etc. Optionally, the backing up the current micro service file corresponding to the target micro service is to ensure that a history service version rollback can be realized subsequently, that is, after the management end executes a service publishing operation based on the target micro service file, if the management end needs to reuse the current micro service file corresponding to the target micro service for service publishing subsequently, the management end may realize a corresponding operation through the backed up current micro service file corresponding to the target micro service. Therefore, the convenience of publishing the micro service is improved by executing the prepositive operation and/or the postpositive operation for publishing the service aiming at the target micro service.
Based on the same inventive concept of the foregoing embodiments, the present application embodiment further provides a micro-service publishing system, including a management end and at least one client end; the management end and the client end are respectively used for executing the corresponding micro-service publishing method described in the foregoing embodiment.
The foregoing embodiments will be described in detail below with reference to a specific example based on the same inventive concept as the foregoing embodiments.
Referring to fig. 4, an overall architecture diagram of the micro-service publishing system provided in this embodiment mainly includes two modules: the management terminal is provided for a unified management platform for the service publisher, the platform is deployed in a company, the deployment node is expandable and is responsible for unified communication with the client node, and the service publisher is used for unified authority control including menu authority, data authority, operation authority and the like; and the client is responsible for receiving the scheduling of the management node, receiving the service file, executing backup storage of the service file, service release, rolling back of a historical service version, monitoring a service release event, and executing a service release pre-operation and a service release post-operation. Wherein, different clients n correspond to the client nodes n, and n is a positive integer.
The management node deployment and main function realization comprises the following steps:
the management nodes are deployed in the company, can be deployed in a single node mode, can additionally register service nodes in a service registration center according to the number of client nodes, and are proxied by the unified gateway to achieve the purpose of horizontal extension.
The management node maintains the heartbeat of the client node, periodically sends a heartbeat packet to the client node through the client node registration address, maintains a healthy node list, and can give early warning if abnormality occurs. And the information is transmitted to the corresponding client node through the operation of the service publisher, and the client node responds to the corresponding operation event to perform processing.
Referring to fig. 5, a schematic diagram of a user authority system is shown, from top to bottom, the types of clients, items, services, and operations are respectively classified according to a tree structure, and the maximum authority can be assigned according to the clients. If the client authority is allocated, all services are provided for the client, and all operations are authorized. The minimum right can be assigned according to a specific operation of a certain service of a certain client.
The client node deployment and the main function realization comprise:
the client nodes are deployed in client companies, and have the main functions of receiving service files, backing up the service files, executing service publishing and service rollback operations, and responding to operation events.
The service file is transmitted to the client node from the management node through a Restful API (application program interface) call, the client node performs authority verification through a secret key pair issued in advance, the service file is stored according to items according to information such as service name, time and remark after passing the verification, the storage address can be stored in a local disk or an NFS (network file system) file server, an Aws S3 and an Huacheng obs object storage server according to the client condition, and the result is returned to the management node and recorded and managed by the management node.
The service issuing and rollback is that the client node finds a target file according to a file address in the request parameter of the management node, and then executes customized service issuing operation, if the Java service executes a corresponding starting command, the static resource stores the target file into a specified proxy directory, and the like. And customizing the pre-operation and the post-operation of service delivery according to the requirements of customers, emptying the Redis cache, refreshing the CDN cache, sending service delivery message reminders and the like.
In summary, in the micro-service publishing method provided in this embodiment, a project service publishing scheme deployed by a client is managed in a unified manner, a management node may adopt distributed deployment, a client node may adopt single-node deployment or distributed deployment according to a resource condition, and the client node and the management node may adopt Restful API interface communication, so that the following effects are achieved: 1) One management service can uniformly manage different customer project nodes, and the customer project nodes can achieve the effect of issuing the management service only by deploying one micro service, so that the resource cost is greatly reduced; 2) The service release has the advantages of quick and simple one-key release, one-key rollback, authority control and operation supervision audit; 3) The unified management service can customize the special needs of different customer service releases based on the release event. That is, the method for publishing the micro-service with low resource consumption by using unified management can reduce the resource requirement of the client server, achieve the purpose of unified management on a plurality of client projects, and rapidly publish and rollback historical version service based on the stored service file.
Based on the same inventive concept of the foregoing embodiments, an embodiment of the present invention provides a microservice issuing apparatus, as shown in fig. 6, the apparatus including: a processor 310 and a memory 311 storing computer programs; the processor 310 illustrated in fig. 6 is not used to refer to the number of the processors 310 as one, but is only used to refer to the position relationship of the processor 310 relative to other devices, and in practical applications, the number of the processors 310 may be one or more; similarly, the memory 311 shown in fig. 6 is also used in the same sense, i.e. only used to refer to the position relationship of the memory 311 relative to other devices, and in practical applications, the number of the memory 311 may be one or more. When the processor 310 runs the computer program, the micro-service issuing method applied to the above-described apparatus is implemented.
The apparatus may further comprise: at least one network interface 312. The various components of the device are coupled together by a bus system 313. It will be appreciated that the bus system 313 is used to enable communications among the components connected. The bus system 313 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as bus system 313 in FIG. 6.
The memory 311 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a magnetic random access Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration, and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), synchronous Static Random Access Memory (SSRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), double Data Rate Synchronous Random Access Memory (ESDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), enhanced Synchronous Random Access Memory (DRAM), synchronous Random Access Memory (DRAM), direct Random Access Memory (DRmb Access Memory). The memory 311 described in connection with the embodiments of the present invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the apparatus. Examples of such data include: any computer program for operation on the device, such as operating systems and application programs; contact data; telephone book data; a message; a picture; video, etc. The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application programs may include various application programs such as a Media Player (Media Player), a Browser (Browser), etc. for implementing various application services. Here, the program that implements the method of the embodiment of the present invention may be included in an application program.
Based on the same inventive concept of the foregoing embodiments, this embodiment further provides a computer storage medium, where a computer program is stored in the computer storage medium, where the computer storage medium may be a Memory such as a magnetic random access Memory (FRAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read Only Memory (CD-ROM), and the like; or a variety of devices, such as mobile phones, computers, tablet devices, personal digital assistants, etc., that include one or any combination of the above memories. When the computer program stored in the computer storage medium is executed by a processor, the micro-service distribution method applied to the device is realized. For the specific steps and processes of the computer program executed by the processor, please refer to the description of the embodiment shown in fig. 1-3, which is not repeated herein.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
As used herein, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, including not only those elements listed, but also other elements not expressly listed.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A micro-service release method is characterized in that the method is applied to a micro-service release system, and the micro-service release system comprises a management end and at least one client end; the method comprises the following steps:
the management terminal responds to a micro-service issuing instruction which is generated on a management interface and aims at a target client, and sends a micro-service issuing request to the client corresponding to the target client, wherein the micro-service issuing request comprises file storage information of the target micro-service to be issued;
and after receiving the micro-service release request, the client acquires a target micro-service file according to the file storage information of the target micro-service, and executes service release operation based on the target micro-service file.
2. The method of claim 1, wherein the managing end responds to the micro-service for the target client issuing the instruction generated in the management interface, and further comprising:
and the management terminal acquires user login information and displays service operation items with operation authority of the user on the management interface according to the user login information.
3. The method of claim 1, wherein before the client receives the microservice publishing request, the method further comprises:
the client receives the target micro service file sent by the management terminal, carries out authority verification based on a key pair issued by the management terminal in advance, stores the target micro service file if the verification is passed, and sends file storage information of the target micro service file to the management terminal;
and the management terminal receives and records the file storage information of the target micro-service file.
4. The method according to any one of claims 1 to 3, further comprising:
the client executes the preposed operation and/or the postpositive operation of service release aiming at the target micro service; the pre-operation comprises at least one of: backing up a current micro service file corresponding to the target micro service, stopping the target micro service and emptying cache data; the post-operation comprises at least one of: the output service issues a reminding message; and refreshing the cached data.
5. The method according to any one of claims 1 to 3, further comprising:
and the management terminal periodically sends heartbeat packets to the client terminal and carries out abnormity detection on the client terminal according to the receiving condition of the heartbeat packets.
6. A micro-service publishing method is applied to a management end, and is characterized by comprising the following steps:
issuing an instruction in response to the micro-service for the target customer generated at the management interface;
and sending a micro-service publishing request to a client corresponding to the target client, wherein the micro-service publishing request comprises file storage information of the target micro-service to be published.
7. A micro-service issuing method is applied to a client, and is characterized by comprising the following steps:
receiving a micro-service release request sent by a management end; the micro-service publishing request comprises file storage information of a target micro-service to be published;
and acquiring a target micro-service file according to the file storage information of the target micro-service, and executing service release operation based on the target micro-service file.
8. A micro-service release system is characterized by comprising a management end and at least one client end; wherein the management end and the client end are respectively used for executing the corresponding micro-service publishing method of any one of claims 1-7.
9. A microservice publishing device, comprising: a processor and a memory storing a computer program which, when executed by the processor, implement the steps of the microservice publishing method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored which, when being executed by a processor, carries out the steps of the microservice publishing method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211091371.6A CN115955506A (en) | 2022-09-07 | 2022-09-07 | Micro-service publishing method, device, system and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211091371.6A CN115955506A (en) | 2022-09-07 | 2022-09-07 | Micro-service publishing method, device, system and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115955506A true CN115955506A (en) | 2023-04-11 |
Family
ID=87281439
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211091371.6A Pending CN115955506A (en) | 2022-09-07 | 2022-09-07 | Micro-service publishing method, device, system and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115955506A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112751916A (en) * | 2020-12-28 | 2021-05-04 | 中国科学院软件研究所 | Data publishing-subscribing method and system for micro-service governance |
CN114064054A (en) * | 2021-11-23 | 2022-02-18 | 金蝶蝶金云计算有限公司 | Micro-service publishing method, device, equipment and storage medium |
CN114398061A (en) * | 2022-01-14 | 2022-04-26 | 中国建设银行股份有限公司 | Publishing method, device, equipment and storage medium |
CN114968276A (en) * | 2021-02-22 | 2022-08-30 | 腾讯科技(深圳)有限公司 | Application program deployment method and device, computer equipment and storage medium |
CN114968286A (en) * | 2022-06-14 | 2022-08-30 | 中国电信股份有限公司 | Micro-service issuing method, device, storage medium and electronic equipment |
-
2022
- 2022-09-07 CN CN202211091371.6A patent/CN115955506A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112751916A (en) * | 2020-12-28 | 2021-05-04 | 中国科学院软件研究所 | Data publishing-subscribing method and system for micro-service governance |
CN114968276A (en) * | 2021-02-22 | 2022-08-30 | 腾讯科技(深圳)有限公司 | Application program deployment method and device, computer equipment and storage medium |
CN114064054A (en) * | 2021-11-23 | 2022-02-18 | 金蝶蝶金云计算有限公司 | Micro-service publishing method, device, equipment and storage medium |
CN114398061A (en) * | 2022-01-14 | 2022-04-26 | 中国建设银行股份有限公司 | Publishing method, device, equipment and storage medium |
CN114968286A (en) * | 2022-06-14 | 2022-08-30 | 中国电信股份有限公司 | Micro-service issuing method, device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP4047487B1 (en) | File storage method, terminal, and storage medium | |
US20110016514A1 (en) | Methods for monitoring and control of electronic devices | |
US20110016199A1 (en) | System for electronic device monitoring | |
CN109587233B (en) | Multi-cloud container management method, device and computer-readable storage medium | |
CN111245656B (en) | Method and system for remote monitoring through mobile equipment | |
CN108804399B (en) | Form verification method and device | |
CN103501237A (en) | Device management method, management platform, device and system | |
CN111813418B (en) | Distributed link tracking method, device, computer equipment and storage medium | |
CN112162761A (en) | Method, system and equipment for automatically deploying project to public cloud containerization platform | |
CN112445860B (en) | Method and device for processing distributed transaction | |
CN103562876A (en) | Redirecting requests to secondary location during temporary outage | |
CN114356654A (en) | Backup system, backup method, backup device, computer device, and storage medium | |
CN117971623A (en) | Data operation and maintenance method, device, equipment and medium | |
US10176059B2 (en) | Managing server processes with proxy files | |
CN116719696A (en) | Method, device, equipment and storage medium for monitoring application program interface data | |
CN115955506A (en) | Micro-service publishing method, device, system and computer readable storage medium | |
US20110282980A1 (en) | Dynamic protection of a resource during sudden surges in traffic | |
CN112084247B (en) | Method and device for expanding application program service | |
CN114661295A (en) | Parameter injection method and device and computer storage medium | |
CN114064054A (en) | Micro-service publishing method, device, equipment and storage medium | |
CN113835827A (en) | Application deployment method and device based on container Docker and electronic equipment | |
CN113835889A (en) | Method for acquiring input event and related device | |
CN111143819A (en) | Application locking method and device and computer storage medium | |
US20190303202A1 (en) | Managing a set of computing resources | |
CN113094211B (en) | Backup data processing method and device |
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 |