CN110347509B - Service framework access system, service request processing method, device and medium - Google Patents

Service framework access system, service request processing method, device and medium Download PDF

Info

Publication number
CN110347509B
CN110347509B CN201910611384.3A CN201910611384A CN110347509B CN 110347509 B CN110347509 B CN 110347509B CN 201910611384 A CN201910611384 A CN 201910611384A CN 110347509 B CN110347509 B CN 110347509B
Authority
CN
China
Prior art keywords
service
module
service request
load balancing
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910611384.3A
Other languages
Chinese (zh)
Other versions
CN110347509A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910611384.3A priority Critical patent/CN110347509B/en
Publication of CN110347509A publication Critical patent/CN110347509A/en
Application granted granted Critical
Publication of CN110347509B publication Critical patent/CN110347509B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • 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

Abstract

The embodiment of the disclosure discloses a service framework access system, a service request processing method, a device and a medium, wherein the system comprises: the cloud dynamic acceleration module is used for linking the service request to a network which is directly led to the load balancing module from the attribution according to the attribution of the received service request so as to send the service request to the load balancing module through the network; the load balancing module is used for acquiring the IP address information of each service machine in the main service module, determining the service machine corresponding to the received service request according to a preset load balancing strategy and distributing the received service request to the corresponding service machine; and the main service module comprises at least one service machine and is used for bearing a service instance so as to respond to the received service request through the service instance. The technical scheme of the embodiment of the disclosure provides a service framework access system capable of flexibly expanding and reducing capacity.

Description

