A data distribution system, method and relay server

By configuring the port connection between the transit server and multiple service servers, the problems of waste of public network resources and expansion of service servers are solved, and efficient resource utilization and system stability are achieved.

CN115529478BActive Publication Date: 2025-07-08BEIJING FEINNO COMM TECH

Patent Information

Application Number
CN202110711986.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2025-07-08
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

In the prior art, each service server needs an independent public domain name and public IP address, resulting in serious waste of public network resources and is inconvenient to expand the service server cluster.

Method used

By configuring multiple service servers and one transit server, the transit server has multiple ports. The terminal device is connected to the unique corresponding service server through the port of the transit server. The transit server is configured with the public domain name and public IP address. The corresponding relationship between the terminal device and the service server is allocated by the service system to reduce the application for public network resources for each business server.

Benefits of technology

It reduces the use of public network resources, meets the capacity expansion requirements of the number of business servers, and improves system stability and scalability through load balancing and high availability design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115529478B_ABST
    Figure CN115529478B_ABST
Patent Text Reader

Abstract

The present application provides a data distribution system, method and relay server. The data distribution system includes: a plurality of first service servers and a first relay server, and the first relay server is configured with a first public network domain name and a first public network IP address; the first relay server has a plurality of first ports, and the first relay server communicates and connects with the plurality of first service servers through different first ports; a terminal device outside the data distribution system is used to communicate and connect with the first relay server through the first public network domain name or the first public network IP address, and the first relay server is used to forward the service data of the terminal device to the first service server uniquely corresponding to the terminal device through the first port. In this way, the terminal device can determine the uniquely corresponding first service server according to different ports, without applying for a public network domain name and a public network IP address for each first service server, reducing the use of public network resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and more particularly, to a data distribution system, method, and relay server. Background Art

[0002] Currently, when a terminal device conducts network services, it needs to meet the unique access requirements with the service server. Therefore, each service server needs to have an independent public network domain name and a public network IP (Internet Protocol) address. For example, for the access solution of an audio and video platform, when a terminal device accesses an audio and video media server, it needs to meet the unique requirement. That is, the audio stream access and the video stream access need to ensure that they are on the same audio and video media server. Therefore, the external access of the audio and video media server requires one-to-one public network resources, and each audio and video media server needs to have an independent public network domain name and a public network IP. The above method requires an application for public network resources every time the service server cluster is expanded, which results in a waste of public network resources and is not convenient for the subsequent expansion of the number of service servers in the cluster. Summary of the Invention

[0003] The purpose of the embodiments of this application is to provide a data distribution system, method, and relay server to reduce the waste of public network resources and facilitate the subsequent expansion of the number of service servers in the cluster.

[0004] The present invention is implemented as follows:

[0005] In a first aspect, the embodiments of this application provide a data distribution system, including: a plurality of first service servers; a first relay server configured with a first public network domain name and a first public network IP address; the first relay server has a plurality of first ports, and the first relay server is communicatively connected to the plurality of first service servers through different first ports; a terminal device outside the data distribution system is used to communicate with the first relay server through the first public network domain name or the first public network IP address, and the first relay server is used to forward the service data of the terminal device to the first service server uniquely corresponding to the terminal device through the first port; the corresponding relationship between the terminal device and the first service server is allocated by a service system communicatively connected to the data distribution system.

[0006] In the embodiments of the present application, only the first public network domain name and the first public network IP address of the first relay server need to be configured in the data distribution system, and multiple first service servers are connected through different first ports of the first relay server. In this way, the terminal device can determine the uniquely corresponding first service server according to the different ports, without applying for a public network domain name and a public network IP address for each first service server, reducing the use of public network resources. In addition, since the number of ports of the current server is 65535, this method can meet the expansion requirements of the number of service servers.

[0007] Combined with the technical solution provided in the first aspect above, in some possible implementation manners, the number of the first relay servers is at least two, each of the first relay servers is configured with the same first public network domain name and the same first public network IP address, and the first ports with the same number in each of the first relay servers are connected to the same first service server.

[0008] In the embodiments of the present application, at least two first relay servers are set, which are configured with the same first public network domain name and the same first public network IP address, and the connection mode of the ports to multiple first service servers is the same, so that the entire data distribution system meets the high-availability principle. When an abnormal situation occurs in one first relay server, the link can be loaded to another normal first relay server for work. In addition, through at least two first relay servers, the data transmission pressure when there is only one first relay server is reduced.

