CN112583721A - Service request routing method, device and medium - Google Patents

Service request routing method, device and medium Download PDF

Info

Publication number
CN112583721A
CN112583721A CN202011378408.4A CN202011378408A CN112583721A CN 112583721 A CN112583721 A CN 112583721A CN 202011378408 A CN202011378408 A CN 202011378408A CN 112583721 A CN112583721 A CN 112583721A
Authority
CN
China
Prior art keywords
routing
service request
preset
ratio
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011378408.4A
Other languages
Chinese (zh)
Other versions
CN112583721B (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.)
May 8 Home Co ltd
Original Assignee
May 8 Home 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 May 8 Home Co ltd filed Critical May 8 Home Co ltd
Priority to CN202011378408.4A priority Critical patent/CN112583721B/en
Publication of CN112583721A publication Critical patent/CN112583721A/en
Application granted granted Critical
Publication of CN112583721B publication Critical patent/CN112583721B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The embodiment of the invention provides a method, equipment and medium for routing a service request. The method comprises the following steps: receiving a plurality of service requests from a requester device; generating a corresponding service request set based on the plurality of service requests; calculating the routing path of each service request in the service request set in real time by adopting a discrete variance algorithm according to the preset routing ratio corresponding to the service request set; and distributing each service request to a target routing node appointed by the routing path of each service request. The method adopts a discrete variance algorithm to calculate the routing path of each service request in the service request set in real time according to the preset routing ratio corresponding to the service request set, and can distribute each service request to a target routing node appointed by the routing path of each service request according to the preset routing ratio, thereby avoiding the waste of network resources and realizing more accurate service request routing.

Description

