WO2019104974A1 - 基于dubbo平台的服务自动启停方法、服务器及存储介质 - Google Patents

基于dubbo平台的服务自动启停方法、服务器及存储介质 Download PDF

Info

Publication number
WO2019104974A1
WO2019104974A1 PCT/CN2018/089136 CN2018089136W WO2019104974A1 WO 2019104974 A1 WO2019104974 A1 WO 2019104974A1 CN 2018089136 W CN2018089136 W CN 2018089136W WO 2019104974 A1 WO2019104974 A1 WO 2019104974A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
platform
stop
hosts
requests
Prior art date
Application number
PCT/CN2018/089136
Other languages
English (en)
French (fr)
Inventor
李刚
刘汉玉
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019104974A1 publication Critical patent/WO2019104974A1/zh

Links

Images

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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements

Definitions

  • the present application relates to the field of service monitoring, and in particular, to a service automatic start and stop method based on the dubbo platform, a server, and a computer readable storage medium.
  • Dubbo is a high-performance distributed service framework open sourced by Facebook, dedicated to providing high-performance and transparent remote service invocation solutions. Dubbo has transparent remote method calls, automatic service registration and discovery, soft load balancing and fault tolerance mechanisms, and is widely used by domestic Internet companies.
  • the platform remotely invokes the service provided by the servant according to the requirements of the requesting party.
  • the requester requests a large number of concurrent requests, if the servant host cluster currently provides fewer host nodes, the platform does not Being able to find it in time will cause the server's system to become blocked or even crash.
  • the number of requests from the requesting party is small, if there are many host nodes that the service host cluster currently provides, and the platform fails to find out in time, the system resources of the server will be wasted.
  • the present application provides a service automatic start and stop method based on the dubbo platform, a server and a computer readable storage medium, which can avoid the stagnation or even crash of the servant system and effectively reduce resource waste.
  • the present application provides a service automatic start and stop method based on the dubbo platform, and the method includes:
  • Receiving step receiving a request call from a requesting party to a service party;
  • Forwarding step determining the priority level of the requesting party according to the service providing rule of the servant, and forwarding the service calling request to the corresponding service host cluster of the servant;
  • Monitoring step monitoring the number of service invocation requests to be processed by the current serving host cluster
  • the first determining step is: determining whether the number of the service invocation requests is greater than a maximum threshold, and if the number of service invocation requests is greater than a maximum threshold, enabling a corresponding number of hosts of the current serving host cluster to provide services according to a preset service start and stop rule, the process Returning to the monitoring step, if the number of the service call requests is less than or equal to the maximum threshold, performing a second determining step;
  • the second determining step is: determining whether the number of the service invocation requests is less than a minimum threshold, and if the number of the service invocation requests is less than a minimum threshold, stopping the corresponding number of hosts in the current serving host cluster according to a preset service start and stop rule, and returning the process
  • the monitoring step is to maintain the number of hosts that the current serving host cluster provides services if the number of service invocation requests is greater than or equal to a minimum threshold.
  • the present application further provides a server, including: a memory, a processor, and a dubbo platform-based service automatic start and stop program stored on the processor and executable on the processor, the dubbo-based platform
  • the service automatic start and stop program is executed by the processor, and the following steps can be implemented:
  • Receiving step receiving a request call from a requesting party to a service party;
  • Forwarding step determining the priority level of the requesting party according to the service providing rule of the servant, and forwarding the service calling request to the corresponding service host cluster of the servant;
  • Monitoring step monitoring the number of service invocation requests to be processed by the current serving host cluster
  • the first determining step is: determining whether the number of the service invocation requests is greater than a maximum threshold, and if the number of service invocation requests is greater than a maximum threshold, enabling a corresponding number of hosts of the current serving host cluster to provide services according to a preset service start and stop rule, the process Returning to the monitoring step, if the number of the service call requests is less than or equal to the maximum threshold, performing a second determining step;
  • the second determining step is: determining whether the number of the service invocation requests is less than a minimum threshold, and if the number of the service invocation requests is less than a minimum threshold, stopping the corresponding number of hosts in the current serving host cluster according to a preset service start and stop rule, and returning the process
  • the monitoring step is to maintain the number of hosts that the current serving host cluster provides services if the number of service invocation requests is greater than or equal to a minimum threshold.
  • the present application further provides a computer readable storage medium, including a dubbo platform-based service automatic start and stop program, and the dubbo platform-based service automatic start and stop program is
  • a computer readable storage medium including a dubbo platform-based service automatic start and stop program, and the dubbo platform-based service automatic start and stop program is
  • the processor is executed, any step in the automatic start and stop method of the service based on the dubbo platform as described above can be implemented.
  • the service automatic start/stop method, the server and the computer readable storage medium based on the dubbo platform proposed by the present application determine the priority level of the requester according to the service provisioning rule of the service party by receiving the service request request of the requesting party to a service party, and The service invocation request is forwarded to the corresponding service host cluster of the service party, and then the number of service invocation requests to be processed by the current service host cluster is monitored, and it is determined whether the number of service invocation requests is greater than a maximum threshold or less than a minimum threshold, if the service invocation request If the number is greater than the maximum threshold, the current service host cluster is enabled to provide the service according to the preset service start and stop rules.
  • the current service host is stopped according to the preset service start and stop rules.
  • the number of hosts in the cluster is maintained. If the number of service invocation requests is between the maximum threshold and the minimum threshold, the number of hosts that provide services for the current serving host cluster is maintained. Mitigating high service call requests When you call a waste of resources requested and low pressure service.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a server of the present application.
  • FIG. 2 is a block diagram of a preferred embodiment of the service automatic start and stop program based on the dubbo platform in FIG. 1;
  • FIG. 3 is a flowchart of a preferred embodiment of a method for automatically starting and stopping a service based on a dubbo platform according to the present application;
  • Figure 4 is a schematic diagram of the application environment of the dubbo platform.
  • FIG. 1 it is a schematic diagram of a preferred embodiment of the server 1 of the present application.
  • the server 1 may be a server, a smart phone, a tablet computer, a personal computer, a portable computer, and other electronic devices having computing functions.
  • the server 1 includes a memory 11, a processor 12, a network interface 13, a communication bus 14, and a dubbo platform-based service automatic start/stop procedure 10 stored on the memory 11 and executable on the processor 12.
  • the network interface 13 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • Communication bus 14 is used to implement connection communication between these components.
  • the memory 11 includes at least one type of readable storage medium.
  • the at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like.
  • the memory 11 may be an internal storage unit of the server 1, such as a hard disk of the server 1.
  • the memory 11 may also be an external storage unit of the server 1, such as a plug-in hard disk equipped on the server 1, a smart memory card (SMC), and a secure digital ( Secure Digital, SD) cards, flash cards, etc.
  • SMC smart memory card
  • SD Secure Digital
  • the memory 11 can be used not only for storing application software installed on the server 1 and various types of data, such as a service automatic start and stop program 10 based on the dubbo platform, service providing work, and service start and stop rules. It can also be used to temporarily store data that has been output or will be output.
  • the processor 12 in some embodiments, may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as executing a dubbo based platform.
  • the service automatically starts and stops the computer program code of the program 10 and the training of various models.
  • the server 1 may also include a display, which may be referred to as a display screen or display unit.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an Organic Light-Emitting Diode (OLED) touch sensor.
  • OLED Organic Light-Emitting Diode
  • the display is used to display information processed in the server 1 and a work interface for displaying visualizations.
  • the server 1 may further include a user interface, and the user interface may include an input unit such as a keyboard, a voice output device such as an audio, a headphone, and the like.
  • the user interface may include an input unit such as a keyboard, a voice output device such as an audio, a headphone, and the like.
  • the program 11 of the dubbo platform-based service automatic start/stop program 10 is stored in the memory 11 as a computer storage medium, and the processor 12 executes the service automatic start/stop procedure based on the dubbo platform.
  • the program code is implemented, the following steps are implemented:
  • Receiving step receiving a request call from a requesting party to a service party;
  • Forwarding step determining the priority level of the requesting party according to the service providing rule of the servant, and forwarding the service calling request to the corresponding service host cluster of the servant;
  • Monitoring step monitoring the number of service invocation requests to be processed by the current serving host cluster
  • the first determining step is: determining whether the number of the service invocation requests is greater than a maximum threshold, and if the number of service invocation requests is greater than a maximum threshold, enabling a corresponding number of hosts of the current serving host cluster to provide services according to a preset service start and stop rule, the process Returning to the monitoring step, if the number of the service call requests is less than or equal to the maximum threshold, performing a second determining step;
  • the second determining step is: determining whether the number of the service invocation requests is less than a minimum threshold, and if the number of the service invocation requests is less than a minimum threshold, stopping the corresponding number of hosts in the current serving host cluster according to a preset service start and stop rule, and returning the process
  • the monitoring step is to maintain the number of hosts that the current serving host cluster provides services if the number of service invocation requests is greater than or equal to a minimum threshold.
  • the requesting party when the requesting party needs to invoke the service of the service party, the requesting party sends a service invocation request to the dubbo service platform.
  • the dubbo service platform is responsible for receiving the requesting service request from the requesting party to a certain service party. For example, the requester A needs to invoke the service of the service party S, and the dubbo service platform receives the service call request sent by the requester A about the service party S.
  • the dubbo service platform determines the priority level of the requester according to the service provisioning rule of the service party, and forwards the service call request to the corresponding service host cluster of the service party.
  • the service interface of the service party has different service host clusters, and the priority level of the requester is determined according to the service provision rule, and different host clusters are selected to provide services.
  • the service provision rule is preset by the service party on the dubbo service platform, and the platform supports the service provider to set respective service provision rules, and the service provision rules of different service parties are different.
  • the dubbo service platform receives two service call requests (service call request a and service call request b) for the service party S, where the service call request a is sent by the requester A, and the service call request b is sent by the requester B. of.
  • the dubbo service platform determines the priority of the requester A and the requester B according to the service provision rule of the service party S. Level, the service invocation request a is forwarded to the service host cluster S 1 of the service provider S, and the service invocation request b is forwarded to the service host cluster S 2 of the service provider S.
  • the service host cluster S 2 as compared to the services provided by the service host clusters S 1 provided services with faster service response timeliness or more comprehensive services.
  • a service provider provides a face recognition system, and the service providers have different face recognition algorithms provided by two teams in Shenzhen and Nanjing. Due to different algorithms, the same service call requests of different priority requesters are respectively sent to Shenzhen and Nanjing service host cluster processing, face recognition accuracy is different.
  • the dubbo service platform monitors the current service host cluster and counts the number of service call requests to be processed by the current service host cluster. Assume that the service provider S provides its service on the dubbo service platform, and the dubbo service platform counts the number of service call requests that the service provider S is currently servicing the host cluster to process. For example, the number of service call requests to be processed by the service host cluster S 1 and the service host cluster S 2 of the dubbo service platform statistical service provider S are 160 and 30, respectively.
  • the service start and stop rules set by different service parties are used to start and stop the host of the corresponding service host cluster.
  • the maximum number of service invocation rules set by the service provider S on the dubbo service platform is 150
  • the minimum threshold is 50, that is, when the number of service invocation requests reaches 150, a new host is provided to provide the service.
  • the number of service invocation requests is as low as 50, other hosts are stopped, and only one host is reserved for service; when the number of service invocation requests is between 50 and 150, the current number of hosts is maintained.
  • service call service host cluster S service server S to be processed a request number 160 is enabled host a new service host cluster by service start and stop rules; Service Host cluster S service server S to be processed 2 If the number of service invocation requests is 30, the other hosts are stopped according to the service start and stop rules, and only one host of the service host cluster is reserved. Therefore, when the number of pending service invocation requests of a service host cluster is greater than 150, the new host that enables the service host cluster shares the pressure of other hosts, and when the number of pending service invocation requests is reduced to 50, the other hosts are shut down. Only one host is reserved to provide services, so the loop is repeated, so that the number of service call requests to be processed is maintained within a certain range.
  • the service automatic start and stop method based on the dubbo platform proposed in the foregoing embodiment uses the service provisioning rule to determine the priority level of the requesting party, and forwards the received service invoking request to the corresponding service host cluster of the service party, and then according to the statistical service host.
  • the number of pending service calls of the cluster automatically adjusts the number of enabled hosts of the service host cluster by using the service start and stop rules, so that the number of hosts of the service host cluster is automatically adjusted according to the number of service call requests, thereby avoiding the collapse of the server system or waste of resources.
  • FIG. 2 it is a block diagram of a preferred embodiment of the service automatic start/stop procedure 10 based on the dubbo platform in FIG.
  • a module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function.
  • the service automatic start and stop program 10 based on the dubbo platform includes: a receiving module 110, a forwarding module 120, a monitoring module 130, and a determining module 140, and the functions or operating steps implemented by the modules 110-140 are both
  • a receiving module 110 includes: a forwarding module 120, a monitoring module 130, and a determining module 140, and the functions or operating steps implemented by the modules 110-140 are both
  • the functions or operating steps implemented by the modules 110-140 are both The text is similar and will not be described in detail here, for example, where:
  • the receiving module 110 is configured to receive a service invocation request of the requesting party to a service party;
  • the forwarding module 120 is configured to determine, according to the service providing rule of the servant, the priority level of the requesting party, and forward the service calling request to the corresponding service host cluster of the servant;
  • the monitoring module 130 is configured to monitor a quantity of service invocation requests to be processed by the current serving host cluster
  • the determining module 140 is configured to determine whether the number of the service invocation requests is greater than a maximum threshold or less than a minimum threshold. If the number of the service invocation requests is greater than a maximum threshold, the corresponding number of the current serving host clusters is enabled according to a preset service start and stop rule. The host provides the service and then returns to the monitoring module 130. If the number of the service call requests is less than the minimum threshold, the host of the current service host cluster is stopped according to the preset service start and stop rules and then returned to the monitoring module 130, if the service is The number of invocation requests is between the maximum threshold and the minimum threshold, and the number of hosts served by the current serving host cluster is maintained.
  • FIG. 3 it is a flowchart of a preferred embodiment of the service automatic start and stop method based on the dubbo platform of the present application.
  • Step S10 receiving a service call request of the requesting party to a service party
  • Step S20 determining, according to the service provisioning rule of the service party, the priority level of the requesting party, and forwarding the service invoking request to the corresponding service host cluster of the service party;
  • Step S30 monitoring the number of service invocation requests to be processed by the current serving host cluster
  • step S40 it is determined whether the number of service call requests is greater than a maximum threshold. If the number of service call requests is greater than a maximum threshold, step S50 is performed to return to step S30, and if the number of service call requests is less than or equal to a maximum threshold, Go to step S60;
  • Step S50 enabling a corresponding number of hosts of the current service host cluster to provide services according to a preset service start and stop rule
  • step S60 it is determined whether the number of service call requests is less than a minimum threshold. If the number of service call requests is less than a minimum threshold, step S70 is performed to return to step S30, and if the number of service call requests is greater than or equal to a minimum threshold, Go to step S80;
  • Step S70 stopping the corresponding number of hosts of the current service host cluster according to a preset service start/stop rule
  • Step S80 maintaining the number of hosts that the current service host cluster provides services.
  • FIG. 4 it is a schematic diagram of an application environment of the dubbo platform.
  • the requesting party 4 needs to invoke the service of the service party 3
  • the requesting party 4 sends a service call request to the server 1, and the dubbo platform is used at this time.
  • the service automatic start and stop program 10 is responsible for receiving the service call request of the requesting party 4 to a certain service party 3.
  • the requester A needs to invoke the service of the service party S
  • the dubbo service platform receives the service call request sent by the requester A about the service party S.
  • the servant 3 refers to one or more service providers
  • the requester 4 refers to one or more service callers.
  • the service automatic start/stop procedure 10 based on the dubbo platform determines the priority level of the requester 4 according to the service provision rule 15 of the servant 3, and forwards the service call request to the corresponding service host cluster of the servant 3.
  • the service interface of the servant 3 has different service host clusters, and the priority level of the requester 4 is determined according to the service provision rule 15, and different host clusters are selected to provide services.
  • the service providing rule 15 is preset by the server 3 in the server 1.
  • the platform supports the service provider 3 to set respective service providing rules, and the service providing rules of different service parties are different.
  • the dubbo service platform receives two service call requests (service call request a and service call request b) for the service party S, where the service call request a is sent by the requester A, and the service call request b is sent by the requester B. of.
  • the dubbo service platform determines the priority of the requester A and the requester B according to the service provision rule of the service party S. Level, the service invocation request a is forwarded to the service host cluster S 1 of the service provider S, and the service invocation request b is forwarded to the service host cluster S 2 of the service provider S.
  • the service host cluster S 2 of the services provided to the service host clusters S 1 provided services with faster service response or aging compared to more comprehensive services.
  • a service provider provides a personal insurance processing system that provides two different insurance processing channels, VIP and non-VIP. The same service invocation request from VIP users and ordinary users is sent to the VIP and non-VIP insurance processing channels respectively. Service host cluster processing, service response time is different.
  • the service automatic start and stop program 10 based on the dubbo platform monitors the current service host cluster and counts the number of service call requests to be processed by the current service host cluster. Assume that the service provider S provides its service on the dubbo service platform, and the dubbo service platform counts the number of service call requests that the service provider S is currently servicing the host cluster to process. For example, the number of service call requests to be processed by the service host cluster S 1 and the service host cluster S 2 of the dubbo service platform statistical service provider S are 160 and 30, respectively.
  • the service start/stop rules 16 set by different servants 3 are used to start and stop the host of the corresponding service host cluster.
  • the service start and stop rules 16 set by different servants 3 may be different. Assume that the maximum number of service invocation rules set by the service provider S on the dubbo service platform is 150, and the minimum threshold is 50, that is, when the number of service invocation requests reaches 150, a new host is provided to provide the service; When the number of service invocation requests is as low as 50, other hosts are stopped, and only one host is reserved for service; when the number of service invocation requests is between 50 and 150, the current number of hosts is maintained.
  • service call service host cluster S service server S to be processed a request number 160 is enabled host a new service host cluster by service start and stop rules; Service Host cluster S service server S to be processed 2 If the number of service invocation requests is 30, the other hosts are stopped according to the service start and stop rules, and only one host of the service host cluster is reserved. Therefore, when the number of pending service invocation requests of a service host cluster is greater than 150, the new host that enables the service host cluster shares the pressure of other hosts, and when the number of pending service invocation requests is reduced to 50, the other hosts are shut down. Only one host is reserved to provide services, so the loop is repeated, so that the number of service call requests to be processed is maintained within a certain range.
  • the service start-up rule 16 can also set the number of hosts enabled by the service host cluster by the return time of each service call request.
  • the return time refers to the time when the server 1 receives the request service request of the requester until the service call request processing is completed.
  • the service provider can also set the maximum threshold of return time to 30 minutes and the minimum threshold of 10s on the dubbo service platform.
  • the dubbo service platform monitors the current service invocation request and starts timing when receiving the service invocation request. When the timer reaches 30 minutes, the service host cluster has not processed the service invocation request, indicating that the service host cluster is to be processed.
  • Too many call requests enable a new host to provide services; when the timer has not reached 10s, the service host cluster has processed the service call request, indicating that the service host cluster has too few service call requests to be processed, and stops other
  • the host keeps only one host to provide services; when the return time is between 10s and 30min, the current number of hosts is maintained.
  • different service providers can set different return times on the dubbo service platform.
  • the service automatic start/stop method based on the dubbo platform proposed by the foregoing embodiment receives the service invocation request of the requesting party, determines the priority level of the requesting party according to the service providing rule, and forwards the requesting party to the corresponding service host cluster of the service party, and counts each The number of pending service invocation requests of all service host clusters of the service provider is controlled by the service start and stop rules set by the service provider to start and stop the host of each service host cluster, thereby meeting the requirements of instantaneous concurrent.
  • the embodiment of the present application further provides a computer readable storage medium, which includes a service automatic start and stop program 10 based on the dubbo platform, and the service automatic start and stop program 10 based on the dubbo platform is processed.
  • a computer readable storage medium which includes a service automatic start and stop program 10 based on the dubbo platform, and the service automatic start and stop program 10 based on the dubbo platform is processed.
  • Receiving step receiving a request call from a requesting party to a service party;
  • Forwarding step determining the priority level of the requesting party according to the service providing rule of the servant, and forwarding the service calling request to the corresponding service host cluster of the servant;
  • Monitoring step monitoring the number of service invocation requests to be processed by the current serving host cluster
  • the first determining step is: determining whether the number of the service invocation requests is greater than a maximum threshold, and if the number of service invocation requests is greater than a maximum threshold, enabling a corresponding number of hosts of the current serving host cluster to provide services according to a preset service start and stop rule, the process Returning to the monitoring step, if the number of the service call requests is less than or equal to the maximum threshold, performing a second determining step;
  • the second determining step is: determining whether the number of the service invocation requests is less than a minimum threshold, and if the number of the service invocation requests is less than a minimum threshold, stopping the corresponding number of hosts in the current serving host cluster according to a preset service start and stop rule, and returning the process
  • the monitoring step is to maintain the number of hosts that the current serving host cluster provides services if the number of service invocation requests is greater than or equal to a minimum threshold.
  • the service providing rule and the service start and stop rule are set by the respective service parties on the platform.
  • the service providing rule comprises:
  • the service interface of the servant has different service host clusters, and services are provided by different host clusters according to the priority level of the requester.
  • the first determining step comprises:
  • the platform sends a shell script according to the rules specified by the server to start the corresponding number of hosts in the service host cluster to meet the instantaneous concurrent demand.
  • the second determining step comprises:
  • the platform When the number of service invocation requests is below the minimum threshold, the platform sends a shell script according to the rules specified by the server to stop the corresponding number of hosts in the service host cluster, thereby avoiding waste of resources.
  • the specific implementation manner of the computer readable storage medium of the present application is substantially the same as the specific implementation manner of the service automatic start and stop method based on the dubbo platform, and details are not described herein again.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种基于dubbo平台的服务自动启停方法、服务器及存储介质,该方法包括:接收请求方对某服务方的服务调用请求;根据服务方的服务提供规则判断请求方的优先级别,将请求转发至服务方相应的服务主机集群;监控当前服务主机集群待处理的服务调用请求的数量;判断服务调用请求数是否大于最大阈值或小于最小阈值,若服务调用请求数大于最大阈值,则按照预设的服务启停规则启用服务主机集群相应数量的主机,若服务调用请求数小于最小阈值,则按照预设的服务启停规则停止服务主机集群相应数量的主机,从而防止请求数量过大时造成系统阻塞,也避免了请求数量过小时造成资源浪费。

