CN116055565B - Data transmission method, system, device, electronic equipment and storage medium - Google Patents

Data transmission method, system, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116055565B
CN116055565B CN202310042948.2A CN202310042948A CN116055565B CN 116055565 B CN116055565 B CN 116055565B CN 202310042948 A CN202310042948 A CN 202310042948A CN 116055565 B CN116055565 B CN 116055565B
Authority
CN
China
Prior art keywords
service server
service
data
client
server
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
CN202310042948.2A
Other languages
Chinese (zh)
Other versions
CN116055565A (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 BlueSky Technologies Co Ltd
Original Assignee
Beijing BlueSky Technologies 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 BlueSky Technologies Co Ltd filed Critical Beijing BlueSky Technologies Co Ltd
Priority to CN202310042948.2A priority Critical patent/CN116055565B/en
Publication of CN116055565A publication Critical patent/CN116055565A/en
Application granted granted Critical
Publication of CN116055565B publication Critical patent/CN116055565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The embodiment of the invention provides a data transmission method, a system, a device, electronic equipment and a storage medium, and relates to the technical field of communication. The method comprises the following steps: the first client sends a first acquisition request to a first service server through a first communication connection with the first service server; the method comprises the steps that a first service server receives a first acquisition request sent by a first client through a first communication connection; if the local storage of the first service server has first service data, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, acquiring the first service data from the second service server, and sending the first service data to the first client through the first communication connection; the first client receives first service data sent by the first service server. By applying the embodiment of the invention, the first service server sends the service data to a plurality of clients, so that the application range of the data transmission method can be improved.

Description

Data transmission method, system, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method, system, device, electronic apparatus, and storage medium.
Background
With the development of communication technology, a service platform (e.g., a server) may provide a data acquisition service for a user, and when the user needs to acquire data, the user may instruct a client to send a data acquisition request to the service platform. Correspondingly, after receiving the data acquisition request sent by the client, the service platform can send the data requested by the client to the client.
In the related art, in order to implement communication between a service platform and a client, a technician may configure a service component for communication with the client in the service platform. The technician can determine the port of the client for communication with the service platform and the format of the data received by the client according to the network protocol of the wired local area network to which the client belongs, and configure the corresponding service assembly in the service platform. And after receiving the data acquisition request, the service platform can establish communication connection with the client through the configured service component according to the configured port. Further, the service platform may send the data requested by the client to the client through the established communication connection according to the configured data format. For example, the service platform may be a video platform, and the video platform may send, through the configured service component, the video resource requested by the client to the client according to the configured data format through the established communication connection.
However, since different clients may belong to different wired local area networks, network protocols of the different wired local area networks are different, that is, different ports where the clients communicate with the service platform, and formats of data received by the clients are different. If the service platform does not configure a service component for sending data to the client in the wired local area network in the server according to the network protocol of a certain wired local area network, the service platform cannot send service data to the client in the wired local area network. As can be seen, in the related art, the application range of the data transmission method is narrow.
Disclosure of Invention
The embodiment of the invention aims to provide a data transmission method, a system, a device, electronic equipment and a storage medium, so as to improve the application range of the data transmission method. The specific technical scheme is as follows:
in a first aspect of the embodiment of the present invention, there is provided a data transmission method, where the method is applied to a first service server of a plurality of service servers in a data transmission system, and a network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the data transmission system further comprises a plurality of clients which are in communication connection with the first service server; the method comprises the following steps:
Receiving a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
if the first service data is stored locally in the first service server, sending the first service data to the first client through the first communication connection so that the first client receives the first service data;
if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; the second service server is: a service server of a layer above the first service server;
and receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection so that the first client receives the first service data.
Optionally, the transmission paths from the first service server to the second service server are multiple; each transmission path includes a plurality of forwarding servers;
the forwarding the first acquisition request to the second service server includes:
determining the shortest transmission path which is included in a plurality of transmission paths between the first service server and the second service server and normally operates by a forwarding server as a target transmission path;
and forwarding the first acquisition request to the second service server according to the target transmission path.
Optionally, a plurality of threads are started in the first service server; each thread is used for processing the acquisition request sent by each client; each thread runs in a designated Central Processing Unit (CPU) core corresponding to the thread in the first service server;
the receiving a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server includes:
receiving a first acquisition request sent by the first client through the first communication connection through a currently idle target thread in the plurality of threads;
The sending the first service data to the first client through the first communication connection includes:
and sending the first service data to the first client through the first communication connection by the target thread.
Optionally, the data transmission system further includes a third service server communicatively connected to the first service server; the network structure of the data transmission system is a tree network structure; the third service server is a service server of a next layer of the first service server;
the method further comprises the steps of:
receiving a second acquisition request sent by the third service server; the second acquisition request is used for acquiring second service data; the second acquisition request is a second client in the data transmission system and is sent to the third service server through a second communication connection with the third service server; the second communication connection is: after the second client sends a connection request to the third service server, the connection request is established according to the port identifier returned by the third service server;
and if the first service server locally stores the second service data, sending the second service data to the third service server so that the third service server receives the second service data, and then sending the second service data to the second client through the second communication connection so that the second client receives the second service data.
Optionally, before the receiving the first acquisition request sent by the first client in the data transmission system through the first communication connection with the first service server, the method further includes:
receiving a connection request which is sent by the first client and carries a port identifier of a first port of the first service server;
if the first port is in an idle state, a first response message carrying a port identifier of the first port is sent to the first client, so that after the first client receives the first response message, a first communication connection with the first service server is established through the first port of the first service server;
and if the first port is in a non-idle state, sending a second response message carrying a port identifier of a second port which is currently idle to the first client, so that the first client establishes a first communication connection with the first service server through the second port of the first service server after receiving the second response message.
Optionally, the data transmission system further comprises a management server;
the method further comprises the steps of:
Counting the size of the data volume of the received service data, the size of the data volume of the transmitted service data and the data flow information of the first service server in a preset time period to obtain a counting result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
the statistical result is sent to the management server, so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data;
and after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
In a second aspect of the embodiment of the present invention, a data transmission method is provided, where the method is applied to a first client in a data transmission system, and the data transmission system further includes a first service server that is communicatively connected to the first client; the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the method comprises the following steps:
sending a first acquisition request to the first service server through a first communication connection with the first service server, so that after the first service server receives the first acquisition request, if first service data is locally stored in the first service server, sending the first service data to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server; the second service server is: a service server of a layer above the first service server;
And receiving the first service data sent by the first service server.
Optionally, before the sending the first acquisition request to the first service server through the first communication connection with the first service server, the method further includes:
sending a connection request carrying a port identifier of a first port of the first service server to the first service server, so that after the first service server receives the connection request, if the first port is in an idle state, sending a first response message carrying the port identifier of the first port to the first client, and if the first port is in a non-idle state, sending a second response message carrying the port identifier of a second port which is currently idle to the first client;
after receiving the first response message sent by the first service server, establishing a first communication connection with the first service server through a first port of the first service server;
and after receiving the second response message sent by the first service server, establishing a first communication connection with the first service server through a second port of the first service server.
In a third aspect of the embodiment of the present invention, a data transmission system is provided, where the system includes a plurality of clients and a plurality of service servers, and a network structure of the system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; each service server in the system is in communication connection with a plurality of clients; wherein:
a first client of the plurality of clients is configured to send a first acquisition request to a first service server of the plurality of service servers through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
the first service server is configured to receive the first acquisition request sent by the first client through the first communication connection; if the first service data is stored locally in the first service server, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server; the second service server is: a service server of a layer above the first service server;
The second service server is configured to send the first service data to the first service server;
the first service server is further configured to receive the first service data sent by the second service server, and send the first service data to the first client through the first communication connection;
the first client is further configured to receive the first service data sent by the first service server.
In a fourth aspect of the embodiment of the present invention, there is provided a data transmission apparatus, the apparatus being applied to a first service server among a plurality of service servers in a data transmission system, a network structure of the data transmission system being a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the data transmission system further comprises a plurality of clients which are in communication connection with the first service server; the device comprises:
a first acquisition request receiving module, configured to receive a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
A first service data sending module, configured to send, if the first service data is stored locally in the first service server, the first service data to the first client through the first communication connection, so that the first client receives the first service data;
if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; the second service server is: a service server of a layer above the first service server;
and receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection so that the first client receives the first service data.
Optionally, the transmission paths from the first service server to the second service server are multiple; each transmission path includes a plurality of forwarding servers;
the first service data sending module is specifically configured to:
determining the shortest transmission path which is included in a plurality of transmission paths between the first service server and the second service server and normally operates by a forwarding server as a target transmission path;
And forwarding the first acquisition request to the second service server according to the target transmission path.
Optionally, a plurality of threads are started in the first service server; each thread is used for processing the acquisition request sent by each client; each thread runs in a designated Central Processing Unit (CPU) core corresponding to the thread in the first service server;
the first acquisition request receiving module is specifically configured to:
receiving a first acquisition request sent by the first client through the first communication connection through a currently idle target thread in the plurality of threads;
the first service data sending module is specifically configured to:
and sending the first service data to the first client through the first communication connection by the target thread.
Optionally, the data transmission system further includes a third service server communicatively connected to the first service server; the network structure of the data transmission system is a tree network structure; the third service server is a service server of a next layer of the first service server;
the apparatus further comprises:
the second acquisition request receiving module is used for receiving a second acquisition request sent by the third service server; the second acquisition request is used for acquiring second service data; the second acquisition request is a second client in the data transmission system and is sent to the third service server through a second communication connection with the third service server; the second communication connection is: after the second client sends a connection request to the third service server, the connection request is established according to the port identifier returned by the third service server;
And the second service data sending module is used for sending the second service data to the third service server if the first service server locally stores the second service data, so that the second service data is sent to the second client through the second communication connection after the third service server receives the second service data, and the second client receives the second service data.
Optionally, the apparatus further includes:
a connection request receiving module, configured to perform, before the first acquisition request receiving module performs the receiving of a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server, a connection request sent by the first client and carrying a port identifier of a first port of the first service server;
a connection establishment module for:
if the first port is in an idle state, a first response message carrying a port identifier of the first port is sent to the first client, so that after the first client receives the first response message, a first communication connection with the first service server is established through the first port of the first service server;
And if the first port is in a non-idle state, sending a second response message carrying a port identifier of a second port which is currently idle to the first client, so that the first client establishes a first communication connection with the first service server through the second port of the first service server after receiving the second response message.
Optionally, the data transmission system further comprises a management server;
the apparatus further comprises:
the statistics module is used for counting the size of the data volume of the received service data, the size of the data volume of the transmitted service data and the data flow direction information of the first service server in a preset time period to obtain a statistics result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
the statistical result sending module is used for sending the statistical result to the management server so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
The acquisition request processing module is used for:
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data; and after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
In a fifth aspect of the embodiments of the present invention, there is provided a data transmission apparatus, the apparatus being applied to a first client in a data transmission system, the data transmission system further including a first service server in communication connection with the first client; the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the device comprises:
The acquisition request sending module is used for sending a first acquisition request to the first service server through a first communication connection with the first service server, so that after the first service server receives the first acquisition request, if first service data is locally stored in the first service server, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server; the second service server is: a service server of a layer above the first service server;
And the service data receiving module is used for receiving the first service data sent by the first service server.
Optionally, the apparatus further includes:
a response information sending module, configured to, before the acquiring request sending module performs the first communication connection with the first service server, send a first acquiring request to the first service server, and perform sending a connection request carrying a port identifier of a first port of the first service server to the first service server, so that after the first service server receives the connection request, if the first port is in an idle state, send a first response message carrying the port identifier of the first port to the first client, and if the first port is in a non-idle state, send a second response message carrying a port identifier of a second port that is currently idle to the first client;
a communication connection establishment module for:
after receiving the first response message sent by the first service server, establishing a first communication connection with the first service server through a first port of the first service server; and after receiving the second response message sent by the first service server, establishing a first communication connection with the first service server through a second port of the first service server.
In a sixth aspect of the embodiment of the present invention, there is provided an electronic device, which is characterized by including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor, configured to implement the steps of the data transmission method according to the first aspect or any one of the second aspect when executing the program stored in the memory.
In a seventh aspect of the embodiments of the present invention, there is provided a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program realizes the steps of the data transmission method in the first aspect or any one of the second aspects when being executed by a processor.
In an eighth aspect of embodiments of the present invention, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the data transmission methods described above.
The embodiment of the invention has the beneficial effects that:
the first client sends a first acquisition request to a first service server through a first communication connection with the first service server in a plurality of service servers; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to the port identifier returned by the first service server; the method comprises the steps that a first service server receives a first acquisition request sent by a first client through a first communication connection; if the local storage of the first service server has first service data, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding a first acquisition request to the second service server so that the second service server sends the first service data to the first service server; the second service server is: a service server of a layer above the first service server; receiving first service data sent by a second service server, and sending the first service data to a first client through a first communication connection; the first client receives first service data sent by the first service server.
Based on the above processing, the first communication connection is established for the first client according to the port identifier returned by the first service server. The first client establishes a first communication connection with the first service server according to the port identifier returned by the first service server, and the first service server does not need to establish the first communication connection with the first client according to the configured port, that is, a service component for sending data to the client in the wired local area network is configured in the first service server in advance according to the network protocol of the wired local area network to which the client belongs. Thus, for each client, the client may send a connection request to the first service server and establish a communication connection with the first service server based on the port identification returned by the first client. Correspondingly, the first service server can send service data to the client through communication connection with the client, that is, the first service server can send service data to a plurality of clients, and the application range of the data transmission method can be improved.
And when the first service server does not store the first service data locally, the first service server can acquire the first service data from the second service server and send the first service data to the first client. For each service server, the service server can request service data from a service server of a layer above the service server, so that data distribution according to a tree network structure can be realized, the data distribution capacity of the data transmission system can be improved, and the data distribution efficiency of the data transmission system can be improved.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
Fig. 1 is a first architecture diagram of a data transmission system according to an embodiment of the present invention;
fig. 2 is a first flowchart of a data transmission method according to an embodiment of the present invention;
fig. 3 is a second flowchart of a data transmission method according to an embodiment of the present invention;
fig. 4 is a second architecture diagram of a data transmission system according to an embodiment of the present invention;
fig. 5 is a third flowchart of a data transmission method according to an embodiment of the present invention;
fig. 6 is a fourth flowchart of a data transmission method according to an embodiment of the present invention;
fig. 7 is a third architecture diagram of a data transmission system according to an embodiment of the present invention;
fig. 8 is a fifth flowchart of a data transmission method according to an embodiment of the present invention;
Fig. 9 is a first block diagram of a data transmission device according to an embodiment of the present invention;
fig. 10 is a second structure diagram of a data transmission device according to an embodiment of the present invention;
fig. 11 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by the person skilled in the art based on the present invention are included in the scope of protection of the present invention.
Because different clients may belong to different wired local area networks, network protocols of the different wired local area networks are different, that is, different ports for the clients to communicate with the service platform, and formats of data received by the clients are different. In the related art, if the service platform does not configure a service component for sending data to a client in a wired local area network according to a network protocol of the wired local area network, the service platform cannot send service data to the client in the wired local area network, which results in a narrower application range of the data transmission method.
In order to solve the above-mentioned problems, referring to fig. 1, fig. 1 is a first architecture diagram of a data transmission system according to an embodiment of the present invention, where a network structure of the data transmission system is a tree network structure; in a data transmission system of a tree network structure, a plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with a service server in an adjacent layer to the layer to which the service server belongs. In this embodiment, the service servers in the data transmission system are divided into two layers, and the first layer includes 3 service servers 102 as an example for explanation, where the 3 service servers 102 are specifically a service server 1021, a service server 1022, and a service server 1023; in this embodiment, the second layer includes 3 service servers 104, and the 3 service servers 104 are specifically a service server 1041, a service server 1042, and a service server 1043. Each service server in the data transmission system is communicatively connected to a plurality of clients, in this embodiment, the service server 102 of the first layer is in communication with the client 101, and the service server 104 of the second layer is in communication with the client 103. Wherein:
A first client 1011 (in this embodiment, the client 1011 is illustrated as an example) of the plurality of clients 101 is configured to send a first acquisition request to a first service server 1021 through a first communication connection with a first service server 1021 (in this embodiment, the service server 1021 is illustrated as an example) of the plurality of service servers 102; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client 1011 sends a connection request to the first service server 1021, the connection request is established according to the port identifier returned by the first service server 1021;
a first service server 1021 for receiving a first acquisition request sent by the first client 1011; if the first service data is stored locally at the first service server 1021, sending the first service data to the first client 1011 over the first communication connection; if the first service data is not stored locally in the first service server 1021, forwarding the first acquisition request to the second service server 1041 (in this embodiment, the service server 1041 is described as an example);
a second service server 1041 for transmitting the first service data to the first service server 1021; the second service server 1041 is: a service server of a layer above the first service server 1021;
The first service server 1021 is further configured to receive the first service data sent by the second service server 1041, and send the first service data to the first client 1011 through the first communication connection;
the first client 1011 is further configured to receive the first service data sent by the first service server 1021.
The process of the client 1012, the client 1013, and the service server 1021, the process of the client 1012, the client 1013, and the service server 1022, the process of the client 1013 and the service server 1023, the process of the client 1031 and the service server 1041, the process of the client 1032 and the service server 1042, and the process of the client 1033 and the service server 1043 are similar to the process of the first client 1011 and the first service server 1021, and will not be repeated here.
Based on the data transmission system provided by the embodiment of the invention, the first communication connection is established for the first client according to the port identifier returned by the first service server. The first client establishes a first communication connection with the first service server according to the port identifier returned by the first service server, and the first service server does not need to establish the first communication connection with the first client according to the configured port, that is, a service component for sending data to the client in the wired local area network is configured in the first service server in advance according to the network protocol of the wired local area network to which the client belongs. Thus, for each client, the client may send a connection request to the first service server and establish a communication connection with the first service server based on the port identification returned by the first client. Correspondingly, the first service server can send service data to the client through communication connection with the client, that is, the first service server can send service data to a plurality of clients, and the application range of the data transmission method can be improved.
And when the first service server does not store the first service data locally, the first service server can acquire the first service data from the second service server and send the first service data to the first client. For each service server, the service server can request service data from a service server of a layer above the service server, so that data distribution according to a tree network structure can be realized, the data distribution capacity of the data transmission system can be improved, and the data distribution efficiency of the data transmission system can be improved.
For further embodiments of the above described data transmission system reference may be made to the following related description of method embodiments with respect to clients and traffic servers.
Based on the same inventive concept, referring to fig. 2, fig. 2 is a first flowchart of a data transmission method provided by an embodiment of the present invention, where the data transmission system may include a plurality of clients and a plurality of service servers; the network structure of the data transmission system is a tree network structure; in a data transmission system of a tree network structure, a plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with a service server in an adjacent layer to the layer to which the service server belongs. The method may comprise the steps of:
S201: the first client sends a first acquisition request to the first service server through a first communication connection with the first service server.
The first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to the port identifier returned by the first service server.
S202: the first service server receives a first acquisition request sent by a first client.
S203: if the local storage of the first service server has first service data, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding a first acquisition request to the second service server so that the second service server sends the first service data to the first service server; and receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection.
The second service server is: and a service server of a layer above the first service server.
S204: the first client receives first service data sent by the first service server.
Based on the data transmission method provided by the embodiment of the invention, the first communication connection is established for the first client according to the port identifier sent by the first service server. The first client establishes a first communication connection with the first service server according to the port identifier returned by the first service server, and the first service server does not need to establish the first communication connection with the first client according to the configured port, that is, a service component for sending data to the client in the wired local area network is configured in the first service server in advance according to the network protocol of the wired local area network to which the client belongs. Thus, for each client, the client may send a connection request to the first service server and establish a communication connection with the first service server based on the port identification returned by the first client. Correspondingly, the first service server can send service data to the client through communication connection with the client, that is, the first service server can send service data to a plurality of clients, and the application range of the data transmission method can be improved.
And when the first service server does not store the first service data locally, the first service server can acquire the first service data from the second service server and send the first service data to the first client. For each service server, the service server can request service data from a service server of a layer above the service server, so that data distribution according to a tree network structure can be realized, the data distribution capacity of the data transmission system can be improved, and the data distribution efficiency of the data transmission system can be improved.
In this embodiment, the plurality of service servers may be service servers distributed in a plurality of regions, for example, the service servers may include: a service server located in guangzhou, a service server located in beijing, a service server located in Shanghai, etc. The client may be a device used by users in different areas, such as a cell phone, a computer, etc. The plurality of clients may communicate with the plurality of service servers over a network. For example, the client may communicate with the service server through a wired local area network to which it has access, or the client may also communicate with the service server through the internet to which it has access.
The data transmission system may be a system for network resource distribution, that is, a plurality of clients in the data transmission system may acquire network resources from a plurality of service servers. The network resource may be a video resource or, alternatively, a text resource.
For steps S201 and S202, the first client may be any client in the data transmission system, and the first client may be communicatively connected to a plurality of service servers in the data transmission system. The first service server may be any service server communicatively connected to the first client. For example, the first service server may be: among the service servers communicatively connected to the first client, the service server closest to the first client is the service server closest to the first client. Alternatively, the first service server may be: a service server specified in the service servers communicatively coupled to the first client.
When the user needs to acquire service data, an acquisition instruction (which may be referred to as a first acquisition instruction) for the first service data may be input to the first client. Correspondingly, after the first client receives the first acquisition instruction, the user needs to acquire the first service data, and the first client can send a first acquisition request for acquiring the first service data to the first service server through a first communication connection with the first service server. For example, the first client sends a first acquisition request carrying an identification of the first service data to the first service server. The identification of the first service data may be a name of the first service data. The first communication connection is a data path for communication between the first client and the first service server.
By way of example, the data transmission system may be a system for video asset distribution. When the user needs to watch the video, the user can click an operation button for playing the video in the display interface of the first client. Accordingly, when the first client detects the click operation of the user on the operation button for playing the video, which indicates that the user needs to watch the video, the first client may send a first acquisition request for the video indicated by the user to the first service server.
The plurality of service servers in the data transmission system can be connected according to a tree network structure, namely, the topology structure of the data transmission system is the tree network structure. In a data transmission system of a tree network structure, a plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with a service server in an adjacent layer to the layer to which the service server belongs. A service server in any layer of the first service server data transmission system.
Illustratively, for the data transmission system shown in fig. 1, the data transmission system includes two layers of service servers, and the first layer includes 3 service servers 102, specifically, a service server 1021, a service server 1022, and a service server 1023. The second tier includes 3 service servers 104, specifically service server 1041, service server 1042, and service server 1043.
Accordingly, the first service server may be a service server in the first layer, that is, the first service server may be any one of the service server 1021, the service server 1022, and the service server 1023. The first client may be communicatively connected to a first traffic server. For example, if the first service server is the service server 1021, the first client may be any one of the client 1011, the client 1012, and the client 1013. Alternatively, the first service server may be a service server in the second layer, that is, the second service server may be any one of the service server 1041, the service server 1042, and the service server 1043. The first client may be communicatively connected to a first traffic server. For example, if the first service server is service server 1041, the first client may be client 1031.
The first service server may receive the first acquisition request, and perform corresponding processing according to the received first acquisition request.
In some embodiments, the first client may establish a first communication connection with the first traffic server as follows. On the basis of fig. 2, referring to fig. 3, before step S201, the following steps may be further included:
s205: the first client sends a connection request carrying a port identification of a first port of the first service server to the first service server.
S206: the first service server receives a connection request which is sent by the first client and carries a port identifier of a first port of the first service server.
S207: if the first port of the first service server is in an idle state, the first service server sends a first response message carrying a port identifier of the first port to the first client; if the first port of the first service server is in a non-idle state, the first service server sends a second response message carrying the port identification of the second port which is currently idle to the first client.
S208: after receiving a first response message sent by a first service server, the first client establishes a first communication connection with the first service server through a first port of the first service server; after receiving the second response message sent by the first service server, the first client establishes a first communication connection with the first service server through a second port of the first service server.
The port of the service server is a data interface through which the service server communicates with other devices. The first service server can communicate with other service servers and clients through ports. The first service server may include a plurality of ports, and the first service server may communicate with a plurality of other devices through one port, and the number of devices that communicate through different ports may be different.
After determining the first service server in the data transmission system, the first client may send a connection request carrying a port identification of the first port of the first service server to the first service server. The connection request also indicates: the first client requests to establish a first communication connection with the first service server through a first port of the first service server.
After receiving the connection request sent by the first client, the first service server can determine that the first client requests to establish a first communication connection with the first service server through the first port according to the port identifier of the first port carried in the connection request. Further, the first service server may determine an operational state of the first port. The working state of the first port indicates: the number of communication connections established by the first service server with other devices through the first port.
The working states of the first port include an idle state and a non-idle state, the idle state representing: the number of communication connections established between the first service server and other devices through the first port is smaller than the preset number; the non-idle state represents: the number of communication connections established between the first service server and other devices through the first port is not smaller than the preset number.
If the working state of the first port is an idle state, which means that the number of communication connections established through the first port of the first service server is small, if the first client establishes communication connections with the first service server through the first port, the first service server can timely receive a first acquisition request sent by the first client.
Thus, the first service server may send a first response message carrying the port identification of the first port to the first client, the first response message also representing: the first traffic server may be communicatively coupled to the first client via a first port.
After the first client receives the first response message sent by the first service server, the first client can establish a first communication connection with the first service server through the first port of the first service server.
For example, the first client sends a SYN (Synchronize Sequence Numbers, synchronization sequence number) data packet to the first service server according to the received port identifier of the first port sent by the first service server; after receiving the SYN packet, the first service server sends an ACK (Acknowledge character, acknowledgement character) packet to the first client through the first port, where the ACK packet indicates that the first client received the SYN packet; after receiving the ACK data packet sent by the first service server, the first client sends the ACK data packet to the first service server through the first port, and after receiving the ACK data packet sent by the first client, the first service server establishes the first communication connection successfully.
If the working state of the first port is a non-idle state, which means that the number of communication connections established through the first port of the first service server is large, if the first client establishes communication connections with the first service server through the first port, the first service server cannot timely receive the first acquisition request sent by the first client, which results in reduced data transmission efficiency.
Therefore, the first service server may determine the second port whose working state is the idle state, and send a second response message carrying the port identifier of the second port to the first client, where the second response message also indicates: the working state of the second port of the first service server is an idle state, and the first service server can be in communication connection with the first client through the second port.
After the first client receives the second response message sent by the first service server, the first client can establish a first communication connection with the first service server through the second port of the first service server. The first communication connection between the first client and the first service server is established through the second port of the first service server, and similar to the manner in which the first client establishes the first communication connection between the first client and the first service server through the first port of the first service server, reference may be made to the related description.
In some embodiments, the first client may establish a communication connection with the first service server when first communicating with the first service server. Since the communication connection between the first client and the first service server may be interrupted, in order to ensure that communication between the first client and the first service server is enabled, the first client may also establish a communication connection with the first service server when a preset period is reached. Alternatively, the first client may establish a communication connection with the first service server before each sending the first acquisition request to the first service server.
Based on the above processing, the first service server may send, to the first client, a response message carrying the port identifier of the port currently in the idle state according to the working state of each port of the first service server, and further, the first client establishes a first communication connection with the first service server according to the port identifier sent by the first service server. That is, according to the state of the port of the first service server, the port selected when the first client establishes a communication connection with the first service server is adjusted. Accordingly, the first service server is not required to establish the first communication connection with the first client according to the configured port, and a service component for sending data to the first client is not required to be configured in the first service server, so that the first service server can send service data to a plurality of clients, and the application range of the data transmission method can be improved.
For step S203 and step S204, after receiving the first acquisition request, the first service server may query whether the first service server locally stores the first service data according to the identifier of the first service data carried in the first acquisition request.
If the first service data is stored locally in the first service server, the first service server may send the first service data to the first client over the first communication connection. The first service data stored locally by the first service server may be sent to the first service server by other service servers in the data transmission system.
Correspondingly, the first client may receive the first service data sent by the first service server. After the first client receives the first service data, the first service data may be presented to the user. For example, if the first service data is video, the video may be played in the first client for browsing by the user.
The first service server may forward the first acquisition request to the second service server if the first service data is not stored locally at the first service server. The second service server is: any one of service servers of a layer of service servers above a first service server in a data transmission system. For example, the second service server may be: and in the service servers of the upper layer of the first service server in the data transmission system, the service server closest to the first service server is selected.
For example, with respect to the data transmission system shown in fig. 1, if the first service server is the service server 1021, the second service server may be any one of the service server 1041, the service server 1042, and the service server 1043. If the first service server is the service server 1022, the second service server may be any one of the service server 1042 and the service server 1043. If the first service server is service server 1023, the second service server may be service server 1043.
After the first service server receives the first acquisition request, if the first service data is not stored locally in the first service server, the first service server may forward the first acquisition request to the second service server.
After the second service server receives the first acquisition request, whether the first service data is stored in the second service server locally can be queried according to the identifier of the first service data carried in the first acquisition request.
The second service server may send the first service data to the first service server if the second service server has the first service data stored locally. If the second service server does not store the first service data locally, the second service server may also forward the first acquisition request to a service server in a layer above the second service server, so as to acquire the first service data from the service server in the layer above the second service server, and so on, until the second service server acquires the first service data, and then send the first service data to the first service server.
Correspondingly, after receiving the first service data, the first service server sends the first service data to the first client, and then the first client can receive the first service data.
In some embodiments, after the first service server receives the first service data sent by the second service server, the first service data may be stored locally on the first service server. Subsequently, if other clients in communication connection with the first service server request the first service data from the first service server, the first service server can directly send the locally stored first service data to the other clients without acquiring the first service data from the other service servers in the data transmission system, so that the data transmission efficiency can be improved.
And when the first service server does not locally store the first service data, the first service server can acquire the first service data from the second service server, and then the first service server can send the first service data to the first client, so that the first client can acquire the first service data, and the user requirement is met. In addition, the data transmission system can carry out data distribution according to the tree network structure, so that the data distribution capacity of the data transmission system is improved, and the throughput of the data transmission system is improved. Therefore, the data transmission system may also be referred to as a high-throughput high-capacity data transmission system.
In some embodiments, if there is no service server on the upper layer of the first service server in the data transmission system, for example, for the data transmission system shown in fig. 1, when the first service server is the service server 1041, there is no service server on the upper layer of the first service server. If the service server 1041 does not store the first service data locally, the service server 1041 may send a notification message to the first client indicating that the first service data is not acquired.
In some embodiments, there are multiple transmission paths between the first traffic server and the second traffic server, each transmission path including multiple forwarding servers. The first service server may forward the first acquisition request to the second service server in the following manner.
In one implementation, for each transmission path between the first service server and the second service server, the first service server may obtain an operation state of each forwarding server included in the transmission path. The first service server may determine a transmission path in which the forwarding server included in the plurality of transmission paths operates normally, and select any transmission path from the determined transmission paths. Further, the first service server forwards the first acquisition request to the second service server according to the selected transmission path.
In another implementation, step S203 may include the following steps:
step 1: the first service server determines the shortest transmission path which is included in a plurality of transmission paths between the first service server and the second service server and is operated normally by the forwarding server as a target transmission path.
Step 2: and the first service server forwards the first acquisition request to the second service server according to the target transmission path.
For each transmission path between the first service server and the second service server, the first service server may determine a transmission path (may be referred to as an alternative transmission path) in which the forwarding server included operates normally from among the plurality of transmission paths. Then, the first service server may select the shortest alternative transmission path from the determined alternative transmission paths as a target transmission path, and forward the first acquisition request to the second service server through the target transmission path.
For each of the alternative transmission paths, the first service server may select, as the target transmission path, the alternative transmission path having the smallest sum of distances between the included forwarding servers from among the alternative transmission paths. Alternatively, the first service server may select, as the target transmission path, the candidate transmission path having the smallest number of forwarding servers included.
Based on the above processing, there are multiple transmission paths between the first service server and the second service server, where the first service server can determine a target transmission path from the multiple transmission paths, and forward the first acquisition request to the second service server according to the target transmission path, where the target transmission path is shortest, and the included transmission paths in which the forwarding servers operate normally, so that it is possible to avoid situations that the first service server and the second service server cannot communicate due to failure of part of the forwarding servers, and further cause reduction in data transmission efficiency, and thus, normal operation of the data transmission system can be ensured. That is, the data transmission can be performed by a non-blocking network data processing mode, so that the stability of the data transmission system can be improved.
In some embodiments, in order to improve the efficiency of data transmission and the stability of the data transmission system, when the second service server sends service data to the first service server, a transmission path which is shortest and includes a forwarding server and operates normally may also be determined from a plurality of transmission paths, and the first service data is sent to the first service server through the selected transmission path.
Based on the above processing, since the target transmission path is: the shortest alternative transmission path among the alternative transmission paths exists between the first service server and the second service server, so that the first service server and the second service server communicate through the target transmission path, and the time required by the first service server to acquire the first service data from the second service server can be reduced. Furthermore, the time required by the first client to acquire the first service data can be reduced, and the delay of data transmission can be reduced.
In some embodiments, the data transmission system may further include a third service server communicatively coupled to the first service server; the network structure of the data transmission system is a tree network structure; the third service server is a service server of a layer next to the first service server. The method may further comprise the steps of:
step 1: and receiving a second acquisition request sent by the third service server.
The second acquisition request is used for acquiring second service data; the second acquisition request is a second client in the data transmission system and is sent to the third service server through a second communication connection with the third service server; the second communication connection is: and after the second client sends a connection request to the third service server, the connection request is established according to the port identifier returned by the third service server.
Step 2: and if the first service server locally stores the second service data, the first service server sends the second service data to the third service server so that the third service server sends the second service data to the second client through the second communication connection after receiving the second service data, and the second client receives the second service data.
The plurality of service servers in the data transmission system can be connected according to a tree network structure, namely, the topology structure of the data transmission system is the tree network structure. For each service server in the data transmission system, the data transmission system may further include a service server of a layer next to the service server.
The third service server is: any one of service servers of a next layer of service servers of a first service server in the data transmission system. For example, the third service server may be: and in the service servers of the next layer of the first service server in the data transmission system, the service server closest to the first service server is selected.
Referring to fig. 4 on the basis of fig. 1, fig. 4 is a second architecture diagram of a data transmission system according to an embodiment of the present invention. The service servers in the data transmission system may be divided into three layers, and the first layer includes a plurality of service servers 106, and in this embodiment, the first layer includes 3 service servers 106 as an example. The second layer includes a plurality of service servers 102, and in this embodiment, the second layer includes 3 service servers 102 as an example. The third layer includes a plurality of service servers 104, and in this embodiment, the third layer includes 3 service servers 104 as an example. The data transmission system also includes clients in communication with the business servers of the layers.
Wherein the first tier comprises 3 service servers 106, the service servers 106 of the first tier are in communication with the clients 105. Specifically, the service server 1061 communicates with the client 1051, the client 1052, and the client 1053; the traffic server 1062 communicates with clients 1052 and 1053; a traffic server 1063 communicates with the client 1053. The second tier comprises 3 service servers 102, the third tier comprises 3 service servers 104, the service servers 102 of the second tier are in communication with the clients 101, and the service servers 104 of the third tier are in communication with the clients 103. The manner in which the service server 102 communicates with the client 101 and the manner in which the service server 104 communicates with the client 103 are referred to in the description of the foregoing embodiments.
Wherein, the service server 1021 next layer of service servers includes: a service server 1061; the service server 1021 is a layer of service servers including: service server 1041, service server 1042, and service server 1043. If the first service server is 1021, the third service server is a service server 1061, and the second service server is any one of a service server 1041, a service server 1042, and a service server 1043. The second client is any one of the client 1051, the client 1052, and the client 1053.
The service server 1022 further includes: a service server 1062 and a service server 1063; the service servers of the upper layer of the service server 1022 include: a service server 1042 and a service server 1043. If the first service server is 1022, the third service server is any one of the service servers 1062 and 1063, and the second service server is any one of the service servers 1042 and 1043. The second client is either one of the client 1052 and the client 1053.
The service server 1023 next layer service server includes: service servers 1061, 1062, and 1063; the service server of the upper layer of the service server 1023 includes: service server 1043. If the first service server is 1023, the third service server is any one of service server 1061, service server 1062, and service server 1063, and the second service server is service server 1043. The second client is client 1053.
When the user needs to acquire service data, an acquisition instruction (which may be referred to as a second acquisition instruction) for the second service data may be input to the second client. Correspondingly, after the second client receives the second acquisition instruction, the second client indicates that the user needs to acquire the second service data, and the second client can send a second acquisition request for acquiring the second service data to the third service server through second communication connection with the third service server. For example, the second client sends a second acquisition request carrying an identification of the second service data to the third service server. The identification of the second service data may be a name of the second service data. The second communication connection is a data channel for communication between the second client and the third service server. The procedure for establishing the second communication connection is similar to the procedure for establishing the first communication connection in the previous embodiment, and reference is made to the description of the previous embodiment.
After the third service server receives the second acquisition request, if the third service server locally stores the second service data, the third service server may send the second service data to the second client through the second communication connection.
If the third service server does not store the second service data locally, the third service server may forward the second acquisition request to the first service server.
After the first service server receives the second acquisition request, if the first service server locally stores the second service data, the first service server may send the second service data to the third service server. The first service server may acquire the second service data from a service server (e.g., a second service server) of a layer above the first service server if the first service server does not store the second service data locally. After the first service server acquires the second service data, the second service data may be sent to the third service server.
After receiving the second service data, the third service server may send the second service data to the second client through the second communication connection. Accordingly, the second client may receive the second service data.
Based on the above processing, when the third service server does not locally store the second service data, the third service server may acquire the second service data from the first service server, and further, the third service server may send the second service data to the second client, so that the second client may acquire the second service data, thereby meeting the user requirement.
In some embodiments, after the third service server receives the second service data sent by the first service server, the second service data may be stored locally on the third service server. Subsequently, if the other clients communicatively connected with the third service server request the second service data from the third service server, the third service server can directly send the locally stored second service data to the other clients without acquiring the second service data from the other service servers in the data transmission system, so that the data transmission efficiency can be improved.
In some embodiments, there are multiple transmission paths between the third traffic server and the first, each transmission path including multiple forwarding servers. In order to improve the efficiency of data transmission and the stability of the data transmission system, the third service server may select a transmission path which is shortest from a plurality of transmission paths and includes a forwarding server that operates normally, and forward the second acquisition request to the first service server through the selected transmission path. And before the first service server sends the second service data to the third service server, the first service server may determine a transmission path which is shortest from a plurality of transmission paths and includes a forwarding server that operates normally. Further, the second service data is transmitted to the third service server through the selected transmission path.
In some embodiments, to improve the efficiency of data transmission, multiple threads may be started in the first service server; each thread is for processing acquisition requests sent by respective clients communicatively coupled to the first service server. For each thread in the first service server, the thread runs in a designated CPU core corresponding to the thread in the first service server. On the basis of fig. 2, referring to fig. 5, the following steps may be included in step S202:
s2021: and the first service server receives a first acquisition request sent by the first client through the first communication connection through a currently idle target thread in the plurality of threads.
Accordingly, step S203 may include the steps of:
s2031: if the first service data is stored locally in the first service server, the first service server sends the first service data to the first client through the first communication connection by the target thread; if the first service data is not stored locally in the first service server, forwarding a first acquisition request to the second service server so that the second service server sends the first service data to the first service server; and receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection by the target thread.
The second service server is: and a service server of a layer above the first service server.
A plurality of threads are started in the first service server, and the number of the started threads can be set according to requirements. For each thread, the technician may bind the thread to, i.e., run on, a CPU (Central Processing Unit ) core in the first service server. Each thread running on the same CPU core equally divides the operation resource and the memory resource of the CPU core, that is, each thread can use the operation resource and the memory resource of the CPU, so that the problem that the thread cannot timely process the received request due to insufficient operation resource or memory resource of a certain thread can be avoided, and further the efficiency of data transmission can be improved.
Each thread is for processing acquisition requests sent by respective clients communicatively coupled to the first service server. For each thread started in the first service server, the thread can process the acquisition requests sent by a plurality of clients.
The first service server may determine a currently idle thread from the plurality of threads, and obtain a target thread. If the currently idle thread in the first service server is one, the first service server may determine the idle thread as the target thread. If the number of currently idle threads in the first service server is multiple, the first service server may determine any one of the multiple currently idle threads as the target thread.
Further, the first service server may receive the first acquisition request sent by the first client through the target thread, and if the first service data is locally stored in the first service server, the first service server may send the first service data to the first service server through the target thread. If the local storage of the first service server does not store the first service data, the first service server can acquire the first service data from other service servers through the target thread, and send the first service data to the first client through the target thread.
Based on the processing, a plurality of threads are started in the first service server, and the received acquisition request is processed through the plurality of threads, so that the efficiency of data transmission can be improved. That is, the efficiency of data transmission can be improved by means of load balancing processing.
In some embodiments, to increase the efficiency of data transmission, for each service server in the data transmission system, multiple threads may be started in the service server, and each thread started in the service server is used to process the acquisition request received by the service server.
In some embodiments, to enable management of individual service servers in the data transmission system, the data transmission system may further include a management server. On the basis of fig. 2, referring to fig. 6, after step S204, the method further comprises the steps of:
s209: the first service server counts the data volume of the received service data, the data volume of the transmitted service data and the data flow information of the service data in a preset time period, and a counting result is obtained.
Wherein the data flow information indicates: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server.
S210: the first service server sends a statistical result to the management server, so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; and when the statistical result does not meet the preset adjustment condition, sending a second adjustment instruction to the first service server.
S211: after receiving the first adjustment instruction, the first service server forwards the third acquisition request to a fourth service server currently idle in the data transmission system if the third acquisition request sent by the third client is received, so that the fourth service server processes the third acquisition request; after receiving the second adjustment instruction, if a third acquisition request sent by a third client is received, acquiring third service data, and sending the third service data to the third client so that the third client receives the third service data.
The third acquiring request is used for acquiring third service data.
The first service server sends the data volume of the service data within a preset time period, wherein the data volume comprises: and the first service server transmits the data quantity to each service server and each client in a preset time period. The first service server receives the data volume of the service data within a preset time period, wherein the data volume comprises: and the data volume sent to the first service server by each service server received by the first service server in the preset time period.
The data flow information indicates the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server. That is, to which service servers, clients, the first service server sent the service data, and which service servers received the service data sent by the first service server.
When the statistics period is reached, the first service server can count the data volume of the service data received by the first service server, the data volume of the transmitted service data and the data flow information within a preset time period, and a statistics result is obtained. The statistical period of the first service server can be set according to actual requirements. In order to improve the accuracy of the management server in managing the service servers in the data transmission system, a smaller statistical period may be set, for example, the statistical period may be 1 minute; in order to reduce the consumption of the operation resources of the first service server and reduce the performance degradation of the first service server, a larger statistics period may be set, for example, the statistics period may be 5 minutes.
Or the management server can send a monitoring request to the first service server, and after the first service server receives the monitoring request sent by the management server, the first service server can count the data volume of the service data received by the first service server, the data volume of the sent service data and the data flow information within a preset time period, so as to obtain a statistical result.
In one implementation manner, the first service server may count the data amount of the service data sent by the first service server to each client, and the data amount of the service data sent by the first service server to each service server, so as to obtain the data amount sent by the first service server in a preset time period. The first service server may further count the data amount of the service data sent by each received service server, to obtain the data amount received by the first service server in the preset time period.
In another implementation manner, the first service server may calculate a sum of data amounts of service data sent by the first service server to each client and each service server, to obtain a total data amount of service data sent by the first service server. The first service server may further calculate a sum of data amounts of the service data sent by each service server received by the first service server, to obtain a total data amount of the service data received by the first service server.
Further, the first service server transmits the statistics to the management server. Correspondingly, the management server can receive the statistical result of the first service server, and judge whether the statistical result sent by the first service server meets the preset adjustment condition according to the statistical result sent by the first service server, so as to make corresponding processing according to the judgment result.
The preset adjustment condition may be determined based on the data amount of the received service data, the data amount of the transmitted service data, and/or the data flow direction information of the first service server in the preset time period.
In one implementation, the statistics include: the total data amount of the service data transmitted by the first service server and the total data amount of the service data received by the first service server. Correspondingly, the preset adjustment conditions may be: at least one of the total data amount of the service data received by the first service server in the preset time period and the total data amount of the service data transmitted by the first service server in the preset time period exceeds a first preset threshold.
Or the first service server determines the sum of the number of clients in communication connection with the first service server and the number of service servers as the number of other devices in communication connection with the first service server according to the data flow information of the service data received in the preset time period. Correspondingly, the preset adjustment conditions may be: the number of other devices communicatively connected to the first traffic server is greater than a second preset threshold.
In another implementation manner, the first service server determines a client and a service server which are in communication connection with the first service server according to data flow direction information of service data received in a preset time period, and determines data amounts sent by the first service server to each service server and the client in the preset time period and data amounts sent by each service server received by the first service server in the preset time period. That is, the statistics include: the data volume sent by the first service server to each service server and the client in the preset time period, and the data volume sent by each service server received by the first service server in the preset time period.
Correspondingly, the preset adjustment conditions may be: the data volume of the service data sent by the first service server to the preset number of other devices is larger than a third preset threshold value, and/or the data volume of the service data sent by the preset number of service servers received by the first service server in a preset time period is larger than a fourth preset threshold value. The other devices include other service servers and clients communicatively connected to the first service server.
If the statistical result of the first service server meets the preset adjustment condition, which indicates that the current data volume transmitted by the first service server is larger, if the first service server continues to process the acquisition request, the first service server may need to wait for a long time to be processed after receiving the acquisition request, thereby reducing the data transmission efficiency. Thus, the management server may send the first adjustment instruction to the first service server.
After the first service server receives the first adjustment instruction, if the first service server receives the third acquisition request sent by the third client, the first service server may forward the third acquisition request sent by the third client to a currently idle service server (i.e., a fourth service server) in the data transmission system, that is, the fourth service server in the data transmission system processes the third acquisition request. The fourth service server is: among the service servers that have been communicatively connected to the third client, the currently idle service server.
And if the first service server receives the third acquisition request forwarded by other service servers in the data transmission system to the first service server, the first service server may forward the third acquisition request to the fourth service server, that is, the fourth service server processes the third acquisition request, so as to avoid the reduction of the efficiency of data transmission.
If the statistical result sent by the first service server does not meet the preset adjustment condition, the statistical result indicates that the current data volume transmitted by the first service server is smaller, and if the first service server continues to process the acquisition request, the first service server can process the acquisition request in time. Thus, the management server may send the second adjustment instruction to the first service server.
After the first service server receives the second adjustment instruction, if the first service server receives a third acquisition request sent by the third client, the first service server can continue to process the third acquisition request, that is, the first service server can acquire third service data indicated by the third acquisition request, and send the third service data to the third client.
Based on the above processing, the management server is in communication connection with other service servers in the data transmission system, monitors the data volume and the data flow information of the data transmission system, and manages the data transmission system according to the monitoring result, that is, feeds back the monitoring result, so that the operation efficiency of the data transmission system can be improved. That is, the problem that the service server cannot process the received request in time due to the large data volume currently transmitted by a certain service server can be avoided by a load balancing processing mode, so that the efficiency of data transmission can be improved.
In some embodiments, the management server may also determine, from the service servers, a fifth service server having a data amount of the received service data and a data amount of the transmitted service data that are both less than a fifth preset threshold according to the statistics result sent by each service server in the data transmission system, and send a shutdown instruction to the fifth service server. After the fifth service server receives the shutdown instruction, the fifth service server may be shutdown, for example, the fifth service server may no longer receive the acquisition request sent by the service server and the client in the data transmission system. And, the management server may transmit a notification message indicating that the fifth service server no longer processes the acquisition request to other service servers and clients in the data transmission system. Correspondingly, after the other service servers and the client side receive the notification message sent by the management server, the fifth service server can be determined to not process the acquisition request any more, and the other service servers and the client side can not send the acquisition request to the fifth service server any more, so that the operation resources consumed by the data transmission system can be reduced, the structure of the data transmission system is optimized, and the operation efficiency of the data transmission system is improved.
Referring to fig. 7, fig. 7 is a third architecture diagram of a data transmission system according to an embodiment of the present invention. The data transmission system includes a plurality of data distribution services (i.e., the service servers in the foregoing embodiments), and the plurality of data distribution services may be divided into a plurality of layers, and in this embodiment, the plurality of data distribution services are described as being divided into 3 layers. The data transmission system also includes clients in communication with the data distribution services of the layers.
Wherein the first tier comprises 4 data distribution services 701, the data distribution services 701 of the first tier are in communication with clients 704. Specific: the data distribution service 7011 communicates with the client 7041; the data distribution service 7012 communicates with the client 7042; the data distribution service 7013 communicates with the client 7043; the data distribution service 7014 communicates with clients 7044.
The second tier includes 2 data distribution services 702, the data distribution services 702 of the second tier being in communication with clients 705. Specific: the data distribution service 7021 communicates with the client 7051; the data distribution service 7022 communicates with clients 7052. The data distribution service 7021 in the second layer is a server of a layer above the data distribution service 7011 and the data distribution service 7012 in the first layer. The data distribution service 7022 in the second layer is a server of a layer above the data distribution service 7013 and the data distribution service 7014 in the first layer. The first client may be client 7041 and the second service server may be data distribution service 7021 if the first service server is data distribution service 7011.
The third tier includes 1 data distribution service 703, and the data distribution service 703 of the second tier communicates with clients 706. Specifically, the data distribution service 7031 communicates with the client 7061 and the client 7062.
The data distribution service 7031 in the third layer is a server of a layer above the data distribution service 7021 and the data distribution service 7022 in the second layer. If the first traffic server is a data distribution service 7021, the first client may be a client 7051, the second traffic server may be a data distribution service 7031, the third traffic server may be any one of a data distribution service 7011 and a data distribution service 7012, and the second client may be a client in communication with the third traffic server.
The specific manner in which data transmission is performed based on the data transmission system of fig. 7 is described with reference to the method embodiment of fig. 8.
Referring to fig. 8, fig. 8 is a fifth flowchart of a data transmission method according to an embodiment of the present invention. The data transmission method applies a data transmission system, the data transmission system comprises: the system comprises a first client, a first service server, a second service server and a sixth service server. The first business server may be any one of the data distribution service 7011, the data distribution service 7012, the data distribution service 7013, and the data distribution service 7014 in fig. 7; the first client may be a client 704 communicatively connected to the first service server; the second service server may be a data distribution service 702 communicatively coupled to the first service server; the sixth business server may be a data distribution service 7031.
The method may comprise the steps of:
s801: the first client sends a first acquisition request to the first service server through a first communication connection with the first service server.
The first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to the port identifier returned by the first service server.
In this step, when the user needs to acquire service data, a first acquisition instruction for the first service data may be input to the first client. After receiving the first acquisition instruction, the first client may send a first acquisition request for acquiring the first service data to the first service server through a first communication connection with the first service server. The first communication connection is a data path for communication between the first client and the first service server.
S802: the first service server receives a first acquisition request sent by a first client.
In this step, after the first service server receives the first acquisition request, it may be queried whether the first service server locally stores the first service data. If the first service data is stored locally in the first service server, the first service server may send the first service data to the first client over the first communication connection. If the first service data is not stored locally at the first service server, step S803 is performed.
S803: the first service server forwards the first acquisition request to the second service server without storing the first service data locally.
S804: the second service server receives a first acquisition request sent by the first service server.
In this step, after the second service server receives the first acquisition request, it may query whether the second service server locally stores the first service data. The second service server may send the first service data to the first service server if the second service server has the first service data stored locally. If the first service data is not stored locally at the second service server, step S805 is performed.
S805: the second service server forwards the first acquisition request to the sixth service server without storing the first service data locally.
S806: the sixth service server receives the first acquisition request sent by the second service server.
In this step, after the sixth service server receives the first acquisition request, it may query whether the sixth service server locally stores the first service data, and perform corresponding processing according to the query result.
S807: the sixth service server transmits the first service data to the second service server.
In this step, if the first service data is stored locally at the sixth service server, the sixth service server may transmit the first service data to the second service server. If the first service data is not stored locally at the sixth service server, the sixth service server may acquire the first service data from the other service servers and then transmit the first service data to the second service server.
S808: the second service server receives the first service data sent by the sixth service server.
S809: the second service server transmits the first service data to the first service server.
S810: the first service server receives first service data sent by the second service server.
S811: the first service server sends first service data to the first client through the first communication connection.
S812: the first client receives first service data sent by the first service server.
Based on the above processing, the first service server can send service data to each client through communication connection with the client, that is, can realize that the first service server sends service data to a plurality of clients, reduces difficulty in establishing communication connection, reduces difficulty in integrating data channel capacity, reduces coupling between the first service server and the clients, can improve application range of a data transmission method, and reduces cost of configuration hardware. The data transmission system comprises a plurality of layers of servers, and when the service server receives the acquisition request of the client, if the service server does not locally store the service data requested by the client, the service server can acquire the service data requested by the client from the service server of the upper layer of the service server and send the requested service data to the client, so that the client can acquire the service data requested by the client, and the user requirement is met. In addition, the data transmission system is in a tree network structure, so that data distribution can be performed according to the tree network structure, and the efficiency of the data transmission system, namely the data distribution capacity of the data transmission system, can be improved.
Based on the same inventive concept as the data transmission method, the embodiment of the invention also provides a data transmission device. The device is applied to a first service server in a plurality of service servers in a data transmission system, and the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the data transmission system further includes a plurality of clients communicatively coupled to the first service server. Referring to fig. 9, fig. 9 is a first structural diagram of a data transmission device according to an embodiment of the present invention, where the device includes:
a first acquisition request receiving module 901, configured to receive a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
A first service data sending module 902, configured to send, if the first service data is stored locally in the first service server, the first service data to the first client through the first communication connection, so that the first client receives the first service data;
if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; the second service server is: a service server of a layer above the first service server;
and receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection so that the first client receives the first service data.
Optionally, the transmission paths from the first service server to the second service server are multiple; each transmission path includes a plurality of forwarding servers;
the first service data sending module 902 is specifically configured to:
determining the shortest transmission path which is included in a plurality of transmission paths between the first service server and the second service server and normally operates by a forwarding server as a target transmission path;
And forwarding the first acquisition request to the second service server according to the target transmission path.
Optionally, a plurality of threads are started in the first service server; each thread is used for processing the acquisition request sent by each client; each thread runs in a designated Central Processing Unit (CPU) core corresponding to the thread in the first service server;
the first acquisition request receiving module 901 is specifically configured to:
receiving a first acquisition request sent by the first client through the first communication connection through a currently idle target thread in the plurality of threads;
the first service data sending module 902 is specifically configured to:
and sending the first service data to the first client through the first communication connection by the target thread.
Optionally, the data transmission system further includes a third service server communicatively connected to the first service server; the network structure of the data transmission system is a tree network structure; the third service server is a service server of a next layer of the first service server;
the apparatus further comprises:
the second acquisition request receiving module is used for receiving a second acquisition request sent by the third service server; the second acquisition request is used for acquiring second service data; the second acquisition request is a second client in the data transmission system and is sent to the third service server through a second communication connection with the third service server; the second communication connection is: after the second client sends a connection request to the third service server, the connection request is established according to the port identifier returned by the third service server;
And the second service data sending module is used for sending the second service data to the third service server if the first service server locally stores the second service data, so that the second service data is sent to the second client through the second communication connection after the third service server receives the second service data, and the second client receives the second service data.
Optionally, the apparatus further includes:
a connection request receiving module, configured to perform, before the first acquisition request receiving module 901 performs the receiving of a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server, a connection request sent by the first client and carrying a port identifier of a first port of the first service server;
a connection establishment module for:
if the first port is in an idle state, a first response message carrying a port identifier of the first port is sent to the first client, so that after the first client receives the first response message, a first communication connection with the first service server is established through the first port of the first service server;
And if the first port is in a non-idle state, sending a second response message carrying a port identifier of a second port which is currently idle to the first client, so that the first client establishes a first communication connection with the first service server through the second port of the first service server after receiving the second response message.
Optionally, the data transmission system further comprises a management server;
the apparatus further comprises:
the statistics module is used for counting the size of the data volume of the received service data, the size of the data volume of the transmitted service data and the data flow direction information of the first service server in a preset time period to obtain a statistics result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
the statistical result sending module is used for sending the statistical result to the management server so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
The acquisition request processing module is used for:
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data; and after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
Based on the data transmission device provided by the embodiment of the invention, the first communication connection is established for the first client according to the port identifier returned by the first service server. The first client establishes a first communication connection with the first service server according to the port identifier returned by the first service server, and the first service server does not need to establish the first communication connection with the first client according to the configured port, that is, a service component for sending data to the client in the wired local area network is configured in the first service server in advance according to the network protocol of the wired local area network to which the client belongs. Thus, for each client, the client may send a connection request to the first service server and establish a communication connection with the first service server based on the port identification returned by the first client. Correspondingly, the first service server can send service data to the client through communication connection with the client, that is, the first service server can send service data to a plurality of clients, and the application range of the data transmission method can be improved.
And when the first service server does not store the first service data locally, the first service server can acquire the first service data from the second service server and send the first service data to the first client. For each service server, the service server can request service data from a service server of a layer above the service server, so that data distribution according to a tree network structure can be realized, the data distribution capacity of the data transmission system can be improved, and the data distribution efficiency of the data transmission system can be improved.
Based on the same inventive concept as the data transmission method, the embodiment of the invention also provides a data transmission device. The device is applied to a first client in a data transmission system, and the data transmission system further comprises a first service server in communication connection with the first client; the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with a service server in an adjacent layer to the layer to which the service server belongs. Referring to fig. 10, fig. 10 is a second structure diagram of a data transmission device according to an embodiment of the present invention, where the device includes:
An acquisition request sending module 1001, configured to send a first acquisition request to the first service server through a first communication connection with the first service server, so that after the first service server receives the first acquisition request, if first service data is locally stored in the first service server, send the first service data to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server; the second service server is: a service server of a layer above the first service server;
A service data receiving module 1002, configured to receive the first service data sent by the first service server.
Optionally, the apparatus further includes:
a response information sending module, configured to, before the obtaining request sending module 1001 performs the first communication connection with the first service server, send a first obtaining request to the first service server, perform sending a connection request carrying a port identifier of a first port of the first service server to the first service server, so that after the first service server receives the connection request, send a first response message carrying the port identifier of the first port to the first client if the first port is in an idle state, and send a second response message carrying the port identifier of a second port that is currently idle to the first client if the first port is in a non-idle state;
a communication connection establishment module for:
after receiving the first response message sent by the first service server, establishing a first communication connection with the first service server through a first port of the first service server; and after receiving the second response message sent by the first service server, establishing a first communication connection with the first service server through a second port of the first service server.
Based on the data transmission device provided by the embodiment of the invention, the first communication connection is established for the first client according to the port identifier returned by the first service server. The first client establishes a first communication connection with the first service server according to the port identifier returned by the first service server, and the first service server does not need to establish the first communication connection with the first client according to the configured port, that is, a service component for sending data to the client in the wired local area network is configured in the first service server in advance according to the network protocol of the wired local area network to which the client belongs. Thus, for each client, the client may send a connection request to the first service server and establish a communication connection with the first service server based on the port identification returned by the first client. Correspondingly, the first service server can send service data to the client through communication connection with the client, that is, the first service server can send service data to a plurality of clients, and the application range of the data transmission method can be improved.
And when the first service server does not store the first service data locally, the first service server can acquire the first service data from the second service server and send the first service data to the first client. For each service server, the service server can request service data from a service server of a layer above the service server, so that data distribution according to a tree network structure can be realized, the data distribution capacity of the data transmission system can be improved, and the data distribution efficiency of the data transmission system can be improved.
The embodiment of the present invention further provides an electronic device, as shown in fig. 11, including a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, where the processor 1101, the communication interface 1102 and the memory 1103 complete communication with each other through the communication bus 1104,
a memory 1103 for storing a computer program;
the processor 1101 is configured to implement the steps of any of the data transmission methods in the above embodiments when executing the program stored in the memory 1103.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (ExtendedIndustry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-ProgrammableGate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the steps of any of the data transmission methods described above.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the data transmission methods of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system, apparatus, electronic device, computer readable storage medium, computer program product embodiments, the description is relatively simple as it is substantially similar to method embodiments, and relevant places are referred to in the section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (17)

1. The data transmission method is characterized by being applied to a first service server in a plurality of service servers in a data transmission system, wherein the data transmission system also comprises a management server, and the network structure of the data transmission system is a tree-shaped network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the data transmission system further comprises a plurality of clients which are in communication connection with the first service server; the method comprises the following steps:
receiving a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
If the first service data is stored locally in the first service server, sending the first service data to the first client through the first communication connection so that the first client receives the first service data;
if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; the second service server is: a service server of a layer above the first service server;
receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection so that the first client receives the first service data;
wherein the method further comprises:
counting the data volume of the received service data, the data volume of the transmitted service data and the data flow information of the first service server in a preset time period to obtain a counting result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
The statistical result is sent to the management server, so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data;
and after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
2. The method of claim 1, wherein the transmission paths between the first service server and the second service server are plural; each transmission path includes a plurality of forwarding servers;
The forwarding the first acquisition request to the second service server includes:
determining the shortest transmission path which is included in a plurality of transmission paths between the first service server and the second service server and normally operates by a forwarding server as a target transmission path;
and forwarding the first acquisition request to the second service server according to the target transmission path.
3. The method of claim 1, wherein the first service server has a plurality of threads started therein; each thread is used for processing the acquisition request sent by each client; each thread runs in a designated Central Processing Unit (CPU) core corresponding to the thread in the first service server;
the receiving a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server includes:
receiving a first acquisition request sent by the first client through the first communication connection through a currently idle target thread in the plurality of threads;
the sending the first service data to the first client through the first communication connection includes:
And sending the first service data to the first client through the first communication connection by the target thread.
4. The method of claim 1, further comprising a third service server in communication with the first service server in the data transmission system; the network structure of the data transmission system is a tree network structure; the third service server is a service server of a next layer of the first service server;
the method further comprises the steps of:
receiving a second acquisition request sent by the third service server; the second acquisition request is used for acquiring second service data; the second acquisition request is a second client in the data transmission system and is sent to the third service server through a second communication connection with the third service server; the second communication connection is: after the second client sends a connection request to the third service server, the connection request is established according to the port identifier returned by the third service server;
and if the first service server locally stores the second service data, sending the second service data to the third service server so that the third service server receives the second service data, and then sending the second service data to the second client through the second communication connection so that the second client receives the second service data.
5. The method of claim 1, wherein prior to said receiving a first acquisition request sent by a first client in the data transmission system over a first communication connection with the first traffic server, the method further comprises:
receiving a connection request which is sent by the first client and carries a port identifier of a first port of the first service server;
if the first port is in an idle state, a first response message carrying a port identifier of the first port is sent to the first client, so that after the first client receives the first response message, a first communication connection with the first service server is established through the first port of the first service server;
and if the first port is in a non-idle state, sending a second response message carrying a port identifier of a second port which is currently idle to the first client, so that the first client establishes a first communication connection with the first service server through the second port of the first service server after receiving the second response message.
6. The data transmission method is characterized by being applied to a first client in a data transmission system, wherein the data transmission system further comprises a first service server in communication connection with the first client, and the data transmission system further comprises a management server; the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, a plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the method comprises the following steps:
Sending a first acquisition request to the first service server through a first communication connection with the first service server, so that after the first service server receives the first acquisition request, if first service data is locally stored in the first service server, sending the first service data to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server; the second service server is: a service server of a layer above the first service server;
Receiving the first service data sent by the first service server;
the first service server is further used for counting the data volume of the received service data, the data volume of the transmitted service data and the data flow information of the received service data in a preset time period by the first service server to obtain a counting result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
the statistical result is sent to the management server, so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data;
And after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
7. The method of claim 6, wherein prior to said sending a first acquisition request to the first service server via a first communication connection with the first service server, the method further comprises:
sending a connection request carrying a port identifier of a first port of the first service server to the first service server, so that after the first service server receives the connection request, if the first port is in an idle state, sending a first response message carrying the port identifier of the first port to the first client, and if the first port is in a non-idle state, sending a second response message carrying the port identifier of a second port which is currently idle to the first client;
after receiving the first response message sent by the first service server, establishing a first communication connection with the first service server through a first port of the first service server;
And after receiving the second response message sent by the first service server, establishing a first communication connection with the first service server through a second port of the first service server.
8. The data transmission system is characterized by comprising a plurality of clients and a plurality of service servers, and further comprises a management server, wherein the network structure of the system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; each service server in the system is in communication connection with a plurality of clients; wherein:
a first client of the plurality of clients is configured to send a first acquisition request to a first service server of the plurality of service servers through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
The first service server is configured to receive the first acquisition request sent by the first client through the first communication connection; if the first service data is stored locally in the first service server, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server; the second service server is: a service server of a layer above the first service server;
the second service server is configured to send the first service data to the first service server;
the first service server is further configured to receive the first service data sent by the second service server, and send the first service data to the first client through the first communication connection;
the first client is further configured to receive the first service data sent by the first service server; the first service server is further configured to count the data volume of the received service data, the data volume of the transmitted service data, and the data flow information of the received service data in a preset time period, obtain a statistics result, and send the statistics result to the management server; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
The management server is used for receiving the statistical result sent by the first service server, and sending a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
the first service server is further configured to, after receiving the first adjustment instruction, forward, if a third acquisition request sent by a third client is received, the third acquisition request to a fourth service server that is currently idle in the data transmission system;
the fourth service server is configured to receive the third acquisition request sent by the first service server, and process the third acquisition request; the third acquisition request user acquires third service data;
the first service server is further configured to, after receiving the second adjustment instruction, obtain the third service data if the third obtaining request sent by the third client is received, and send the third service data to the third client;
the third client is configured to receive the third service data sent by the first service server.
9. The data transmission device is characterized by being applied to a first service server in a plurality of service servers in a data transmission system, wherein the data transmission system also comprises a management server, and the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, the plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the data transmission system further comprises a plurality of clients which are in communication connection with the first service server; the device comprises:
a first acquisition request receiving module, configured to receive a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server;
A first service data sending module, configured to send, if the first service data is stored locally in the first service server, the first service data to the first client through the first communication connection, so that the first client receives the first service data;
if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; the second service server is: a service server of a layer above the first service server;
receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection so that the first client receives the first service data;
wherein the apparatus further comprises:
the statistics module is used for counting the size of the data volume of the received service data, the size of the data volume of the transmitted service data and the data flow direction information of the first service server in a preset time period to obtain a statistics result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
The statistical result sending module is used for sending the statistical result to the management server so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
the acquisition request processing module is used for:
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data; and after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
10. The apparatus of claim 9, wherein the transmission paths between the first service server to the second service server are plural; each transmission path includes a plurality of forwarding servers;
The first service data sending module is specifically configured to:
determining the shortest transmission path which is included in a plurality of transmission paths between the first service server and the second service server and normally operates by a forwarding server as a target transmission path;
and forwarding the first acquisition request to the second service server according to the target transmission path.
11. The apparatus of claim 9, wherein the first service server has a plurality of threads started therein; each thread is used for processing the acquisition request sent by each client; each thread runs in a designated Central Processing Unit (CPU) core corresponding to the thread in the first service server;
the first acquisition request receiving module is specifically configured to:
receiving a first acquisition request sent by the first client through the first communication connection through a currently idle target thread in the plurality of threads;
the first service data sending module is specifically configured to:
and sending the first service data to the first client through the first communication connection by the target thread.
12. The apparatus of claim 9, further comprising a third service server in communication with the first service server in the data transmission system; the network structure of the data transmission system is a tree network structure; the third service server is a service server of a next layer of the first service server;
The apparatus further comprises:
the second acquisition request receiving module is used for receiving a second acquisition request sent by the third service server; the second acquisition request is used for acquiring second service data; the second acquisition request is a second client in the data transmission system and is sent to the third service server through a second communication connection with the third service server; the second communication connection is: after the second client sends a connection request to the third service server, the connection request is established according to the port identifier returned by the third service server;
and the second service data sending module is used for sending the second service data to the third service server if the first service server locally stores the second service data, so that the second service data is sent to the second client through the second communication connection after the third service server receives the second service data, and the second client receives the second service data.
13. The apparatus of claim 9, wherein the apparatus further comprises:
a connection request receiving module, configured to perform, before the first acquisition request receiving module performs the receiving of a first acquisition request sent by a first client in the data transmission system through a first communication connection with the first service server, a connection request sent by the first client and carrying a port identifier of a first port of the first service server;
A connection establishment module for:
if the first port is in an idle state, a first response message carrying a port identifier of the first port is sent to the first client, so that after the first client receives the first response message, a first communication connection with the first service server is established through the first port of the first service server;
and if the first port is in a non-idle state, sending a second response message carrying a port identifier of a second port which is currently idle to the first client, so that the first client establishes a first communication connection with the first service server through the second port of the first service server after receiving the second response message.
14. A data transmission device, wherein the device is applied to a first client in a data transmission system, the data transmission system further comprises a first service server in communication connection with the first client, and the data transmission system further comprises a management server; the network structure of the data transmission system is a tree network structure; in the data transmission system of the tree network structure, a plurality of service servers are divided into a plurality of layers, and each layer comprises at least one service server; each service server is in communication connection with the service servers in the adjacent layers of the layers to which the service server belongs; the device comprises:
The acquisition request sending module is used for sending a first acquisition request to the first service server through a first communication connection with the first service server, so that after the first service server receives the first acquisition request, if first service data is locally stored in the first service server, the first service data is sent to the first client through the first communication connection; if the first service data is not stored locally in the first service server, forwarding the first acquisition request to a second service server so that the second service server sends the first service data to the first service server; receiving the first service data sent by the second service server, and sending the first service data to the first client through the first communication connection; the first acquisition request is used for acquiring first service data; the first communication connection is: after the first client sends a connection request to the first service server, the connection request is established according to a port identifier returned by the first service server; the second service server is: a service server of a layer above the first service server;
The service data receiving module is used for receiving the first service data sent by the first service server;
the first service server is further used for counting the data volume of the received service data, the data volume of the transmitted service data and the data flow information of the received service data in a preset time period by the first service server to obtain a counting result; wherein the data flow information represents: the flow direction of the service data sent by the first service server and the flow direction of the service data received by the first service server;
the statistical result is sent to the management server, so that the management server sends a first adjustment instruction to the first service server when the statistical result meets a preset adjustment condition; when the statistical result does not meet the preset adjustment condition, a second adjustment instruction is sent to the first service server;
after receiving the first adjustment instruction, if a third acquisition request sent by a third client is received, forwarding the third acquisition request to a fourth service server currently idle in the data transmission system, so that the fourth service server processes the third acquisition request; the third acquiring request is used for acquiring third service data;
And after receiving the second adjustment instruction, if the third acquisition request sent by the third client is received, acquiring the third service data, and sending the third service data to the third client so that the third client receives the third service data.
15. The apparatus of claim 14, wherein the apparatus further comprises:
a response information sending module, configured to, before the acquiring request sending module performs the first communication connection with the first service server, send a first acquiring request to the first service server, and perform sending a connection request carrying a port identifier of a first port of the first service server to the first service server, so that after the first service server receives the connection request, if the first port is in an idle state, send a first response message carrying the port identifier of the first port to the first client, and if the first port is in a non-idle state, send a second response message carrying a port identifier of a second port that is currently idle to the first client;
A communication connection establishment module for:
after receiving the first response message sent by the first service server, establishing a first communication connection with the first service server through a first port of the first service server; and after receiving the second response message sent by the first service server, establishing a first communication connection with the first service server through a second port of the first service server.
16. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-5 or claims 6-7 when executing a program stored on a memory.
17. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-5, or of claims 6-7.
CN202310042948.2A 2023-01-28 2023-01-28 Data transmission method, system, device, electronic equipment and storage medium Active CN116055565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310042948.2A CN116055565B (en) 2023-01-28 2023-01-28 Data transmission method, system, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310042948.2A CN116055565B (en) 2023-01-28 2023-01-28 Data transmission method, system, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116055565A CN116055565A (en) 2023-05-02
CN116055565B true CN116055565B (en) 2023-06-06

Family

ID=86112967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310042948.2A Active CN116055565B (en) 2023-01-28 2023-01-28 Data transmission method, system, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116055565B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200218A (en) * 2018-03-09 2018-06-22 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment for realizing load balancing
CN110825525A (en) * 2019-11-06 2020-02-21 湖南快乐阳光互动娱乐传媒有限公司 Data resource back-source method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101361061B1 (en) * 2007-04-09 2014-02-07 삼성전자주식회사 Method for transmitting effectively information in server/client network and server/client apparatus using the same
CN102088484B (en) * 2010-12-20 2014-12-10 南京中兴新软件有限责任公司 Write lock method of distributed file system and a system thereof
KR102312336B1 (en) * 2014-07-29 2021-10-14 삼성전자주식회사 Method for sharing data and apparatus thereof
CN106817381A (en) * 2015-11-27 2017-06-09 阿里巴巴集团控股有限公司 Data processing method and device
CN107404504B (en) * 2016-05-19 2020-08-04 中国移动通信集团河南有限公司 Communication method, device and system
CN108418884A (en) * 2018-03-09 2018-08-17 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment of transmission services data
CN111726401B (en) * 2020-06-09 2023-05-26 北京天空卫士网络安全技术有限公司 File transmission method and device
CN113839982B (en) * 2020-06-24 2023-03-21 北京金山云网络技术有限公司 Scheduling method and device, scheduling server, edge server and scheduling system
CN113612735B (en) * 2021-07-15 2022-09-02 中国联合网络通信集团有限公司 Secure storage system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200218A (en) * 2018-03-09 2018-06-22 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment for realizing load balancing
CN110825525A (en) * 2019-11-06 2020-02-21 湖南快乐阳光互动娱乐传媒有限公司 Data resource back-source method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Ericsson / Janne.C1-153357 "Aligning MCPTT client procedures with MCPTT server procedures".3GPP tsg_ct\WG1_mm-cc-sm_ex-CN1.2015,(第TSGC1_94_Belgrade期),全文. *

Also Published As

Publication number Publication date
CN116055565A (en) 2023-05-02

Similar Documents

Publication Publication Date Title
US10951733B2 (en) Route selection method and system, network acceleration node, and network acceleration system
WO2021249490A1 (en) Communication method and service data transmission method in blockchain network
EP2563062B1 (en) Long connection management apparatus and link resource management method for long connection communication
US9299111B2 (en) Efficient presence distribution mechanism for a large enterprise
CN102281190B (en) Networking method for load balancing apparatus, server and client access method
KR101887581B1 (en) Flow-based packet transport device and packet management method thereof
CN107528891B (en) Websocket-based automatic clustering method and system
US20060069777A1 (en) Request message control method for using service and service providing system
US11251981B2 (en) Communication method and apparatus
WO2021254331A1 (en) Resource management method and system, proxy server, and storage medium
JP2022549055A (en) NODE RATE LIMITING METHOD, APPARATUS, ELECTRONIC DEVICE AND STORAGE MEDIUM
EP3979577B1 (en) Queue congestion control method, device and storage medium
US11057475B2 (en) Methods, apparatus and systems for resuming transmission link
CN110096381B (en) Method, device, equipment and medium for realizing remote procedure call
CN101268642B (en) Serial clustering
CN116055565B (en) Data transmission method, system, device, electronic equipment and storage medium
US10135916B1 (en) Integration of service scaling and external health checking systems
CN112087382B (en) Service routing method and device
US11595471B1 (en) Method and system for electing a master in a cloud based distributed system using a serverless framework
CN115665262A (en) Request processing method and device, electronic equipment and storage medium
WO2023045191A1 (en) Video stream obtaining method and apparatus, server, storage medium, and program product
WO2021073367A1 (en) Data processing method, device, and system
WO2021088905A1 (en) Positioning measurement method, terminal and network node
WO2011012034A1 (en) Method for automatically spreading resources and equipment thereof
CN113596109B (en) Service request operation method, system, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A data transmission method, system, device, electronic device, and storage medium

Granted publication date: 20230606

Pledgee: Zhongguancun Beijing technology financing Company limited by guarantee

Pledgor: BLUESTAR TECHNOLOGIES CO.,LTD.

Registration number: Y2024990000070