Service framework access system, service request processing method, device and medium
Technical Field
The present disclosure relates to application software data processing technologies, and in particular, to a service framework access system, a service request processing method, a device, and a medium.
Background
With the wide use of intelligent terminals, various application software is continuously updated. A list page (commonly referred to as Feed page) is a common interface presentation form in the existing application software client. Because the Feed pages of some application software clients show the interestingness of the content and the accuracy of content recommendation, the interest and hobbies of each user are perfectly met, a large number of fan users are attracted, and the fan users are enabled to be refreshed. Thus, Feed pages of some application clients need to carry huge daily data. Therefore, the Feed page of the application software client bears most of the advertising income of each application software developer, and a small Feed accident may bring huge economic loss to the developer and also influence the customer experience. Therefore, the stability of the application client Feed page is very important.
The overall architecture of Feed includes an access layer and a service layer. The access layer is used for routing the received Feed stream service request to one of the deployed service machines, and the service machine processes the Feed stream service request. The security and the stability of the access layer have great influence on the overall performance of the whole Feed architecture, and how to improve the security and the stability of the access layer is a problem to be solved in the prior art.
Disclosure of Invention
The embodiment of the disclosure provides a service framework access system, a service request processing method, equipment and a medium, so as to provide a service framework access system capable of flexibly expanding and reducing capacity.
In a first aspect, an embodiment of the present disclosure provides a service framework access system, including:
the cloud dynamic acceleration module is connected with the load balancing module and used for linking the service request to a network which is directly led to the load balancing module from a home location according to the home location of the received service request so as to send the service request to the load balancing module through the network;
the load balancing module is connected with the main service module and used for acquiring IP (Internet Protocol) address information of each service machine in the main service module, determining the service machine corresponding to the received service request according to a preset load balancing strategy and distributing the received service request to the corresponding service machine;
and the main service module comprises at least one service machine and is used for bearing a service instance so as to respond to the received service request through the service instance.
Further, the load balancing module includes: an external load balancing unit and an internal load balancing unit; wherein the content of the first and second substances,
the external load balancing unit is respectively connected with the cloud dynamic acceleration module and the internal load balancing unit, and is used for receiving the service request forwarded by the cloud dynamic acceleration module and sending the received service request to the internal load balancing unit;
the internal load balancing unit is connected with the main service module and used for acquiring IP address information of each service machine in the main service module, determining the service machine corresponding to the received service request according to a preset load balancing strategy and distributing the received service request to the corresponding service machine.
Further, the pair of internal load balancing units is specifically configured to:
acquiring IP address information of each service machine in the main service module from a service discovery module according to a preset frequency;
comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list to add the newly online IP address information to the IP address list and delete the offline IP address information in the IP address list;
determining the IP address of the business machine corresponding to the service request from the IP address list according to a preset load balancing strategy;
distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine;
when the service machine in the main service module is restarted, the IP address information of the current service machine is registered to the service discovery module.
Further, the intra-pair load balancing unit is further connected to a standby service module, and configured to forward the received service request to the standby service module when the main service module fails, so as to respond to the service request through the standby service module.
Further, when the service request is a Feed stream service request, the standby service module is specifically configured to:
reading target information from a local file through a loaded Feedstandby service instance;
taking the target information as response information corresponding to the Feed stream service request;
and the target information of the local file is synchronously acquired from the local file of the main service module based on kafka service.
Further, the main service module is further configured to carry a bottom-pocketed service of a service instance, and when the service instance cannot work normally, respond to the service request through the bottom-pocketed service;
wherein the bottom-pocket service and the business service instance have the same service function.
Further, the main service module is specifically configured to:
reading target information from a local file through a bottom-pocketing service;
taking the target information as response information corresponding to the service request;
and caching the acquired response information to the local file based on a set rule when the response information is successfully acquired through the business service instance each time.
In a second aspect, an embodiment of the present disclosure further provides a service request processing method, which is applied to the service framework access system in the first aspect, where the method includes:
linking, by a dynamic cloud acceleration module, a service request to a network which is directly led to a load balancing module from a home location according to the home location of the received service request, so as to send the service request to the load balancing module through the network;
determining a business machine corresponding to the received service request according to a preset load balancing strategy through a load balancing module, and distributing the received service request to the corresponding business machine;
and responding to the service request through the service instance carried by the service machine.
Further, the determining, by the load balancing module, a service machine corresponding to the received service request according to a preset load balancing policy, and distributing the received service request to the corresponding service machine includes:
receiving the service request forwarded by the cloud dynamic acceleration module through an external load balancing unit, and sending the received service request to the internal load balancing unit;
and receiving the service request sent by the external load balancing unit through the internal load balancing unit, determining a service machine corresponding to the service request according to a preset load balancing strategy based on the acquired IP address information of each service machine in the main service module, and distributing the service request to the corresponding service machine.
Further, the determining, based on the obtained IP address information of each service machine in the main service module, a service machine corresponding to the service request according to a preset load balancing policy and distributing the service request to the corresponding service machine includes:
determining the IP address of the business machine corresponding to the service request from the IP address list according to a preset load balancing strategy;
distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine;
the internal load balancing unit acquires IP address information of each service machine in the main service module from the service discovery module according to a preset frequency; comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list to add the newly online IP address information to the IP address list and delete the offline IP address information in the IP address list; and when the service machine in the main service module is restarted, registering the IP address information of the current service machine to the service discovery module.
Further, the method further comprises: when the main service module fails, the received service request is forwarded to a standby service module through the internal load balancing unit, so that the service request is responded through the standby service module.
Further, when the service request is a Feed stream service request, the responding to the Feed stream service request by the standby service module includes:
reading target information from a local file through a Feedstandby service instance borne by a standby service module;
taking the target information as response information corresponding to the Feed stream service request;
and the target information of the local file is synchronously acquired from the local file of the main service module based on kafka service.
Further, the method further comprises: when the business service instance can not work normally, responding to the service request through the bottom-pocketed service carried by the main business module;
wherein the bottom-pocket service and the business service instance have the same service function.
Further, responding to the service request through the bottom-pocket service carried by the main service module includes:
reading target information from a local file through a bottom-pocketing service;
taking the target information as response information corresponding to the service request;
and caching the acquired response information to the local file based on a set rule when the response information is successfully acquired through the business service instance each time.
In a third aspect, an embodiment of the present disclosure further provides a terminal device, where the terminal device includes:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the service request processing method according to the embodiment of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processing device, implements the service request processing method according to the disclosed embodiments.
According to the business framework access system provided by the embodiment of the disclosure, the cloud dynamic acceleration module is arranged and used for linking the service request to the network which is directly communicated with the load balancing module from the attribution according to the attribution of the received service request, so that the purpose of accelerating the received service request is realized, the time delay of the service request is reduced, and the service request can quickly reach the service end to be responded; the load balancing module is connected with the main service module and used for acquiring the IP address information of each service machine in the main service module, determining the service machine corresponding to the received service request according to a preset load balancing strategy and distributing the received service request to the corresponding service machine, so that the IP address information of each service machine in the main service module is automatically updated, the capacity expansion or reduction of the system according to the service requirement is facilitated, the operation and maintenance cost is reduced, the purpose of evenly distributing the received service request to each service machine according to the load balancing strategy is realized, and the stability of the system is improved.
Drawings
Fig. 1 is a schematic structural diagram of a service framework access system according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a service framework access system according to a second embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a service framework access system provided in a third embodiment of the present disclosure;
fig. 4 is a schematic flowchart of a service request processing method according to a fourth embodiment of the present disclosure;
fig. 5 is a schematic flowchart of a service request processing method according to a fifth embodiment of the present disclosure;
fig. 6 is a schematic diagram of a hardware structure of a terminal device according to a sixth embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not limiting of the disclosure. It should be further noted that, for the convenience of description, only some of the structures relevant to the present disclosure are shown in the drawings, not all of them.
In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution.
Example one
Fig. 1 is a schematic structural diagram of a service framework access system according to a first embodiment of the present disclosure. The system can be applied to the condition that the service request sent by the client is accessed to the server. Referring to fig. 1, the system specifically includes: the cloud dynamic acceleration module 110, the load balancing module 120 and the main service module 130;
the cloud dynamic acceleration module 110 is connected to the load balancing module 120, and configured to link the service request to a network that is directly connected to the load balancing module 120 from a home location of the received service request according to the home location of the service request, so as to send the service request to the load balancing module 120 through the network. Specifically, the service request may be sent by a user through a client, where the attribution of the service request specifically refers to a location where the user sends the service request, for example, if the user sends a video display request through an application client for displaying an interesting video on a mobile phone in city a, the attribution of the video display request is city a. When a user sends a service request through a client, the cloud dynamic acceleration module 110 receives the service request, and links the service request to a network which is from the home location to the load balancing module 120 according to the home location of the service request, so as to send the service request to the load balancing module 120 through the network, and the purpose is to enable the service request to reach the load balancing module 120 through the fastest route, so as to reduce the delay of the service request reaching the service end to be responded, and achieve the effect that the user can see the response immediately after sending the service request, for example, the user can immediately see the corresponding video displayed by the client after sending the video display request.
Many operators of application clients do not have the capability of distributing network nodes and servers in each city, and usually only distribute servers in more developed cities. Therefore, some service requests sent by such application clients in remote areas are usually forwarded to the service end through common routes of some operators, and due to the turnover of network transmission, the service requests reach the service end with a certain delay. However, at present, an operator with relatively strong capital is provided with its own network node in each city, and for this reason, the service framework access system provided in this embodiment is additionally provided with the cloud dynamic acceleration module 110, configured to link the service request to the preset network node of the home location according to the home location of the service request, where the preset network node specifically refers to the network node of the operator provided with its own network node in each city, and link the service request to the network that goes from the home location to the service end through the preset network node, so as to achieve the purpose of quickly sending the service request to the service end. For example, the service end is arranged in the o city, if a service request sent by a user in the a city goes through a common route, the service request needs to be routed from the a city to the b city first, and then routed from the b city to the service end in the o city, and if the service request reaches the service end in the o city through a route through which the a city directly reaches the o city through the cloud dynamic acceleration module 110 provided in this embodiment, the delay time for sending the service request to the service end can be reduced. It is understood that the IP address of the server is written in advance to the preset network node.
And a load balancing module 120, connected to the main service module 130, configured to obtain IP address information of each service machine in the main service module 130, determine a service machine corresponding to the received service request according to a preset load balancing policy, and distribute the received service request to the corresponding service machine.
Specifically, the load balancing module 120 obtains the IP address information of each service machine in the main service module 130 from the service discovery module according to the preset frequency; comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list, adding newly online IP address information to the IP address list, and deleting offline IP address information in the IP address list, wherein when the service machine is restarted, the IP address information of the current service machine is automatically registered to the service discovery module, so that the aim of automatically updating the configuration of the service machine is fulfilled, the number of the service machines can be increased or reduced at will according to service requirements, the configuration of each service machine does not need to be manually updated, the operation and maintenance cost of the system is reduced, and the flexibility of capacity expansion and reduction of the system is increased. The service discovery module may specifically be a service discovery framework built based on consul. The above "IP address information of new line" and "IP address information of dropped line" are exemplified: assume that the IP address information of each service machine in the IP address list stored by the load balancing module 120 includes: 1,2 and 3; the IP address information of each service machine acquired from the service discovery module at the current time includes 2, 3 and 4, then the IP address information 4 is newly online IP address information, and the IP address information 1 is offline IP address information. It should be noted that, in this embodiment, each service machine bears the same service instance as an example, so the IP address list only needs to record the IP address information of each service machine, and does not need to record the service function of the service instance corresponding to each service machine. If the service instances carried by the service machines are different, the service functions corresponding to the service instances need to be recorded in the IP address list, and further the IP address information of the service machines carrying the service instances is correspondingly recorded.
Further, the load balancing module 120 is further configured to determine, according to a preset load balancing policy, an IP address of a service machine corresponding to the service request from the IP address list; and distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine. For example, the policy for balancing in charge may be an alternate policy, for example, there are three service machines, and the corresponding IP addresses are 1,2, and 3, respectively, so that the first service request is distributed to the service machine with the IP address 1, the second service request is distributed to the service machine with the IP address 2, the third service request is distributed to the service machine with the IP address 3, and the fourth service request is distributed to the service machine with the IP address 1 … …. By evenly distributing the service requests to all the service machines, the condition that a large number of service requests are concentrated on one service machine to cause the crash of the service machine due to overlarge pressure can be avoided, and the overall stability of the system is improved.
The main service module 130 includes at least one service machine, and is configured to carry a service instance, so as to respond to the received service request through the service instance. The business service instance specifically refers to logic code that responds to a received service request.
According to the service framework access system provided by the embodiment of the disclosure, the purpose of accelerating the received service request is realized by arranging the cloud dynamic acceleration module, so that the time delay of the service request is reduced, and the service request can quickly reach the server to be responded; by arranging the load balancing module, the automatic updating of the IP address information of each service machine in the main service module is realized, the system can be expanded or reduced randomly according to the service requirements, the operation and maintenance cost is reduced, the purpose of evenly distributing the received service requests to each service machine is realized, and the stability of the system is improved.
Example two
Fig. 2 is a schematic structural diagram of a service framework access system according to a second embodiment of the present disclosure. The embodiment is embodied on the basis of each alternative in the above embodiments, and provides an optional service framework access system, specifically, a load balancing module is split into an external load balancing unit and an internal load balancing unit, where the external load balancing unit is responsible for being docked with a cloud dynamic acceleration module, and the internal load balancing unit is responsible for being docked with a main service module, and by setting the main service module and the cloud dynamic acceleration module in an isolated manner, a risk that the main service module is exposed to a public network is reduced, and security of the system is improved. Referring to fig. 2, the system specifically includes:
a cloud dynamic acceleration module 210, an external load balancing unit 221, an internal load balancing unit 222 and a main service module 230;
the cloud dynamic acceleration module 210 is connected to the external load balancing unit 221, and configured to link the service request to a network that is directly routed from the home location to the external load balancing unit 221 according to the home location of the received service request, so as to send the service request to the external load balancing unit 221 through the network.
The external load balancing unit 221 is connected to the internal load balancing unit 222, and is configured to receive the service request forwarded by the cloud dynamic acceleration module 210, and send the received service request to the internal load balancing unit 222. Specifically, the internal load balancing unit 222 generally includes a plurality of service machines, and the external load balancing unit 221 averagely sends the received service request to the service machine of the internal load balancing unit 222 based on a certain policy, where the policy may be an alternate policy described in the above embodiment, or a policy that realizes load balancing by combining hash operation.
It should be noted that another important role of the external load balancing unit 221 is to isolate the internal load balancing unit 222 from the cloud dynamic acceleration module 210, so as to improve the security of the system. The principle of the cloud dynamic acceleration module 210 for accelerating the service request depends on the public network of the operator who has distributed its own network nodes in each city, so if the load balancing module 120 storing the IP address information of each service machine of the main service module 230 is directly connected to the cloud dynamic acceleration module 210, the main service module 230 is easily exposed, damaged or attacked, and thus the security of the system is not high. By splitting the load balancing module 120 into the external load balancing unit 221 and the internal load balancing unit 222, wherein the external load balancing unit 221 is responsible for being connected with the cloud dynamic acceleration module 210 in a butt joint mode, and the internal load balancing unit 222 is responsible for being connected with the main service module 230 in a butt joint mode, the internal load balancing unit 222 and the cloud dynamic acceleration module 210, which store the IP address information of each service machine of the main service module 230, are arranged in an isolated mode, the risk that the main service module 230 is exposed to the public network is reduced, and the security of the system is improved. Further, the external load balancing unit 221 may further set a Service program for preventing DDoS (Distributed Denial of Service) attacks, so as to further improve the security of the system.
The internal load balancing unit 222 is connected to the main service module 230, and is configured to obtain IP address information of each service machine in the main service module 230, determine a service machine corresponding to the received service request according to a preset load balancing policy, and distribute the received service request to the corresponding service machine.
Illustratively, the intra-pair load balancing unit 222 is specifically configured to:
acquiring IP address information of each service machine in the main service module from a service discovery module according to a preset frequency;
comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list to add the newly online IP address information to the IP address list and delete the offline IP address information in the IP address list;
determining the IP address of the business machine corresponding to the service request from the IP address list according to a preset load balancing strategy;
distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine;
when the service machine in the main service module is restarted, the IP address information of the current service machine is registered to the service discovery module.
The main service module 230 includes at least one service machine, and is configured to carry a service instance, so as to respond to the received Feed stream service request through the service instance.
Further, the main service module 230 is further configured to carry a bottom-of-pocket service of a service instance, and when the service instance cannot work normally, respond to the service request through the bottom-of-pocket service; wherein the bottom-pocket service and the business service instance have the same service function.
Illustratively, when the service instance cannot work normally, the main service module 230 is specifically configured to: reading target information from a local file through a bottom-pocketing service;
taking the target information as response information corresponding to the service request;
and caching the acquired response information to the local file based on a set rule when the response information is successfully acquired through the business service instance each time. The local file specifically refers to a disk file of a service machine bearing a service instance.
Further, caching the acquired response information to the local file based on a set rule, including:
randomly determining information of a preset proportion from the acquired response information;
and caching the determined information to the local file.
For example, 2% of the obtained response information is cached in the local file, and the 2% of the obtained response information can be randomly determined from the obtained response information, aiming at ensuring the most basic service function of the system.
According to the technical scheme, on the basis of the embodiment, the load balancing module is divided into the external load balancing unit and the internal load balancing unit, wherein the external load balancing unit is in charge of being in butt joint with the cloud dynamic acceleration module, and the internal load balancing unit is in charge of being in butt joint with the main service module, so that the internal load balancing unit and the cloud dynamic acceleration module which store IP address information of each service machine of the main service module are arranged in an isolated mode, the risk that the main service module is exposed to a public network is reduced, and the safety of the system is improved; the bottom pocket service of the business service instance is deployed in the main business module, so that the purpose of responding to the service request through the bottom pocket service when the business service instance cannot work normally is achieved, and the stability of the system is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an access system in a service framework according to a third embodiment of the present disclosure. The present embodiment is embodied on the basis of the optional solutions in the foregoing embodiments, and provides an optional service framework access system, specifically, a standby service module is additionally provided, and is configured to forward a received service request to the standby service module when the main service module fails, so as to respond to the service request through the standby service module, and further improve stability of the system. Referring to fig. 3, the system specifically includes:
the system comprises a cloud dynamic acceleration module 310, an external load balancing unit 321, an internal load balancing unit 322, a main service module 330 and a standby service module 340;
the cloud dynamic acceleration module 310 is connected to the external load balancing unit 321, and configured to link the service request to a network that is directly routed from the home location to the external load balancing unit 321 according to the home location of the received service request, so as to send the service request to the external load balancing unit 321 through the network.
The external load balancing unit 321 is connected to the internal load balancing unit 322, and is configured to receive the service request forwarded by the cloud dynamic acceleration module 310, and send the received service request to the internal load balancing unit 322.
The internal load balancing unit 322 is connected to the main service module 330, and is configured to obtain IP address information of each service machine in the main service module 330, determine a service machine corresponding to the received service request according to a preset load balancing policy, and distribute the received service request to the corresponding service machine.
The internal load balancing unit 322 is further connected to the standby service module 340, and is configured to forward the received service request to the standby service module 340 when the main service module 330 fails, so as to respond to the service request through the standby service module 340.
The main service module 330 includes at least one service machine, and is configured to carry a service instance, so as to respond to the received service request through the service instance.
The standby service module 340 is configured to carry a bottom-of-pocket service instance of a service instance, so as to respond to a received service request through the bottom-of-pocket service instance.
Preferably, the main service module 330 and the standby service module 340 are disposed in different regions, so as to prevent that the main service module 330 and the standby service module 340 are unavailable at the same time when a power failure occurs in a certain region, or that the main service module 330 and the standby service module 340 are unavailable at the same time due to other reasons, thereby further improving the stability of the system.
Illustratively, when the service request is a Feed stream service request, the main service module 330 is specifically configured to respond to the received Feed service request through a loaded Feed service instance; the standby service module 340 is specifically configured to:
reading target information from a local file through a loaded Feedstandby service instance;
taking the target information as response information corresponding to the Feed stream service request;
and the target information of the local file is synchronously acquired from the local file of the main service module based on kafka service. The kafka service is used for synchronizing the information of the local file of the main service module to the local file of the standby service module, wherein the information generation process in the local file of the main service module is as follows: and when the response of the received Feed service request is successful through the Feed service instance each time, backing up the corresponding response information to the local file of the main service module. And meanwhile, synchronizing the information of the local file of the main service module to the local file of the standby service module through the kafka service so as to prevent the main service module from responding to the Feed service request through the standby service module when the main service module cannot work normally.
In the technical scheme of this embodiment, on the basis of the above embodiment, by adding the standby service module, the purpose of responding to the service request through the standby service module when the main service module cannot normally operate is achieved, and the stability of the system is further improved.
Example four
Fig. 4 is a service request processing method provided in a fourth embodiment of the present disclosure, where the method is applied to the service framework access system in the first embodiment. Referring to fig. 4, the method specifically includes the following steps:
and step 410, linking the service request to a network which is directly led to a load balancing module from a home location through a dynamic cloud acceleration module according to the home location of the received service request, so as to send the service request to the load balancing module through the network.
Step 420, determining, by the load balancing module, a service machine corresponding to the received service request according to a preset load balancing policy, and distributing the received service request to the corresponding service machine.
Step 430, responding to the service request through the service instance carried by the service machine.
Further, when the business service instance cannot work normally, responding to the service request through a bottom-pocket service borne by the main business module;
wherein the bottom-pocket service and the business service instance have the same service function.
Illustratively, responding to the service request by a bottom-of-pocket service carried by the main business module includes:
reading target information from a local file through a bottom-pocketing service;
taking the target information as response information corresponding to the service request;
and caching the acquired response information to the local file based on a set rule when the response information is successfully acquired through the business service instance each time.
According to the technical scheme of the embodiment, the cloud dynamic acceleration module directly sends the service request to the load balancing module from the attribution of the service request, so that the purpose of accelerating the service request is achieved, the time delay of the service request is reduced, and the service request is quickly responded; the service request is accurately distributed to the effective business machine through the load balancing module, and guarantee is provided for the service request to be quickly responded; when the business service instance carried by the business machine can not work normally, the service request is processed through the bottom-pocket service of the business service instance, and the stability of service request processing is improved.
EXAMPLE five
Fig. 5 is a service request processing method provided in the fifth embodiment of the present disclosure, which is applied to the service framework access systems described in the second embodiment and the third embodiment. Referring to fig. 5, the method specifically includes the following steps:
step 510, linking the service request to a network which is directly led to an external load balancing unit from the home location through a dynamic cloud acceleration module according to the home location of the received service request, so as to send the service request to the external load balancing unit through the network.
And step 520, sending the service request received from the dynamic cloud acceleration module to the internal load balancing unit through the external load balancing unit.
Step 530a, if the main service module works normally, the service request is distributed to the service machine corresponding to the main service module through the intra-pair load balancing unit, and step 540a is continuously executed.
Specifically, the intra-pair load balancing unit determines the service machine corresponding to the service request according to a preset load balancing policy based on the acquired IP address information of each service machine in the main service module, and distributes the service request to the corresponding service machine.
Illustratively, the determining, based on the acquired IP address information of each service machine in the main service module, a service machine corresponding to the service request according to a preset load balancing policy and distributing the service request to the corresponding service machine includes:
determining the IP address of the business machine corresponding to the service request from the IP address list according to a preset load balancing strategy;
distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine;
the internal load balancing unit acquires IP address information of each service machine in the main service module from the service discovery module according to a preset frequency; comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list to add the newly online IP address information to the IP address list and delete the offline IP address information in the IP address list; and when the service machine in the main service module is restarted, registering the IP address information of the current service machine to the service discovery module.
And 540a, responding to the service request through the service instance carried by the service machine.
Step 530b, if the main service module can not work normally, the service request is forwarded to the standby service module through the internal load balancing unit, and step 540b is continuously executed.
540b, responding to the service request through the standby service module.
Illustratively, when the service request is a Feed stream service request, the responding to the Feed stream service request by the standby service module includes:
reading target information from a local file through a Feedstandby service instance borne by a standby service module;
taking the target information as response information corresponding to the Feed stream service request;
and the target information of the local file is synchronously acquired from the local file of the main service module based on kafka service.
In the technical solution of this embodiment, on the basis of the above embodiment, when the main service module fails to work normally, the service request is forwarded to the standby service module through the intra-pair load balancing unit, and the service request is processed through the standby service module, so that the stability of processing the service request is improved.
EXAMPLE six
Referring now to fig. 6, a block diagram of a terminal device 400 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the terminal device 400 may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 401 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the terminal apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates a terminal apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be included in the terminal device; or may exist separately without being assembled into the terminal device.
The computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: linking, by a dynamic cloud acceleration module, a service request to a network which is directly led to a load balancing module from a home location according to the home location of the received service request, so as to send the service request to the load balancing module through the network; determining a business machine corresponding to the received service request according to a preset load balancing strategy through a load balancing module, and distributing the received service request to the corresponding business machine; and responding to the service request through the service instance carried by the service machine.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or service server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. The modules or units described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the designation of a module or unit does not in some cases constitute a limitation of the module or unit itself.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (14)