[0009] Combined with the technical solution provided in the first aspect above, in some possible implementation manners, the data distribution system further includes: a load balancer; the load balancer is respectively connected to each of the first relay servers, and the load balancer is used to allocate one of the first relay servers to the terminal device according to the usage situation of each of the first relay servers.

[0010] In the embodiments of the present application, when the number of the first relay servers is at least two, the set load balancer is used to reasonably and evenly allocate the first relay servers, thereby improving the stability of the entire data distribution system.

[0011] Combined with the technical solution provided in the first aspect above, in some possible implementation manners, the data distribution system further includes: a load balancer; the first relay server is connected to the load balancer in an access mode of three lines and three IPs.

[0012] In an embodiment of the present application, the first relay server is connected to the load balancer in a three-line and three-IP access mode, enabling the load balancer to select a corresponding link to connect to the first relay server according to the network of the terminal device (mobile network, Unicom network, and Telecom network).

[0013] Combined with the technical solution provided in the first aspect above, in some possible implementation manners, the data distribution system further includes: a second relay server and multiple second service servers; the second relay server is configured with a second public domain name and a second public IP address; the second relay server has multiple second ports, and the second relay server communicates with the multiple second service servers through different second ports; the terminal device is further configured to communicate with the second relay server through the second public domain name or the second public IP address, and the second relay server is configured to forward the service data of the terminal device to the second service server uniquely corresponding to the terminal device through the second port; the correspondence between the terminal device and the second service server is allocated by the service system.

[0014] In an embodiment of the present application, the service servers and the relay servers are grouped. The first relay server and multiple first service servers are taken as a group, and the second relay server and multiple second service servers are taken as a group. The terminal device can communicate with the first relay server or the second relay server. By grouping the service servers and the relay servers, the entire data distribution system meets the high-availability principle, and when a group of devices fails, the link load can be transferred to the other group of devices for operation.

[0015] Combined with the technical solution provided in the first aspect above, in some possible implementation manners, the number of the second relay servers is at least two, each of the second relay servers is configured with the same second public domain name and the same second public IP address, and the second ports with the same numbers in each of the second relay servers are connected to the same second service server.

[0016] Combined with the technical solution provided in the first aspect above, in some possible implementation manners, the first service server is an audio and video media server, and the first relay server is an Nginx server.

[0017] In an embodiment of the present application, the data distribution system can perform audio and video services. By using the Nginx server as the relay server for multiple audio and video media servers, it is not necessary to apply for a public domain name and a public IP address for each audio and video media server, reducing the use of public network resources.

[0018] Second aspect, an embodiment of the present application provides a data distribution method, which is applied to a relay server in a data distribution system. The relay server is configured with a public network domain name and a public network IP address. The data distribution system further includes a plurality of service servers. The relay server has a plurality of ports, and the relay server communicates and connects with the plurality of service servers through different ports. The method includes: obtaining an access port corresponding to a terminal device; wherein the access port includes a gateway port and a service port. The gateway port is used to determine the service server connected to the terminal device, and the gateway port is allocated by a service system communicating with the data distribution system. The service port is used for data transmission; the gateway port and the service port corresponding to the terminal device are connected to the same service server; receiving service data sent by the terminal device, and forwarding the service data to the service server corresponding to the service port according to the service port corresponding to the terminal device.

[0019] Combined with the technical solution provided in the above second aspect, in some possible implementation manners, the relay server is an Nginx server, and the service server is an audio and video media server; correspondingly, the service port includes an audio stream port and a video stream port; the receiving service data sent by the terminal device, and forwarding the service data to the service server corresponding to the service port according to the service port corresponding to the terminal device includes: receiving audio data sent by the terminal device, and forwarding the audio data to the service server corresponding to the audio stream port according to the audio stream port corresponding to the terminal device; and / or receiving video data sent by the terminal device, and forwarding the video data to the service server corresponding to the video stream port according to the video stream port corresponding to the terminal device.

