CN111917838B - Micro-service-based processing method and device, storage medium and electronic device - Google Patents

Micro-service-based processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111917838B
CN111917838B CN202010676588.8A CN202010676588A CN111917838B CN 111917838 B CN111917838 B CN 111917838B CN 202010676588 A CN202010676588 A CN 202010676588A CN 111917838 B CN111917838 B CN 111917838B
Authority
CN
China
Prior art keywords
service
policy
information
proxy
micro
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.)
Active
Application number
CN202010676588.8A
Other languages
Chinese (zh)
Other versions
CN111917838A (en
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202010676588.8A priority Critical patent/CN111917838B/en
Publication of CN111917838A publication Critical patent/CN111917838A/en
Application granted granted Critical
Publication of CN111917838B publication Critical patent/CN111917838B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing

Abstract

The application provides a processing method and device based on micro-services, a storage medium and an electronic device. The method comprises the steps of obtaining the service information reported by the agent component; generating the service list through the service information and sending the service list to the proxy component; processing service requests in the micro-service by the proxy component proxy; maintaining service information and control strategies of the micro services in a service list of the service request locally; and calling the control strategy information through a third party calling interface and issuing the control strategy information to the corresponding proxy component. The application solves the problem that the micro-service system can not better meet the multi-language access and update the control strategy.

Description

Micro-service-based processing method and device, storage medium and electronic device
Technical Field
The present application relates to the field of micro services, and in particular, to a micro service-based processing method and apparatus, a storage medium, and an electronic apparatus.
Background
SpringCloud provides a complete solution for developers to build micro-service architecture. SpringCloud is a collection of several frameworks, including nearly 20 sub-items of spring-closed-config, spring-closed-bus, which provides solutions in the fields of service remediation, service gateway, intelligent routing, load balancing, circuit breakers, monitoring tracking, distributed message queuing, configuration management, etc.
Since SpringCloud is developed based on Java language, services in other programming languages cannot be directly accessed into the SrpingCloud micro-service system. In addition, only http protocol transmission is supported between service modules in SpringCloud, and other protocol transmission cannot be supported. Meanwhile, the control strategy in SpringCloud cannot realize hot update, and cannot meet the actual changing requirement.
Aiming at the problem that a micro service system cannot better meet the multi-language access and update control strategies in the related technology, no effective solution exists at present.
Disclosure of Invention
The embodiment of the application provides a processing method and device based on micro service, a storage medium and an electronic device, which at least solve the problem that a micro service system in the related technology cannot better meet multi-language access and update control strategies.
According to one embodiment of the present application, a micro-service-based processing method is provided, in which the service information reported by a proxy component is acquired; generating the service list through the service information and sending the service list to the proxy component; processing service requests in the micro-service by the proxy component proxy; maintaining service information and control strategies of the micro services in a service list of the service request locally; invoking the control strategy information through a third party invoking interface and issuing the control strategy information to the corresponding proxy component
According to another embodiment of the present application, there is provided a micro-service based processing system including: the acquisition module is used for acquiring the service information reported by the proxy component; the sending module is used for generating the service list through the service information and sending the service list to the proxy component; the processing module is used for processing the service request in the micro-service through the proxy component proxy; the maintenance module is used for locally maintaining service information and control strategies of the micro services in the service list of the service request; and the calling module is used for calling the control strategy information through a third party calling interface and issuing the control strategy information to the corresponding proxy component.
According to a further embodiment of the application, there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the application, the proxy component is adopted to proxy the service request, so that the communication request between services can be better realized. The proxy component is adopted to locally maintain the service list and the control strategy information of the service request, so that the control strategy can be effectively updated. Therefore, the problem that the micro-service system cannot better meet the multi-language access and update the control strategy can be solved, and the effects of realizing the multi-language multi-protocol high-reliability high-concurrency access with lower resource occupancy rate and adapting to the flow requirement of the service which is changed continuously through strategy hot update are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a block diagram of the hardware architecture of a computer device of a microservice-based processing method of an embodiment of the present application;
FIG. 2 is a flow chart of a micro-service based processing method according to an alternative embodiment of the application;
FIG. 3 is a block diagram of the components in a micro-service system according to an alternative embodiment of the present application;
FIG. 4 is a flow chart of an actual service request according to an embodiment of the present application;
FIG. 5 is a flow chart of management, issue and acquisition of control strategies according to an alternative embodiment of the present application;
fig. 6 is a schematic structural diagram of a micro-service based processing device according to an embodiment of the present application.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
Example 1
The method according to the first embodiment of the present application may be implemented in a mobile terminal, a computer terminal or a similar computing device. Taking the example of running on a computer device, fig. 1 is a block diagram of the hardware architecture of the computer device of the micro service system according to an embodiment of the present application.
The embodiment of the application provides a computer terminal. As shown in fig. 1, the computer device 20 may include: at least one processor 201, such as a CPU, at least one network interface 204, a user interface 203, memory 205, at least one communication bus 202, and optionally, a display 206. Wherein the communication bus 202 is used to enable connected communication between these components. The user interface 203 may include a touch screen, a keyboard or mouse, among others. The network interface 204 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and a communication connection may be established with a server through the network interface 204. The memory 205 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory, where the memory 205 includes a flash in an embodiment of the present application. The memory 205 may also optionally be at least one storage system located remotely from the aforementioned processor 201. As shown in fig. 1, an operating system, a network communication module, a user interface module, and program instructions may be included in the memory 205, which is a type of computer storage medium.
It should be noted that, the network interface 204 may be connected to a receiver, a transmitter, or other communication modules, which may include, but are not limited to, a WiFi module, a bluetooth module, etc., and it is understood that in embodiments of the present application, the computer device may also include a receiver, a transmitter, other communication modules, etc.
The processor 201 may be used to invoke program instructions stored in the memory 205 and cause the computer device 20 to perform operations based on micro-services processing.
As shown in fig. 2, in this embodiment, a processing method based on micro services is provided, which specifically includes the following steps:
step S202, obtaining the service information reported by the agent component;
step S204, generating the service list through the service information and sending the service list to the proxy component;
step S206, processing the service request in the micro-service through the proxy component proxy;
step S208, service information and control strategies of the micro services in the service list of the service request are maintained locally;
step S210, calling the control strategy information through a third party calling interface and issuing the control strategy information to the corresponding proxy component.
Through the steps, the service request is processed by adopting the proxy component proxy, so that the communication request between services can be better realized. The proxy component is adopted to locally maintain the service list and the control strategy information of the service request, so that the control strategy can be effectively updated. Therefore, the problem that the micro-service system cannot better meet the multi-language access and update the control strategy can be solved, and the effects of realizing the multi-language multi-protocol high-reliability high-concurrency access with lower resource occupancy rate and adapting to the flow requirement of the service which is changed continuously through strategy hot update are achieved.
And in the step S202, the service information reported by the agent component is obtained, and the local business service information is reported to the registration center of the micro service. And meanwhile, the proxy component regularly saves the related request current service information list pulled to the registration center of the micro service into the shared memory.
After the service list is generated through the service information in the above step S204, the service list is transmitted to the proxy component.
The request between related services is proxied by the proxy component in step S206 described above and may be based on multiprotocol transmission. And maintaining a relevant service list and relevant control strategy information locally, so that the control of the service is realized according to the strategy control information.
The request between related services is proxied in step S206 described above and may be based on multiprotocol transmission. And maintaining a relevant service list and relevant control strategy information locally, so that the control of the service is realized according to the strategy control information.
Service information and control policy of the micro service in the service list of the service request are maintained locally in the above step S208.
In step S210, in order to cooperate with the micro-service system to implement a corresponding function, policies such as load balancing, current limiting, fusing degradation, gray release, bluish green release, canary release, etc. of the related service are managed, and meanwhile, related control policies are issued to the corresponding proxy components.
As an alternative embodiment of the present application, the proxy processing, by the proxy component, the service request in the micro service includes: the proxy component proxies a first service request from a first service to a second service in a micro service, wherein the first service comprises: a Web service written in a first programming language, the second service comprising: a Web service written in a second programming language.
Specifically, the original http protocol is taken into account, and meanwhile, the grpc websocket protocol transmission can be supported, so that various protocol transmission requirements under the micro-service are met. The method can be compatible with the original micro-service system, thereby realizing service access of non-java language.
As an optional embodiment of the application, in a case where the service request includes a first service request sent by a first service to a second service, the proxy processing, by the proxy component, the service request in the micro service includes:
receiving a control strategy information request from the first service to the second service; according to the control strategy information request, saving control strategy information carried in the control strategy information request; and under the condition that the acquired local first service list contains the first service, the control strategy information is issued to a proxy component of the first service.
Specifically, the control policy information is integrated as an SDK into the registry so as to share service list information. The control strategy information receives and stores the control strategy through the strategy component, and then queries local related source and target service information and synchronizes the strategy to the proxy component of the corresponding service. And the proxy component can regularly pull the control strategy information from the source service to the related target service to the strategy component for maintenance in the local shared memory.
Preferably, in the case that the service request includes a first service request sent by a first service to a second service, the proxy processing of the service request in the micro service by the proxy component includes: the agent receives the first service request, wherein the service request carries identification information of the second service; matching a target service address of the second service according to the identification information, wherein the target service address is stored locally; and transmitting the service request to the second service according to the target service address to instruct the second service to respond to the service request. That is, when the first service requests the second service, the first service request is transmitted to the proxy component, the proxy component acquires the control policy, and forwards the control policy to the proxy component under the corresponding server, the proxy component transmits the request to the second service, and the second service normally responds to the service request.
In the above step, when the proxy component receives the service request, the proxy component analyzes the target service name in the request header, searches the service list information matching the service name in the local shared memory, and selects a certain target service address for request transparent transmission through the local control policy screening algorithm, thereby realizing multi-language and multi-protocol micro service access.
In a specific implementation, in a case that the service request includes a first service request sent by a first service to a second service, after the service request is transparently transferred to the second service according to the target service address, the method further includes: acquiring second service list information of a local cache; finding a second service in the second service list information, and acquiring a second policy under the condition that the first policy acquired by the proxy component does not meet the first policy condition; finding a second service in the second service list information and responding to an exception to the first service if the first policy acquired by the proxy component meets a first policy condition; acquiring a third strategy under the condition that the agent component acquires that the second strategy does not meet the second strategy condition; and responding to the exception to the first service in the case that the agent component acquires that the second policy satisfies the second policy condition.
Optionally, the policy component includes one of: load balancing policies, current limiting control policies, gray level distribution policies, canary distribution policies, service degradation policies, the first policies including fuse degradation policies, the second policies including current limiting control policies, the third policies including gray level and load balancing policies. The control strategies of current limiting, fusing degradation, load balancing, gray scale, bluish green, canary and the like can be used for thermal updating, and the control strategies are suitable for the flow requirements and the like of services which are changed continuously.
As an optional embodiment of the present application, after the service request in the micro service is proxied by the proxy component, the method further includes: heartbeat keep-alive for the first service or the second service, wherein a transmission protocol between the first service or the second service comprises at least one of: http, grpc, websocket transport protocol.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
Example 2
In an embodiment of the present application, a processing system based on micro services is provided, as shown in fig. 6, including:
an acquisition module 62, configured to acquire the service information reported by the proxy component;
a transmitting module 64 for generating the service list from the service information and transmitting the service list to the proxy component;
a processing module 66 for proxy processing of service requests in the micro-services by the proxy component;
a maintenance module 68 for locally maintaining service information and control policies of the micro-services in the service list of the service request;
and the calling module 610 is used for calling the control strategy information through a third party calling interface and issuing the control strategy information to the corresponding proxy component.
The service information reported by the proxy component is obtained in the obtaining module 62, and the local business service information is reported to the registration center of the micro service. And meanwhile, the proxy component regularly saves the related request current service information list pulled to the registration center of the micro service into the shared memory.
After the service list is generated by the service information in the above-mentioned transmitting module 64, the service list is transmitted to the proxy component.
Requests between related services are proxied through the proxy component in the processing module 66 described above and may be based on multiprotocol transmissions. And maintaining a relevant service list and relevant control strategy information locally, so that the control of the service is realized according to the strategy control information.
Requests between related services are proxied in the processing module 66 described above and may be based on multiprotocol transmissions. And maintaining a relevant service list and relevant control strategy information locally, so that the control of the service is realized according to the strategy control information.
Service information and control policies for the micro-services in the service list of the service request are maintained locally in the maintenance module 68 described above.
In order to cooperate with the micro-service system to realize the corresponding functions in the calling module 610, policies such as load balancing, current limiting, fusing degradation, gray release, bluish green release, canary release and the like of the related services are managed, and meanwhile, related control policies are issued to the corresponding proxy components.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
In order to better understand the implementation flow of the micro service system, the following explanation is given with reference to the preferred embodiment, but the technical solution of the embodiment of the present application is not limited.
In the preferred embodiment of the application, the problem that the micro-service system cannot better meet the requirement of multi-language access and updating the control strategy can be solved, and the effects of realizing multi-language multi-protocol high-reliability high-concurrency access with lower resource occupancy rate and adapting to the flow requirement of service which is changed continuously through strategy hot updating can be achieved.
Fig. 3 is a block diagram of the architecture of a micro service system according to an embodiment of the present application, as shown in fig. 3, including: proxy component 30, registry 32, policy component 34, proxy component a301, proxy component B302, proxy component C303, service a, service B, and service C.
The registry 32 is a service discovery framework developed based on Netflix, which is itself a REST-based service, to achieve the goals of load balancing and intermediate layer service failover. SpringCloud integrates it in its sub-project spring-closed-netflix to implement the service discovery function of SpringCloud.
The policy component 34 is a platform-independent component, and can manage policies such as load balancing, current limiting, fuse degradation, gray distribution, bluish green distribution, canary distribution, and the like of related services through control plane api, and issue related policies to the corresponding proxy components 30.
The proxy component A301, the proxy component B302 and the proxy component C303 are developed based on Nginx+lua, and can be compatible with all advantages of Nginx and used for proxy related service requests. May be based on http, grpc, websocket protocol transmissions.
It should be noted that, in the embodiment of the present application, proxy written by nginnx+lua is mainly used to replace original Spring Cloud Netflix Sidecar, so as to satisfy multiple protocols and also consider the performance of the sidecar.
The proxy component a301, the proxy component B302, and the proxy component C303 locally maintain a relevant service list and relevant control policy information, and need to acquire relevant information from the registry 32 and the rough component 34 in real time, so as to implement control on load balancing, current limiting control, gray level release, canary release, service degradation, and the like of the service.
The proxy component A301, the proxy component B302 and the proxy component C303 also need keep-alive monitoring for Service services A/B/C.
The service a/B/C is an actual service module, needs to send heartbeat to keep-alive to the proxy component 30, can be web services written in different languages, and the transmission protocol can be http, grpc, websocket.
Fig. 4 is a flow chart of an actual service request according to an embodiment of the present application, where nmginxsidecar refers to a proxy component a, nmginxsidecar refers to a proxy component B, when nmginxsidecar receives a service request, a target service name in a request header is resolved, service list information matching the service name in a local shared memory is searched, and a certain target service address is selected through a local control policy screening algorithm to perform request transparent transmission, so that a multi-language and multi-protocol Java SpringCloud micro-service system access is realized, and the access stability and performance are greatly improved based on natural high reliability, high concurrency and low resource occupation of nmlnx. The method comprises the following specific steps:
step S400, SA (c++ write) requests SB (golang write) based on GRPC.
In step S402, the SA request is transmitted to NginxSidecarA, nginxSidecarA and the SA request is received.
Step S404, the ngixsidecara obtains local cache SB service list information,
in step S406, if SB service information is not found, the exception code is directly responded to the SA.
In step S408, the ngixsidecara obtains the local fusing policy and determines whether the fusing policy is satisfied, if the fusing condition is satisfied, the service is directly degraded, and the abnormal code is responded to the SA.
In step S410, the nmginxsidecar a obtains the current limiting policy and determines whether the current limiting policy is satisfied, if the current limiting condition is satisfied, it is easy to respond to the exception code directly to the SA.
In step S412, the ngixsidecar a obtains policies such as local gray scale and load balancing, and forwards the policies to the ngixsidecar service under the corresponding server.
In step S414, the NginxSideCarB passes the request through to the SB service, which receives the SA request.
Step S416, SB receives SA request service normal response business.
The nmginxsidecar is written based on nmginx+lua, and can periodically send a request to acquire the keep-alive state and service information (including service name, external ip port, load, flow and the like) of the back-end business service, and report the local business service information to a registry. The relevant request current service information list which is regularly pulled to the registration center is also required to be stored in the Nginx shared memory.
FIG. 5 is a flowchart of the management, issuing and obtaining of control policies according to an alternative embodiment of the application, the specific steps comprising:
in step S500, the service platform issues a control policy request to create SA to SB to the policy component through control plane api.
In step S502, the Policy component saves the control Policy to the data and the cache, and responds to the success to the business service after the success.
In step S504, the Policy component obtains local SA list information.
Step S506, if SA service information is included, if SA information is not included, the process is directly ended.
In step S508, the Policy component issues the Policy to the ngixsidearcon for each SA service.
In step S510, the NginxSidecar receives a Policy component request.
In step S512, nginxSidecar saves the policy to the local cache.
Step S514, ends.
The Policy component may be integrated into the registry as an SDK to share service list information, the external management service sends control Policy (including load balancing, blue-green, gray, current limiting degradation, canary, etc.) requests for innovative update, modification, deletion, etc. to the Policy component through the RestApi, after the Policy component stores the information of the local related source and target services, the Policy is synchronized to the NginxSidecar of the corresponding service, and meanwhile, the NginxSidecar can regularly pull the control Policy information from the source service to the related target service to the Policy component and maintain the control Policy information in the local shared memory.
An embodiment of the application also provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, adding a proxy component, wherein the proxy component is configured to proxy to process a service request, and the service request comprises a communication request between a first service and a second service in a micro service;
and S2, the proxy component is further configured to locally maintain a service list of the service request and control policy information, wherein the service list comprises service information of the micro service, and the control policy information comprises control policies of the micro service.
Optionally, the storage medium is further arranged to store a computer program for performing the steps of:
s1, adding a registry, wherein the registry is configured to acquire the service information reported by the proxy component, generate the service list based on the service information and send the service list to the proxy component;
s2, adding a strategy component, wherein the strategy component is configured to call the control strategy information through a third party call interface and issue the control strategy information to the corresponding proxy component.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, adding a proxy component, wherein the proxy component is configured to proxy to process a service request, and the service request comprises a communication request between a first service and a second service in a micro service;
and S2, the proxy component is further configured to locally maintain a service list of the service request and control policy information, wherein the service list comprises service information of the micro service, and the control policy information comprises control policies of the micro service.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A method of microservice-based processing comprising:
acquiring service information reported by an agent component;
generating the service list through the service information and sending the service list to the proxy component;
processing service requests in the micro-service by the proxy component proxy;
maintaining service information and control strategies of the micro services in a service list of the service request locally;
invoking the control strategy information through a third party invoking interface and issuing the control strategy information to the corresponding proxy component;
wherein, in a case where the service request includes a first service request sent by a first service to a second service, processing the service request in the micro-service by the proxy component proxy further includes: acquiring second service list information of a local cache; finding a second service in the second service list information, and acquiring a second policy under the condition that the first policy acquired by the proxy component does not meet the first policy condition; finding a second service in the second service list information and responding to an exception to the first service if the first policy acquired by the proxy component meets a first policy condition; acquiring a third strategy under the condition that the agent component acquires that the second strategy does not meet the second strategy condition; responding to an exception to the first service if the agent component obtains that a second policy meets a second policy condition, wherein the first policy comprises a fuse demotion policy, the second policy comprises a current limit control policy, and the third policy comprises a gray scale and load balancing policy.
2. The method of claim 1, wherein proxy processing of service requests in a micro service by the proxy component comprises:
the proxy component proxies a first service request from a first service to a second service in a micro service, wherein the first service comprises: a Web service written in a first programming language, the second service comprising: a Web service written in a second programming language.
3. The method of claim 1, wherein, in the case where the service request includes a first service request sent by a first service to a second service, the proxy processing of the service request in the micro-service by the proxy component comprises:
receiving a control strategy information request from the first service to the second service;
according to the control strategy information request, saving control strategy information carried in the control strategy information request;
and under the condition that the acquired local first service list contains the first service, the control strategy information is issued to a proxy component of the first service.
4. The method of claim 1, wherein, in the case where the service request includes a first service request sent by a first service to a second service, the proxy processing of the service request in the micro-service by the proxy component comprises:
the agent receives the first service request, wherein the service request carries identification information of the second service;
matching a target service address of the second service according to the identification information, wherein the target service address is stored locally;
and transmitting the service request to the second service according to the target service address to instruct the second service to respond to the service request.
5. The method of claim 1, wherein the policy component comprises one of: load balancing strategy, current limiting control strategy, gray level release strategy, canary release strategy and service degradation strategy.
6. The method of claim 2, wherein after proxy processing of the service request in the micro-service by the proxy component, further comprises:
heartbeat keep-alive for the first service or the second service, wherein a transmission protocol between the first service or the second service comprises at least one of: http, grpc, websocket transport protocol.
7. A micro-service based processing system, comprising:
the acquisition module is used for acquiring the service information reported by the proxy component;
the sending module is used for generating the service list through the service information and sending the service list to the proxy component;
the processing module is used for processing the service request in the micro-service through the proxy component proxy;
the maintenance module is used for locally maintaining service information and control strategies of the micro services in the service list of the service request;
the calling module is used for calling the control strategy information through a third party calling interface and issuing the control strategy information to the corresponding proxy component;
wherein the processing module is further configured to, when the service request includes a first service request sent by a first service to a second service, process, by the proxy component, a service request in a micro service, and further include: acquiring second service list information of a local cache; finding a second service in the second service list information, and acquiring a second policy under the condition that the first policy acquired by the proxy component does not meet the first policy condition; finding a second service in the second service list information and responding to an exception to the first service if the first policy acquired by the proxy component meets a first policy condition; acquiring a third strategy under the condition that the agent component acquires that the second strategy does not meet the second strategy condition; responding to an exception to the first service if the agent component obtains that a second policy meets a second policy condition, wherein the first policy comprises a fuse demotion policy, the second policy comprises a current limit control policy, and the third policy comprises a gray scale and load balancing policy.
8. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when run.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 6.
CN202010676588.8A 2020-07-14 2020-07-14 Micro-service-based processing method and device, storage medium and electronic device Active CN111917838B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010676588.8A CN111917838B (en) 2020-07-14 2020-07-14 Micro-service-based processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010676588.8A CN111917838B (en) 2020-07-14 2020-07-14 Micro-service-based processing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111917838A CN111917838A (en) 2020-11-10
CN111917838B true CN111917838B (en) 2023-08-29

Family

ID=73280686

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010676588.8A Active CN111917838B (en) 2020-07-14 2020-07-14 Micro-service-based processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111917838B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637126B (en) * 2020-11-23 2023-04-07 北京中电普华信息技术有限公司 Service registration method and Pod
CN114650317A (en) * 2020-12-15 2022-06-21 中国移动通信有限公司研究院 Micro-service system and micro-service registration, discovery and keep-alive method
CN115150457A (en) * 2022-06-28 2022-10-04 亿咖通(湖北)技术有限公司 Micro-service management method, vehicle-mounted system and vehicle-mounted equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
CN108255615A (en) * 2017-11-30 2018-07-06 平安科技(深圳)有限公司 Across language call method, server and storage medium
CN109981716A (en) * 2017-12-28 2019-07-05 北京奇虎科技有限公司 A kind of micro services call method and device
CN110011846A (en) * 2019-03-29 2019-07-12 努比亚技术有限公司 Micro services construction method, device, mobile terminal and storage medium
CN110032392A (en) * 2019-04-15 2019-07-19 杭州朗和科技有限公司 Service administering method and device, storage medium and electronic equipment
CN110225131A (en) * 2019-06-19 2019-09-10 广州小鹏汽车科技有限公司 A kind of service calling method and device
CN110324177A (en) * 2019-05-31 2019-10-11 中国人民解放军国防科技大学 Service request processing method, system and medium under micro-service architecture
CN110401696A (en) * 2019-06-18 2019-11-01 华为技术有限公司 A kind of method, communication agent, host and the storage medium of decentralization processing
CN111131193A (en) * 2019-12-10 2020-05-08 四川新网银行股份有限公司 Distributed service governance method supporting multi-protocol heterogeneous non-code intrusion
CN111193803A (en) * 2019-12-31 2020-05-22 四川省公安科研中心 Spring group-based micro-service construction method and spring group micro-service framework
CN111245925A (en) * 2020-01-09 2020-06-05 北京理工大学 Communication method and system for modern distributed micro-service architecture

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
CN108255615A (en) * 2017-11-30 2018-07-06 平安科技(深圳)有限公司 Across language call method, server and storage medium
CN109981716A (en) * 2017-12-28 2019-07-05 北京奇虎科技有限公司 A kind of micro services call method and device
CN110011846A (en) * 2019-03-29 2019-07-12 努比亚技术有限公司 Micro services construction method, device, mobile terminal and storage medium
CN110032392A (en) * 2019-04-15 2019-07-19 杭州朗和科技有限公司 Service administering method and device, storage medium and electronic equipment
CN110324177A (en) * 2019-05-31 2019-10-11 中国人民解放军国防科技大学 Service request processing method, system and medium under micro-service architecture
CN110401696A (en) * 2019-06-18 2019-11-01 华为技术有限公司 A kind of method, communication agent, host and the storage medium of decentralization processing
CN110225131A (en) * 2019-06-19 2019-09-10 广州小鹏汽车科技有限公司 A kind of service calling method and device
CN111131193A (en) * 2019-12-10 2020-05-08 四川新网银行股份有限公司 Distributed service governance method supporting multi-protocol heterogeneous non-code intrusion
CN111193803A (en) * 2019-12-31 2020-05-22 四川省公安科研中心 Spring group-based micro-service construction method and spring group micro-service framework
CN111245925A (en) * 2020-01-09 2020-06-05 北京理工大学 Communication method and system for modern distributed micro-service architecture

Also Published As

Publication number Publication date
CN111917838A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
CN110417842B (en) Fault processing method and device for gateway server
CN111917838B (en) Micro-service-based processing method and device, storage medium and electronic device
CN109618005B (en) Method for calling server and proxy server
CN103209223B (en) distributed application session information sharing method, system and application server
EP3275162B1 (en) Systems and techniques for web communication
JP4616159B2 (en) Cluster system, load balancer, node transfer method, and node transfer program
US9043424B2 (en) Method for activating and deactivating client-side services from a remote server
CN107950038A (en) Subscribe to and notify to carry efficient method and apparatus with clustering service layer for analyzing
CN105721547B (en) The method and apparatus for cooperateing with processing business
JP2007226783A (en) Apparatus and related method for facilitating delivery and processing of push content
CN102291243A (en) Service processing server, system and method
US10785601B2 (en) System and method for transmitting dynamic content to mobile devices
JP2005346573A (en) Web service providing method, server device and client terminal in web service system, web service system, web service program, and recording medium
WO2017128713A1 (en) Method and device for publishing subscription message
CN111770176B (en) Traffic scheduling method and device
US11356298B2 (en) Access management apparatus and access management method
Josyula et al. Internet of things and cloud interoperability application based on Android
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN114760360B (en) Request response method, request response device, electronic equipment and computer readable storage medium
CN113301088B (en) Message processing method, device and system, electronic equipment and readable storage medium
US20220405084A1 (en) Method and apparatus for multi-access edge computing in a wireless communication system
CN112565173B (en) Method and apparatus for message processing
JP4893712B2 (en) Web service system and web service providing method
KR20190070630A (en) Server topology generation method
JP2016110175A (en) Client device, communication system, and data processing method and program

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
GR01 Patent grant
GR01 Patent grant