1. A service framework access system, comprising:
the cloud dynamic acceleration module is connected with the load balancing module and used for linking the service request to a network which is directly led to the load balancing module from a home location according to the home location of the received service request so as to send the service request to the load balancing module through the network;
the load balancing module is connected with the main service module and used for acquiring Internet Protocol (IP) address information of each service machine in the main service module, determining the service machine corresponding to the received service request according to a preset load balancing strategy and distributing the received service request to the corresponding service machine;
the main business module comprises at least one business machine and is used for bearing a business service instance so as to respond to the received service request through the business service instance;
the load balancing module comprises: an external load balancing unit and an internal load balancing unit; wherein the content of the first and second substances,
the external load balancing unit is respectively connected with the cloud dynamic acceleration module and the internal load balancing unit, and is used for receiving the service request forwarded by the cloud dynamic acceleration module and sending the received service request to the internal load balancing unit;
the internal load balancing unit is connected with the main service module and used for acquiring IP address information of each service machine in the main service module, determining the service machine corresponding to the received service request according to a preset load balancing strategy and distributing the received service request to the corresponding service machine.
2. The system of claim 1, wherein the intra-pair load balancing unit is specifically configured to:
acquiring IP address information of each service machine in the main service module from a service discovery module according to a preset frequency;
comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list to add the newly online IP address information to the IP address list and delete the offline IP address information in the IP address list;
determining the IP address of the business machine corresponding to the service request from the IP address list according to a preset load balancing strategy;
distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine;
when the service machine in the main service module is restarted, the IP address information of the current service machine is registered to the service discovery module.
3. The system according to claim 1, wherein the intra-pair load balancing unit is further connected to a standby service module, and configured to forward the received service request to the standby service module when the main service module fails, so as to respond to the service request through the standby service module.
4. The system of claim 3, wherein when the service request is a Feed stream service request, the standby service module is specifically configured to:
reading target information from a local file through a loaded Feedstandby service instance;
taking the target information as response information corresponding to the Feed stream service request;
and the target information of the local file is synchronously acquired from the local file of the main service module based on kafka service.
5. The system according to any of claims 1-4, wherein the main business module is further configured to carry a bottom-of-pocket service of a business service instance, and when the business service instance fails to work normally, respond to the service request through the bottom-of-pocket service;
wherein the bottom-pocket service and the business service instance have the same service function.
6. The system of claim 5, wherein the main service module is specifically configured to:
reading target information from a local file through a bottom-pocketing service;
taking the target information as response information corresponding to the service request;
and caching the acquired response information to the local file based on a set rule when the response information is successfully acquired through the business service instance each time.
7. A service request processing method applied to the service framework access system of any one of the above claims 1 to 6, characterized by comprising:
linking, by a dynamic cloud acceleration module, a service request to a network which is directly led to a load balancing module from a home location according to the home location of the received service request, so as to send the service request to the load balancing module through the network;
determining a business machine corresponding to the received service request according to a preset load balancing strategy through a load balancing module, and distributing the received service request to the corresponding business machine;
responding the service request through a service instance carried by the service machine;
the determining, by the load balancing module, a service machine corresponding to the received service request according to a preset load balancing policy, and distributing the received service request to the corresponding service machine includes:
receiving the service request forwarded by the cloud dynamic acceleration module through an external load balancing unit, and sending the received service request to the internal load balancing unit;
and receiving the service request sent by the external load balancing unit through the internal load balancing unit, determining a service machine corresponding to the service request according to a preset load balancing strategy based on the acquired IP address information of each service machine in the main service module, and distributing the service request to the corresponding service machine.
8. The method according to claim 7, wherein the determining, based on the obtained IP address information of each service machine in the main service module, a service machine corresponding to the service request according to a preset load balancing policy and distributing the service request to the corresponding service machine comprises:
determining the IP address of the business machine corresponding to the service request from an IP address list according to a preset load balancing strategy;
distributing the service request to the corresponding business machine according to the IP address of the corresponding business machine;
the internal load balancing unit acquires IP address information of each service machine in the main service module from the service discovery module according to a preset frequency; comparing the acquired IP address information of each service machine with the IP address information of each service machine in a stored IP address list to add the newly online IP address information to the IP address list and delete the offline IP address information in the IP address list; and when the service machine in the main service module is restarted, registering the IP address information of the current service machine to the service discovery module.
9. The method of claim 7, further comprising: when the main service module fails, the received service request is forwarded to a standby service module through the internal load balancing unit, so that the service request is responded through the standby service module.
10. The method of claim 9, wherein when the service request is a Feed stream service request, the responding, by the standby service module, to the Feed stream service request comprises:
reading target information from a local file through a Feedstandby service instance borne by a standby service module;
taking the target information as response information corresponding to the Feed stream service request;
and the target information of the local file is synchronously acquired from the local file of the main service module based on kafka service.
11. The method of any of claims 7-10, further comprising: when the business service instance can not work normally, responding to the service request through the bottom-pocketed service carried by the main business module;
wherein the bottom-pocket service and the business service instance have the same service function.
12. The method of claim 11, wherein responding to the service request via a bottom-of-pocket service hosted by the main business module comprises:
reading target information from a local file through a bottom-pocketing service;
taking the target information as response information corresponding to the service request;
and caching the acquired response information to the local file based on a set rule when the response information is successfully acquired through the business service instance each time.
13. A terminal device, characterized in that the device comprises:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the service request processing method of any of claims 7-12.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by processing means, carries out a service request processing method according to any one of claims 7 to 12.
CN201910611384.3A 2019-07-08 2019-07-08 Service framework access system, service request processing method, device and medium Active CN110347509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910611384.3A CN110347509B (en) 2019-07-08 2019-07-08 Service framework access system, service request processing method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910611384.3A CN110347509B (en) 2019-07-08 2019-07-08 Service framework access system, service request processing method, device and medium

