CN112860431B - 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 PDF

Info

Publication number
CN112860431B
CN112860431B CN202110074735.9A CN202110074735A CN112860431B CN 112860431 B CN112860431 B CN 112860431B CN 202110074735 A CN202110074735 A CN 202110074735A CN 112860431 B CN112860431 B CN 112860431B
Authority
CN
China
Prior art keywords
connection channel
connection
micro service
service node
deleted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110074735.9A
Other languages
Chinese (zh)
Other versions
CN112860431A (en
Inventor
魏新宇
胡炼壮
闫强
张浩晨
叶家俊
陈鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Liuhua Network Technology Co ltd
Original Assignee
Chongqing Liuhua Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Liuhua Network Technology Co ltd filed Critical Chongqing Liuhua Network Technology Co ltd
Priority to CN202110074735.9A priority Critical patent/CN112860431B/en
Publication of CN112860431A publication Critical patent/CN112860431A/en
Application granted granted Critical
Publication of CN112860431B publication Critical patent/CN112860431B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation 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/505Allocation 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
    • 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

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 connection method, a system, equipment and a storage medium of a micro service node, wherein the method comprises the following steps: acquiring historical calling times and calling times thresholds of all the connecting channels in the connecting channel set; acquiring a to-be-deleted connection channel with historical calling times larger than a calling times threshold value in a connection channel set; deleting a connection channel to be deleted from the connection channel set, and creating a connection channel in the connection channel set; and establishing connection between the service transmitting end and the micro service nodes in an 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 in service sharing, has the advantage of low cost, and is worth popularizing.

Description

Connection method, system, equipment and storage medium of micro service node
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, a system, an apparatus, and a storage medium for connecting micro service nodes.
Background
Kubernetes, also known as k8s, is a Google-open-source container cluster management system, which is a complete distributed system support platform with complete cluster management capability. A dispatch service for a container (POD, also called a micro service node) may be built through Kubernetes to allow users to manage container clusters through Kubernetes. RPC (Remote Procedure Call Protocol ), a protocol that requests services from a remote computer program over a network without requiring knowledge of underlying network technology. GRPC (Google Remote Procedure Call Protocol) developed by google is a language neutral, platform neutral, open source remote procedure call system, which may be referred to as google remote procedure call.
In the current process of using Kubernetes to manage server resources, connection between the GRPC and the POD is generally established based on the http2.0 protocol, so that the service transmitting end transmits the service to the POD for service processing through the GRPC. But the connection between the GRPC and the POD established based on the http2.0 protocol is durable, and all GRPCs cannot be re-connected with other PODs, so that the service sent by the service sending end is processed by the POD which is permanently connected with the GRPC, and the POD in an idle state cannot play a role in service sharing.
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 durable, so that the POD in an idle state cannot play a role in service sharing by providing a connection method, a system, equipment and a storage medium of a micro service node.
The embodiment of the application provides a connection method of a micro service node, which comprises the following steps:
acquiring historical calling times and calling times thresholds of all the connecting channels in the connecting channel set;
acquiring a to-be-deleted connection channel of which the historical calling times are larger than a calling times threshold value in the connection channel set;
deleting the connection channel to be deleted from the connection channel set, and creating a connection channel in the connection channel set;
and establishing connection between the service transmitting end and the micro service nodes in an idle state in the micro service node set through the established connection channel.
In an embodiment, after the obtaining the connection channel to be deleted, where the historical call number of times in the connection channel set is greater than the call number threshold, the method includes:
judging whether the connection channel to be deleted meets the deletion condition or not;
and when the connection channel to be deleted meets the deletion condition, executing the steps of deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set.
In an embodiment, after the determining whether the connection channel to be deleted meets the deletion condition, the method includes:
and when the connection channel to be deleted does not meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and maintaining the connection between the connection channel to be deleted and the corresponding micro service node in the service transmitting end and the micro service node set.
In an embodiment, the determining whether the connection channel to be deleted meets a deletion condition includes:
acquiring the service quantity of the service to be processed, which is being transmitted on the connection channel to be deleted;
judging whether the service quantity is smaller than or equal to a preset quantity, wherein if the service quantity is smaller than or equal to the preset quantity, judging that the connection channel to be deleted meets the deletion condition.
In an embodiment, the establishing a connection between the service sending end and the micro service node in the idle state in the micro service node set through the created connection channel 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 transmitting 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.
In an embodiment, the obtaining the micro service node in the idle state in the micro service node set 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 the connection between the service sending end and the micro service node in the idle state in the micro service node set is established through the created connection channel, the method includes:
when the to-be-processed service output by the service transmitting end is detected, 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 connection channel.
In addition, to achieve the above object, the present invention further provides a connection system of a micro service node, including:
the first acquisition module is used for acquiring historical calling times and calling times thresholds of all the connecting channels in the connecting channel set;
the second acquisition module is used for acquiring the to-be-deleted connection channels of which the historical calling times are larger than a calling times threshold value in the connection channel set;
the creation module is used for deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set;
and the connection module is used for establishing connection between the service transmitting end and the micro service nodes in the idle state in the micro service node set through the established connection channel.
In addition, in order to achieve the above object, the present invention also provides a connection apparatus including: the method comprises the steps of a memory, a processor and a connection program of a micro service node, wherein the connection program of the micro service node is stored in the memory and can run on the processor, and the connection program of the micro service node is executed by the processor to realize the connection method of the micro service node.
In addition, in order to achieve the above object, the present invention also provides a storage medium having stored thereon a connection program of a micro service node, which when executed by a processor, implements the steps of the connection method of a micro service node described above.
The technical scheme of the connection method, the system, the equipment and the storage medium of the micro service node provided by the embodiment of the application has at least the following technical effects or advantages:
the method and the device have the advantages that the historical calling times and the calling times threshold value of each connecting channel in the connecting channel set are acquired, the connecting channels to be deleted, of which the historical calling times are larger than the calling times threshold value, are acquired, the connecting channels to be deleted are deleted from the connecting channel set, the connecting channels are created in the connecting channel set, and the connection between the service transmitting end and the micro service nodes in the micro service node set in an idle state is established through the created connecting channels, so that the problem that the connection between the GRPC and the POD established based on the http2.0 protocol is durable, the POD in the idle state cannot play a role in service sharing 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, and the method and the device have the advantages of low cost and are worth popularizing.
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 of a connection method of a micro service node according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a connection method of a micro service node according to a second embodiment of the present invention;
FIG. 4 is a flowchart of a third embodiment of a method for connecting a micro service node according to the present invention;
FIG. 5 is a flowchart of a fourth embodiment of a method for connecting a micro service node according to the present invention;
fig. 6 is a functional block diagram of a connection system of a micro service node according to the present invention.
Detailed Description
In order that the above-described aspects may be better understood, 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 running environment according to an embodiment of the present invention.
It should be noted that 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, memory 1005, user interface 1003, network interface 1004, communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further 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 stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the connection device may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among other sensors, 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 moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile terminal is stationary, and the mobile terminal can be used for recognizing the gesture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, which are not described herein.
Those skilled in the art will appreciate that the connection device structure shown in fig. 1 is not limiting of the connection device and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
As shown in fig. 1, a storage 1005, which is a storage medium, may include an operating system, a network communication module, a user interface module, and a connection program of a micro service node. The operating system is a program for managing and controlling hardware and software resources of the connection device, a connection program of the micro service node and other software or running of the program.
In the connection device shown in fig. 1, the user interface 1003 is mainly used for connecting a terminal, and performs data communication with the terminal; the network interface 1004 is mainly used for a background server and is in data communication with the background server; the processor 1001 may be used to invoke a connectivity program of the micro service node stored in the memory 1005.
In this embodiment, the connection device includes: a memory 1005, a processor 1001, and a connectivity program of a micro service node stored on the memory and executable on the processor, wherein:
when the processor 1001 calls the connection program of the micro service node stored in the memory 1005, the following operations are performed:
acquiring historical calling times and calling times thresholds of all the connecting channels in the connecting channel set;
acquiring a to-be-deleted connection channel of which the historical calling times are larger than a calling times threshold value in the connection channel set;
deleting the connection channel to be deleted from the connection channel set, and creating a connection channel in the connection channel set;
and establishing connection between the service transmitting end and the micro service nodes in an idle state in the micro service node set through the established connection channel.
When the processor 1001 calls the connection program of the micro service node stored in the memory 1005, the following operations are also performed:
judging whether the connection channel to be deleted meets the deletion condition or not;
and when the connection channel to be deleted meets the deletion condition, executing the steps of deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set.
When the processor 1001 calls the connection program of the micro service node stored in the memory 1005, the following operations are also performed:
and when the connection channel to be deleted does not meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and maintaining the connection between the connection channel to be deleted and the corresponding micro service node in the service transmitting end and the micro service node set.
When the processor 1001 calls the connection program of the micro service node stored in the memory 1005, the following operations are also performed:
acquiring the service quantity of the service to be processed, which is being transmitted on the connection channel to be deleted;
judging whether the service quantity is smaller than or equal to a preset quantity, wherein if the service quantity is smaller than or equal to the preset quantity, judging that the connection channel to be deleted meets the deletion condition.
When the processor 1001 calls the connection program of the micro service 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 transmitting 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.
When the processor 1001 calls the connection program of the micro service 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 micro service node stored in the memory 1005, the following operations are also performed:
when the to-be-processed service output by the service transmitting end is detected, 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 connection channel.
The embodiments of the present invention provide an embodiment of a connection method of micro service nodes, and it should be noted that, although a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a sequence different from that herein, where the connection method of micro service nodes is applied to a container cluster management system (Kubernetes is also referred to as k8 s), and specifically is 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 services to be processed by the micro service nodes in each idle state.
As shown in fig. 2, in a first embodiment of the present application, the connection method of the micro service node 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 times thresholds 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 sending terminals are constructed based on the container cluster management system, and the service sending terminals are also micro service nodes, specifically, micro service nodes for outputting the 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 comprises a plurality of micro service nodes for processing the services. The connection channel set comprises a plurality of connection channels which are created in advance, each service transmitting end can be connected 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 transmitting end to the corresponding micro-service node so that the micro-service node can process the received service to be processed.
Specifically, when the service sending end detects that the service sending end outputs the service to be processed, each connection channel in the connection channel set is traversed, the historical calling times and calling times threshold values of each connection channel are obtained, and whether the connection channel to be deleted exists in the connection channel set or not is determined according to the historical calling times and calling times threshold values of each connection channel. The historical call times can be understood as the times that the connection channel has been called currently to transmit the service to be processed, and the call times threshold can be understood as the times that the connection channel is allowed to be called. The threshold number of calls of each connection channel may be the same or different. When the historical calling times of any one connecting channel exceeds the calling times threshold, the connecting channel can still transmit the to-be-processed service, but the transmitted to-be-processed service is always processed by the same micro service node, so that the micro service node in the idle state is easy to be idle all the time, and the sharing of the service by the micro service node in the idle state is difficult to be realized.
Step S220: and acquiring the connection channels to be deleted, wherein the historical calling times of the connection channels are larger than the calling times threshold value.
In this embodiment, according to the historical call times and call times threshold of each connection channel in the connection channel set, connection channels with historical call times greater than the call times threshold are obtained from the connection channel set, and connection channels with historical call times greater than the call times threshold are marked as connection channels to be deleted. For example, the threshold number of calls of the connection channel a is 10, but the history of calls of the connection channel a actually obtained is 12, and then the connection channel a is marked as a connection channel to be deleted.
Step S230: deleting the connection channel to be deleted from the connection channel set, and creating a connection channel in the connection channel set.
In this embodiment, after the connection channel to be deleted is marked in the connection channel set, the connection channel marked as the connection channel to be deleted is deleted from the connection channel set, and then the connection channel is recreated in the connection channel set. The function and function of the recreated connection channel are the same as those of the connection channel not deleted from the connection channel set and those of the connection channel deleted from the connection 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 acquired, 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 the port of the micro service node in the idle state according to the port information.
Step S240: and establishing connection between the service transmitting end and the micro service nodes in an 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 a 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 low resource occupancy rate, that is, the micro service node is idle and has more resources not used.
According to the technical scheme, the historical calling times and the calling times threshold value of each connecting channel in the connecting channel set are obtained, the connecting channels to be deleted, of which the historical calling times are larger than the calling times threshold value, are obtained, the connecting channels to be deleted are deleted from the connecting channel set, the connecting channels are created in the connecting channel set, and the technical means of connection between the service transmitting end and the micro service nodes in the micro service node set in an idle state is established through the created connecting channels, so that load balance of the micro service nodes can be simply, efficiently, controllably and stably realized, the service sharing effect can be achieved, and the method has the advantage of low cost and is worth popularizing.
As shown in fig. 3, in the second embodiment of the present application, based on the first embodiment, step S220 includes the following steps:
step S221: and judging whether the connection channel to be deleted meets the deletion condition or not.
In this embodiment, the deletion condition is that the number of services to be processed, which are being transmitted on the connection channel to be deleted, is less than or equal to a preset number. Specifically, it is determined whether the connection channel to be deleted satisfies the deletion condition, firstly, the number of services of the pending service being transmitted on the connection channel to be deleted needs to be acquired, then, it is determined whether the number of services is less than or equal to the preset number, if the number of services is less than or equal to the preset number, it is determined that the connection channel to be deleted satisfies the deletion condition, then step S222 is executed, otherwise, step S223 is executed.
Step S222: and when the connection channel to be deleted meets the deletion condition, executing the steps of deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set.
Step S223: and when the connection channel to be deleted does not meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and maintaining the connection between the connection channel to be deleted and the corresponding micro service node in the service transmitting end and the micro service node set.
In the present embodiment, if it is determined that the connection channel to be deleted satisfies the deletion condition, step S230 is performed, namely, deleting the connection channel to be deleted from the connection channel set, and recreating the connection channel in the connection channel set. If the connection channel to be deleted is judged not to meet the deletion condition, the fact that the service to be processed which is being transmitted on the connection channel to be deleted is not transmitted is not completed yet is indicated, namely the number of the service to be processed which is being transmitted on the connection channel to be deleted is larger than the preset number, and then the connection channel to be deleted needs to be removed from the connection channel set. After the connection channel to be deleted is removed from the connection channel set, connection between the connection channel to be deleted and the corresponding micro service node in the service transmitting end and the micro service node set is still maintained, so that 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 re-outputs the service to be processed, the service to be processed re-output by the service sending end is not transmitted through the connection channel to be deleted. And when the connection channel to be deleted is judged to meet the deletion condition, executing step S230.
According to the technical scheme, the method comprises the steps of judging whether the to-be-deleted connecting channel meets the deleting condition, executing the step of deleting the to-be-deleted connecting channel from the connecting channel set when judging that the to-be-deleted connecting channel meets the deleting condition, creating the connecting channel in the connecting channel set, removing the to-be-deleted connecting channel from the connecting channel set when judging that the to-be-deleted connecting channel does not meet the deleting condition, and maintaining the connection between the to-be-deleted connecting channel and the corresponding micro service node in the service transmitting end and the micro service node set.
As shown in fig. 4, in the third embodiment of the present application, based on the first embodiment, step S240 includes the steps of:
step S241: acquiring micro service nodes in an idle state in the micro service node set; and obtaining address information of the micro service node in the idle state.
In this embodiment, when establishing a connection between a service transmitting end and a micro service node in an idle state in a micro service node set through a created connection channel, it is necessary to obtain the micro service node in the idle state from the micro service node set first, and then obtain address information of the micro service node in the idle state. 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 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 transmitting 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.
In this embodiment, 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 which idle-state micro service node the service transmitting end needs to be connected to through the created connection channel. After the service sending end is connected with the micro service nodes in the idle state through the created connection channel according to the address information of the micro service nodes in the idle state, each micro service node in the idle state is likely to share the service to be processed, which is re-output by the service sending end.
According to the technical scheme, the micro service nodes in the idle state in the micro service node set are acquired, the address information of the micro service nodes in the idle state is acquired, and the service transmitting end is connected with the micro service nodes in the idle state through the established connection channel according to the address information of the micro service nodes in the idle state, so that the micro service nodes in each idle state can play a role in service sharing.
As shown in fig. 5, in the fourth embodiment of the present application, based on the first embodiment, step S240 includes the following steps:
step S250: and when the to-be-processed service output by the service transmitting end is detected, acquiring a connection channel corresponding to the micro-service node in the idle state.
In this embodiment, after a connection between a service sending end and a micro service node in an idle state in a micro service node set is established 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 obtained, and 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 connection channel.
In this embodiment, after a connection channel corresponding to the micro service node in the idle state is acquired, the connection is adopted to transmit the current service to be processed to the micro service node in the idle state, so that the micro service node in the idle state processes the current service to be processed.
According to the technical scheme, when the to-be-processed service output by the service sending end is detected, the connection channel corresponding to the micro-service node in the idle state is obtained, and the to-be-processed service is sent to the micro-service node in the idle state for processing through the connection channel, so that the sharing of the service by the micro-service node in the idle state is realized.
As shown in fig. 6, a connection system of a micro service node provided in the present application includes:
a first obtaining module 310, configured to obtain historical call times and call times thresholds 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 number is greater than a call number 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;
and the connection module 340 is configured to establish a connection between the service sending end and a micro service node in an idle state in the micro service node set through the created connection channel.
Further, the creating module 330 deletes the connection channel to be deleted from the connection channel set, specifically includes:
the judging unit is used for judging whether the connection channel to be deleted meets the deleting condition or not;
and the deleting unit is used for executing the steps of 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 is judged to meet the deleting condition.
Further, the creating module 330 deletes the connection channel to be deleted from the connection channel set, and specifically further includes:
and the removing unit is used for 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 node in the service transmitting end and the micro service node set when the connection channel to be deleted is judged not to meet the deletion condition.
Further, the judging unit includes:
the data acquisition subunit is used for acquiring the service quantity of the service to be processed, which is being transmitted on the connection channel to be deleted;
and the condition judging subunit is used for judging whether the service quantity is smaller than or equal to the preset quantity, wherein if the service quantity is smaller than or equal to the preset quantity, the connection 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 the idle state in the micro service node set;
an address obtaining unit, configured to obtain 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;
the occupancy rate acquisition subunit is used for acquiring the resource occupancy rate 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 micro service 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 transmitting the service to be processed to the micro service node in the idle state for processing through the connection channel.
The specific implementation manner of the connection system of the micro service node is basically the same as that of each embodiment of the connection method of the micro service node, and is not repeated here.
It will be appreciated by those skilled in the art that 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 use of the words first, second, third, etc. do not denote any order. 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. It is therefore intended that the following claims be interpreted as including the 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 modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (9)

1. A method for connecting micro service nodes, which is applied to a container cluster management system, comprising:
acquiring historical calling times and calling times thresholds of all the connecting channels in the connecting channel set;
acquiring a to-be-deleted connection channel of which the historical calling times are larger than a calling times threshold value in the connection channel set;
deleting the connection channel to be deleted from the connection channel set, and creating a connection channel in the connection channel set;
establishing connection between a service transmitting end and micro service nodes in an idle state in a micro service node set through the established connection channel;
when the to-be-processed service output by the service transmitting end is detected, 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 connection channel.
2. The method of claim 1, wherein after the obtaining the connection channels to be deleted in the connection channel set for which the historical call number is greater than the call number threshold, the method comprises:
judging whether the connection channel to be deleted meets the deletion condition or not;
and when the connection channel to be deleted meets the deletion condition, executing the steps of deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set.
3. The method of claim 2, wherein the determining whether the connection channel to be deleted satisfies a deletion condition comprises:
and when the connection channel to be deleted does not meet the deletion condition, removing the connection channel to be deleted from the connection channel set, and maintaining the connection between the connection channel to be deleted and the corresponding micro service node in the service transmitting end and the micro service node set.
4. The method of claim 3, wherein the determining whether the connection channel to be deleted satisfies a deletion condition comprises:
acquiring the service quantity of the service to be processed, which is being transmitted on the connection channel to be deleted;
judging whether the service quantity is smaller than or equal to a preset quantity, wherein if the service quantity is smaller than or equal to the preset quantity, judging that the connection channel to be deleted meets the deletion condition.
5. The method of claim 1, wherein the establishing a connection between the service sender and a micro service node in an idle state in the set of micro service nodes 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 transmitting 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.
6. The method of claim 5, wherein the obtaining the micro service node 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. A connection system for a micro service node, comprising:
the first acquisition module is used for acquiring historical calling times and calling times thresholds of all the connecting channels in the connecting channel set;
the second acquisition module is used for acquiring the to-be-deleted connection channels of which the historical calling times are larger than a calling times threshold value in the connection channel set;
the creation module is used for deleting the connection channel to be deleted from the connection channel set and creating the connection channel in the connection channel set;
the connection module is used for establishing connection between the service transmitting end and the micro service nodes in an idle state in the micro service node set through the established connection channel;
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 transmitting the service to be processed to the micro service node in the idle state for processing through the connection channel.
8. A connection apparatus, characterized by comprising: memory, a processor and a connection program of micro service nodes stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the connection method of micro service nodes according to any of claims 1-6.
9. A storage medium having stored thereon a connection program of micro service nodes, which when executed by a processor, implements the steps of the connection method of micro service nodes of any of claims 1-6.
CN202110074735.9A 2021-01-20 2021-01-20 Connection method, system, equipment and storage medium of micro service node Active CN112860431B (en)

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 CN112860431A (en) 2021-05-28
CN112860431B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
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
CN114928596B (en) * 2022-04-20 2024-06-21 上海昱极科技有限公司 Data transmission method and device in micro-service communication process

Citations (8)

* Cited by examiner, † Cited by third party
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3069475A4 (en) * 2013-11-12 2017-07-05 Pivotal Software, Inc. Streaming event data collection
US10171612B2 (en) * 2015-12-28 2019-01-01 Microsoft Technology Licensing, Llc Caching service with client-enabled routing

Patent Citations (8)

* Cited by examiner, † Cited by third party
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
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)