[0020] Combined with the technical solution provided in the above second aspect, in some possible implementation manners, the method further includes: receiving the internal network IP address of a newly added service server; based on the internal network IP address of the newly added service server, allocating an idle port, so that the relay server communicates and connects with the newly added service server through the allocated port.

[0021] In an embodiment of the present application, the configuration of the newly added service server is implemented through an automated script. By this automated script, only the internal network IP address of the newly added service server needs to be obtained to achieve the allocation of idle ports, and the expansion of the number of service servers is efficiently and conveniently achieved.

[0022] In a third aspect, an embodiment of the present application provides a data distribution device, which is applied to a relay server in a data distribution system. The relay server is configured with a public network domain name and a public network IP address. The data distribution system further includes a plurality of service servers. The relay server has a plurality of ports, and the relay server communicates with the plurality of service servers through different ports. The device includes: an acquisition module, configured to acquire an access port corresponding to a terminal device; wherein, the access port includes a gateway port and a service port. The gateway port is used to determine the service server connected to the terminal device, and the gateway port is allocated by a service system that communicates with the data distribution system. The service port is used for data transmission; the gateway port and the service port corresponding to the terminal device are connected to the same service server; a forwarding module, configured to receive service data sent by the terminal device, and forward the service data to the service server corresponding to the service port according to the service port corresponding to the terminal device.

[0023] Combined with the technical solution provided in the above third aspect, in some possible implementation manners, the relay server is an Nginx server, and the service server is an audio and video media server; correspondingly, the service ports include an audio stream port and a video stream port; specifically, the forwarding module is configured to receive audio data sent by the terminal device, and forward the audio data to the service server corresponding to the audio stream port according to the audio stream port corresponding to the terminal device; and / or receive video data sent by the terminal device, and forward the video data to the service server corresponding to the video stream port according to the video stream port corresponding to the terminal device.

[0024] Combined with the technical solution provided in the above third aspect, in some possible implementation manners, the data distribution device further includes an allocation module; the allocation module is configured to receive the internal network IP address of a newly added service server; based on the internal network IP address of the newly added service server, allocate an idle port, so that the relay server communicates with the newly added service server through the allocated port.

[0025] In a fourth aspect, an embodiment of the present application provides a relay server, including: a processor and a memory, the processor is connected to the memory; the memory is used to store a program; the processor is used to run the program stored in the memory and execute the method provided in the above second aspect embodiment and / or in combination with some possible implementation manners of the above second aspect embodiment.

[0026] Fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when run by a processor, executes the method provided in the embodiment of the second aspect above and / or in combination with some possible implementation manners of the embodiment of the second aspect above. Description of the Drawings

[0027] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.

[0028] Figure 1 It is a module block diagram of the first data distribution system provided by the embodiment of the present application.

[0029] Figure 2 It is a module block diagram of the first relay server provided by the embodiment of the present application.

[0030] Figure 3 It is a module block diagram of the second data distribution system provided by the embodiment of the present application.

[0031] Figure 4 It is a module block diagram of the third data distribution system provided by the embodiment of the present application.

[0032] Figure 5 It is a module block diagram of the fourth data distribution system provided by the embodiment of the present application.

[0033] Figure 6 It is a step flowchart of a data distribution method provided by the embodiment of the present application.

[0034] Figure 7 It is a module block diagram of a data distribution device provided by the embodiment of the present application.

[0035] Icons: 100 - data distribution system; 10 - first relay server; 110 - processor; 120 - memory; 20 - first service server; 30 - second relay server; 40 - second service server; 50 - load balancer; 200 - terminal device; 300 - data distribution device; 301 - acquisition module; 302 - forwarding module. Detailed Embodiments

[0036] The following will describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application.

[0037] Please refer to Figure 1, an embodiment of the present application provides a data distribution system 100. The data distribution system 100 includes a first relay server 10 and a plurality of first service servers 20.

[0038] Among them, the first relay server 10 is configured with a first public network domain name and a first public network IP address. The first relay server 10 has a plurality of first ports. The first relay server 10 communicates with a plurality of first service servers 20 through different first ports. The plurality of first service servers 20 communicate with each other through internal network IP addresses.

[0039] The terminal device 200 outside the data distribution system is used to communicate with the first relay server 10 through the first public network domain name or the first public network IP address. The first relay server 10 is used to forward the service data of the terminal device 200 to the first service server 20 uniquely corresponding to the terminal device 200 through the first port.