Publications (2)

Publication Number Publication Date
CN110347509A CN110347509A (en) 2019-10-18
CN110347509B true CN110347509B (en) 2021-12-10

Family

ID=68178431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910611384.3A Active CN110347509B (en) 2019-07-08 2019-07-08 Service framework access system, service request processing method, device and medium

Country Status (1)

Country Link
CN (1) CN110347509B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314457B (en) * 2020-02-13 2022-04-29 北京百度网讯科技有限公司 Method and device for setting virtual private cloud

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1703892A (en) * 2002-10-03 2005-11-30 思科技术公司 Method, device and system for distributing server requests among a cluster of servers that have registered as mobile nodes
CN104333568A (en) * 2014-07-22 2015-02-04 江苏惠居乐信息科技有限公司 Cloud system for household electronic commerce based on CDN (Content Delivery Network) and load balancing technology as well as implementation method
CN105704708A (en) * 2014-11-25 2016-06-22 中兴通讯股份有限公司 Mobile network content distribution method, device and system
CN108055157A (en) * 2017-12-19 2018-05-18 北京奇艺世纪科技有限公司 The acquisition methods and device of a kind of service node

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8359390B2 (en) * 2004-09-29 2013-01-22 Fujitsu Limited Method and system for provisioning services on a communication network
CN100373867C (en) * 2005-01-14 2008-03-05 北邮英科(北京)信息技术研究所有限公司 Massive parallel processing apparatus and method for network isolation and information exchange module
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN102780702B (en) * 2012-07-30 2015-01-21 北京市计算中心 System and method for document security transmission
CN106686085B (en) * 2016-12-29 2020-06-16 华为技术有限公司 Load balancing method, device and system
CN110430259B (en) * 2018-04-16 2020-12-01 腾讯科技(深圳)有限公司 Data service system, server, and computer-readable storage medium
CN109327542B (en) * 2018-11-19 2021-10-26 网易(杭州)网络有限公司 Game service access response method, request forwarding method, connection method and device
CN109714648B (en) * 2018-12-03 2021-09-03 南方电网科学研究院有限责任公司 Video stream load balancing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1703892A (en) * 2002-10-03 2005-11-30 思科技术公司 Method, device and system for distributing server requests among a cluster of servers that have registered as mobile nodes
CN104333568A (en) * 2014-07-22 2015-02-04 江苏惠居乐信息科技有限公司 Cloud system for household electronic commerce based on CDN (Content Delivery Network) and load balancing technology as well as implementation method
CN105704708A (en) * 2014-11-25 2016-06-22 中兴通讯股份有限公司 Mobile network content distribution method, device and system
CN108055157A (en) * 2017-12-19 2018-05-18 北京奇艺世纪科技有限公司 The acquisition methods and device of a kind of service node

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于IMS的CDN网络实现技术研究;袁刚;《中国优秀硕士学位论文全文数据库 信息科技辑》;20160515;I136-121 *