Description

基于dubbo平台的服务自动启停方法、服务器及存储介质
优先权申明
本申请要求于2017年11月30日提交中国专利局、申请号为201711237316.2,名称为“基于dubbo平台的服务自动启停方法、服务器及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合本申请中。
技术领域
本申请涉及服务监控领域,尤其涉及一种基于dubbo平台的服务自动启停方法、服务器及计算机可读存储介质。
背景技术
dubbo是阿里巴巴公司开源的一个高性能的分布式服务框架,致力于提供高性能和透明化的远程服务调用方案。dubbo具有透明化的远程方法调用、服务自动注册与发现、软负载均衡及容错机制等功能,被国内互联网公司广泛使用。
目前,基于dubbo框架的服务平台,该平台根据请求方的需求远程调用服务方提供的服务,当请求方的请求大量并发时,若服务方主机集群当前提供服务的主机节点较少,而平台未能及时发现,会使服务方的系统造成阻塞甚至崩溃宕机。当请求方的请求数量较少时,若服务方主机集群当前提供服务的主机节点较多,而平台未能及时发现,就会造成服务方系统资源的浪费。
发明内容
鉴于以上内容,本申请提供一种基于dubbo平台的服务自动启停方法、服务器及计算机可读存储介质,能够避免服务方系统阻塞甚至崩溃宕机的同时有效地减少资源浪费。
为实现上述目的,本申请提供一种基于dubbo平台的服务自动启停方法,该方法包括:
接收步骤:接收请求方对某服务方的服务调用请求;
转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将 服务调用请求转发至服务方相应的服务主机集群;
监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
此外,本申请还提供一种服务器,该服务器包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于dubbo平台的服务自动启停程序,所述基于dubbo平台的服务自动启停程序被所述处理器执行,可实现如下步骤:
接收步骤:接收请求方对某服务方的服务调用请求;
转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括基于dubbo平台的服务自动启停程序,所述基于dubbo平台的服务自动启停程序被处理器执行时,可实现如上所述基于dubbo平台的服务自动启停方法中的任意步骤。
本申请提出的基于dubbo平台的服务自动启停方法、服务器及计算机可读存储介质,通过接收请求方对某服务方的服务调用请求,根据服务方的服务提供规则判断请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群,然后监控当前服务主机集群待处理的服务调用请求的数量,判断所述服务调用请求数是否大于最大阈值或小于最小阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,若所述服务调用请求数在最大阈值和最小阈值之间,则维持当前服务主机集群提供服务的主机数量,本申请通过对服务方的服务主机集群进行启停控制,从而缓解高服务调用请求时系统的压力和低服务调用请求时资源的浪费。
附图说明
图1为本申请服务器较佳实施例的示意图;
图2为图1中基于dubbo平台的服务自动启停程序较佳实施例的模块示意图;
图3为本申请基于dubbo平台的服务自动启停方法较佳实施例的流程图;
图4为dubbo平台的应用环境示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
如图1所示,是本申请服务器1较佳实施例的示意图。
在本实施例中,服务器1可以是服务器、智能手机、平板电脑、个人电脑、便携计算机以及其它具有运算功能的电子设备。
该服务器1包括:存储器11、处理器12、网络接口13、通信总线14及存储在存储器11上并可在所述处理器12上运行的基于dubbo平台的服务自动启停程序10。
其中,网络接口13可选地可以包括标准的有线接口、无线接口(如WI-FI接口)。通信总线14用于实现这些组件之间的连接通信。
存储器11至少包括一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述存储器11可以是所述服务器1的内部存储单元,例如该服务器1的硬盘。在另一些实施例中,所述存储器11也可以是所述服务器1的外部存储单元,例如所述服务器1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
在本实施例中,所述存储器11不仅可以用于存储安装于所述服务器1的应用软件及各类数据,例如基于dubbo平台的服务自动启停程序10、服务提供工作和服务启停规则,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其它数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行基于dubbo平台的服务自动启停程序10的计算机程序代码和各类模型的训练等。
优选地,该服务器1还可以包括显示器,显示器可以称为显示屏或显示单元。在一些实施例中显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。显示器用于显示在服务器1中处理的信息以及用于显示可视化的工作界面。
优选地,该服务器1还可以包括用户接口,用户接口可以包括输入单元比如键盘(Keyboard)、语音输出装置比如音响、耳机等。
在图1所示的服务器实施例中,作为一种计算机存储介质的存储器11中存储基于dubbo平台的服务自动启停程序10的程序代码,处理器12执行基于dubbo平台的服务自动启停程序10的程序代码时,实现如下步骤:
接收步骤:接收请求方对某服务方的服务调用请求;
转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
本实施例中,当请求方需要调用服务方的服务时,请求方会向dubbo服务平台发送服务调用请求,此时dubbo服务平台负责接收请求方对某服务方的服务调用请求。例如请求方A需要调用服务方S的服务,dubbo服务平台会接收到请求方A发送过来关于服务方S的服务调用请求。
dubbo服务平台根据服务方的服务提供规则判断请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群。服务方的服务接口有不同的服务主机集群,根据服务提供规则判断请求方的优先级别,选择不同的主机集群提供服务。其中,服务提供规则是服务方在dubbo服务平台预先设定的,该平台支持服务方设置各自的服务提供规则,不同服务方的服务提供规则不同。例如,dubbo服务平台接收到两个关于服务方S的服务调用请求(服务调用请求a和服务调用请求b),其中服务调用请求a是请求方A发送的,服务调用请求b是请求方B发送的。假设请求方A的优先级别较低且为普通请求方,请求方B的优先级别较高为高级请求方,则dubbo服务平台根据服务方S的服务提供规则判断请求方A和请求方B的优先级别,将服务调用请求a转发到服务方S的服务主机集群S 1,将服务调用请求b转发到服务方S的服务主机集群S 2。其中,服务主机集群S 2所提供服务相比于服务主机集群S 1所提供服务具有更快的服务响应时效或更全面服务内容。例如,某服务方提供人脸识别系统,该服务方有深圳、南京两个团队提供不同的人脸识别算法,因采用的算法不同,不同优先级的请求方的相同的服务调用请求分别发至深圳、南京的服务主机集群处理,人脸识别的精准度不同。
dubbo服务平台监控当前服务主机集群,统计当前服务主机集群待处理的 服务调用请求的数量。假设,服务方S在dubbo服务平台提供其服务,则dubbo服务平台统计服务方S当前服务主机集群待处理的服务调用请求的数量。例如,dubbo服务平台统计服务方S的服务主机集群S 1和服务主机集群S 2的待处理的服务调用请求数分别为160和30。
根据不同数量的服务调用请求,利用不同的服务方设置的服务启停规则对对应的服务主机集群的主机进行启停控制。假设,服务方S在dubbo服务平台设置的服务启停规则为服务调用请求数的最大阈值为150条,最小阈值为50条,即服务调用请求数达到150条时启用一台新的主机提供服务;服务调用请求数低至50条时停掉其它主机,只保留一台主机提供服务;服务调用请求数在50-150条之间时维持当前数量的主机提供服务。例如,服务方S的服务主机集群S 1的待处理的服务调用请求数为160,则按照服务启停规则启用一台新的服务主机集群的主机;服务方S的服务主机集群S 2的待处理的服务调用请求数为30,则按照服务启停规则停掉其它主机,只保留一台服务主机集群的主机。因此,当某服务主机集群的待处理服务调用请求数大于150条时,启用该服务主机集群的新主机分担其它主机的压力,当待处理的服务调用请求数减少到50条时,关闭其它主机,只保留一台主机提供服务,如此反复循环,使得待处理的服务调用请求数维持在一定范围。
上述实施例提出的基于dubbo平台的服务自动启停方法,利用服务提供规则对请求方优先级别的判断,将接收到的服务调用请求转发至服务方相应的服务主机集群中,再根据统计服务主机集群的待处理服务调用数利用服务启停规则自动调整服务主机集群的启用主机数,从而使得服务主机集群的主机数随着服务调用请求数自动调整,避免服务方系统的崩溃或资源的浪费。
如图2所示,是图1中基于dubbo平台的服务自动启停程序10较佳实施例的模块示意图。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。
在本实施例中,基于dubbo平台的服务自动启停程序10包括:接收模块110、转发模块120、监控模块130、判断模块140,所述模块110-140所实现的功能或操作步骤均与上文类似,此处不再详述,示例性地,例如其中:
接收模块110,用于接收请求方对某服务方的服务调用请求;
转发模块120,用于根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
监控模块130,用于监控当前服务主机集群待处理的服务调用请求的数量;
判断模块140,用于判断所述服务调用请求数是否大于最大阈值或小于最小阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务再返回至监控模块130,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机再返回至监控模块130,若所述服务调用请求数在最大阈值与最小阈值之间,则维持当前服务主机集群提供服务的主机数量。
如图3所示,是本申请基于dubbo平台的服务自动启停方法较佳实施例的流程图。
在本实施例中,处理器12执行存储器11中存储的基于dubbo平台的服务自动启停程序10的计算机程序时实现基于dubbo平台的服务自动启停方法的如下步骤:
步骤S10,接收请求方对某服务方的服务调用请求;
步骤S20,根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
步骤S30,监控当前服务主机集群待处理的服务调用请求的数量;
步骤S40,判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则执行步骤S50再返回至步骤S30,若所述服务调用请求数小于或等于最大阈值,则执行步骤S60;
步骤S50,按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务;
步骤S60,判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则执行步骤S70再返回至步骤S30,若所述服务调用请求数大于或等于最小阈值,则执行步骤S80;
步骤S70,按照预设的服务启停规则停止当前服务主机集群相应数量的主机;
步骤S80,维持当前服务主机集群提供服务的主机数量。
本实施例中,如图4所示,是dubbo平台的应用环境示意图,当请求方4需要调用服务方3的服务时,请求方4会向服务器1发送服务调用请求,此时基于dubbo平台的服务自动启停程序10负责接收请求方4对某服务方3的服务调用请求。例如请求方A需要调用服务方S的服务,dubbo服务平台会接收到请求方A发送过来关于服务方S的服务调用请求。其中,服务方3指一个或多个服务提供者,请求方4指一个或多个服务调用者。
基于dubbo平台的服务自动启停程序10根据服务方3的服务提供规则15判断请求方4的优先级别,将服务调用请求转发至服务方3相应的服务主机集群。服务方3的服务接口有不同的服务主机集群,根据服务提供规则15判断请求方4的优先级别,选择不同的主机集群提供服务。其中,服务提供规则15是服务方3在服务器1预先设定的,该平台支持服务方3设置各自的服务提供规则,不同服务方的服务提供规则不同。例如,dubbo服务平台接收到两个关于服务方S的服务调用请求(服务调用请求a和服务调用请求b),其中服务调用请求a是请求方A发送的,服务调用请求b是请求方B发送的。假设请求方A的优先级别较低且为普通请求方,请求方B的优先级别较高为高级请求方,则dubbo服务平台根据服务方S的服务提供规则判断请求方A和请求方B的优先级别,将服务调用请求a转发到服务方S的服务主机集群S 1,将服务调用请求b转发到服务方S的服务主机集群S 2。其中,服务主机集群S 2所提供服务相比于服务主机集群S 1所提供服务具有更快的服务响应时效或更全面的服务内容。例如,某服务方提供一种个人保险处理系统,该服务方提供VIP和非VIP两种不同的保险处理通道,VIP用户和普通用户的相同服务调用请求分别发至VIP和非VIP保险处理通道的服务主机集群处理,服务响应时效不同。
基于dubbo平台的服务自动启停程序10监控当前服务主机集群,统计当前服务主机集群待处理的服务调用请求的数量。假设,服务方S在dubbo服务平台提供其服务,则dubbo服务平台统计服务方S当前服务主机集群待处理的服务调用请求的数量。例如,dubbo服务平台统计服务方S的服务主机集群S 1和服务主机集群S 2的待处理的服务调用请求数分别为160和30。
根据不同数量的服务调用请求,利用不同的服务方3设置的服务启停规则16对对应的服务主机集群的主机进行启停控制。其中不同的服务方3设置 的服务启停规则16可以不同。假设,服务方S在dubbo服务平台设置的服务启停规则为服务调用请求数的最大阈值为150条,最小阈值为50条,即服务调用请求数达到150条时启用一台新的主机提供服务;服务调用请求数低至50条时停掉其它主机,只保留一台主机提供服务;服务调用请求数在50-150条之间时维持当前数量的主机提供服务。例如,服务方S的服务主机集群S 1的待处理的服务调用请求数为160,则按照服务启停规则启用一台新的服务主机集群的主机;服务方S的服务主机集群S 2的待处理的服务调用请求数为30,则按照服务启停规则停掉其它主机,只保留一台服务主机集群的主机。因此,当某服务主机集群的待处理服务调用请求数大于150条时,启用该服务主机集群的新主机分担其它主机的压力,当待处理的服务调用请求数减少到50条时,关闭其它主机,只保留一台主机提供服务,如此反复循环,使得待处理的服务调用请求数维持在一定范围。
此外,在另一个实施例中,所述服务启停规则16还可以通过每个服务调用请求的返回时间对服务主机集群启用的主机数进行设置。其中,所述返回时间指服务器1接收到请求方的服务调用请求到该服务调用请求处理完成的时间。假设,服务方还可以在dubbo服务平台设置返回时间的最大阈值为30min、最小阈值为10s。dubbo服务平台监控当前的服务调用请求,从接收到该服务调用请求时开始计时,当计时器达到30min时,服务主机集群还没处理完该服务调用请求,则说明该服务主机集群待处理的服务调用请求过多,启用一台新的主机提供服务;当计时器未达到10s时,服务主机集群已经处理完该服务调用请求,则说明该服务主机集群待处理的服务调用请求过少,停掉其它主机,只保留一台主机提供服务;返回时间在10s至30min之间时,维持当前数量的主机提供服务。其中,不同的服务方在dubbo服务平台设置的返回时间可以不同。
上述实施例提出的基于dubbo平台的服务自动启停方法,通过接收请求方的服务调用请求,根据服务提供规则判断请求方的优先级别,将请求方转发至服务方相应的服务主机集群,统计各个服务方的所有服务主机集群的待处理服务调用请求数,利用服务方设置的服务启停规则对每个服务主机集群的主机进行启停控制,从而满足瞬间并发的需求。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质中包括基于dubbo平台的服务自动启停程序10,所述基于dubbo平台的服务自动启停程序10被处理器12执行时实现如下操作:
接收步骤:接收请求方对某服务方的服务调用请求;
转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
优选地,所述服务提供规则和服务启停规则由各个服务方在平台设置。
优选地,所述服务提供规则包括:
服务方的服务接口有不同的服务主机集群,根据请求方的优先级别,由不同的主机集群提供服务。
优选地,所述第一判断步骤包括:
当服务调用请求数达到最大阈值时,平台按照服务方指定的规则发送shell脚本来启动服务主机集群相应数量的主机数,满足瞬间并发需求。
优选地,所述第二判断步骤包括:
当服务调用请求数低于最小阈值时,平台按照服务方指定的规则发送shell脚本来停止服务主机集群相应数量的主机数,避免资源浪费。
本申请之计算机可读存储介质的具体实施方式与上述基于dubbo平台的服务自动启停方法的具体实施方式大致相同,在此不再赘述。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述 实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种基于dubbo平台的服务自动启停方法,其特征在于,所述方法包括:
    接收步骤:接收请求方对某服务方的服务调用请求;
    转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
    监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
    第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
    第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
  2. 根据权利要求1所述的基于dubbo平台的服务自动启停方法,其特征在于,所述服务提供规则和服务启停规则由各个服务方在平台设置。
  3. 根据权利要求1或2所述的基于dubbo平台的服务自动启停方法,其特征在于,所述服务提供规则包括:
    服务方的服务接口有不同的服务主机集群,根据请求方的优先级别,由不同的主机集群提供服务。
  4. 根据权利要求1所述的基于dubbo平台的服务自动启停方法,其特征在于,所述服务启停规则包括:
    设置服务调用请求的最大阈值及最小阈值,根据服务调用请求的数量,启动或停止预设数量的服务主机。
  5. 根据权利要求4所述的基于dubbo平台的服务自动启停方法,其特征在于,所述服务启停规则还可以根据每个服务调用请求的返回时间设置相应数量的服务主机数。
  6. 根据权利要求1所述的基于dubbo平台的服务自动启停方法,其特征在于,所述第一判断步骤包括:
    当服务调用请求数达到最大阈值时,平台按照服务方指定的规则发送shell脚本来启动服务主机集群相应数量的主机数,满足瞬间并发需求。
  7. 根据权利要求1所述的基于dubbo平台的服务自动启停方法,其特征在于,所述第二判断步骤包括:
    当服务调用请求数低于最小阈值时,平台按照服务方指定的规则发送shell脚本来停止服务主机集群相应数量的主机数,避免资源浪费。
  8. 一种服务器,其特征在于,所述服务器包括:存储器、处理器,所述存储器上存储有基于dubbo平台的服务自动启停程序,所述基于dubbo平台的服务自动启停程序被所述处理器执行,可实现如下步骤:
    接收步骤:接收请求方对某服务方的服务调用请求;
    转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
    监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
    第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
    第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
  9. 根据权利要求8所述的服务器,其特征在于,所述服务提供规则和服务启停规则由各个服务方在平台设置。
  10. 根据权利要求8或9所述的服务器,其特征在于,所述服务提供规则包括:
    服务方的服务接口有不同的服务主机集群,根据请求方的优先级别,由不同的主机集群提供服务。
  11. 根据权利要求8所述的服务器,其特征在于,所述服务启停规则包括:
    设置服务调用请求的最大阈值及最小阈值,根据服务调用请求的数量,启动或停止预设数量的服务主机。
  12. 根据权利要求11所述的服务器,其特征在于,所述服务启停规则还可以根据每个服务调用请求的返回时间设置相应数量的服务主机数。
  13. 根据权利要求8所述的服务器,其特征在于,所述第一判断步骤包括:
    当服务调用请求数达到最大阈值时,平台按照服务方指定的规则发送shell脚本来启动服务主机集群相应数量的主机数,满足瞬间并发需求。
  14. 根据权利要求8所述的服务器,其特征在于,所述第二判断步骤包括:
    当服务调用请求数低于最小阈值时,平台按照服务方指定的规则发送shell脚本来停止服务主机集群相应数量的主机数,避免资源浪费。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括基于dubbo平台的服务自动启停程序,所述统基于dubbo平台的服务自动启停程序被处理器执行时,可实现如下步骤:
    接收步骤:接收请求方对某服务方的服务调用请求;
    转发步骤:根据该服务方的服务提供规则判断该请求方的优先级别,将服务调用请求转发至服务方相应的服务主机集群;
    监控步骤:监控当前服务主机集群待处理的服务调用请求的数量;
    第一判断步骤:判断所述服务调用请求数是否大于最大阈值,若所述服务调用请求数大于最大阈值,则按照预设的服务启停规则启用当前服务主机集群相应数量的主机提供服务,流程返回所述监控步骤,若所述服务调用请求数小于或等于最大阈值,则执行第二判断步骤;
    第二判断步骤:判断所述服务调用请求数是否小于最小阈值,若所述服务调用请求数小于最小阈值,则按照预设的服务启停规则停止当前服务主机集群相应数量的主机,流程返回所述监控步骤,若所述服务调用请求数大于或等于最小阈值,则维持当前服务主机集群提供服务的主机数量。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述服务提供规则和服务启停规则由各个服务方在平台设置。
  17. 根据权利要求15或16所述的计算机可读存储介质,其特征在于,所述服务提供规则包括:
    服务方的服务接口有不同的服务主机集群,根据请求方的优先级别,由 不同的主机集群提供服务。
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述服务启停规则包括:
    设置服务调用请求的最大阈值及最小阈值,根据服务调用请求的数量,启动或停止预设数量的服务主机。
  19. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述第一判断步骤包括:
    当服务调用请求数达到最大阈值时,平台按照服务方指定的规则发送shell脚本来启动服务主机集群相应数量的主机数,满足瞬间并发需求。
  20. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述第二判断步骤包括:
    当服务调用请求数低于最小阈值时,平台按照服务方指定的规则发送shell脚本来停止服务主机集群相应数量的主机数,避免资源浪费。
