CN112860431A - Connection method, system, equipment and storage medium of micro service node - Google Patents
Connection method, system, equipment and storage medium of micro service node Download PDFInfo
- Publication number
- CN112860431A CN112860431A CN202110074735.9A CN202110074735A CN112860431A CN 112860431 A CN112860431 A CN 112860431A CN 202110074735 A CN202110074735 A CN 202110074735A CN 112860431 A CN112860431 A CN 112860431A
- Authority
- CN
- China
- Prior art keywords
- micro service
- connection
- deleted
- service node
- channel
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000012217 deletion Methods 0.000 claims description 34
- 230000037430 deletion Effects 0.000 claims description 34
- 238000012545 processing Methods 0.000 claims description 14
- 238000010586 diagram Methods 0.000 description 12
- 238000004590 computer program Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000002085 persistent effect Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 230000007935 neutral effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000010079 rubber tapping Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a method, a system, equipment and a storage medium for connecting micro service nodes, wherein the method comprises the following steps: acquiring historical calling times and calling time thresholds of all the connecting channels in the connecting channel set; acquiring a connection channel to be deleted, of which the historical calling times are greater than a calling time threshold value, in a connection channel set; deleting the connecting channel to be deleted from the connecting channel set, and creating the connecting channel in the connecting channel set; and establishing connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel. The invention can simply, efficiently, controllably and stably realize the load balance of the micro service node, can play a role of sharing the service, has the advantage of low cost and is worthy of popularization.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, a system, a device, and a storage medium for connecting microservice nodes.
Background
Kubernetes is also called k8s, is a Google open-source container cluster management system, is a complete distributed system support platform and has complete cluster management capability. A scheduling service for one container (POD, also called a micro service node) can be constructed by kubernets, so that a user can manage container clusters by kubernets. RPC (Remote Procedure Call Protocol), a Protocol that requests services from Remote computer programs over a network without knowledge of the underlying network technology. Grpc (google Remote Procedure protocol) was developed by google, is a language neutral, platform neutral, open source Remote Procedure Call system, and may be referred to as google Remote Procedure Call.
In the process of performing server resource management by using Kubernetes, a connection between a GRPC and a POD is generally established based on an http2.0 protocol, so that a service sending end sends a service to the POD through the GRPC for service processing. However, the connections between the GRPC and the PODs established based on the http2.0 protocol are persistent, and all the GRPCs cannot establish connections with other PODs again, so that the service sent by the service sending end is processed by the PODs persistently connected to the GRPC, and the PODs in an idle state cannot share the service.
Disclosure of Invention
The embodiment of the application aims to solve the problem that the connection between the GRPC and the POD established based on the http2.0 protocol is persistent, so that the POD in an idle state cannot share the service.
The embodiment of the application provides a method for connecting micro service nodes, which comprises the following steps:
acquiring historical calling times and calling time thresholds of all the connecting channels in the connecting channel set;
acquiring a connection channel to be deleted, of which the historical calling times are greater than a calling time threshold value, in the connection channel set;
deleting the connecting channel to be deleted from the connecting channel set, and creating the connecting channel in the connecting channel set;
and establishing connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
In an embodiment, after obtaining the connection channel to be deleted whose historical number of calls is greater than the threshold number of calls in the connection channel set, the method includes:
judging whether the connecting channel to be deleted meets a deletion condition;
and when judging that the connecting channel to be deleted meets the deletion condition, executing the steps of deleting the connecting channel to be deleted from the connecting channel set and creating the connecting channel in the connecting channel set.
In an embodiment, after determining whether the connection channel to be deleted satisfies the deletion condition, the method includes:
and when the connection channel to be deleted is judged not to meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and keeping the connection between the connection channel to be deleted and the service sending end and the corresponding micro service node in the micro service node set.
In an embodiment, the determining whether the connection channel to be deleted satisfies a deletion condition includes:
acquiring the service quantity of the service to be processed which is transmitted on the connecting channel to be deleted;
and judging whether the service quantity is less than or equal to a preset quantity, wherein if the service quantity is less than or equal to the preset quantity, the connection channel to be deleted is judged to meet a deletion condition.
In an embodiment, the establishing, through the created connection channel, a connection between a service sending end and a micro service node in an idle state in a micro service node set includes:
acquiring micro service nodes in an idle state in the micro service node set;
acquiring address information of the micro service node in the idle state;
and connecting the service sending end with the micro service node in the idle state through the created connecting channel according to the address information of the micro service node in the idle state.
In an embodiment, the obtaining of the micro service node in an idle state in the set of micro service nodes includes:
acquiring the resource occupancy rate of each micro service node in the micro service node set;
and taking the micro service node with the resource occupancy rate smaller than the preset occupancy rate as the micro service node in the idle state.
In an embodiment, after establishing a connection between a service sender and a micro service node in an idle state in a micro service node set through the created connection channel, the method includes:
when detecting the service to be processed output by the service sending end, acquiring a connection channel corresponding to the micro service node in an idle state;
and sending the service to be processed to the micro service node in the idle state for processing through the connecting channel.
In addition, to achieve the above object, the present invention further provides a connection system of microservice nodes, including:
the first acquisition module is used for acquiring historical calling times and calling time thresholds of all the connecting channels in the connecting channel set;
the second acquisition module is used for acquiring the connection channel to be deleted, of which the historical calling times are greater than the threshold value of the calling times, in the connection channel set;
a creating module, configured to delete the connection channel to be deleted from the connection channel set, and create a connection channel in the connection channel set;
and the connection module is used for establishing the connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
Further, to achieve the above object, the present invention also provides a connection apparatus including: the micro service node connection method comprises a memory, a processor and a micro service node connection program which is stored on the memory and can run on the processor, wherein the micro service node connection program realizes the steps of the micro service node connection method when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a storage medium having a connection program of a microservice node stored thereon, the connection program of the microservice node implementing the steps of the connection method of the microservice node described above when executed by a processor.
The technical scheme of the method, the system, the equipment and the storage medium for connecting the micro service nodes provided in the embodiment of the application at least has the following technical effects or advantages:
the technical scheme is that the historical calling times and calling time thresholds of all the connecting channels in the connecting channel set are obtained, the connecting channels to be deleted, the historical calling times of which are larger than the calling time threshold, in the connecting channel set are obtained, the connecting channels to be deleted are deleted from the connecting channel set, the connecting channels are established in the connecting channel set, and the connection between the service sending end and the micro service nodes in the idle state in the micro service node set is established through the established connecting channels, so that the problem that the PODs in the idle state cannot share the service due to the fact that the connection between GRPC and the PODs established based on the http2.0 protocol is persistent is solved, the load balance of the micro service nodes can be simply, efficiently, controllably and stably realized, the service sharing effect can be achieved, the cost is low, and the method is worthy of popularization.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a connection method of micro service nodes according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a connection method of micro service nodes according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a connection method of micro service nodes according to a third embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for connecting microservice nodes according to a fourth embodiment of the present invention;
FIG. 6 is a functional block diagram of a connection system of the microservice node of the present invention.
Detailed Description
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
Fig. 1 may be a schematic structural diagram of a hardware operating environment of a connection device.
As shown in fig. 1, the connection device may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the connection device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the connecting device configuration shown in fig. 1 is not intended to be limiting of connecting devices and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a connection program of the micro service node. Among them, the operating system is a program that manages and controls the hardware and software resources of the connected device, the connection program of the microservice node, and the operation of other software or programs.
In the connection apparatus shown in fig. 1, the user interface 1003 is mainly used for connecting a terminal, and performing data communication with the terminal; the network interface 1004 is mainly used for the background server and performs data communication with the background server; processor 1001 may be used to invoke a connectivity program for a microservice node stored in memory 1005.
In this embodiment, the connection device includes: a memory 1005, a processor 1001 and a connectivity program for a microservice node stored on said memory and executable on said processor, wherein:
when the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are performed:
acquiring historical calling times and calling time thresholds of all the connecting channels in the connecting channel set;
acquiring a connection channel to be deleted, of which the historical calling times are greater than a calling time threshold value, in the connection channel set;
deleting the connecting channel to be deleted from the connecting channel set, and creating the connecting channel in the connecting channel set;
and establishing connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
When the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are also performed:
judging whether the connecting channel to be deleted meets a deletion condition;
and when judging that the connecting channel to be deleted meets the deletion condition, executing the steps of deleting the connecting channel to be deleted from the connecting channel set and creating the connecting channel in the connecting channel set.
When the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are also performed:
and when the connection channel to be deleted is judged not to meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and keeping the connection between the connection channel to be deleted and the service sending end and the corresponding micro service node in the micro service node set.
When the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are also performed:
acquiring the service quantity of the service to be processed which is transmitted on the connecting channel to be deleted;
and judging whether the service quantity is less than or equal to a preset quantity, wherein if the service quantity is less than or equal to the preset quantity, the connection channel to be deleted is judged to meet a deletion condition.
When the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are also performed:
acquiring micro service nodes in an idle state in the micro service node set;
acquiring address information of the micro service node in the idle state;
and connecting the service sending end with the micro service node in the idle state through the created connecting channel according to the address information of the micro service node in the idle state.
When the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are also performed:
acquiring the resource occupancy rate of each micro service node in the micro service node set;
and taking the micro service node with the resource occupancy rate smaller than the preset occupancy rate as the micro service node in the idle state.
When the processor 1001 calls the connection program of the microservice node stored in the memory 1005, the following operations are also performed:
when detecting the service to be processed output by the service sending end, acquiring a connection channel corresponding to the micro service node in an idle state;
and sending the service to be processed to the micro service node in the idle state for processing through the connecting channel.
The embodiment of the present invention provides an embodiment of a method for connecting micro service nodes, and it should be noted that, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a sequence different from that here, and the method for connecting micro service nodes is applied to a container cluster management system (kubernets is also referred to as k8s), and is specifically used for performing scheduling management on micro service nodes (PODs) constructed based on the container cluster management system in a server, so as to implement sharing of traffic to be processed by each idle micro service node.
As shown in fig. 2, in a first embodiment of the present application, a connection method of micro service nodes of the present application is applied to a container cluster management system, and includes the following steps:
step S210: and acquiring historical calling times and calling time threshold values of all the connecting channels in the connecting channel set.
In this embodiment, a plurality of micro service nodes for processing services and a plurality of service transmitting ends are constructed based on the container cluster management system, and the service transmitting ends are also micro service nodes, specifically, micro service nodes for outputting services to be processed. The micro service nodes for processing the services form a micro service node set, that is, the micro service node set includes a plurality of micro service nodes for processing the services. The connection channel set comprises a plurality of pre-established connection channels, each service sending end can establish connection with the same micro service node through at least one connection channel, and each connection channel is used for transmitting the service to be processed output by the service sending end to the corresponding micro service node, so that the micro service node processes the received service to be processed.
Specifically, when it is detected that the service sending end outputs the service to be processed, traversing each connection channel in the connection channel set, obtaining the historical calling times and the calling time threshold of each connection channel, and determining whether the connection channel to be deleted exists in the connection channel set according to the historical calling times and the calling time threshold of each connection channel. The historical call times may be understood as the times that the connection channel has been called to transmit the service to be processed currently, and the call time threshold may be understood as the times that the connection channel is allowed to be called. The threshold value of the number of calls of each connection channel may be the same or different. When the historical calling times of any one connection channel exceed the calling time threshold, the connection channel can still transmit the service to be processed, but the transmitted service to be processed is always processed by the same micro service node, so that the micro service node in the idle state is always idle, and the micro service node in the idle state is difficult to share the service.
Step S220: and acquiring the connection channel to be deleted of which the historical calling times are greater than a calling time threshold value in the connection channel set.
In this embodiment, according to the historical calling times and the calling time threshold of each connection channel in the connection channel set, the connection channel of which the historical calling times is greater than the calling time threshold is obtained from the connection channel set, and the connection channel of which the historical calling times is greater than the calling time threshold is marked as a connection channel to be deleted. For example, if the threshold value of the number of calls of the connection channel a is 10, but the history number of calls of the actually acquired connection channel a is 12, the connection channel a is marked as a connection channel to be deleted.
Step S230: and deleting the connecting channel to be deleted from the connecting channel set, and creating the connecting channel in the connecting channel set.
In this embodiment, after the connecting channel to be deleted is marked in the connecting channel set, the connecting channel marked as the connecting channel to be deleted is deleted from the connecting channel set, and then the connecting channel is created again in the connecting channel set. The function and effect of the re-created connecting channel are the same as those of the connecting channel which is not deleted from the connecting channel set and those of the connecting channel which is deleted from the connecting channel set. When the connection channel is created, the interface information of the created connection channel, the domain name information and the port information of the micro service node in the idle state are obtained, and the connection channel is established according to the interface information, the domain name information and the port information. The micro service node in the idle state can be determined through the domain name information, and the interface of the created connection channel can be determined to be connected with which port of the micro service node in the idle state according to the port information.
Step S240: and establishing connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
In this embodiment, after a connection channel is created in the connection channel set, the service sending end is connected with the micro service node in an idle state in the micro service node set through the created connection channel. The micro service node in the idle state refers to a micro service node with a low resource occupancy rate, that is, the micro service node is idle and has more resources that are not used.
According to the technical scheme, the method comprises the steps of obtaining historical calling times and calling time thresholds of all the connecting channels in the connecting channel set, obtaining the connecting channels to be deleted, of which the historical calling times are larger than the calling time threshold, of the connecting channel set, deleting the connecting channels to be deleted from the connecting channel set, creating the connecting channels in the connecting channel set, and establishing connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the created connecting channels, so that load balance of the micro service nodes can be simply, efficiently, controllably and stably achieved, a service sharing effect can be achieved, the cost is low, and the method is worthy of popularization.
As shown in fig. 3, in the second embodiment of the present application, based on the first embodiment, the following steps are included after step S220:
step S221: and judging whether the connecting channel to be deleted meets the deletion condition or not.
In this embodiment, the deletion condition is that the number of services of the pending service being transmitted on the connection channel to be deleted is less than or equal to a preset number. Specifically, whether the connection channel to be deleted meets the deletion condition is determined, first, the number of services of the service to be processed, which is being transmitted on the connection channel to be deleted, needs to be acquired, and then, whether the number of the services is smaller than or equal to a preset number is determined, if the number of the services is smaller than or equal to the preset number, it is determined that the connection channel to be deleted meets the deletion condition, then step S222 is executed, otherwise, step S223 is executed.
Step S222: and when judging that the connecting channel to be deleted meets the deletion condition, executing the steps of deleting the connecting channel to be deleted from the connecting channel set and creating the connecting channel in the connecting channel set.
Step S223: and when the connection channel to be deleted is judged not to meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and keeping the connection between the connection channel to be deleted and the service sending end and the corresponding micro service node in the micro service node set.
In this embodiment, if it is determined that the connection channel to be deleted satisfies the deletion condition, step S230 is executed to delete the connection channel to be deleted from the connection channel set and to recreate the connection channel in the connection channel set. If the connection channel to be deleted does not meet the deletion condition, it is indicated that the transmission of the to-be-processed service being transmitted on the connection channel to be deleted is not completed, that is, the number of the to-be-processed service being transmitted on the connection channel to be deleted is greater than the preset number, and then the connection channel to be deleted needs to be removed from the connection channel set. And after the connection channel to be deleted is removed from the connection channel set, the connection between the connection channel to be deleted and the corresponding micro service nodes in the service sending end and the micro service node set is still maintained, so that the normal transmission of the service to be processed is ensured. It should be noted that, after the connection channel to be deleted is removed from the connection channel set, when the service sending end outputs the service to be processed again, the service to be processed that is output again by the service sending end is no longer transmitted through the connection channel to be deleted. While maintaining the normal transmission of the pending service by the pending deletion connection channel, the method repeatedly determines whether the pending deletion connection channel satisfies the deletion condition, and if it is determined that the pending deletion connection channel satisfies the deletion condition, step S230 is executed.
According to the technical scheme, the method comprises the steps of judging whether the connection channel to be deleted meets the deletion condition, deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set when the connection channel to be deleted meets the deletion condition is judged, removing the connection channel to be deleted from the connection channel set and keeping the connection between the connection channel to be deleted and the corresponding micro service nodes in the service sending end and the micro service node set when the connection channel to be deleted does not meet the deletion condition, and is favorable for realizing load balance of the micro service nodes by deleting the connection channel to be deleted and creating the connection channel.
As shown in fig. 4, in the third embodiment of the present application, based on the first embodiment, the step S240 includes the steps of:
step S241: acquiring micro service nodes in an idle state in the micro service node set; and acquiring the address information of the micro service node in the idle state.
In this embodiment, when establishing a connection between a service sending end and a micro service node in an idle state in a micro service node set through a created connection channel, the micro service node in the idle state needs to be obtained from the micro service node set first, and then address information of the micro service node in the idle state needs to be obtained. The method comprises the steps of obtaining resource occupancy rates of all micro service nodes in a micro service node set, obtaining the resource occupancy rates corresponding to all the micro service nodes, and then taking the micro service nodes with the resource occupancy rates smaller than a preset occupancy rate in the micro service node set as the micro service nodes in the idle state.
Step S242: and connecting the service sending end with the micro service node in the idle state through the created connecting channel according to the address information of the micro service node in the idle state.
In this embodiment, the address information of the idle-state micro service node may be obtained by performing Domain Name Server (DNS) resolution, and according to the address information of the idle-state micro service node, it may be determined with which idle-state micro service node the service sending end needs to be connected through the created connection channel. After the service sending end is connected with the micro service nodes in the idle state through the created connecting channel according to the address information of the micro service nodes in the idle state, each micro service node in the idle state is possible to share the service to be processed, which is output again by the service sending end.
According to the technical scheme, the method and the device have the advantages that the micro service nodes in the idle state in the micro service node set are obtained, the address information of the micro service nodes in the idle state is obtained, and the service sending end and the micro service nodes in the idle state are connected through the created connecting channel according to the address information of the micro service nodes in the idle state, so that the micro service nodes in the idle state can share services.
As shown in fig. 5, in the fourth embodiment of the present application, based on the first embodiment, the following steps are included after step S240:
step S250: and when detecting the service to be processed output by the service sending end, acquiring a connection channel corresponding to the micro service node in an idle state.
In this embodiment, after establishing a connection between a service sending end and a micro service node in an idle state in a micro service node set through a created connection channel, if it is detected that the service sending end outputs a service to be processed, the micro service node in the idle state is acquired, then a connection channel corresponding to the micro service node in the idle state is called, and the connection channel is used as a channel for transmitting the current service to be processed.
Step S260: and sending the service to be processed to the micro service node in the idle state for processing through the connecting channel.
In this embodiment, after the connection channel corresponding to the idle-state micro service node is acquired, the current service to be processed is transmitted to the idle-state micro service node by using the connection channel, so that the idle-state micro service node processes the current service to be processed.
According to the technical scheme, the technical means that when the to-be-processed service output by the service sending end is detected, the connection channel corresponding to the idle-state micro service node is obtained, and the to-be-processed service is sent to the idle-state micro service node through the connection channel for processing is adopted, so that the idle-state micro service node shares the service.
As shown in fig. 6, the present application provides a connection system for microserver nodes, including:
a first obtaining module 310, configured to obtain historical call times and a call time threshold of each connection channel in the connection channel set;
a second obtaining module 320, configured to obtain a connection channel to be deleted in the connection channel set, where the historical call frequency is greater than a call frequency threshold;
a creating module 330, configured to delete the connection channel to be deleted from the connection channel set, and create a connection channel in the connection channel set;
the connection module 340 is configured to establish a connection between the service sending end and the micro service node in an idle state in the micro service node set through the created connection channel.
Further, the creating module 330, in deleting the connection channel to be deleted from the connection channel set, specifically includes:
the judging unit is used for judging whether the connecting channel to be deleted meets the deleting condition;
and the deleting unit is used for executing the steps of deleting the connecting channel to be deleted from the connecting channel set and creating the connecting channel in the connecting channel set when judging that the connecting channel to be deleted meets the deleting condition.
Further, the creating module 330, in deleting the connection channel to be deleted from the connection channel set, specifically further includes:
and a removing unit, configured to remove the connection channel to be deleted from the connection channel set and maintain a connection between the connection channel to be deleted and the service sending end and the corresponding micro service node in the micro service node set when it is determined that the connection channel to be deleted does not satisfy the deletion condition.
Further, the judging unit includes:
a data obtaining subunit, configured to obtain a service quantity of a service to be processed that is being transmitted on the connection channel to be deleted;
and the condition judging subunit is used for judging whether the service quantity is less than or equal to a preset quantity, wherein if the service quantity is less than or equal to the preset quantity, the connecting channel to be deleted is judged to meet the deletion condition.
Further, the connection module 340 includes:
the node acquisition unit is used for acquiring the micro service nodes in an idle state in the micro service node set;
the address acquisition unit is used for acquiring the address information of the micro service node in the idle state;
and the connection unit is used for connecting the service sending end with the micro service node in the idle state through the created connection channel according to the address information of the micro service node in the idle state.
Further, the node obtaining unit includes;
an occupancy rate acquiring subunit, configured to acquire resource occupancy rates of each micro service node in the micro service node set;
and the node determining subunit is used for taking the micro service node with the resource occupancy rate smaller than the preset occupancy rate as the micro service node in the idle state.
Further, the connection system of the microserver node further includes:
the service detection unit is used for acquiring a connection channel corresponding to the micro service node in an idle state when the service to be processed output by the service sending end is detected;
and the service transmission unit is used for sending the service to be processed to the micro service node in the idle state for processing through the connecting channel.
The specific implementation of the connection system of the microservice node of the present invention is basically the same as the embodiments of the connection method of the microservice node, and is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A method for connecting micro service nodes is applied to a container cluster management system, and comprises the following steps:
acquiring historical calling times and calling time thresholds of all the connecting channels in the connecting channel set;
acquiring a connection channel to be deleted, of which the historical calling times are greater than a calling time threshold value, in the connection channel set;
deleting the connecting channel to be deleted from the connecting channel set, and creating the connecting channel in the connecting channel set;
and establishing connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
2. The method of claim 1, wherein after obtaining the connection channel to be deleted whose historical number of calls in the connection channel set is greater than the threshold number of calls, the method comprises:
judging whether the connecting channel to be deleted meets a deletion condition;
and when judging that the connecting channel to be deleted meets the deletion condition, executing the steps of deleting the connecting channel to be deleted from the connecting channel set and creating the connecting channel in the connecting channel set.
3. The method as claimed in claim 2, wherein said determining whether the connection channel to be deleted satisfies a deletion condition comprises:
and when the connection channel to be deleted is judged not to meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and keeping the connection between the connection channel to be deleted and the service sending end and the corresponding micro service node in the micro service node set.
4. The method as claimed in claim 3, wherein said determining whether said connection channel to be deleted satisfies a deletion condition comprises:
acquiring the service quantity of the service to be processed which is transmitted on the connecting channel to be deleted;
and judging whether the service quantity is less than or equal to a preset quantity, wherein if the service quantity is less than or equal to the preset quantity, the connection channel to be deleted is judged to meet a deletion condition.
5. The method of claim 1, wherein the establishing a connection between a service sender and a micro service node in an idle state in a micro service node set through the created connection channel comprises:
acquiring micro service nodes in an idle state in the micro service node set;
acquiring address information of the micro service node in the idle state;
and connecting the service sending end with the micro service node in the idle state through the created connecting channel according to the address information of the micro service node in the idle state.
6. The method of claim 5, wherein the obtaining of the micro service nodes in an idle state in the set of micro service nodes comprises:
acquiring the resource occupancy rate of each micro service node in the micro service node set;
and taking the micro service node with the resource occupancy rate smaller than the preset occupancy rate as the micro service node in the idle state.
7. The method of claim 1, wherein after establishing the connection between the service sender and the micro service node in the idle state in the micro service node set through the created connection channel, the method comprises:
when detecting the service to be processed output by the service sending end, acquiring a connection channel corresponding to the micro service node in an idle state;
and sending the service to be processed to the micro service node in the idle state for processing through the connecting channel.
8. A connection system for microservice nodes, comprising:
the first acquisition module is used for acquiring historical calling times and calling time thresholds of all the connecting channels in the connecting channel set;
the second acquisition module is used for acquiring the connection channel to be deleted, of which the historical calling times are greater than the threshold value of the calling times, in the connection channel set;
a creating module, configured to delete the connection channel to be deleted from the connection channel set, and create a connection channel in the connection channel set;
and the connection module is used for establishing the connection between the service sending end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
9. A connection device, comprising: memory, a processor and a connectivity program of a microservice node stored on the memory and executable on the processor, the connectivity program of a microservice node implementing the steps of the connectivity method of a microservice node according to any of claims 1-7 when executed by the processor.
10. A storage medium on which a connection program of a micro service node is stored, the connection program of the micro service node implementing the steps of the connection method of the micro service node according to any one of claims 1 to 7 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110074735.9A CN112860431B (en) | 2021-01-20 | 2021-01-20 | Connection method, system, equipment and storage medium of micro service node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110074735.9A CN112860431B (en) | 2021-01-20 | 2021-01-20 | Connection method, system, equipment and storage medium of micro service node |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112860431A true CN112860431A (en) | 2021-05-28 |
CN112860431B CN112860431B (en) | 2024-03-15 |
Family
ID=76007614
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110074735.9A Active CN112860431B (en) | 2021-01-20 | 2021-01-20 | Connection method, system, equipment and storage medium of micro service node |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112860431B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113630472A (en) * | 2021-09-13 | 2021-11-09 | 东软集团股份有限公司 | Method, device, electronic equipment and medium for avoiding channel waste between network nodes |
CN114928596A (en) * | 2022-04-20 | 2022-08-19 | 上海昱极科技有限公司 | Data transmission method and device in micro-service communication process |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103534996A (en) * | 2012-11-29 | 2014-01-22 | 华为技术有限公司 | Method and device for implementing load balance |
CN104301287A (en) * | 2013-07-16 | 2015-01-21 | 中兴通讯股份有限公司 | Method, network node, server and system of implementing many-to-many session |
US20150135193A1 (en) * | 2013-11-12 | 2015-05-14 | Xiong Li | Streaming event data collection |
US20170187820A1 (en) * | 2015-12-28 | 2017-06-29 | Microsoft Technology Licensing, Llc | Caching service with client-enabled routing |
CN108337163A (en) * | 2018-02-07 | 2018-07-27 | 北京百度网讯科技有限公司 | Method and apparatus for link aggregation |
CN109412966A (en) * | 2018-12-12 | 2019-03-01 | 北京信息科技大学 | A kind of extensive log transmission method, apparatus and system |
CN109547261A (en) * | 2018-12-12 | 2019-03-29 | 平安科技(深圳)有限公司 | Service line switching method, device, electronic equipment and storage medium |
WO2019128647A1 (en) * | 2017-12-29 | 2019-07-04 | 中兴通讯股份有限公司 | Message transmission method and device, storage medium and electronic device |
CN111124643A (en) * | 2019-12-20 | 2020-05-08 | 浪潮电子信息产业股份有限公司 | Task deletion scheduling method, system and related device in distributed storage |
CN111880932A (en) * | 2020-07-24 | 2020-11-03 | 西安奥卡云数据科技有限公司 | Data storage method and device based on multiple network ports |
-
2021
- 2021-01-20 CN CN202110074735.9A patent/CN112860431B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103534996A (en) * | 2012-11-29 | 2014-01-22 | 华为技术有限公司 | Method and device for implementing load balance |
CN104301287A (en) * | 2013-07-16 | 2015-01-21 | 中兴通讯股份有限公司 | Method, network node, server and system of implementing many-to-many session |
US20150135193A1 (en) * | 2013-11-12 | 2015-05-14 | Xiong Li | Streaming event data collection |
US20170187820A1 (en) * | 2015-12-28 | 2017-06-29 | Microsoft Technology Licensing, Llc | Caching service with client-enabled routing |
WO2019128647A1 (en) * | 2017-12-29 | 2019-07-04 | 中兴通讯股份有限公司 | Message transmission method and device, storage medium and electronic device |
CN108337163A (en) * | 2018-02-07 | 2018-07-27 | 北京百度网讯科技有限公司 | Method and apparatus for link aggregation |
CN109412966A (en) * | 2018-12-12 | 2019-03-01 | 北京信息科技大学 | A kind of extensive log transmission method, apparatus and system |
CN109547261A (en) * | 2018-12-12 | 2019-03-29 | 平安科技(深圳)有限公司 | Service line switching method, device, electronic equipment and storage medium |
CN111124643A (en) * | 2019-12-20 | 2020-05-08 | 浪潮电子信息产业股份有限公司 | Task deletion scheduling method, system and related device in distributed storage |
CN111880932A (en) * | 2020-07-24 | 2020-11-03 | 西安奥卡云数据科技有限公司 | Data storage method and device based on multiple network ports |
Non-Patent Citations (1)
Title |
---|
唐菁敏;张伟;周旋;王朝阳;王红彬;: "无线Mesh网络负载均衡的蚁群链路权值算法研究", 信息技术, no. 06 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113630472A (en) * | 2021-09-13 | 2021-11-09 | 东软集团股份有限公司 | Method, device, electronic equipment and medium for avoiding channel waste between network nodes |
CN114928596A (en) * | 2022-04-20 | 2022-08-19 | 上海昱极科技有限公司 | Data transmission method and device in micro-service communication process |
Also Published As
Publication number | Publication date |
---|---|
CN112860431B (en) | 2024-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110795022B (en) | Terminal testing method, system and storage medium | |
CN110781373B (en) | List updating method and device, readable medium and electronic equipment | |
CN111246228B (en) | Method, device, medium and electronic equipment for updating gift resources of live broadcast room | |
CN114217707B (en) | Sharing method, sharing device, electronic equipment and storage medium | |
CN112019625A (en) | Websocket-based message pushing method, system, equipment and medium | |
CN111209306A (en) | Business logic judgment method and device, electronic equipment and storage medium | |
CN112860431B (en) | Connection method, system, equipment and storage medium of micro service node | |
CN113521728A (en) | Cloud application implementation method and device, electronic equipment and storage medium | |
CN110336592B (en) | Data transmission method suitable for Bluetooth card reader, electronic equipment and storage medium | |
CN113596328B (en) | Camera calling method and device and electronic equipment | |
CN111478916B (en) | Data transmission method, device and storage medium based on video stream | |
CN112291325A (en) | Message processing method and device and computer system | |
CN115225586B (en) | Data packet transmitting method, device, equipment and computer readable storage medium | |
CN107342981B (en) | Sensor data transmission method and device and virtual reality head-mounted equipment | |
CN115600964A (en) | Voice approval method and device and related equipment | |
CN114095907B (en) | Bluetooth connection control method, device and equipment | |
CN107025118B (en) | Method and device for ending application program | |
CN111212296B (en) | Live broadcast room gift list configuration method, device, medium and electronic equipment | |
CN111367592B (en) | Information processing method and device | |
CN113518183A (en) | Camera calling method and device and electronic equipment | |
CN111399730A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
CN112311840A (en) | Multi-terminal data synchronization method, device, equipment and medium | |
CN111291254A (en) | Information processing method and device | |
CN114172946B (en) | Request result sending method, device, electronic equipment and computer readable medium | |
CN111241443A (en) | Method and device for pushing information and electronic equipment |
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 |