[0040] The above-mentioned terminal device 200 may be, but is not limited to, a personal computer (PC), a smart phone, a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc.

[0041] In the embodiment of the present application, the allocation between the terminal device 200 and the first service server 20 is determined by the service system. The data distribution system 100 provided by the embodiment of the present application is mainly used for data transmission and distribution, while the service system is mainly used to determine the transmission object of the data.

[0042] The data distribution system 100 is communicatively connected to the service system. Specifically, the service system is respectively connected to the first relay server 10 and the first service server 20.

[0043] When the terminal device 200 makes a service request, the service system can make a reasonable allocation according to the usage situation of the first service server 20. For example, when the first service server A is idle, the first service server A is used as the first service server corresponding to the terminal device 200 and is informed to the first relay server 10. After receiving the service data sent by the terminal device 200, the first relay server 10 sends the service data to the first service server A through the port.

[0044] In addition, it should be noted that when the first service server 20 is connected to the first relay server 10, the first ports for connection include a gateway port and a service port. Among them, the gateway port is used to determine the first service server 20 connected to the terminal device 200, and the service port is used for data transmission. Specifically, when the service system receives a service request from the terminal device 200, it can allocate a relatively idle first service server according to the usage situation of the first service server 20. At this time, the allocated port is the gateway port, and the terminal device 200 establishes a connection with the corresponding first service server A through this gateway port. When it is necessary to upload service data, the upload is then carried out through the service port connected to the first service server A.

[0045] The above-mentioned service system can also be installed on one or more servers, and this application does not limit the form of the service system.

[0046] In summary, in the data distribution system 100 provided by the embodiments of this application, only the first public network domain name and the first public network IP address (which can include both IPv4 and IPv6) of the first relay server 10 need to be configured, and multiple first service servers 20 are connected through different first ports of the first relay server 10. In this way, the terminal device 200 can determine the uniquely corresponding first service server 20 according to the different ports, without applying for a public network domain name and a public network IP address for each first service server 20, reducing the use of public network resources.

[0047] In addition, it should be noted that the number of the first ports of the current server is 65,535. This method can fully meet the expansion requirements of the number of service servers.

[0048] The above-mentioned data distribution system 100 can be applied to audio and video services. Correspondingly, the first relay server 10 can be an Nginx (a reverse proxy web server) server, and the first service server 20 can be an audio and video media server. At this time, the Nginx server is specifically used to forward the audio and video data sent by the terminal device 200 to the corresponding audio and video media server.

[0049] Each audio and video media server is connected to three ports on the Nginx server. The first port is the TCP (Transmission Control Protocol) listening port for the access of the audio and video media service gateway (i.e., the gateway interface), the second port is the listening port for the audio access of the audio and video media server (i.e., the audio stream port for transmitting audio data), and the third port is the listening port for the video stream access of the audio and video media server (i.e., the video stream port for transmitting video data).

[0050] Exemplarily, when the terminal device 200 is performing audio and video services, such as when the user is using the terminal device 200 for a live broadcast service or a video call service, the live broadcast data or video data is uploaded to the Nginx server, and then the Nginx server forwards the audio data through the audio stream port to the unique audio and video media server corresponding to the terminal device 200, and the Nginx server forwards the video data through the video stream port to the unique audio and video media server corresponding to the terminal device 200.

[0051] The above-mentioned data distribution system 100 can also be applied to terminal positioning services, communication services, etc., which are not limited in this application. When applying other services, the above-mentioned first transit server 10 can also be a network server such as Apache (a type of network server), which is not limited in this application.

[0052] See also Figure 2 Structurally, the first transit server 10 may include a processor 110 and a memory 120 .

[0053] The processor 110 is electrically connected to the memory 120 directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The data distribution device includes at least one software module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the first transit server 10. The processor 110 is used to execute executable modules stored in the memory 120, such as software function modules and computer programs included in the data distribution device, to implement the data distribution method. The processor 110 can execute the computer program after receiving the execution instruction.

[0054] The processor 110 has signal processing capabilities. The processor 110 may also be a general-purpose processor, for example, a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. In addition, the general-purpose processor may be a microprocessor or any conventional processor, etc.