Also Published As

Publication number Publication date
CN110347509A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
US10601947B2 (en) Application service delivery through an application service avatar
CN110417842B (en) Fault processing method and device for gateway server
US10044798B2 (en) Context-aware task offloading among multiple devices
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
US10742559B2 (en) Eliminating data traffic redirection in scalable clusters
CN110750393B (en) Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking
US11057475B2 (en) Methods, apparatus and systems for resuming transmission link
US20170244783A1 (en) Federating geographically distributed networks of message brokers into a scalable content delivery network
CN110263276B (en) Message distribution method, device, equipment and storage medium
CN111600794B (en) Server switching method, terminal, server and storage medium
CN110996372B (en) Message routing method, device and system and electronic equipment
CN110347509B (en) Service framework access system, service request processing method, device and medium
CN110177047B (en) Message sending method, device, electronic equipment and computer readable storage medium
CN114938395A (en) Service response method, device, equipment and storage medium
CN111752939A (en) Data processing method, device, computer system and medium for multiple systems
CN117061535A (en) Multi-activity framework data synchronization method, device, computer equipment and storage medium
KR102492793B1 (en) System for providing virtual desktop service and method for the same
CN114760360B (en) Request response method, request response device, electronic equipment and computer readable storage medium
US20210037090A1 (en) Systems and Methods for Server Failover and Load Balancing
KR20230003490A (en) Orchestrated proxy service
CN112866329A (en) Request response method, device, medium and electronic equipment based on hybrid cloud
CN113765972A (en) Data request response method, device, system, server and storage medium
CN110633324B (en) Method, apparatus, electronic device and computer readable medium for synchronizing data
CN117478579A (en) Message communication method, device, equipment and medium
CN114785794A (en) Resource allocation method, device, equipment, medium, program product and system

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