* Cited by examiner, † Cited by third party
Title
无线Mesh网络负载均衡的蚁群链路权值算法研究;唐菁敏;张伟;周旋;王朝阳;王红彬;;信息技术(第06期);全文 *

Also Published As

Publication number Publication date
CN112860431A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN110808922B (en) Message processing method and device, storage medium and electronic equipment
CN109542614B (en) Resource allocation method, device, terminal and storage medium
CN109101335B (en) Extending functionality of a host device
CN110012328B (en) Method and device for interacting with smart television
CN112860431B (en) Connection method, system, equipment and storage medium of micro service node
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN106658064B (en) Virtual gift display method and device
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
CN109446204B (en) Data storage method and device for instant messaging, electronic equipment and medium
WO2018033463A1 (en) A method for predicting the engagement level of a user of a user device, a related engagement prediction device and user device
CN112291325A (en) Message processing method and device and computer system
CN112256371A (en) Method and device for displaying information and electronic equipment
CN114327846A (en) Cluster capacity expansion method and device, electronic equipment and computer readable storage medium
CN107463395B (en) Component calling method and device
CN109413592B (en) Broadcasting method and mobile terminal
CN107025118B (en) Method and device for ending application program
CN111193805B (en) Resource discovery method and device
CN111367592B (en) Information processing method and device
CN114268799A (en) Streaming media transmission method and device, electronic equipment and medium
CN113852450A (en) Message push feedback method and device, electronic equipment and storage medium
CN111787043A (en) Data request method and device
CN112311840A (en) Multi-terminal data synchronization method, device, equipment and medium
CN111258670B (en) Method and device for managing component data, electronic equipment and storage medium
CN113612676B (en) Social group message synchronization method, device, equipment and storage medium
CN109587291B (en) File stream acceleration communication method, system and 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