[0055] The memory 120 can be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), and an Electric Erasable Programmable Read-Only Memory (EEPROM). The memory 120 is used to store a program, and after receiving an execution instruction, the processor 110 executes the program.

[0056] It should be noted that Figure 2 The structure shown is only for illustration. The first relay server 10 provided by the embodiments of the present application may also have Figure 2 fewer or more components, or have a configuration different from Figure 2 that shown. In addition, Figure 2 each of the components shown can be implemented by software, hardware, or a combination thereof.

[0057] It can be understood that in terms of structure, the first service server 20 can also adopt the structure as Figure 2 shown. The first service servers 20 communicate with each other through an internal network IP. The service data of the terminal device 200 can be forwarded in the internal network. The first service server 20 is specifically used to process the service data.

[0058] Please refer to Figure 3 , optionally, according to the principle of high availability, the number of the first relay servers 10 is at least two. Each first relay server 10 is configured with the same first public domain name and the same first public IP address. The first ports with the same number in each first relay server 10 are connected to the same first service server 20.

[0059] Assume that the number of the first relay servers 10 is two. If the first port numbered 500 in the first first relay server 10 is connected to the first service server A, then the first port numbered 500 in the other first relay server 10 is also connected to the first service server A.

[0060] When building the system, the number of the first relay servers 10 can be determined according to the number of the first service servers 20. Of course, it can also be determined according to the estimated number of the terminal devices 200. The present application does not limit the number. For example, according to actual requirements, the number of the first relay servers 10 can be two, four, ten, etc.

[0061] It should be noted that in the embodiments of the present application, at least two first relay servers 10 are provided, which are configured with the same first public network domain name and the same first public network IP address, and the connection method between the ports and the multiple first service servers 20 is the same. The purpose is to make the entire data distribution system 100 meet the high availability principle. When an abnormal situation occurs in one first relay server 10, the link can be loaded to another normal first relay server 10 for work. In addition, through at least two first relay servers 10, the data transmission pressure when there is only one first relay server 10 is reduced.

[0062] Please refer to Figure 4 , optionally, the data distribution system 100 further includes: a second relay server 30 and multiple second service servers 40.

[0063] The second relay server 30 is configured with a second public network domain name and a second public network IP address.

[0064] The second relay server 30 has multiple second ports. The second relay server 30 communicates with the multiple second service servers 40 through different second ports; the terminal device 200 is further configured to communicate with the second relay server 30 through the second public network domain name or the second public network IP address. The second relay server 30 is configured to forward the service data of the terminal device 200 to the second service server 40 uniquely corresponding to the terminal device 200 through the second port.

[0065] That is to say, in the embodiments of the present application, the service servers and the relay servers are grouped, and then divided into different parks (or isolation areas). The first relay server 10 and the multiple first service servers 20 form a first park as a group. The second relay server 30 and the multiple second service servers 40 form a second park as another group. The terminal device 200 can communicate with the first relay server 10 or the second relay server 30. By grouping the service servers and the relay servers, the entire data distribution system 100 meets the high availability principle. When an abnormal situation occurs in a group of devices, the link can be loaded to another group of devices for work.

[0066] It should be noted that the above division of the park can be based on the geographical location of the service servers or the number of service servers.

[0067] Exemplarily, ten first service servers 20 in Province A and the first relay server 10 form a park, while ten second service servers 40 in Province B and the second relay server 30 form another park.

[0068] Exemplarily, assume that there are a total of one hundred business servers in Region A. Fifty of the business servers can be grouped with the first relay server 10 as one park, and the other fifty business servers can be grouped with the second relay server 30 as another park.

[0069] Of course, in other embodiments, the data distribution system 100 can also be divided into a greater number of parks. For example, the number of parks can be three, four, ten, etc., which is not limited in this application. The structure of the second relay server 30 can also be the structure shown as Figure 2 The relay servers provided in the embodiments of this application can all be referenced by the structure shown as Figure 2 shown.

[0070] Among them, the determination of the park can be based on specific services. For example, if the terminal device A calls the terminal device B for an audio and video call, then the terminal device A and the terminal device B are in the same audio and video room. At this time, the terminal device B and the terminal device A need to be in the same park.

[0071] Of course, the specific allocation method can be set by the service system in the foregoing embodiments, which is not limited in this application.

