CN112422609A - Programming device and service request connection method - Google Patents

Programming device and service request connection method Download PDF

Info

Publication number
CN112422609A
CN112422609A CN202010893163.2A CN202010893163A CN112422609A CN 112422609 A CN112422609 A CN 112422609A CN 202010893163 A CN202010893163 A CN 202010893163A CN 112422609 A CN112422609 A CN 112422609A
Authority
CN
China
Prior art keywords
target
module
routing
service request
grouping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010893163.2A
Other languages
Chinese (zh)
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202010893163.2A priority Critical patent/CN112422609A/en
Publication of CN112422609A publication Critical patent/CN112422609A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a programming device and a service request connection method, wherein the programming device is configured on a server and comprises a grouping module, a configuration management module, a service calling module and a routing module; the grouping module is configured to set a preset grouping strategy for a plurality of servers, wherein each server is a group, and each group of servers comprises at least one connection; the configuration management module is configured to configure a corresponding routing policy for a preset grouping policy, and generate a routing configuration rule; the service calling module is configured to receive a target service request sent by a client, wherein the target service request carries a target grouping strategy; the routing module is configured to determine a target routing path of the target service request according to a target grouping policy and a routing configuration rule in the configuration management module, and determine a target server according to the target routing path.

Description

Programming device and service request connection method
Technical Field
The present application relates to the field of computer technologies, and in particular, to a programming apparatus, a service request connection method, a computing device, and a computer-readable storage medium.
Background
Non-blocking I/o (NIO) is a new function for network transmission performance optimization introduced after java se1.4, and accordingly, the NIO programming framework has been developed for corresponding program development.
In the existing open source NIO programming framework, only one SocketChannel is usually maintained between the client and the server, the SocketChannel is a TCP communication channel for connecting sockets, if a plurality of SocketChannel channels are to be maintained, management needs to be performed by an upper service party, and load balancing maintenance of services in the NIO programming framework is performed by the upper service party, so that workload of the upper service party is increased, and development cost of the upper service party is greatly increased.
Therefore, how to solve the above problems becomes a problem to be faced by the skilled person.
Disclosure of Invention
In view of this, embodiments of the present application provide a programming apparatus, a service request connection method, a computing device, and a computer-readable storage medium, so as to solve the problems in the prior art that service load balancing is implemented by an upper-layer service party, development workload is large, and cost is high.
According to a first aspect of the embodiments of the present application, there is provided a programming apparatus, configured to a server, including a grouping module, a configuration management module, a service invocation module, and a routing module;
the grouping module is configured to set a preset grouping strategy for a plurality of servers, wherein each server is a group, and each group of servers comprises at least one connection;
the configuration management module is configured to configure a corresponding routing policy for a preset grouping policy, and generate a routing configuration rule;
the service calling module is configured to receive a target service request sent by a client, wherein the target service request carries a target grouping strategy;
the routing module is configured to determine a target routing path of the target service request according to a target grouping policy and a routing configuration rule in the configuration management module, and determine a target server according to the target routing path.
According to a second aspect of the embodiments of the present application, there is provided a service request connection method, applied to a programming device, including:
receiving a target service request sent by a client, wherein the target service request carries a target grouping strategy;
determining a target routing path for the target service request according to the target grouping strategy and a preset routing configuration rule;
and determining a target server according to the target routing path, and forwarding the target service request to the target server.
According to a third aspect of embodiments herein, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the service request connection method when executing the instructions.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the service request connection method.
The programming device provided by the embodiment of the application comprises a grouping module, a configuration management module, a service calling module and a routing module; the grouping module is configured to set a preset grouping strategy for a plurality of servers, wherein each server is a group, each group of servers comprises at least one connection, in the programming device, the servers are divided into a plurality of groups, and each group of servers can contain a plurality of connections; the configuration management module is configured to configure a corresponding routing policy for a preset grouping policy, generate a routing configuration rule, and configure a routing policy for each grouping policy in advance, so as to improve the efficiency of determining a routing path, and the service invocation module is configured to receive a target service request sent by a client, wherein the target service request carries the target grouping policy; the routing module is configured to determine a target routing path of the target service request according to a target grouping policy and a routing configuration rule in the configuration management module, and determine a target server according to the target routing path. According to the programming device, the target service request sent by the client carries the target grouping strategy, the target routing strategy corresponding to the target grouping strategy can be determined according to the preset routing configuration rule, then the target routing path is determined through the target routing strategy, the target server is further determined, through setting the grouping strategy and the routing strategy, service load balance is achieved in the programming device, the upper-layer service only needs to send the service request, and the development workload and the development cost of an upper-layer service party are reduced.
Drawings
FIG. 1 is a schematic block diagram of a programming apparatus according to an embodiment of the present disclosure;
FIG. 2 is a functional diagram of a programming device provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a single set of multiple connection grouping policies in a programming device provided by an embodiment of the present application;
FIG. 4 is a diagram illustrating multiple groups of multi-connection grouping policies in a programming apparatus according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a service request connection method provided in an embodiment of the present application;
fig. 6 is an interaction diagram of a service request connection method provided in an embodiment of the present application;
fig. 7 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the one or more embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the present application. As used in one or more embodiments of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments of the present application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first aspect may be termed a second aspect, and, similarly, a second aspect may be termed a first aspect, without departing from the scope of one or more embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present invention relate are explained.
NIO: the non-blocking I/O is a new function for optimizing network transmission efficiency after Java SE1.4 edition.
Reactor mode: the Reactor mode, an event design mode that handles one or more client concurrent delivery service requests, uses the I/O multiplex side rate when the requests arrive, and then dispatches the requests synchronously to the relevant request handlers.
NIO programming framework: a non-blocking programming framework implemented in Reactor mode.
Service request: requests related to upper layer services, such as write requests, read requests, etc.
And (3) service events: events corresponding to the service request, such as write events corresponding to the write request, and read events corresponding to the read request.
A single set of single connections: a communication connection is established between the client and a server.
A single set of multiple connections: a plurality of communication connections are established between the client and one server.
Multiple groups of single connections: the client and the servers are respectively connected in a communication mode.
Multi-group multi-connection: a plurality of communication connections are respectively established between the client and the plurality of servers.
In the present application, a programming apparatus, a service request connection method, a computing device, and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.
In the following, a programming device provided in an embodiment of the present application is further explained with reference to fig. 1 and fig. 2, fig. 1 shows a schematic structural diagram of the programming device provided in an embodiment of the present application, and fig. 2 shows a schematic functional diagram of the programming device provided in an embodiment of the present application, where underlying functions of the programming device include configuration management, timeout management, event processing, and multiple reactors, and upper functions of the programming device include protocol configuration, reconnection management, service invocation, packet management, and request response.
As shown in fig. 1, the programming device 100 includes a grouping module 102, a configuration management module 104, a service invocation module 106, and a routing module 108;
the grouping module 102 is configured to set a preset grouping policy for a plurality of servers, where each server is a group, and each group includes at least one connection.
In the programming device provided by the application, each server is a group, a plurality of servers are a plurality of groups, and a plurality of connections between the client and each group of servers can be provided.
Specifically, the grouping policy may be divided into a single group of single connection, a single group of multiple connections, a plurality of groups of single connections, a plurality of groups of multiple connections, a broadcast connection, and the like according to the connection condition between the client and the server.
The single group of single connections is a connection channel between a client and a group of servers.
The single-group multi-connection is a plurality of connection channels between a client and a group of servers, and referring to fig. 3, fig. 3 shows a schematic diagram of the single-group multi-connection between the client and the server provided by the present application.
The multiple groups of single connections are formed by keeping connection between the client and the multiple groups of servers, and a connection channel is formed between the client and each group of servers.
The multiple-group multiple-connection is a connection between the client and the multiple-group server, and there are multiple connection channels with each group of server, see fig. 4, and fig. 4 shows a schematic diagram of the multiple-group multiple-connection between the client and the server provided by the present application.
In one embodiment, the programming apparatus provided in the present application, the connection between the client and the server is a long connection, such as a TCP long connection.
TCP is a connection-oriented and reliable byte stream service, a client and a server need to establish a TCP connection before data interaction, the TCP connection needs three-way handshake, the client sends a segment of message to the server to indicate that the connection is to be established with the server, the server immediately replies that the client agrees to establish the connection after receiving the message, the client sends a segment of message to the server to indicate that the connection is to be confirmed, and the client is finally connected with the server after three-way information transmission.
Each TCP connection only has two endpoints, and there is a one-to-one communication between the two endpoints, and data is transmitted in a byte stream manner, so that the transmission efficiency of each TCP connection is fixed within a certain time, for example, if the transmission speed of the TCP connection between the client and the server is 10K/S, if a 1000K file is transmitted, it takes 100S time to complete the transmission.
The single-group multi-connection and the multi-group multi-connection included in the grouping strategy set in the grouping module of the application mean that when the client establishes connection with the server, multiple connections can be established with the group server, for example, in the single-group multi-connection, 5 long TCP connections are established between the client and the server, the transmission speed of each long TCP connection is 10K/S, if a 1000K file is transmitted, and the file is transmitted simultaneously through the 5 long TCP connections, the transmission can be completed within 20S, the transmission time is saved, and the data transmission efficiency is greatly improved.
In a specific embodiment provided by the present application, taking an example that a game developer needs to update a game, the game provides a plurality of servers, and the game developer needs to update the plurality of servers synchronously at a time, so that a selected multi-group single-connection form can be used to connect and communicate with each group of servers, and further, in order to improve communication efficiency, a selected multi-group multi-connection form can also be used to connect and communicate with each group of servers, thereby further improving data transmission efficiency.
In another embodiment provided by the present application, taking a user logging in a server as an example, the user can select a server to log in at a login interface, and a single-group connection is adopted because a large data file does not need to be transferred in the login operation.
In another specific embodiment provided by the present application, taking the user playing a game logout server as an example, when the user logs out of the game, a logout notification needs to be sent to friends in the game, for example, "your friends have already logged out of the game", and at this time, a grouping policy of broadcast connection may be selected, and the logout notification is notified to each group of servers in a broadcast manner, so as to achieve the purpose of no missing message.
The grouping module 102 corresponds to a grouping management function in the upper layer function shown in fig. 2, and is configured to divide the servers into groups, where each group of servers may establish multiple connections with the client.
The configuration management module 104 is configured to configure a corresponding routing policy for a preset grouping policy, and generate a routing configuration rule.
The programming modules provided by the present application also include a configuration-rich configuration management module. According to the practical application condition, a developer configures a corresponding routing strategy for each grouping strategy in advance, and in the practical application, the routing strategy comprises the following steps: one of a random routing policy, a round robin routing policy, a least active number policy, a consistent hashing policy, and a dynamic configuration policy.
For example, a random routing policy is configured for a single-group single-connection grouping policy, a consistent hash policy is distributed for a plurality of-group multi-connection grouping policies, a minimum active number policy is configured for a single-group multi-connection grouping policy, and the like.
Optionally, the configuration management module is further configured to:
under the condition of receiving a custom configuration parameter, configuring a corresponding routing strategy for each preset grouping strategy according to the custom configuration parameter; or
And under the condition that the self-defined configuration parameters are not received, configuring a corresponding routing strategy for each preset grouping strategy according to the default configuration parameters.
In practical application, the programming device can configure the corresponding routing strategy for each grouping strategy by using the default configuration parameters in advance, so that a user can use the routing strategy directly, the working efficiency of the user is improved, meanwhile, the programming device also provides a self-defined configuration interface, the user can input the self-defined configuration parameters, and the programming device configures the corresponding routing strategy for each grouping strategy according to the self-defined configuration parameters, so that the user can conveniently perform personalized customization according to the self service requirement and the actual application condition, and the working efficiency of the user is further improved.
The configuration management module 104 corresponds to a configuration management function in the bottom layer function shown in fig. 2, and the configuration management module may also be used for reading, writing, dispatching a thread model, receiving a Buffer model of a message, setting a timeout threshold, setting a Mertic, and the like.
The service invoking module 106 is configured to receive a target service request sent by a client, where the target service request carries a target grouping policy.
In practical application, service requests sent by a client to a server, such as a read request, a write request, a transmission request, a connection request and the like, are all sent to a service calling module, when the client sends a read request, the read request is a target service request, and when the client sends a transmission request, the transmission request is a target service request. The target service request carries a target grouping strategy corresponding to the target service request.
Optionally, the service invoking module is further configured to:
providing a corresponding service calling interface according to the grouping strategy in the grouping module;
and receiving a target service request sent by a client through the service calling interface.
In practical application, the service invoking module further provides a service invoking interface to the outside, specifically, for a grouping policy of the programming device, the service invoking module provides a corresponding service invoking interface according to a grouping policy preset in the grouping module, for example, a single group of single connection interfaces are provided for a grouping policy of a single group of single connection, a plurality of groups of single connection interfaces are provided for a grouping policy of a plurality of groups of single connection, and so on, each grouping policy corresponds to one service invoking interface one by one, when a user needs to use a certain grouping policy, the corresponding service invoking interface is invoked, a target service request is sent to the server through the service invoking interface, and a corresponding target grouping policy is determined at the same time.
The service calling module 106 corresponds to a service calling function in the upper layer function shown in fig. 2, and the service calling module may also be used to support multiple service calling modes, such as synchronous, asynchronous + listener, and oneway.
The routing module 108 is configured to determine a target routing path of the target service request according to a target grouping policy and a routing configuration rule in the configuration management module, and determine a target server according to the target routing path.
In practical application, after a target service request is sent to a programming device, the routing module determines a corresponding target routing policy according to a target grouping policy in the target service request and a good routing configuration rule pre-configured in the configuration management module, determines a target routing path of the target service request through the target routing policy, and determines a corresponding target server after determining the target routing path.
Optionally, the programming apparatus further includes: a reactor module;
the reactor module is configured to process the target service request and trigger a target service event corresponding to the target service request.
And after the target server is determined, forwarding the target service request to the target server, receiving the target service request by a reactor module in the target server, sending the target service request to a corresponding processing program synchronously by using an I/O (input/output) multiplexing strategy, and triggering a target service event corresponding to the target service request.
The reactor module corresponds to the reactor in the bottom level function shown in fig. 2 for management of each reactor instance, wherein each reactor includes a selector, a channel, and a buffer.
Optionally, the programming apparatus further includes: an event processing module;
the event processing module is configured to process the target business event triggered by the reactor management module.
The event processing module corresponds to an event processing function in the underlying function shown in fig. 2, and the event processing module is a core of the programming apparatus and is configured to process events occurring in the programming apparatus, such as an accept event, a connection event, a read event, a write event, a timeout event, and a node state change event.
Optionally, the programming apparatus further includes: a request response module;
and the request response module is configured to return a processing result of the target business event.
The request response module corresponds to a request response function in the upper layer function shown in fig. 2, and is configured to set a corresponding request processor for each request, and return a processing result of the target service event.
Optionally, the programming apparatus further includes: the system comprises an overtime management module, a protocol configuration module and a reconnection management module;
the timeout management module is configured to manage a timeout task in the programming device;
the timeout management module corresponds to the timeout management function in the bottom layer function shown in fig. 2, and is configured to manage Channel idle and timeout tasks and upper layer service timeout tasks.
The protocol configuration module is configured to configure a communication protocol corresponding to the service;
the protocol configuration module corresponds to a protocol configuration function in the upper layer function shown in fig. 2, and is used for flexibly customizing a communication protocol and realizing an encoding and decoding interface.
The reconnection management module is configured to reestablish the connection with the client when the client is disconnected from the server;
the reconnection management module corresponds to a reconnection management function in the upper layer functions shown in fig. 2, and can automatically repair and reconnect the client when the network connection is abnormally disconnected.
The programming device provided by the embodiment of the application comprises a grouping module, a configuration management module, a service calling module and a routing module; the grouping module is configured to set a preset grouping strategy for a plurality of servers, wherein each server is in a group, each group of servers comprises at least one connection, common grouping connection conditions are set as the preset grouping strategy in advance, the configuration management module is convenient to configure a corresponding routing strategy to generate a routing configuration rule according to the grouping strategy, the service calling module is also convenient to provide a corresponding service calling interface according to the grouping strategy and receive a target service request sent by a client, after the target service request arrives, the routing module determines a target routing path according to the target grouping strategy and the routing configuration rule carried in the target service request to further determine a target server, the programming device realizes server grouping management in the programming device and then realizes service load balancing through the routing configuration rule, the functions of grouping and routing can be completed only by receiving the service request sent by the client, the programming device realizes service load balancing, the workload of an upper-layer service party does not need to be increased, the use is more friendly and convenient, and the working efficiency is improved.
Referring to fig. 5, fig. 5 is a flowchart illustrating a service request connection method provided in an embodiment of the present application, where the method is applied to a programming device, and specifically includes the following steps 502 to 506:
step 502: receiving a target service request sent by a client, wherein the target service request carries a target grouping strategy.
In practical application, the programming device receives a target service request sent by a client, where the target service request may be a login request, a logout request, a file transfer request, and the like, and the target service request is a service request sent by the client to a server.
And carrying the corresponding target grouping strategy in the target service request. Specifically, the programming device configures different service invocation interfaces for the preset grouping policy, the upper-layer service party can select different service invocation interfaces to invoke the service, and when a certain service invocation interface is selected, the corresponding target grouping policy is selected.
Optionally, before receiving the target service request sent by the client, the method further includes:
setting a preset grouping strategy for a plurality of servers; and configuring a corresponding routing strategy for the preset grouping strategy, and generating a preset routing configuration rule.
Specifically, the grouping policy includes one of a single group of single connections, a single group of multiple connections, a plurality of groups of single connections, a plurality of groups of multiple connections, and a broadcast connection.
The routing policy includes: one of a random routing policy, a round robin routing policy, a least active number policy, a consistent hashing policy, and a dynamic configuration policy.
In practical application, the programming device sets different grouping policies, specifically, a single group of single connection, a single group of multiple connections, a multiple group of single connections, a multiple group of multiple connections, broadcast connections, and the like, according to actual use conditions, and a target grouping policy is carried in a target connection request sent by a client each time.
After determining the target grouping policy, the programming device may also configure a corresponding service invocation interface for each grouping policy, such as providing a single set of single connection interfaces for a single set of single connections, providing a single set of multiple connection interfaces for a single set of multiple connections, and so on.
Meanwhile, the programming device also sets a corresponding routing strategy according to each grouping strategy to generate a routing configuration rule, the programming device has default setting parameters, the corresponding routing strategy is set for each grouping strategy, the programming device can also receive the self-defined setting parameters of an upper-layer service party, and the corresponding relation between the grouping strategy and the routing strategy is set by the upper-layer service party in a self-defined mode, so that the flexible mobility of the programming device is improved, and the use experience of the upper-layer service party is improved.
In the embodiment provided by the application, taking the upper-layer service party as an example of a game manufacturer, the game manufacturer needs to update game patches in 50 servers, the size of the game patches to be updated is 50M, in order to not affect the game experience of a user, the 50 servers are updated in 5 times, 10 servers are updated each time, the game manufacturer selects multiple groups of multi-connection interfaces provided by the programming device, and sends a game update request through the multiple groups of multi-connection interfaces, so that multiple groups of multi-connection grouping strategies are carried in the game update request.
Step 504: and determining a target routing path for the target service request according to the target grouping strategy and a preset routing configuration rule.
In the embodiment provided by the application, following the above example, the routing configuration rule set by the game manufacturer in advance is a consistent hash policy that is a routing policy corresponding to a plurality of groups of multi-connection grouping policies, and a routing policy corresponding to a game update request is determined to be a consistent hash policy, first, 10 entry label routing paths are determined from 50 servers as routing paths updated for the first time, after the update is completed, 10 entry label routing paths are determined from the remaining 40 servers as routing paths updated for the second time, and so on until all servers are completely updated.
Step 506: and determining a target server according to the target routing path, and forwarding the target service request to the target server.
In the embodiment provided by the application, following the above example, 10 corresponding servers are determined according to the first determined 10 entry label routing paths, the game update request is forwarded to the 10 servers, meanwhile, the transmission of the game patch is performed, after the transmission is finished, the game update of the 10 servers is completed, then, a second 10 servers are determined according to the second determined 10 entry label routing paths, and the game update step is continuously executed until the game patch is transmitted to all the servers to complete the game update.
The service request connection method provided by the embodiment of the application is applied to a programming device, and receives a target service request sent by a client, wherein the target service request carries a target grouping strategy; determining a target routing path for the target service request according to the target grouping strategy and a preset routing configuration rule; and determining a target server according to the target routing path, forwarding the target service request to the target server, sending the service request to a programming device without paying more attention to the distribution of service load balance by an upper-layer service party, determining the target server by the programming device according to a grouping strategy of the upper-layer service party and a corresponding routing strategy, forwarding the service request to the target server to finish the service request, realizing service load balance in the programming device, reducing the development pressure and the development cost of the upper-layer service party, and greatly improving the working efficiency of the upper-layer service party.
In the following, taking user login as an example, and further explaining the service request connection method provided by the present application with reference to fig. 6, fig. 6 shows an interaction diagram of the service request connection method provided by the embodiment of the present application, which includes the following steps:
step 602: the client sends a login request, wherein the login request carries a target grouping strategy.
In the embodiment provided by the present application, taking the example that the login request carries the single-group connection grouping policy, the target grouping policy is the single-group connection grouping policy.
Step 604: and determining a target routing strategy according to a preset routing configuration rule and a target grouping strategy, and determining a routing path.
In the embodiment provided by the present application, following the above example, if the routing policy corresponding to the single group of single connection grouping policy in the preset routing configuration rule is a random routing policy, the target routing policy is determined to be the random routing policy according to the preset routing configuration rule and the single group of single connection grouping policy, and the routing path is determined according to the random routing policy.
Step 606: and returning the routing path to the client.
Step 608: and the client sends the login request to the target server according to the routing path.
Step 610: and the server receives the login request, completes the login operation and returns the processing result to the client.
The service request connection method provided by the embodiment of the application is applied to a programming device, the upper-layer service party does not need to pay more attention to the distribution of service load balancing, only the service request needs to be sent to the programming device, the programming device determines the target server according to the grouping strategy of the upper-layer service party and the corresponding routing strategy, and forwards the service request to the target server to complete the service request, so that the service load balancing is realized in the programming device, the development pressure and the development cost of the upper-layer service party are reduced, and the working efficiency of the upper-layer service party is greatly improved.
FIG. 7 shows a block diagram of a computing device 700, according to an embodiment of the present application. The components of the computing device 700 include, but are not limited to, memory 710 and a processor 720. Processor 720 is coupled to memory 710 via bus 730, and database 750 is used to store data.
Computing device 700 also includes access device 740, access device 740 enabling computing device 700 to communicate via one or more networks 760. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 740 may include one or more of any type of network interface, e.g., a Network Interface Card (NIC), wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the application, the above-described components of the computing device 700 and other components not shown in fig. 7 may also be connected to each other, for example, by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 7 is for purposes of example only and is not limiting as to the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 700 may also be a mobile or stationary server.
Wherein processor 720 is configured to execute the computer-executable instructions that when executed by the processor implement the steps of the service request connection method.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the service request connection method described above belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the service request connection method described above.
An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, the method for requesting connection of service requests according to the foregoing embodiments is implemented.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the service request connection method belong to the same concept, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the service request connection method.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical applications, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (11)