PCT/CN2018/089136 2017-11-30 2018-05-31 基于dubbo平台的服务自动启停方法、服务器及存储介质 WO2019104974A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711237316.2 2017-11-30
CN201711237316.2A CN107995286B (zh) 2017-11-30 2017-11-30 基于dubbo平台的服务自动启停方法、服务器及存储介质

Publications (1)

Publication Number Publication Date
WO2019104974A1 true WO2019104974A1 (zh) 2019-06-06

Family

ID=62034764

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089136 WO2019104974A1 (zh) 2017-11-30 2018-05-31 基于dubbo平台的服务自动启停方法、服务器及存储介质

Country Status (2)

Country Link
CN (1) CN107995286B (zh)
WO (1) WO2019104974A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124837A (zh) * 2019-12-26 2020-05-08 中国建设银行股份有限公司 一种Open API服务的管理方法及管理系统
CN111953772A (zh) * 2020-08-11 2020-11-17 北京达佳互联信息技术有限公司 请求处理方法、装置、服务器及存储介质
CN112256432A (zh) * 2020-10-29 2021-01-22 北京达佳互联信息技术有限公司 服务过载的处理方法、装置、电子设备及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107995286B (zh) * 2017-11-30 2021-03-02 平安科技(深圳)有限公司 基于dubbo平台的服务自动启停方法、服务器及存储介质
CN108667934A (zh) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 信息处理方法、装置、电子设备及存储介质
CN109871267B (zh) * 2018-12-26 2023-05-09 国网甘肃省电力公司 一种基优先级的一键启停方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172084A1 (en) * 2008-01-02 2009-07-02 Oracle International Corporation Facilitating A User Of A Client System To Continue With Submission Of Additional Requests When An Application Framework Processes Prior Requests
CN103391299A (zh) * 2012-05-08 2013-11-13 深圳市腾讯计算机系统有限公司 负载均衡方法和负载均衡系统
CN103957246A (zh) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 基于租户感知的动态负载均衡方法及系统
CN104158911A (zh) * 2014-09-01 2014-11-19 青岛海信电器股份有限公司 一种面向服务器集群的控制方法及系统
CN105897861A (zh) * 2016-03-28 2016-08-24 乐视控股(北京)有限公司 一种服务器集群的服务器部署方法及系统
CN107995286A (zh) * 2017-11-30 2018-05-04 平安科技(深圳)有限公司 基于dubbo平台的服务自动启停方法、服务器及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713226B (zh) * 2015-11-12 2019-07-12 卓望数码技术(深圳)有限公司 一种用于分布式系统的远程过程调用处理方法和系统
CN105915583B (zh) * 2016-03-28 2020-05-26 联想(北京)有限公司 一种启动服务集群的方法及服务集群
CN107145393A (zh) * 2017-04-27 2017-09-08 努比亚技术有限公司 一种负载调整方法、设备及计算机可读存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172084A1 (en) * 2008-01-02 2009-07-02 Oracle International Corporation Facilitating A User Of A Client System To Continue With Submission Of Additional Requests When An Application Framework Processes Prior Requests
CN103391299A (zh) * 2012-05-08 2013-11-13 深圳市腾讯计算机系统有限公司 负载均衡方法和负载均衡系统
CN103957246A (zh) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 基于租户感知的动态负载均衡方法及系统
CN104158911A (zh) * 2014-09-01 2014-11-19 青岛海信电器股份有限公司 一种面向服务器集群的控制方法及系统
CN105897861A (zh) * 2016-03-28 2016-08-24 乐视控股(北京)有限公司 一种服务器集群的服务器部署方法及系统
CN107995286A (zh) * 2017-11-30 2018-05-04 平安科技(深圳)有限公司 基于dubbo平台的服务自动启停方法、服务器及存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124837A (zh) * 2019-12-26 2020-05-08 中国建设银行股份有限公司 一种Open API服务的管理方法及管理系统
CN111124837B (zh) * 2019-12-26 2023-08-11 中国建设银行股份有限公司 一种Open API服务的管理方法及管理系统
CN111953772A (zh) * 2020-08-11 2020-11-17 北京达佳互联信息技术有限公司 请求处理方法、装置、服务器及存储介质
CN111953772B (zh) * 2020-08-11 2022-11-22 北京达佳互联信息技术有限公司 请求处理方法、装置、服务器及存储介质
CN112256432A (zh) * 2020-10-29 2021-01-22 北京达佳互联信息技术有限公司 服务过载的处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN107995286B (zh) 2021-03-02
CN107995286A (zh) 2018-05-04