[0072] Correspondingly, according to the high availability principle, the number of the second relay servers 30 is at least two. Each second relay server 30 is configured with the same second public network domain name and the same second public network IP address. The second service servers 40 connected to the same second port in each second relay server 30 are the same.

[0073] It should be noted that the public network domain names and public network IP addresses configured by the relay servers in different parks are different, that is, the first public network domain name is different from the second public network domain name, and the first public network IP address is different from the second public network IP address.

[0074] When building the system, the number of the second relay servers 30 can be determined according to the number of the second service servers 40. Of course, it can also be determined according to the estimated number of the terminal devices 200, which is not limited in terms of quantity in this application. For example, according to actual requirements, the number of the second relay servers 30 can be two, four, ten, etc. The number of the first relay servers 10 can be the same as or different from the number of the second relay servers 30.

[0075] It should be noted that in the embodiments of the present application, at least two second relay servers 30 are provided, which are configured with the same second public network domain name and the same second public network IP address, and the ports are connected to multiple second service servers 40 in the same way. The purpose is to make the entire data distribution system 100 meet the high-availability principle. When an abnormal situation occurs in one second relay server 30, the link can be loaded to another normal second relay server 30 for operation.

[0076] In the embodiments of the present application, the data distribution system 100 further includes a load balancer.

[0077] When only one first relay server 10 is included in the data distribution system 100, the load balancer is connected to the first relay server 10.

[0078] Optionally, when the number of the above-mentioned first relay servers 10 is at least two, each first relay server 10 is configured with the same first public network domain name and the same first public network IP address, the first ports with the same number in each first relay server 10 are connected to the same first service server, the load balancer is respectively connected to each first relay server 10, and the load balancer is used to allocate a first relay server 10 to the terminal device 200 according to the usage situation of each first relay server 10. That is, the first relay server 10 connected to the terminal device 200 can be determined through the load balancer. By setting the load balancer, a reasonable and balanced allocation of the first relay server 10 can be facilitated, thereby improving the stability of the entire data distribution system 100.

[0079] Please refer to Figure 5 , when the data distribution system 100 is divided into different campuses, the number of load balancers 50 corresponds to the number of campuses. For example, when the data distribution system 100 further includes second relay servers 30 and second service servers 40, the entire data distribution system 100 is divided into two campuses. Correspondingly, the number of load balancers 50 is also two. Among them, the first load balancer 50 is connected to the first relay server 10, and the second load balancer 50 is connected to the second relay server 30.

[0080] Correspondingly, when the number of the above-mentioned second relay servers 30 is at least two, each second relay server 30 is configured with the same second public network domain name and the same second public network IP address, the second ports with the same number in each second relay server 30 are connected to the same second service server 40, the second load balancer 50 is respectively connected to each second relay server 30, and the second load balancer 50 is used to allocate a second relay server 30 to the terminal device 200 according to the usage situation of each second relay server 30.

[0081] Optionally, the first relay server 10 and the second relay server 30 are connected to the load balancer 50 in a three-line and three-IP access mode. It should be noted that the three-line access refers to the access of mobile network links, Unicom network links, and telecom network links, and the load balancer 50 is pre-configured with the IP addresses corresponding to each link.

[0082] In the embodiment of the present application, both the first relay server 10 and the second relay server 30 are connected to the load balancer 50 in a three-line and three-IP access mode, so that the load balancer 50 can select the corresponding link according to the network (mobile network, Unicom network, and telecom network) of the terminal device 200 and connect to the first relay server 10 and the second relay server 30.

[0083] The operation process of the above data distribution system 100 will be described below. After the terminal device 200 logs in to a specific service platform, if there is a service requirement at this time, the terminal device 200 sends service data to the load balancer 50. The load balancer 50 selects the corresponding link according to the network of the terminal device 200 and sends the service data to the relay server. Finally, the relay server forwards the service data according to the access port allocated by the service system.

[0084] Please refer to Figure 6 , based on the same inventive concept, the embodiment of the present application also provides a data distribution method, which is applied to the relay server in the data distribution system (which can be the first relay server or the second relay server). It should be noted that the data distribution method provided by the embodiment of the present application is not limited by Figure 6 and the following order. The method includes: step S101 - step S102.