1. A programming device is characterized in that the programming device is configured on a server and comprises a grouping module, a configuration management module, a service calling module and a routing module;
the grouping module is configured to set a preset grouping strategy for a plurality of servers, wherein each server is a group, and each group of servers comprises at least one connection;
the configuration management module is configured to configure a corresponding routing policy for a preset grouping policy, and generate a routing configuration rule;
the service calling module is configured to receive a target service request sent by a client, wherein the target service request carries a target grouping strategy;
the routing module is configured to determine a target routing path of the target service request according to a target grouping policy and a routing configuration rule in the configuration management module, and determine a target server according to the target routing path.
2. The programming apparatus of claim 1, wherein the configuration management module is further configured to:
under the condition of receiving a custom configuration parameter, configuring a corresponding routing strategy for each preset grouping strategy according to the custom configuration parameter; or
And under the condition that the self-defined configuration parameters are not received, configuring a corresponding routing strategy for each preset grouping strategy according to the default configuration parameters.
3. The programming apparatus of claim 1 or 2, wherein the service invocation module is further configured to:
providing a corresponding service calling interface according to the grouping strategy in the grouping module;
and receiving a target service request sent by a client through the service calling interface.
4. The programming apparatus according to claim 1 or 2, further comprising: a reactor module;
the reactor module is configured to process the target service request and trigger a target service event corresponding to the target service request.
5. The programming apparatus of claim 4, further comprising: an event processing module;
the event processing module is configured to process the target business event triggered by the reactor management module.
6. The programming apparatus of claim 5, further comprising: a request response module;
and the request response module is configured to return a processing result of the target business event.
7. The programming apparatus according to claim 1 or 2, further comprising: the system comprises an overtime management module, a protocol configuration module and a reconnection management module;
the timeout management module is configured to manage a timeout task in the programming device;
the protocol configuration module is configured to configure a communication protocol corresponding to the service;
the reconnection management module is configured to reestablish the connection with the client when the client is disconnected from the server.
8. A service request connection method is applied to a programming device and comprises the following steps:
receiving a target service request sent by a client, wherein the target service request carries a target grouping strategy;
determining a target routing path for the target service request according to the target grouping strategy and a preset routing configuration rule;
and determining a target server according to the target routing path, and forwarding the target service request to the target server.
9. The service request connection method according to claim 8, before receiving the target service request sent by the client, further comprising:
setting a preset grouping strategy for a plurality of servers;
and configuring a corresponding routing strategy for the preset grouping strategy, and generating a preset routing configuration rule.
10. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 8-9 when executing the instructions.
11. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 8 to 9.
CN202010893163.2A 2020-08-31 2020-08-31 Programming device and service request connection method Pending CN112422609A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010893163.2A CN112422609A (en) 2020-08-31 2020-08-31 Programming device and service request connection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010893163.2A CN112422609A (en) 2020-08-31 2020-08-31 Programming device and service request connection method