Similar Documents

Publication Publication Date Title
WO2019104974A1 (zh) 基于dubbo平台的服务自动启停方法、服务器及存储介质
EP3605352B1 (en) Short-link parsing method, apparatus and device
CN109684358B (zh) 数据查询的方法和装置
US20160117079A1 (en) Method and apparatus for displaying application icons on terminal
CN111131058B (zh) 访问量控制方法和装置
WO2021258753A1 (zh) 一种业务处理方法、装置及电子设备和存储介质
US20180205593A1 (en) Resource Management for Services
US20160269479A1 (en) Cloud virtual server scheduling method and apparatus
CN110933075B (zh) 服务调用方法、装置、电子设备及存储介质
WO2019148716A1 (zh) 数据传输方法、服务器及存储介质
US20140337536A1 (en) Method and apparatus for data communication
CN103019653B (zh) 一种基于linux系统的内核消息分发方法
US20170329628A1 (en) Task Processing Apparatus, Intelligent Device, Task Processing Method, and Baseband Processor
TW201243727A (en) Managing a portal application
CN107784085B (zh) 一种数据列表的导出方法及其终端
WO2023193687A1 (zh) 一种共享内存的访问方法、装置、设备和存储介质
CN104793982A (zh) 一种创建虚拟机的方法和设备
WO2021128918A1 (zh) 终端设备的控制方法、终端设备及存储介质
US10701159B2 (en) Method and apparatus for implementing device sharing
CN112788585B (zh) 一种5g核心网中nf切换方法、装置及存储介质
CN109948332A (zh) 一种物理机登录密码重置方法及装置
US9167052B2 (en) Apparatus, systems, and methods for providing policy in network-based applications
CN108600349B (zh) 连接池中的连接管理方法及装置
CN110430318B (zh) 移动终端wifi调用控制方法、移动终端及存储介质
JP2018521583A (ja) アプリケーション実装方法およびサービスコントローラ

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18882472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31.08.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18882472

Country of ref document: EP

Kind code of ref document: A1