[0085] Step S101: Obtain the access port corresponding to the terminal device.

[0086] Among them, the access port includes a gateway port and a service port. The gateway port is used to determine the service server connected to the terminal device, and the gateway port is allocated by the service system communicatively connected to the data distribution system, while the service port is used for data transmission. The gateway port and the service port corresponding to the terminal device are connected to the same service server.

[0087] It should be noted that when the terminal device makes a service request, the service system can allocate a relatively idle first service server according to the usage situation of the first service server. At this time, the allocated is the gateway port, and the terminal device establishes a connection with the corresponding first service server A through this gateway port. When it is necessary to upload service data, it is uploaded through the service port connected to the first service server A. That is, when the gateway port connected to the terminal device is determined, the uniquely corresponding service port can be determined.

[0088] Step S102: Receive the service data sent by the terminal device, and forward the service data to the service server corresponding to the service port according to the service port corresponding to the terminal device.

[0089] Optionally, when the above data distribution system is specifically applied to the audio and video service, the relay server is an Nginx server, and the service server is an audio and video media server. The service ports include an audio stream port and a video stream port.

[0090] Correspondingly, step S102 specifically includes: receiving the audio data sent by the terminal device, and forwarding the audio data to the service server corresponding to the audio stream port according to the audio stream port corresponding to the terminal device; and / or receiving the video data sent by the terminal device, and forwarding the video data to the service server corresponding to the video stream port according to the video stream port corresponding to the terminal device.

[0091] Optionally, when more service servers need to be added or deployed in the data distribution system, the method further includes: receiving the internal network IP address of the newly added service server; based on the internal network IP address of the newly added service server, allocating idle ports so that the relay server can communicate with the newly added service server through the allocated ports.

[0092] In the embodiment of the present application, the configuration of the newly added service server is implemented through an automated script. By this automated script, only the internal network IP address of the newly added service server needs to be obtained to achieve the allocation of idle ports, and the expansion of the number of service servers is realized efficiently and conveniently.

[0093] Among them, the code of the automated script is as follows (in the following code, the relay server is an Ngnix server, and the service server is an audio and video media server):

[0094]

[0095]

[0096]

[0097]

[0098] Please refer to Figure 7, based on the same inventive concept, an embodiment of the present application further provides a data distribution device 300, which is applied to a transit server in a data distribution system. The transit server is configured with a public domain name and a public IP address. The data distribution system further includes a plurality of service servers. The transit server has a plurality of ports, and the transit server communicates with the plurality of service servers through different ports. The data distribution device 300 includes: an acquisition module 301 and a forwarding module 302.

[0099] The acquisition module 301 is used to acquire an access port corresponding to the terminal device; wherein, the access port includes a gateway port and a service port. The gateway port is used to determine the service server connected to the terminal device, and the gateway port is allocated by a service system communicating with the data distribution system. The service port is used for data transmission; the gateway port and the service port corresponding to the terminal device are connected to the same service server.

[0100] The forwarding module 302 is used to receive the service data sent by the terminal device, and forward the service data to the service server corresponding to the service port according to the service port corresponding to the terminal device.

[0101] Optionally, the transit server is an Nginx server, and the service server is an audio and video media server; correspondingly, the service port includes an audio stream port and a video stream port. The forwarding module 302 is specifically used to receive the audio data sent by the terminal device, and forward the audio data to the service server corresponding to the audio stream port according to the audio stream port corresponding to the terminal device; and / or receive the video data sent by the terminal device, and forward the video data to the service server corresponding to the video stream port according to the video stream port corresponding to the terminal device.

[0102] Optionally, the data distribution device 300 further includes an allocation module.

[0103] The allocation module is used to receive the internal network IP address of the newly added service server; based on the internal network IP address of the newly added service server, allocate an idle port, so that the transit server communicates with the newly added service server through the allocated port.

[0104] It should be noted that, since those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0105] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when running, executes the method provided in the above embodiment.

[0106] The storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that integrates one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

[0107] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be in an electrical, mechanical or other form.

[0108] In addition, the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] Furthermore, in each embodiment of the present application, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.