Publications (1)

Publication Number Publication Date
CN112422609A true CN112422609A (en) 2021-02-26

Family

ID=74854226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010893163.2A Pending CN112422609A (en) 2020-08-31 2020-08-31 Programming device and service request connection method

Country Status (1)

Country Link
CN (1) CN112422609A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112968975A (en) * 2021-03-31 2021-06-15 中国建设银行股份有限公司 Service request processing method and device
CN113472875A (en) * 2021-06-28 2021-10-01 深信服科技股份有限公司 Connection multiplexing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301709A1 (en) * 2007-05-30 2008-12-04 Bela Ban Queuing for thread pools using number of bytes
US20160285975A1 (en) * 2014-05-21 2016-09-29 Societal Innovations Ipco Limited System and method for aggregating and acting on signals from one or more remote sources in real time using a configurable platform instance
US10469362B1 (en) * 2015-09-30 2019-11-05 Amazon Technologies, Inc. Network routing utilization of application programming interfaces
CN110505269A (en) * 2019-06-21 2019-11-26 广州虎牙科技有限公司 Transaction processing system, method for processing business and server
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301709A1 (en) * 2007-05-30 2008-12-04 Bela Ban Queuing for thread pools using number of bytes
US20160285975A1 (en) * 2014-05-21 2016-09-29 Societal Innovations Ipco Limited System and method for aggregating and acting on signals from one or more remote sources in real time using a configurable platform instance
US10469362B1 (en) * 2015-09-30 2019-11-05 Amazon Technologies, Inc. Network routing utilization of application programming interfaces
CN110505269A (en) * 2019-06-21 2019-11-26 广州虎牙科技有限公司 Transaction processing system, method for processing business and server
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112968975A (en) * 2021-03-31 2021-06-15 中国建设银行股份有限公司 Service request processing method and device
CN113472875A (en) * 2021-06-28 2021-10-01 深信服科技股份有限公司 Connection multiplexing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9503957B2 (en) Low cost mesh network capability
US11172530B2 (en) Communication establishment method and terminal
US11336734B1 (en) System and method for aggregating communication connections
CN110808948B (en) Remote procedure calling method, device and system
US20140029474A1 (en) Voip service with streamlined conferencing options
CN102137032B (en) Cloud message system and cloud message transmitting and receiving method
CN113556359B (en) Communication protocol conversion method, device, system and gateway device
JP6988973B2 (en) System processing using OPC UA, communication method using OPC UA, and load balancer
CN110234140A (en) A kind of communication means, device, entity and storage medium
JP2005518016A (en) Method and apparatus for reconfiguring server system
CN115022318A (en) Message publishing method and system based on micro-service architecture
CN112422609A (en) Programming device and service request connection method
CN114884880A (en) Data transmission method and system
CN115918044A (en) Method and apparatus for dynamic and efficient load balancing in a mobile communication network
GB2514093A (en) Receiving a communication event
CN114710496B (en) Multi-node load balancing method and device
CN114598739B (en) Cloud application-based communication channel processing method, device and system
Husnjak et al. Relevant affect factors of smartphone mobile data traffic
CN102316142A (en) Method for realizing p2p-based remote video education
CN112417349B (en) Programming device and network state monitoring method
CN101557309A (en) Network configuration method, client, server and communication system thereof
US11418928B1 (en) Duplicate message management
CN114928635B (en) Micro-service calling method and related equipment
CN110049071A (en) Network data exchange control method, device and terminal
US9667512B2 (en) Providing and resolving an IP address for swarm-based services

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210226

RJ01 Rejection of invention patent application after publication