Service request routing method, device and medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, a device, and a medium for routing a service request.
Background
In the communication process, multiple transmission paths are usually provided between network devices, and a routing algorithm can be used to select an optimal path and transmit information from a sending end device to a receiving device through the optimal path.
Taking a test scenario as an example, in order to test the online effect of different service schemes, the service request needs to be routed according to different ratios. At present, the average routing algorithm and the existing layered routing algorithm cannot realize routing processing with accurate ratio, and the testing effect is influenced.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, and a medium for routing a service request, so as to implement more accurate routing processing.
In a first aspect, an embodiment of the present invention provides a method for routing a service request, where the method includes:
receiving a service request from a requesting device;
inquiring a routing node container to obtain a routing path of the service request, wherein the routing node container stores a plurality of routing nodes corresponding to the service request, the plurality of routing nodes respectively correspond to a plurality of servers, the plurality of routing nodes are obtained according to a preset routing ratio, and the routing path is used for indicating a target routing node for processing the service request;
and distributing the service request to a target routing node specified by the routing path.
Further optionally, obtaining the plurality of routing nodes according to a preset routing ratio includes:
determining a plurality of servers for processing the service request;
acquiring a preset routing ratio corresponding to the service request, wherein the preset routing ratio refers to the ratio of the service requests expected to be carried by each of the plurality of servers;
and virtualizing the plurality of servers into a plurality of corresponding routing nodes in the routing node container according to the preset routing ratio.
Further optionally, virtualizing, in the routing node container, the plurality of servers into a corresponding plurality of routing nodes according to a preset routing ratio, where the virtualizing includes:
and virtualizing the servers into a plurality of corresponding routing nodes by adopting a discrete variance algorithm according to a preset routing ratio, and storing the routing nodes obtained by the virtualization into a routing node container.
Further optionally, assigning the service request to a target routing node specified by the routing path includes:
and calculating the server address corresponding to the target routing node in real time according to a preset calculation rule, and distributing the service request to the target routing node corresponding to the server address.
In a second aspect, an embodiment of the present invention provides a method for routing a service request, where the method includes:
receiving a plurality of service requests from a requester device;
generating a corresponding service request set based on the plurality of service requests;
calculating the routing path of each service request in the service request set in real time by adopting a discrete variance algorithm according to the preset routing ratio corresponding to the service request set, wherein the routing path of each service request is used for indicating a target routing node for processing each service request, and the target routing node of each service request corresponds to each server;
and distributing each service request to a target routing node appointed by the routing path of each service request.
Further optionally, the method further comprises:
counting response results based on the service request set in a preset time period;
and correspondingly processing each service request in the service request set according to the response result.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores executable codes, and when the executable codes are executed by the processor, the processor is enabled to implement at least the method for routing a service request in the first aspect.
In a fourth aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores executable codes, and when the executable codes are executed by the processor, the processor is enabled to implement at least the method for routing a service request in the second aspect.
An embodiment of the present invention further provides a system, including a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the above-described service request routing method.
Embodiments of the present invention further provide a computer-readable medium having stored thereon at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement a method for routing service requests as described above.
In the technical solution provided in the embodiment of the present invention, a service request from a requesting device is received, and a routing node container is queried to obtain a routing path of the service request, where the routing node container stores a plurality of routing nodes corresponding to the service request, the plurality of routing nodes respectively correspond to a plurality of servers, and the routing path is used to indicate a target routing node for processing the service request. Because the plurality of routing nodes are obtained according to the preset routing ratio, the plurality of service requests can be distributed to the target routing node appointed by the routing path according to the preset routing ratio, thereby avoiding the waste of network resources and realizing more accurate routing distribution.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a service request routing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another service request routing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention 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, and "a plurality" typically includes at least two.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.
In the communication process, multiple transmission paths are usually provided between network devices, and a routing algorithm can be used to select an optimal path and transmit information from a sending end device to a receiving device through the optimal path.
Taking a test scenario as an example, in order to test the online effect of different service schemes, the service request needs to be routed according to different ratios. At present, the average routing algorithm and the existing layered routing algorithm cannot realize routing processing with accurate ratio, and the testing effect is influenced. Routing the service request to different service schemes easily causes network resource waste and also affects the test effect. Therefore, how to implement a routing scheme becomes a technical problem to be solved urgently.
In view of the above technical problems, in some embodiments of the present invention, a solution is provided, and the technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
First, to solve at least one technical problem, a core idea of a service request routing scheme provided in an embodiment of the present invention is:
the method comprises the steps of firstly receiving a plurality of service requests from requesting equipment, generating a corresponding service request set based on the service requests, adopting a discrete variance algorithm to calculate the routing path of each service request in the service request set in real time according to the preset routing ratio corresponding to the service request set, wherein the routing path of each service request is used for indicating a target routing node for processing each service request, and the target routing node of each service request corresponds to each server, so that each service request is distributed to the target routing node appointed by the routing path of each service request, the waste of network resources is avoided, and more accurate service request routing is realized.
Based on the core idea, taking a test scenario as an example, the service request routing scheme can perform routing distribution on each service request according to a preset routing ratio, so that network resource waste can be avoided, more accurate routing distribution service can be provided, and the test effect is improved.
The routing scheme of the service request provided by the embodiment of the invention is suitable for various routing scenes. In practical application, the routing scheme of the service request is suitable for a routing request distribution scene among different server programs in a test point city, a request routing distribution scene for verifying different versions in the same server and the like.
Based on the basic ideas and the applicable scenarios described above, an embodiment of the present invention provides a service request routing method, and fig. 1 is a schematic flow diagram of a service request routing method provided in an exemplary embodiment of the present invention, as shown in fig. 1, the method includes:
101. a service request is received from a requestor device.
102. And inquiring a routing node container to obtain a routing path of the service request, wherein the routing node container stores a plurality of routing nodes corresponding to the service request, the plurality of routing nodes respectively correspond to the plurality of servers, the plurality of routing nodes are obtained according to a preset routing ratio, and the routing path is used for indicating a target routing node for processing the service request.
103. And distributing the service request to a target routing node specified by the routing path.
The above steps may be performed by a server device, for example, a server. The server may be a physical server including an independent host, or may also be a virtual server carried by a host cluster, or may also be a cloud server.
In order to make the routing distribution result more accurate, optionally, an optional implementation manner of obtaining the plurality of routing nodes according to the preset routing ratio is as follows:
determining a plurality of servers for processing the service request; acquiring a preset routing ratio corresponding to the service request; and virtualizing the plurality of servers into a plurality of corresponding routing nodes in the routing node container according to the preset routing ratio.
The preset routing ratio refers to a ratio of service requests that the plurality of servers respectively expect to carry. Alternatively, the routing ratios required for the various service requests may be planned in advance.
For example, the route ratio to be planned may be dynamically calculated according to the processing results or implementation effects of various service requests. In practical application, the processing result or the implementation effect of the service request can be implemented in a point burying mode, and the certainty of the routing rule is verified by adopting a relevant program statistical tool.
In the above steps, for example, assume that a plurality of servers for processing service requests are server a and server b, and assume that the preset routing ratio of server a and server b is 7: based on the above assumptions, obtaining a preset routing ratio corresponding to the service request as 7:3 (server a and server b), virtualizing the server a and the server b into a plurality of corresponding routing nodes respectively in the routing node container according to a preset routing ratio, that is, the ratio of the number of the routing nodes corresponding to the server a and the server b is 7: 3.
in the above steps, in order to improve the accuracy of the routing ratio, the blurring process may be implemented by using a discrete variance algorithm. The specific principle is that the larger the variance calculated based on the discrete variance algorithm is, the larger the discrete degree is, and the closer the variance is to the statistical expectation value is. Thus, the greater the degree of dispersion, the more contributing to the improvement of the achievement effect of the preset routing ratio.
Further optionally, according to the preset routing ratio, an optional implementation manner of virtualizing the plurality of servers into the corresponding plurality of routing nodes in the routing node container is as follows: and virtualizing the servers into a plurality of corresponding routing nodes by adopting a discrete variance algorithm according to a preset routing ratio, and storing the routing nodes obtained by the virtualization into a routing node container.
Specifically, according to a preset routing ratio, a discrete variance algorithm is adopted to calculate continuity variance variables corresponding to a plurality of servers as a plurality of routing nodes, and the plurality of routing nodes are injected into a routing node container. In fact, whatever discrete variance algorithm is adopted, the essential purpose is to make the multiple routing nodes have a stronger degree of dispersion so as to be closer to the statistical expectation value and improve the accuracy of route distribution.
Based on the above-described routing node container, the following describes the steps of the service request routing method exemplarily provided in fig. 1:
in 101, a service request is received from a requesting device.
102, the routing node container is queried to obtain the routing path of the service request.
In the above steps, for example, it is continuously assumed that the plurality of servers for processing the service request are server a and server b, and the preset routing ratio of server a and server b is 7: 3. it is assumed that the routing node container stores therein a plurality of routing nodes corresponding to the service requests, and the plurality of routing nodes correspond to a plurality of servers, respectively. Based on this, the ratio of the number of routing nodes corresponding to server a to the number of routing nodes corresponding to server b is 7: 3.
Based on the above assumption, after receiving a service request from a requester device in 101, a routing node container is queried, and a target routing node corresponding to the service request is selected from a plurality of routing nodes to obtain a routing path indicating the target routing node.
Therefore, the routing nodes corresponding to the servers are created according to the preset routing ratio, so that the steps can distribute the service requests to the routing nodes according to the preset routing ratio through the routing node container, and more accurate routing distribution is realized.
Furthermore, in 103, an optional implementation manner of allocating the service request to the target routing node specified by the routing path is as follows:
and acquiring a server address corresponding to the target routing node according to a preset calculation rule, and distributing the service request to the target routing node corresponding to the server address.
Continuing with the above example, according to a preset calculation rule, calculating a server address corresponding to the target routing node in real time, and distributing the received service request to the target routing node corresponding to the server address. Thus, the routing distribution of the service request is realized.
In the routing method for a service request provided in the foregoing embodiment, the service request from a requesting device is received, and a routing node container is queried to obtain a routing path of the service request, where the routing node container stores a plurality of routing nodes corresponding to the service request, the plurality of routing nodes respectively correspond to a plurality of servers, and the routing path is used to indicate a target routing node for processing the service request. Because the plurality of routing nodes are obtained according to the preset routing ratio, the plurality of service requests can be distributed to the target routing node designated by the routing path according to the preset routing ratio, and more accurate routing distribution is realized.
In addition to the service request routing method provided in the foregoing embodiment, the present invention also provides a service request routing method, which will be exemplarily described below.
Fig. 2 is a flowchart illustrating a service request routing method according to an exemplary embodiment of the present invention, and as shown in fig. 2, the method includes:
201. receiving a plurality of service requests from a requester device;
202. generating a corresponding service request set based on the plurality of service requests;
203. calculating the routing path of each service request in the service request set in real time by adopting a discrete variance algorithm according to the preset routing ratio corresponding to the service request set, wherein the routing path of each service request is used for indicating a target routing node for processing each service request, and the target routing node of each service request corresponds to each server;
204. and distributing each service request to a target routing node appointed by the routing path of each service request.
In the above steps, first, a plurality of service requests from a requesting device are received, a corresponding service request set is generated based on the plurality of service requests, then, a discrete variance algorithm is adopted to calculate the routing path of each service request in the service request set in real time according to the preset routing ratio corresponding to the service request set, and finally, each service request can be distributed to a target routing node designated by the routing path of each service request according to the preset routing ratio, so that the waste of network resources is avoided, and more accurate service request routing is realized.
Further optionally, the response result based on the service request set in the preset time period is counted, and each service request in the service request set is correspondingly processed according to the response result.
For example, it is assumed that the above steps are performed by the server device, and based on this, after the server device receives a plurality of service requests provided by a plurality of requester devices, a corresponding service request set is generated based on the plurality of service requests. Therefore, the service request set is sent to a service provider device set composed of a plurality of service provider devices (e.g., servers), and a timer is used to start timing, so that within a preset time period timed by the timer, the response results of the service provider devices to the service request set are counted, and the service requests provided by the requester devices are processed correspondingly according to the response results to the service request set.
Therefore, in the service request popularization process, corresponding processing can be timely performed according to the response result, network resource waste is avoided, and precision and efficiency are improved.
In the routing method for the service request provided in the above embodiment, the routing path of each service request in the service request set can be calculated in real time by using the discrete variance algorithm according to the preset routing ratio corresponding to the service request set, so that each service request can be allocated to the target routing node specified by the routing path of each service request according to the preset routing ratio, thereby avoiding network resource waste and realizing more accurate service request routing.
It should be noted that the execution subjects of the steps of the methods provided in the above embodiments may be the same device, or different devices may be used as the execution subjects of the methods. For example, the execution subjects of steps 101 to 103 may be device a; for another example, the execution subject of steps 101 and 102 may be device a, and the execution subject of step 103 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 101, 102, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel.
It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
Fig. 3 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present invention, where the electronic device is configured to execute a method for routing a service request according to the foregoing embodiments.
As shown in fig. 3, the electronic apparatus includes: memory 301, processor 302, and communication component 303.
The memory 301 is used for storing computer programs and may be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
A processor 302, coupled to the memory 301, for executing the computer program in the memory 301 to: receiving a service request from a requesting device; inquiring the routing node container to obtain a routing path of the service request; and distributing the service request to a target routing node specified by the routing path.
The routing node container stores a plurality of routing nodes corresponding to the service request, the routing nodes respectively correspond to the servers, the routing nodes are obtained according to a preset routing ratio, and the routing path is used for indicating a target routing node for processing the service request.
Further optionally, the processor 302 is further configured to: determining a plurality of servers for processing the service request; acquiring a preset routing ratio corresponding to the service request, wherein the preset routing ratio refers to the ratio of the service requests expected to be carried by each of the plurality of servers; and virtualizing the plurality of servers into a plurality of corresponding routing nodes in the routing node container according to the preset routing ratio.
Further optionally, when the processor 302 virtualizes a plurality of servers into a plurality of corresponding routing nodes in the routing node container according to a preset routing ratio, the processor is specifically configured to:
and virtualizing the servers into a plurality of corresponding routing nodes by adopting a discrete variance algorithm according to a preset routing ratio, and storing the routing nodes obtained by the virtualization into a routing node container.
Further optionally, when the processor 302 allocates the service request to the target routing node specified by the routing path, the service request is specifically configured to:
and calculating the server address corresponding to the target routing node in real time according to a preset calculation rule, and distributing the service request to the target routing node corresponding to the server address.
Further, as shown in fig. 3, the electronic device further includes: display component 304, power component 305, audio component 306, and the like. Only some of the components are schematically shown in fig. 3, and it is not meant that the electronic device comprises only the components shown in fig. 3.
The memory 301 may be implemented, among other things, by any type of volatile or non-volatile storage device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
Wherein the communication component 303 is configured to facilitate communication between the device in which the communication component is located and other devices in a wired or wireless manner. The device in which the communication component is located may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may be implemented based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The display assembly 304 includes a screen, which may include a liquid crystal display assembly (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The power supply assembly 305 provides power to various components of the device in which the power supply assembly is located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
In this embodiment, a service request from a requesting device is received, a routing node container is queried to obtain a routing path of the service request, where the routing node container stores a plurality of routing nodes corresponding to the service request, the plurality of routing nodes respectively correspond to a plurality of servers, and the routing path is used to indicate a target routing node for processing the service request. Because the plurality of routing nodes are obtained according to the preset routing ratio, the plurality of service requests can be distributed to the target routing node appointed by the routing path according to the preset routing ratio, thereby avoiding the waste of network resources and realizing more accurate routing distribution.
In addition to the execution logic described in the foregoing embodiments, the electronic device shown in fig. 3 may be further configured to execute the following service request routing logic: the processor 302 is configured to: receiving a plurality of service requests from a requesting device; generating a corresponding service request set based on the plurality of service requests; calculating the routing path of each service request in the service request set in real time by adopting a discrete variance algorithm according to the preset routing ratio corresponding to the service request set, wherein the routing path of each service request is used for indicating a target routing node for processing each service request, and the target routing node of each service request corresponds to each server; and distributing each service request to a target routing node appointed by the routing path of each service request.
Further optionally, the processor 302 is further configured to: counting response results based on the service request set in a preset time period; and correspondingly processing each service request in the service request set according to the response result.
Based on the implementation mode, the routing path of each service request in the service request set can be calculated in real time by adopting a discrete variance algorithm according to the preset routing ratio corresponding to the service request set, so that each service request can be distributed to the target routing node appointed by the routing path of each service request according to the preset routing ratio, the waste of network resources is avoided, and more accurate routing of the service request is realized.
Accordingly, the embodiment of the present invention further provides a computer-readable storage medium storing a computer program, where the computer program can implement the steps that can be executed by the electronic device in the above method embodiments when executed.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A method for routing a service request, comprising:
receiving a plurality of service requests from a requester device;
generating a corresponding service request set based on the plurality of service requests;
calculating a routing path of each service request in the service request set in real time by adopting a discrete variance algorithm according to a preset routing ratio corresponding to the service request set, wherein the routing path of each service request is used for indicating a target routing node for processing each service request, the target routing node of each service request corresponds to each server, and the preset routing ratio refers to the ratio of the service requests expected to be carried by each server;
and distributing each service request to a target routing node appointed by the routing path of each service request.
2. The method of claim 1, further comprising:
counting response results based on the service request set in a preset time period;
and correspondingly processing each service request in the service request set according to the response result.
3. A method for routing a service request, comprising:
receiving a service request from a requesting device;
querying a routing node container to obtain a routing path of the service request, wherein the routing node container stores a plurality of routing nodes corresponding to the service request, the plurality of routing nodes respectively correspond to a plurality of servers, the plurality of routing nodes are obtained according to a preset routing ratio, and the routing path is used for indicating a target routing node for processing the service request;
and distributing the service request to a target routing node specified by the routing path.
4. The method of claim 3, wherein deriving the plurality of routing nodes according to a preset routing ratio comprises:
determining a plurality of servers for processing the service request;
acquiring a preset routing ratio corresponding to the service request, wherein the preset routing ratio refers to the ratio of the service requests expected to be carried by each of the plurality of servers;
and virtualizing a plurality of servers into a plurality of corresponding routing nodes in the routing node container according to the preset routing ratio.
5. The method of claim 4, wherein the virtualizing a plurality of servers into a corresponding plurality of routing nodes in the routing node container according to the preset routing ratio comprises:
and virtualizing a plurality of servers into a plurality of corresponding routing nodes by adopting a discrete variance algorithm according to the preset routing ratio, and storing the plurality of routing nodes obtained by the virtualization into the routing node container.
6. The method of claim 3, wherein said assigning the service request to a target routing node specified by the routing path comprises:
and acquiring a server address corresponding to the target routing node according to a preset calculation rule, and distributing the service request to the target routing node corresponding to the server address.
7. An electronic device, comprising: a memory, a processor; wherein the memory has stored thereon executable code which, when executed by the processor, causes the processor to perform a method of routing a service request as claimed in any one of claims 1 to 2.
8. A computer readable medium having stored thereon at least one instruction, at least one program, a set of codes or a set of instructions, which is loaded and executed by a processor to implement the method of routing a service request according to any of claims 1 to 2.
9. An electronic device, comprising: a memory, a processor; wherein the memory has stored thereon executable code which, when executed by the processor, causes the processor to perform a method of routing a service request as claimed in any of claims 3 to 6.
10. A computer readable medium having stored thereon at least one instruction, at least one program, a set of codes or a set of instructions, which is loaded and executed by a processor to implement the method of routing a service request according to any of claims 3 to 6.
CN202011378408.4A 2020-11-30 2020-11-30 Service request routing method, device and medium Active CN112583721B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011378408.4A CN112583721B (en) 2020-11-30 2020-11-30 Service request routing method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011378408.4A CN112583721B (en) 2020-11-30 2020-11-30 Service request routing method, device and medium

Publications (2)

Publication Number Publication Date
CN112583721A true CN112583721A (en) 2021-03-30
CN112583721B CN112583721B (en) 2023-04-18

Family

ID=75126847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011378408.4A Active CN112583721B (en) 2020-11-30 2020-11-30 Service request routing method, device and medium

Country Status (1)

Country Link
CN (1) CN112583721B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1245614A (en) * 1996-12-13 2000-02-23 艾利森电话股份有限公司 Dynamic traffic distribution
CN101355492A (en) * 2007-07-27 2009-01-28 华为技术有限公司 Routing method and system for access protocol of simple objects as well as relevant equipment
CN101651598A (en) * 2008-08-12 2010-02-17 华为技术有限公司 Method and device for allocating network resources
CN102143042A (en) * 2010-07-09 2011-08-03 华为技术有限公司 Virtual cluster router system and flow sharing method thereof, controller and sub routers
CN102821044A (en) * 2012-07-27 2012-12-12 北京奇虎科技有限公司 Method and device for configuring server cluster
US20150139028A1 (en) * 2013-11-18 2015-05-21 Huawei Technologies Co., Ltd. Method for controlling generation of routing information, method for generating routing information and apparatuses thereof
CN105049353A (en) * 2015-07-28 2015-11-11 华为技术有限公司 Method for configuring routing path of business and controller
US20160142310A1 (en) * 2014-11-13 2016-05-19 At&T Intellectual Property I, L.P. Methods and apparatus to route traffic in a virtual private network
CN106789707A (en) * 2016-11-28 2017-05-31 北京邮电大学 A kind of software definition Packet Transport Network overall situation service dynamic optimization method and device
CN107431968A (en) * 2015-12-30 2017-12-01 华为技术有限公司 A kind of method for establishing routing table, electronic equipment and network
CN107770096A (en) * 2017-12-11 2018-03-06 国网河南省电力公司信息通信公司 A kind of SDN/NFV network dynamic resource allocation algorithms based on load balancing
CN108076158A (en) * 2018-01-08 2018-05-25 苏州大学 Minimum load route selection method and system based on Naive Bayes Classifier
CN110347596A (en) * 2019-07-02 2019-10-18 腾讯科技(深圳)有限公司 A kind of test method, device, system, electronic equipment and medium
CN110557289A (en) * 2019-09-17 2019-12-10 中国人民解放军战略支援部队信息工程大学 Network architecture supporting configuration and service response method
CN110891021A (en) * 2018-09-11 2020-03-17 中兴通讯股份有限公司 Path calculation method and device and computer readable storage medium
CN111092814A (en) * 2019-12-02 2020-05-01 中国联合网络通信集团有限公司 Service handling request message distribution method and equipment
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium
CN111901409A (en) * 2020-07-24 2020-11-06 山东海量信息技术研究院 Load balancing implementation method and device of virtualized cloud platform and readable storage medium

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1245614A (en) * 1996-12-13 2000-02-23 艾利森电话股份有限公司 Dynamic traffic distribution
CN101355492A (en) * 2007-07-27 2009-01-28 华为技术有限公司 Routing method and system for access protocol of simple objects as well as relevant equipment
CN101651598A (en) * 2008-08-12 2010-02-17 华为技术有限公司 Method and device for allocating network resources
CN102143042A (en) * 2010-07-09 2011-08-03 华为技术有限公司 Virtual cluster router system and flow sharing method thereof, controller and sub routers
CN102821044A (en) * 2012-07-27 2012-12-12 北京奇虎科技有限公司 Method and device for configuring server cluster
US20150139028A1 (en) * 2013-11-18 2015-05-21 Huawei Technologies Co., Ltd. Method for controlling generation of routing information, method for generating routing information and apparatuses thereof
US20160142310A1 (en) * 2014-11-13 2016-05-19 At&T Intellectual Property I, L.P. Methods and apparatus to route traffic in a virtual private network
CN105049353A (en) * 2015-07-28 2015-11-11 华为技术有限公司 Method for configuring routing path of business and controller
CN107431968A (en) * 2015-12-30 2017-12-01 华为技术有限公司 A kind of method for establishing routing table, electronic equipment and network
CN106789707A (en) * 2016-11-28 2017-05-31 北京邮电大学 A kind of software definition Packet Transport Network overall situation service dynamic optimization method and device
CN107770096A (en) * 2017-12-11 2018-03-06 国网河南省电力公司信息通信公司 A kind of SDN/NFV network dynamic resource allocation algorithms based on load balancing
CN108076158A (en) * 2018-01-08 2018-05-25 苏州大学 Minimum load route selection method and system based on Naive Bayes Classifier
CN110891021A (en) * 2018-09-11 2020-03-17 中兴通讯股份有限公司 Path calculation method and device and computer readable storage medium
CN110347596A (en) * 2019-07-02 2019-10-18 腾讯科技(深圳)有限公司 A kind of test method, device, system, electronic equipment and medium
CN110557289A (en) * 2019-09-17 2019-12-10 中国人民解放军战略支援部队信息工程大学 Network architecture supporting configuration and service response method
CN111092814A (en) * 2019-12-02 2020-05-01 中国联合网络通信集团有限公司 Service handling request message distribution method and equipment
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium
CN111901409A (en) * 2020-07-24 2020-11-06 山东海量信息技术研究院 Load balancing implementation method and device of virtualized cloud platform and readable storage medium

Also Published As

Publication number Publication date
CN112583721B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
US9929913B2 (en) Automatic finding and sharing of IoT connected devices
JP2020173778A (en) Method, apparatus, electronic facility, computer readable medium, and computer program for allocating resource
US20180189163A1 (en) Optimizing Adaptive Monitoring in Resource Constrained Environments
CN104579768A (en) Client upgrading method and device
CN110442610A (en) The method, apparatus of load balancing calculates equipment and medium
CN109254913B (en) Device sharing method and device, electronic device and computer storage medium
US10282120B2 (en) Method, apparatus and system for inserting disk
CN115118784A (en) Computing resource scheduling method, device and system
CN109428682A (en) A kind of Message Processing confirmation method and device
EP4006725A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
CN112583721B (en) Service request routing method, device and medium
JP2021170319A (en) Method and device for acquiring information
CN106571935B (en) Resource scheduling method and equipment
CN109542775B (en) Test script generation and execution method and device
CN113778547B (en) Object processing method, device, computer program product and processor
CN105511959A (en) Method and device for distributing virtual resource
CN108023920B (en) Data packet transmission method, equipment and application interface
CN111967938B (en) Cloud resource recommendation method and device, computer equipment and readable storage medium
CN114489985A (en) Data processing method, device and storage medium
CN113300982B (en) Resource allocation method, device, system and storage medium
CN111435320B (en) Data processing method and device
CN114189457A (en) Cloud resource display and processing method, equipment and storage medium
CN112507193A (en) Data updating method, device, equipment and storage medium
CN110874268B (en) Data processing method, device and equipment
CN108572871B (en) Resource allocation method and device, electronic equipment and storage medium

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