[0110] In this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0111] The above are only the embodiments of the present application and are not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A data distribution system, characterized in that, Including: Multiple first service servers, where the first service servers are audio and video media servers; A first relay server, which is an Nginx server and is configured with a first public domain name and a first public IP address; The first relay server has multiple first ports, and the first relay server communicates and connects with multiple first service servers through different first ports; the terminal device outside the data distribution system is used to communicate and connect with the first relay server through the first public domain name or the first public IP address, and the first relay server is used to forward the service data of the terminal device to the first service server uniquely corresponding to the terminal device through the first port; the corresponding relationship between the terminal device and the first service server is allocated by the service system that communicates and connects with the data distribution system; The first relay server is further used to obtain the first port corresponding to the terminal device; wherein, the first port includes a gateway port and a service port, the gateway port is used to determine the first service server connected to the terminal device, the gateway port is allocated by the service system, and the service port is used for data transmission; the gateway port and the service port corresponding to the terminal device are connected to the same first service server; Wherein, the first relay server is used to forward the service data of the terminal device to the first service server uniquely corresponding to the terminal device through the first port, including: The first relay server is used to forward the service data of the terminal device to the first service server uniquely corresponding to the terminal device through the service port.

2. The data distribution system according to claim 1, wherein The number of the first relay servers is at least two, each first relay server is configured with the same first public domain name and the same first public IP address, and the first ports with the same number in each first relay server are connected to the same first service server.

3. The data distribution system according to claim 2, wherein The data distribution system further includes: a load balancer; The load balancer is respectively connected to each first relay server, and the load balancer is used to allocate a first relay server to the terminal device according to the usage situation of each first relay server.

4. The data distribution system according to claim 1, wherein The data distribution system further includes: a load balancer; The first relay server is connected to the load balancer in a three-line three-IP access mode.

5. The data distribution system according to claim 1, wherein The data distribution system further includes: a second relay server and multiple second service servers; The second relay server is configured with a second public domain name and a second public IP address; The second relay server has a plurality of second ports, and the second relay server is communicatively connected to a plurality of the second service servers through different ones of the second ports; the terminal device is further configured to be communicatively connected to the second relay server through the second public domain name or the second public IP address, and the second relay server is configured to forward service data of the terminal device to a second service server uniquely corresponding to the terminal device through the second port; the correspondence between the terminal device and the second service server is assigned by the service system.

6. A data distribution method, characterized in that, Applied to a relay server in a data distribution system, the relay server is an Nginx server, the relay server is configured with a public domain name and a public IP address, the data distribution system further includes a plurality of service servers, the service servers are audio and video media servers, the relay server has a plurality of ports, and the relay server is communicatively connected to the plurality of service servers through different ones of the ports, the method includes: Obtain an access port corresponding to the terminal device; wherein, the access port includes a gateway port and a service port, the gateway port is used to determine the service server connected to the terminal device, the gateway port is assigned by a service system communicatively connected to the data distribution system, and the service port is used for data transmission; the gateway port and the service port corresponding to the terminal device are connected to the same service server; Receive service data sent by the terminal device, and forward the service data to a service server corresponding to the service port according to the service port corresponding to the terminal device.

7. The data distribution method according to claim 6, wherein The service port includes an audio stream port and a video stream port; The receiving the service data sent by the terminal device and forwarding the service data to a service server corresponding to the service port according to the service port corresponding to the terminal device includes: Receiving audio data sent by the terminal device, and forwarding the audio data to a service server corresponding to the audio stream port according to the audio stream port corresponding to the terminal device; and / or Receiving video data sent by the terminal device, and forwarding the video data to a service server corresponding to the video stream port according to the video stream port corresponding to the terminal device.

8. The data distribution method according to claim 7, characterized in that, The method further includes: Receiving the internal network IP address of a newly added service server; Based on the internal network IP address of the newly added service server, allocate an idle port, so that the relay server is communicatively connected to the newly added service server through the allocated port.

9. A transit server, characterized in that, Includes: A processor and a memory, the processor and the memory are connected; The memory is used to store programs; The processor is configured to run a program stored in the memory and execute the method according to any one of claims 6-8.

Citation Information

Patent Citations

  • Communication method and system

    CN107454210A

  • A load balancing and fault transferring system and method based on an application level

    CN109714190A

Cited By

  • Communication based on relay cluster

    US12641066B2

  • Communication based on relay cluster

    US20240244040A1