WO2014036718A1 - Data sending method and device at server end and server using device - Google Patents

Data sending method and device at server end and server using device Download PDF

Info

Publication number
WO2014036718A1
WO2014036718A1 PCT/CN2012/081113 CN2012081113W WO2014036718A1 WO 2014036718 A1 WO2014036718 A1 WO 2014036718A1 CN 2012081113 W CN2012081113 W CN 2012081113W WO 2014036718 A1 WO2014036718 A1 WO 2014036718A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage area
client
content storage
sending
Prior art date
Application number
PCT/CN2012/081113
Other languages
French (fr)
Chinese (zh)
Inventor
官宇
钟超
刘凌云
Original Assignee
北京网鼎芯睿科技有限公司
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 北京网鼎芯睿科技有限公司 filed Critical 北京网鼎芯睿科技有限公司
Priority to PCT/CN2012/081113 priority Critical patent/WO2014036718A1/en
Publication of WO2014036718A1 publication Critical patent/WO2014036718A1/en

Links

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Definitions

  • the present invention relates to a network communication technology, and more particularly to an optimized server-side data transmission method and apparatus and a server using the same. Background technique
  • the WWW service on the Internet is provided by the Web server, and the service standard port is port 80 of TCP/IP; the FTP service is provided by the book FTP server, and the standard service port is port 21.
  • the client needs to access the data resource, it requests a TCP/IP connection to the server's service port.
  • Most data resource access is initiated by the client and then obtained by the server.
  • the server establishes a send buffer for each connection with the client, and then copies the data to be sent to the send buffer.
  • the present invention is directed to the problem that when the server is concurrently connected with a large number of clients, the existing server-side data transmission method causes the server performance to be degraded due to copying the data resources requested by the clients to the respective transmission buffers and then sending them to the clients.
  • the present invention also provides a server-side data transmitting apparatus and a server using the same.
  • a server-side data transmitting method characterized in that the method comprises the following steps:
  • the content sending pointer acquires data in the data content storage area according to the location information, and encapsulates the data and sends the data to the client.
  • the location of the data in the data content storage area is determined by establishing data location information.
  • step A The specific steps of step A are as follows:
  • A analyzes the size of the data accessed by the client
  • A2 a space for allocating corresponding data in the memory storage area as a data content storage area
  • A3. Store data for client access in the data content storage area
  • step B after the client establishes a TCP/IP connection with the server, the server establishes a content sending pointer used by the client TCP/IP connection, and then according to the client's access request, the access request data is The location information of the data content storage area is sent to the content delivery pointer.
  • the data accessed by the client is sent in the form of a plurality of data blocks, and the position of each data block in the data in the data content storage area is determined by step A, and the location information of the data block in the data content storage area is determined in the step B.
  • the location information of a data block in the data content storage area is obtained in the next data block in the data content storage area, and is sent to the client after being encapsulated until all data accessed by the client is completely transmitted.
  • the data sent by the server includes IP data or UDP data or TCP data.
  • a server-side data transmitting device comprising: an interconnected data content storage area, a system module, and a sending module, wherein the sending module includes a content sending pointer, and the system module is configured to load a data resource, and the client
  • the accessed data is stored in the data content storage area, determining the location of the data in the data content storage area and managing the content sending pointer; the system module sends the location information of the data in the data content storage area to the content sending according to the request of the client access
  • the pointer sends the data in the data content storage area through the content sending pointer, and encapsulates the data and sends the data to the client.
  • the transmitting module includes an FPGA or a network processor.
  • the data content storage area includes a RAM or SSD hard disk or a network storage system.
  • the system module determines the location of the data in the data content storage area by establishing data location information.
  • the system module After the client establishes a TCP/IP connection with the sending module, the system module sends the location information of the data of the access request in the data content storage area to the content sending pointer according to the access request of the client.
  • the device sends the data accessed by the client in the form of a plurality of data blocks, and the system module determines the location of each data block in the data content storage area, and sends the location information of the data block in the data content storage area.
  • Send content a pointer; the sending module acquires a data block in the data content storage area through the content sending pointer, and sends the data block to the client after being encapsulated, and the sending module updates the content of the content sending pointer, so that the updated content sending pointer is based on the next data.
  • the location information of the block in the data content storage area is obtained in the next data block in the data content storage area, and is sent to the client after being encapsulated until all the data accessed by the client is completely transmitted.
  • the technical effects of the present invention are as follows:
  • the server-side data transmitting method of the present invention by setting a data content storage area and storing data for client access in the data content storage area, and determining the location of the data in the data content storage area,
  • the content sending pointer needs to establish a connection for the data, and the content sending pointer acquires the data accessed by the client stored in the data content storage area according to the location information of the data, and directly sends the data to the client, so the method of the present invention only needs to be
  • Each connection establishes a content sending pointer for data access, and does not need to establish a sending buffer for each concurrent connection, and at the same time, does not need to copy the data requested by the client in the data transmission multiple times, avoiding a large number of
  • the client concurrently connects the data resources requested by the clients to the respective sending buffers, the data transmission on the server side is slow, and the performance of the server is degraded.
  • the method of the present invention sends the data when the data resources of the server are accessed. No need to carry out any form
  • the server-side data transmitting apparatus sets a data content storage area system module and a sending module, and sets a content sending pointer in the sending module, and the system module stores data for client access in the data content storage area, The location of the data in the data content storage area is determined and the content delivery pointer is managed.
  • the sending module obtains the data in the data content storage area through the content sending pointer, and sends the data to the client after the data is encapsulated.
  • the device does not need to set a transmission buffer area for each concurrent connection. At the same time, the data does not need to be copied and retransmitted multiple times, and the components work together to directly send data to the client through data multiplexing and content sending pointers. Therefore, it can effectively improve the server data transmission performance.
  • the server of the above-mentioned server-side data transmitting device optimizes the data transmission efficiency of the client access, overcomes the problem that the existing server has a rapidly decreasing performance with the number of concurrent connections, and effectively improves the performance of the server itself.
  • FIG. 1 is a flowchart of a method for transmitting data on a server side according to the present invention.
  • FIG. 2 is a schematic structural diagram of a data transmitting apparatus on a server side according to the present invention. detailed description
  • the present invention relates to a server-side data transmission method.
  • the flowchart of the method is as shown in FIG. 1 and includes the following steps: A. Setting a data content storage area and storing data for client access in the data content storage area And determining the location of the data in the data content storage area; wherein, the data content storage area is specifically set, and the size of the data accessible by the client may be analyzed, and then the space of the corresponding data is allocated in the memory storage area as Data content storage area. Data for client access is loaded in the data content storage area, and positioning information of the data resource is established, and the location of the data in the data content storage area is determined.
  • the data of the client access request may be IP data or UDP data or TCP data
  • the location information of the data in the data content storage area is sent to the content sending pointer according to the request of the client access.
  • the server establishes a TCP/IP connection with the client, receives the access request of the client, and assigns a content sending pointer to the connection, or the server establishes a TCP/IP connection with the client.
  • the used content sending pointer analyzes the data access request of the client, determines the positioning information of the data of the access request, and transmits the location information of the data in the data content storage area to the content sending pointer.
  • the data accessed by the client pointed to by the content sending pointer is located in the data content storage area, and the data in the data content storage area is obtained, and the data is encapsulated and sent to the client.
  • the data accessed by the client may be sent in the form of a plurality of data blocks.
  • step A the location of each data block in the data in the data content storage area is determined, and the data is in step B.
  • the location information of the block in the data content storage area is sent to the content delivery pointer.
  • step C the content delivery pointer obtains the data in the data content storage area according to the location information of the data block in the data content storage area of the data accessed by the client.
  • the location in the storage area is obtained according to the updated content sending pointer, and the next data block in the data content storage area is obtained and sent to the client after being encapsulated until all the data accessed by the client is completely transmitted.
  • the present invention relates to a server-side data transmitting apparatus.
  • the schematic structural diagram of the apparatus is as shown in FIG. 2, and includes an interconnected data content storage area, a system module, and a sending module, and the sending module includes a content sending pointer.
  • the preferred transmitting module may comprise an FPGA (Field-Programmable Gate Array) or a Network Processor NP (Network Processor), and the preferred system module comprises a CPU.
  • the preferred data content storage area includes RAM (Random Access Memory) or SSD hard disk (Solid State Disk) or network storage system.
  • the sending module is responsible for establishing a TCP/IP/UDP connection with the client (implementing TCP communication or IP communication or UDP communication with the client), reading data from the content storage area, and transmitting the data package.
  • the system module is responsible for loading the data resources, storing the data accessed by the client in the data content storage area, constructing a data resource location table (or establishing location information of the data by other means) to determine the location of the data in the data content storage area.
  • the system module sends the location information of the data of the access request in the data content storage area to the content sending pointer according to the request of the client access; the sending module acquires the data in the data content storage area through the content sending pointer, and encapsulates the data and sends the data to the client. end.
  • the device of the present invention may send the data accessed by the client in the form of multiple data blocks, and the system module sends the location information of each data block in the data content storage area to the device.
  • the content sending pointer the sending module first obtains the data block in the data content storage area through the content sending pointer, and sends the data block to the client after being encapsulated, and the sending module updates the content of the content sending pointer, so that the updated content sending pointer is according to the client.
  • the location information of the next data block in the accessed data in the data content storage area is obtained in the data content storage area, and is sent to the client after being encapsulated until all the data accessed by the client is completely transmitted.
  • the device of the present invention specifically works as follows:
  • the system module first pre-stores all data for the client to access the browsing in the data content storage area, and determines the location of the data in the data content storage area;
  • the sending module establishes communication with the client, and the sending module notifies the system module of the client's access request, and the system module transmits the location information of the data requested by the client in the data memory storage area to the content according to the request.
  • Sending a pointer the sending module obtains data in the data content storage area through the direction of the content sending pointer, and encapsulates it and sends it to the client.
  • the sending module modifies the content sending pointer to point to the next transmitted data block, and reads the data from the data content storage area through the modified content sending pointer (ie, acquires the next data block), and encapsulates It is then sent to the client until the requested data is sent. After the client disconnects, the contents of the connection send pointer content is cleared.
  • the present invention also relates to a novel server, that is, a server using the server-side data transmitting apparatus according to the present invention, when a large number of clients simultaneously establish a connection with the server, the data transmission performance of the server is not lowered.
  • Data multiplexing and content sending pointers optimize the data transmission efficiency of the data resources accessed by the client.
  • Formal data replication including DMA (Direct Memory Access) replication, effectively improves the performance of the server itself.

Abstract

The present invention provides a data sending method and device at a server end and a server using the device. The data sending method at a server end comprises the following steps: A. configuring a data content storage area, saving data to be accessed by a client in the data content storage area, and determining a location of the data in the data content storage area; B. sending information about the location of the data in the data content storage area to a content sending pointer based on a data access request sent by the client; C. the content sending pointer obtaining the data from the data content storage area based on the location information, encapsulating the data, and sending the encapsulated data to the client. In the method, the data content storage area is configured and data is directly sent to the client through data multiplexing and the content sending pointer, thereby improving the data sending performance of the server in the case of a large number of concurrent connections.

Description

服务器端的数据发送方法和装置以及采用该装置的服务器 技术领域  Server-side data transmitting method and device, and server using the same
本发明涉及一种网络通信技术, 特别是一种优化的服务器端的数据发送方法和装置以及 采用该装置的服务器。 背景技术  The present invention relates to a network communication technology, and more particularly to an optimized server-side data transmission method and apparatus and a server using the same. Background technique
目前, Internet中的大部分应用是客户端服务器模式。 客户端通过 TCP/IP协议, 与服务 说  Currently, most applications on the Internet are client-server models. The client communicates with the service through the TCP/IP protocol.
器建立连接, 访问获取服务器数据资源。 服务器承载了互联网的巨大数据资源, 这些数据资 源,已经成为我们生活中不可缺少的一部分。互联网中的 WWW服务是由 Web服务器来提供, 服务标准端口为 TCP/IP的 80端口; FTP服务是由书 FTP服务器来提供, 标准服务端口为 21 端口。 客户端需要访问数据资源时, 向服务器的服务端口请求建立 TCP/IP连接。 Establish a connection, access to get server data resources. Servers carry huge data resources on the Internet, and these data resources have become an indispensable part of our lives. The WWW service on the Internet is provided by the Web server, and the service standard port is port 80 of TCP/IP; the FTP service is provided by the book FTP server, and the standard service port is port 21. When the client needs to access the data resource, it requests a TCP/IP connection to the server's service port.
大多数的数据资源访问都是由客户端发起, 再到服务器去获取。 当客户端连接到服务器 后, 请求服务器发送数据时, 服务器会给每个与客户端的连接建立发送缓存区, 然后将要发 送的数据复制到发送缓存区。  Most data resource access is initiated by the client and then obtained by the server. When the client connects to the server and requests the server to send data, the server establishes a send buffer for each connection with the client, and then copies the data to be sent to the send buffer.
如果大量的客户端同时向服务器建立连接, 服务器端就会有大量的并发连接。 此时, 服 务器需要将各客户端请求的数据资源复制到各个发送缓存区去, 同时要维护管理这些发送缓 存区, 这样服务器端的数据发送的效率大大降低, 同时占用了服务器中的处理器的资源。 所 以互联网上的服务器随着并发连接数的增加, 性能迅速下降。 发明内容  If a large number of clients establish a connection to the server at the same time, there will be a large number of concurrent connections on the server side. At this time, the server needs to copy the data resources requested by each client to each sending buffer area, and maintain and manage these sending buffer areas, so that the efficiency of data transmission on the server side is greatly reduced, and the resources of the processor in the server are occupied. . As a result, the number of concurrent connections on servers on the Internet has rapidly declined. Summary of the invention
本发明针对在服务器与大量的客户端并发连接时, 现有的服务器端的数据发送方法由于 要将各客户端请求的数据资源复制到各个发送缓存区再发给各客户端导致服务器性能下降的 问题, 提供一种服务器端的数据发送方法, 设置数据内容存储区, 通过数据复用和内容发送 指针, 直接将数据发送给客户端, 提高了服务器在大量并发连接数下的数据发送性能。 本发 明还提供一种服务器端的数据发送装置以及采用该装置的服务器。  The present invention is directed to the problem that when the server is concurrently connected with a large number of clients, the existing server-side data transmission method causes the server performance to be degraded due to copying the data resources requested by the clients to the respective transmission buffers and then sending them to the clients. Providing a server-side data sending method, setting a data content storage area, directly transmitting data to the client through data multiplexing and content sending pointers, and improving data transmission performance of the server under a large number of concurrent connections. The present invention also provides a server-side data transmitting apparatus and a server using the same.
本发明的技术方案如下:  The technical solution of the present invention is as follows:
一种服务器端的数据发送方法, 其特征在于, 所述方法包括以下步骤:  A server-side data transmitting method, characterized in that the method comprises the following steps:
A、 设置数据内容存储区并将用于客户端访问的数据存储在所述数据内容存储区中, 再 确定所述数据在数据内容存储区的位置;  A. setting a data content storage area and storing data for client access in the data content storage area, and determining a location of the data in the data content storage area;
B、 根据客户端访问的请求将数据在数据内容存储区的位置信息发送给内容发送指针; C、 内容发送指针根据所述位置信息获取在数据内容存储区的数据, 并将数据封装后发 送给客户端。 B. Send the location information of the data in the data content storage area to the content sending pointer according to the request of the client access; C. The content sending pointer acquires data in the data content storage area according to the location information, and encapsulates the data and sends the data to the client.
在所述步骤 A中, 通过建立数据定位信息来确定数据在数据内容存储区的位置。  In the step A, the location of the data in the data content storage area is determined by establishing data location information.
所述步骤 A的具体步骤为:  The specific steps of step A are as follows:
A 分析供客户端访问的数据大小;  A analyzes the size of the data accessed by the client;
A2、 在内存存储区中分配相应数据的空间作为数据内容存储区;  A2, a space for allocating corresponding data in the memory storage area as a data content storage area;
A3、 将用于客户端访问的数据存储在所述数据内容存储区中;  A3. Store data for client access in the data content storage area;
A4、 建立数据内容存储区中数据的定位信息以确定所述数据在数据内容存储区的位置。 在所述步骤 B 中, 在客户端与服务器建立 TCP/IP连接后, 服务器建立与所述客户端 TCP/IP连接所使用的内容发送指针, 再根据客户端的访问请求, 将访问请求的数据在数据内 容存储区的位置信息发送给内容发送指针。  A4. Establish positioning information of data in the data content storage area to determine the location of the data in the data content storage area. In the step B, after the client establishes a TCP/IP connection with the server, the server establishes a content sending pointer used by the client TCP/IP connection, and then according to the client's access request, the access request data is The location information of the data content storage area is sent to the content delivery pointer.
客户端访问的数据以多个数据块的形式发送, 通过步骤 A确定数据中的各数据块在数据 内容存储区的位置, 并在所述步骤 B中将数据块在数据内容存储区的位置信息发送给内容发 送指针, 在步骤 C中, 内容发送指针获取在数据内容存储区的数据块, 并在封装后发送给客 户端, 再更新内容发送指针的内容, 使更新后的内容发送指针根据下一个数据块在数据内容 存储区中的位置信息取得在数据内容存储区的所述下一个数据块,并在封装后发送给客户端, 直到客户端访问的数据全部发送完毕。  The data accessed by the client is sent in the form of a plurality of data blocks, and the position of each data block in the data in the data content storage area is determined by step A, and the location information of the data block in the data content storage area is determined in the step B. Sending to the content sending pointer, in step C, the content sending pointer acquires the data block in the data content storage area, and sends it to the client after encapsulation, and then updates the content of the content sending pointer, so that the updated content is sent according to the pointer. The location information of a data block in the data content storage area is obtained in the next data block in the data content storage area, and is sent to the client after being encapsulated until all data accessed by the client is completely transmitted.
服务器端发送的数据包括 IP数据或 UDP数据或 TCP数据。  The data sent by the server includes IP data or UDP data or TCP data.
一种服务器端的数据发送装置, 其特征在于, 包括互相连接的数据内容存储区、 系统模 块和发送模块, 所述发送模块包括内容发送指针, 所述系统模块用于数据资源的装载, 将客 户端访问的数据存储在所述数据内容存储区中, 确定数据在数据内容存储区的位置并管理内 容发送指针; 系统模块根据客户端访问的请求将数据在数据内容存储区的位置信息发送给内 容发送指针; 发送模块通过内容发送指针取得在数据内容存储区的数据, 并将数据封装后发 送给客户端。  A server-side data transmitting device, comprising: an interconnected data content storage area, a system module, and a sending module, wherein the sending module includes a content sending pointer, and the system module is configured to load a data resource, and the client The accessed data is stored in the data content storage area, determining the location of the data in the data content storage area and managing the content sending pointer; the system module sends the location information of the data in the data content storage area to the content sending according to the request of the client access The pointer sends the data in the data content storage area through the content sending pointer, and encapsulates the data and sends the data to the client.
所述发送模块包括 FPGA或网络处理器。  The transmitting module includes an FPGA or a network processor.
所述数据内容存储区包括 RAM或 SSD硬盘或网络存储系统。  The data content storage area includes a RAM or SSD hard disk or a network storage system.
所述系统模块通过建立数据定位信息来确定数据在数据内容存储区的位置。  The system module determines the location of the data in the data content storage area by establishing data location information.
在客户端与发送模块建立 TCP/IP连接后, 系统模块根据客户端的访问请求, 将访问请求 的数据在数据内容存储区的位置信息发送给内容发送指针。  After the client establishes a TCP/IP connection with the sending module, the system module sends the location information of the data of the access request in the data content storage area to the content sending pointer according to the access request of the client.
所述装置将客户端访问的数据以多个数据块的形式发送, 所述系统模块确定数据中的各 数据块在数据内容存储区的位置, 并将数据块在数据内容存储区的位置信息发送给内容发送 指针; 所述发送模块通过内容发送指针取得在数据内容存储区的数据块, 并在封装后发送给 客户端, 发送模块再更新内容发送指针的内容, 使更新后的内容发送指针根据下一个数据块 在数据内容存储区中的位置信息取得在数据内容存储区的所述下一个数据块, 并在封装后发 送给客户端, 直到客户端访问的数据全部发送完毕。 The device sends the data accessed by the client in the form of a plurality of data blocks, and the system module determines the location of each data block in the data content storage area, and sends the location information of the data block in the data content storage area. Send content a pointer; the sending module acquires a data block in the data content storage area through the content sending pointer, and sends the data block to the client after being encapsulated, and the sending module updates the content of the content sending pointer, so that the updated content sending pointer is based on the next data. The location information of the block in the data content storage area is obtained in the next data block in the data content storage area, and is sent to the client after being encapsulated until all the data accessed by the client is completely transmitted.
一种服务器, 其特征在于, 包括上述的服务器端的数据发送装置。 本发明的技术效果如下:  A server characterized by comprising the server-side data transmitting apparatus described above. The technical effects of the present invention are as follows:
本发明所述的服务器端的数据发送方法, 通过设置数据内容存储区并将用于客户端访问 的数据存储在所述数据内容存储区中, 再确定所述数据在数据内容存储区的位置, 只需要通 过内容发送指针为数据建立连接, 内容发送指针根据数据的位置信息获取在数据内容存储区 存储的客户端访问的数据, 直接将该数据发送给客户端, 故本发明所述方法只需要为每个连 接建立进行数据访问的内容发送指针, 不需要为每个并发连接建立发送缓存区, 同时, 不需 要在数据发送中将客户端请求访问的数据进行多次复制, 避免了在与大量的客户并发连接时 由于将各客户端请求的数据资源复制到各个发送缓存区导致服务器端的数据发送缓慢, 服务 器性能下降的问题, 本发明所述方法在服务器的数据资源被访问时将数据进行发送过程中不 需要进行任何形式的数据复制, 提高了服务器在大量并发连接数下的数据发送性能。  The server-side data transmitting method of the present invention, by setting a data content storage area and storing data for client access in the data content storage area, and determining the location of the data in the data content storage area, The content sending pointer needs to establish a connection for the data, and the content sending pointer acquires the data accessed by the client stored in the data content storage area according to the location information of the data, and directly sends the data to the client, so the method of the present invention only needs to be Each connection establishes a content sending pointer for data access, and does not need to establish a sending buffer for each concurrent connection, and at the same time, does not need to copy the data requested by the client in the data transmission multiple times, avoiding a large number of When the client concurrently connects the data resources requested by the clients to the respective sending buffers, the data transmission on the server side is slow, and the performance of the server is degraded. The method of the present invention sends the data when the data resources of the server are accessed. No need to carry out any form Replication, high performance server transmits data at a large number of concurrent connections.
本发明涉及的服务器端的数据发送装置,通过设置数据内容存储区系统模块和发送模块, 发送模块中设置内容发送指针, 系统模块将用于客户端访问的数据存储在所述数据内容存储 区中, 确定数据在数据内容存储区的位置并管理内容发送指针, 发送模块通过内容发送指针 取得在数据内容存储区的数据, 并在数据封装后发送给客户端。 该装置不需要为每个并发连 接设置发送缓存区, 同时, 不需要将数据进行多次的复制再发送, 各部件配合工作, 通过数 据复用和内容发送指针, 直接将数据发送给客户端, 故能够有效提高服务器数据发送性能。  The server-side data transmitting apparatus according to the present invention sets a data content storage area system module and a sending module, and sets a content sending pointer in the sending module, and the system module stores data for client access in the data content storage area, The location of the data in the data content storage area is determined and the content delivery pointer is managed. The sending module obtains the data in the data content storage area through the content sending pointer, and sends the data to the client after the data is encapsulated. The device does not need to set a transmission buffer area for each concurrent connection. At the same time, the data does not need to be copied and retransmitted multiple times, and the components work together to directly send data to the client through data multiplexing and content sending pointers. Therefore, it can effectively improve the server data transmission performance.
采用上述服务器端的数据发送装置的服务器, 优化了客户端访问的数据发送效率, 克服 了现有的服务器随并发连接数的增加性能迅速下降的问题,有效的提高了服务器自身的性能。 附图说明  The server of the above-mentioned server-side data transmitting device optimizes the data transmission efficiency of the client access, overcomes the problem that the existing server has a rapidly decreasing performance with the number of concurrent connections, and effectively improves the performance of the server itself. DRAWINGS
图 1为本发明服务器端的数据发送方法的流程图。  FIG. 1 is a flowchart of a method for transmitting data on a server side according to the present invention.
图 2为本发明服务器端的数据发送装置的结构示意图。 具体实施方式  2 is a schematic structural diagram of a data transmitting apparatus on a server side according to the present invention. detailed description
下面结合附图对本发明进行说明。 本发明涉及一种服务器端的数据发送方法, 该方法的流程图如图 1所示, 包括以下步骤: A、 设置数据内容存储区并将用于客户端访问的数据存储在所述数据内容存储区中, 再 确定所述数据在数据内容存储区的位置; 其中, 数据内容存储区是专门设置的, 可以通过分 析可供客户端访问的数据大小, 然后在内存存储区中分配相应数据的空间作为数据内容存储 区。 将用于客户端访问的数据装载在所述数据内容存储区中, 再建立数据资源的定位信息, 确定数据在数据内容存储区中的位置。 The invention will now be described with reference to the accompanying drawings. The present invention relates to a server-side data transmission method. The flowchart of the method is as shown in FIG. 1 and includes the following steps: A. Setting a data content storage area and storing data for client access in the data content storage area And determining the location of the data in the data content storage area; wherein, the data content storage area is specifically set, and the size of the data accessible by the client may be analyzed, and then the space of the corresponding data is allocated in the memory storage area as Data content storage area. Data for client access is loaded in the data content storage area, and positioning information of the data resource is established, and the location of the data in the data content storage area is determined.
B、 客户端访问请求的数据可以是 IP数据或 UDP数据或 TCP数据, 根据客户端访问的 请求将数据在数据内容存储区的位置信息发送给内容发送指针。 优选为, 客户端访问服务器 后, 将服务器与客户端建立 TCP/IP连接, 接收客户端的访问请求, 并分配给此连接一个内容 发送指针, 或者说是服务器建立与所述客户端 TCP/IP连接所使用的内容发送指针, 分析客户 端的数据访问请求, 确定访问请求的数据的定位信息, 将该数据在数据内容存储区的位置信 息发送给内容发送指针。  B. The data of the client access request may be IP data or UDP data or TCP data, and the location information of the data in the data content storage area is sent to the content sending pointer according to the request of the client access. Preferably, after the client accesses the server, the server establishes a TCP/IP connection with the client, receives the access request of the client, and assigns a content sending pointer to the connection, or the server establishes a TCP/IP connection with the client. The used content sending pointer analyzes the data access request of the client, determines the positioning information of the data of the access request, and transmits the location information of the data in the data content storage area to the content sending pointer.
c、 在内容发送指针所指向的客户端访问的数据在数据内容存储区中的位置, 取得在数 据内容存储区的数据, 并将数据封装后发送给客户端。  c. The data accessed by the client pointed to by the content sending pointer is located in the data content storage area, and the data in the data content storage area is obtained, and the data is encapsulated and sent to the client.
客户端访问的数据可通过多个数据块的形式发送, 此时本发明所述方法中, 在步骤 A中 确定数据中的各数据块在数据内容存储区的位置, 并在步骤 B中将数据块在数据内容存储区 的位置信息发送给内容发送指针, 在步骤 C中, 内容发送指针根据客户端访问的数据中的数 据块在数据内容存储区中的位置信息取得在数据内容存储区的数据块, 并在封装后发送给客 户端, 再更新内容发送指针的内容, 使其指向下一个数据块位置, 即更新后的内容发送指针 指向客户端访问的数据中的下一个数据块在数据内容存储区中的位置, 根据更新的内容发送 指针所指位置获取在数据内容存储区的下一个数据块, 并在封装后发送给客户端, 直到客户 端访问的数据全部发送完毕。  The data accessed by the client may be sent in the form of a plurality of data blocks. In the method of the present invention, in step A, the location of each data block in the data in the data content storage area is determined, and the data is in step B. The location information of the block in the data content storage area is sent to the content delivery pointer. In step C, the content delivery pointer obtains the data in the data content storage area according to the location information of the data block in the data content storage area of the data accessed by the client. Block, and after being encapsulated, sent to the client, and then update the content of the content sending pointer to point to the next data block position, that is, the updated content sending pointer points to the next data block in the data accessed by the client in the data content. The location in the storage area is obtained according to the updated content sending pointer, and the next data block in the data content storage area is obtained and sent to the client after being encapsulated until all the data accessed by the client is completely transmitted.
本发明涉及一种服务器端的数据发送装置, 该装置的结构示意图如图 2所示, 包括互相 连接的数据内容存储区、 系统模块和发送模块, 发送模块包括内容发送指针。 优选的发送模 块可以包括 FPGA(Field-Programmable Gate Array 现场可编程门阵列)或网络处理器 NP (Network Processor),优选的系统模块包括 CPU。优选的数据内容存储区包括 RAM (Random Access Memory随机存储器) 或 SSD硬盘 (Solid State Disk, 固态硬盘) 或网络存储系统。  The present invention relates to a server-side data transmitting apparatus. The schematic structural diagram of the apparatus is as shown in FIG. 2, and includes an interconnected data content storage area, a system module, and a sending module, and the sending module includes a content sending pointer. The preferred transmitting module may comprise an FPGA (Field-Programmable Gate Array) or a Network Processor NP (Network Processor), and the preferred system module comprises a CPU. The preferred data content storage area includes RAM (Random Access Memory) or SSD hard disk (Solid State Disk) or network storage system.
发送模块负责与客户端建立 TCP/IP/UDP连接 (实现与客户端的 TCP通信或 IP通信或 UDP 通信), 从内容存储区中读取数据, 将数据封装发送。 系统模块负责数据资源的装载, 将客户端访问的数据存储在所述数据内容存储区中, 构建数据资源定位表 (或通过其它方式 建立数据的定位信息)以确定数据在数据内容存储区的位置, 管理发送模块的内容发送指针; 系统模块根据客户端访问的请求将访问请求的数据在数据内容存储区的位置信息发送给内容 发送指针; 发送模块通过内容发送指针取得在数据内容存储区的数据, 并将数据封装后发送 给客户端。 The sending module is responsible for establishing a TCP/IP/UDP connection with the client (implementing TCP communication or IP communication or UDP communication with the client), reading data from the content storage area, and transmitting the data package. The system module is responsible for loading the data resources, storing the data accessed by the client in the data content storage area, constructing a data resource location table (or establishing location information of the data by other means) to determine the location of the data in the data content storage area. , managing the content sending pointer of the sending module; The system module sends the location information of the data of the access request in the data content storage area to the content sending pointer according to the request of the client access; the sending module acquires the data in the data content storage area through the content sending pointer, and encapsulates the data and sends the data to the client. end.
当客户端访问请求的数据比较大时, 本发明所述装置可以将客户端访问的数据以多个数 据块的形式发送, 系统模块将各数据块在数据内容存储区中的位置信息均发送给内容发送指 针, 发送模块先通过内容发送指针取得在数据内容存储区的数据块, 并在封装后发送给客户 端, 发送模块再更新内容发送指针的内容, 使更新后的内容发送指针根据客户端访问的数据 中的下一个数据块在数据内容存储区中的位置信息取得在数据内容存储区的数据块, 并在封 装后发送给客户端, 直到客户端访问的数据全部发送完毕。  When the data of the client access request is relatively large, the device of the present invention may send the data accessed by the client in the form of multiple data blocks, and the system module sends the location information of each data block in the data content storage area to the device. The content sending pointer, the sending module first obtains the data block in the data content storage area through the content sending pointer, and sends the data block to the client after being encapsulated, and the sending module updates the content of the content sending pointer, so that the updated content sending pointer is according to the client. The location information of the next data block in the accessed data in the data content storage area is obtained in the data content storage area, and is sent to the client after being encapsulated until all the data accessed by the client is completely transmitted.
本发明所述装置具体工作如下: 系统模块先将用于客户端将要访问浏览的全部数据预先 存储在数据内容存储区中, 并确定该数据在数据内容存储区中的位置; 在客户端访问到服务 器后, 通过发送模块建立与客户端的通信, 发送模块会将客户端的访问请求告诉系统模块, 系统模块根据该请求, 将该客户端所请求的数据在数据内存存储区中的位置信息传送给内容 发送指针; 发送模块通过内容发送指针的指向, 在数据内容存储区取得数据, 封装后发送给 客户端。 在数据发送后, 发送模块修改内容发送指针, 使其指向下一个发送的数据块, 通过 该修改的内容发送指针从数据内容存储区中读取数据(即获取下一个数据块), 并在封装后发 送给客户端, 直到所请求的数据发送完成。 在客户端断开连接后, 此连接的内容发送指针内 容清除。  The device of the present invention specifically works as follows: The system module first pre-stores all data for the client to access the browsing in the data content storage area, and determines the location of the data in the data content storage area; After the server, the sending module establishes communication with the client, and the sending module notifies the system module of the client's access request, and the system module transmits the location information of the data requested by the client in the data memory storage area to the content according to the request. Sending a pointer; the sending module obtains data in the data content storage area through the direction of the content sending pointer, and encapsulates it and sends it to the client. After the data is sent, the sending module modifies the content sending pointer to point to the next transmitted data block, and reads the data from the data content storage area through the modified content sending pointer (ie, acquires the next data block), and encapsulates It is then sent to the client until the requested data is sent. After the client disconnects, the contents of the connection send pointer content is cleared.
本发明还涉及一种新型的服务器, 即采用了本发明所述的服务器端的数据发送装置的服 务器, 在大量的客户端同时与服务器建立连接时, 并不会降低该服务器的数据发送性能, 通 过数据复用和内容发送指针, 优化了客户端访问的数据资源的数据发送效率, 在客户端访问 服务器进而进行数据发送时, 不需要建立发送缓存区, 且在数据发送过程中也不需要进行任 何形式的数据复制, 包括 DMA (Direct Memory Access, 存储器直接访问) 复制, 有效的提 高了服务器自身的性能。  The present invention also relates to a novel server, that is, a server using the server-side data transmitting apparatus according to the present invention, when a large number of clients simultaneously establish a connection with the server, the data transmission performance of the server is not lowered. Data multiplexing and content sending pointers optimize the data transmission efficiency of the data resources accessed by the client. When the client accesses the server and then performs data transmission, there is no need to establish a transmission buffer area, and no need to perform any data transmission process. Formal data replication, including DMA (Direct Memory Access) replication, effectively improves the performance of the server itself.
应当指出, 以上所述具体实施方式可以使本领域的技术人员更全面地理解本发明创造, 但不以任何方式限制本发明创造。 因此, 尽管本说明书参照附图和实施例对本发明创造已进 行了详细的说明, 但是, 本领域技术人员应当理解, 仍然可以对本发明创造进行修改或者等 同替换, 总之, 一切不脱离本发明创造的精神和范围的技术方案及其改进, 其均应涵盖在本 发明创造专利的保护范围当中。  It should be noted that the above-described embodiments may enable those skilled in the art to more fully understand the present invention, but do not limit the invention in any way. Therefore, although the present invention has been described in detail with reference to the drawings and embodiments, it will be understood by those skilled in the art that the invention may be modified or equivalently substituted. In short, all without departing from the invention. The technical solutions of the spirit and scope and their improvements shall be covered by the scope of protection of the patents of the present invention.

Claims

1、 一种服务器端的数据发送方法, 其特征在于, 所述方法包括以下步骤: 1. A server-side data sending method, characterized in that the method includes the following steps:
A、 设置数据内容存储区并将用于客户端访问的数据存储在所述数据内容存储区中, 再 确定所述数据在数据内容存储区的位置; A. Set up a data content storage area and store the data for client access in the data content storage area, and then determine the location of the data in the data content storage area;
B、 根据客户端访问的请求将数据在数据内容存储区的位置信息发送给内容发送指针; B. Send the location information of the data in the data content storage area to the content sending pointer according to the client access request;
C、 内容发送指针根据所述位置信息获取在数据内容存储区的数据, 并将数据封装后发 送给客户端。 C. The content sending pointer obtains the data in the data content storage area according to the location information, and encapsulates the data before sending it to the client.
2、 根据权利要求 1所述的方法, 其特征在于, 在所述步骤 A中, 通过建立数据定位信 息来确定数据在数据内容存储区的位置。 2. The method according to claim 1, characterized in that, in step A, the location of the data in the data content storage area is determined by establishing data positioning information.
3、 根据权利要求 1所述的方法, 其特征在于, 所述步骤 A的具体步骤为: 3. The method according to claim 1, characterized in that the specific steps of step A are:
A 分析供客户端访问的数据大小; A Analyze the data size for client access;
A2、 在内存存储区中分配相应数据的空间作为数据内容存储区; A2. Allocate space for corresponding data in the memory storage area as the data content storage area;
A3、 将用于客户端访问的数据存储在所述数据内容存储区中; A3. Store data for client access in the data content storage area;
A4、 建立数据内容存储区中数据的定位信息以确定所述数据在数据内容存储区的位置。 A4. Establish the positioning information of the data in the data content storage area to determine the location of the data in the data content storage area.
4、 根据权利要求 1至 3之一所述的方法, 其特征在于, 在所述步骤 B中, 在客户端与 服务器建立 TCP/IP连接后, 服务器建立与所述客户端 TCP/IP连接所使用的内容发送指针, 再根据客户端的访问请求, 将访问请求的数据在数据内容存储区的位置信息发送给内容发送 指针。 4. The method according to any one of claims 1 to 3, characterized in that, in step B, after the client establishes a TCP/IP connection with the server, the server establishes a TCP/IP connection with the client. The content sending pointer is used, and then according to the client's access request, the location information of the access requested data in the data content storage area is sent to the content sending pointer.
5、根据权利要求 1至 3之一所述的方法, 其特征在于, 客户端访问的数据以多个数据块 的形式发送, 通过步骤 A确定数据中的各数据块在数据内容存储区的位置, 并在所述步骤 B 中将数据块在数据内容存储区的位置信息发送给内容发送指针, 在步骤 C中, 内容发送指针 获取在数据内容存储区的数据块, 并在封装后发送给客户端, 再更新内容发送指针的内容, 使更新后的内容发送指针根据下一个数据块在数据内容存储区中的位置信息取得在数据内容 存储区的所述下一个数据块, 并在封装后发送给客户端, 直到客户端访问的数据全部发送完 毕。 5. The method according to any one of claims 1 to 3, characterized in that the data accessed by the client is sent in the form of multiple data blocks, and the location of each data block in the data in the data content storage area is determined through step A. , and in step B, the location information of the data block in the data content storage area is sent to the content sending pointer. In step C, the content sending pointer obtains the data block in the data content storage area, and sends it to the client after encapsulation end, and then update the content of the content sending pointer, so that the updated content sending pointer obtains the next data block in the data content storage area based on the position information of the next data block in the data content storage area, and sends it after encapsulation to the client until all data accessed by the client is sent.
6、 根据权利要求 1至 3之一所述的方法, 其特征在于, 服务器端发送的数据包括 IP数 据或 UDP数据或 TCP数据。 6. The method according to one of claims 1 to 3, characterized in that the data sent by the server includes IP data or UDP data or TCP data.
7、 一种服务器端的数据发送装置, 其特征在于, 包括互相连接的数据内容存储区、 系统 模块和发送模块, 所述发送模块包括内容发送指针, 所述系统模块用于数据资源的装载, 将 客户端访问的数据存储在所述数据内容存储区中, 确定数据在数据内容存储区的位置并管理 内容发送指针; 系统模块根据客户端访问的请求将数据在数据内容存储区的位置信息发送给 内容发送指针; 发送模块通过内容发送指针取得在数据内容存储区的数据, 并将数据封装后 发送给客户端。 7. A server-side data sending device, characterized in that it includes an interconnected data content storage area, a system module and a sending module. The sending module includes a content sending pointer, and the system module is used for loading data resources. The data accessed by the client is stored in the data content storage area, determines the location of the data in the data content storage area and manages the content sending pointer; the system module sends the location information of the data in the data content storage area to the client according to the client access request. Content sending pointer; The sending module obtains the data in the data content storage area through the content sending pointer and encapsulates the data. Sent to client.
8、 根据权利要求 7所述的装置, 其特征在于, 所述发送模块包括 FPGA或网络处理器。 8. The device according to claim 7, wherein the sending module includes an FPGA or a network processor.
9、根据权利要求 7所述的装置, 其特征在于, 所述数据内容存储区包括 RAM或 SSD硬 盘或网络存储系统。 9. The device according to claim 7, characterized in that the data content storage area includes RAM or SSD hard disk or network storage system.
10、 根据权利要求 7至 9之一所述的装置, 其特征在于, 所述系统模块通过建立数据定 位信息来确定数据在数据内容存储区的位置。 10. The device according to any one of claims 7 to 9, characterized in that the system module determines the location of the data in the data content storage area by establishing data positioning information.
11、根据权利要求 7至 9之一所述的装置,其特征在于,在客户端与发送模块建立 TCP/IP 连接后, 系统模块根据客户端的访问请求, 将访问请求的数据在数据内容存储区的位置信息 发送给内容发送指针。 11. The device according to any one of claims 7 to 9, characterized in that, after the client establishes a TCP/IP connection with the sending module, the system module stores the access requested data in the data content storage area according to the client's access request. The location information is sent to the content sending pointer.
12、 根据权利要求 7至 9之一所述的装置, 其特征在于, 所述装置将客户端访问的数据 以多个数据块的形式发送, 所述系统模块确定数据中的各数据块在数据内容存储区的位置, 并将数据块在数据内容存储区的位置信息发送给内容发送指针; 所述发送模块通过内容发送 指针取得在数据内容存储区的数据块, 并在封装后发送给客户端, 发送模块再更新内容发送 指针的内容, 使更新后的内容发送指针根据下一个数据块在数据内容存储区中的位置信息取 得在数据内容存储区的所述下一个数据块, 并在封装后发送给客户端, 直到客户端访问的数 据全部发送完毕。 12. The device according to any one of claims 7 to 9, characterized in that, the device sends the data accessed by the client in the form of multiple data blocks, and the system module determines that each data block in the data is in the data. The location of the content storage area, and sends the location information of the data block in the data content storage area to the content sending pointer; the sending module obtains the data block in the data content storage area through the content sending pointer, and sends it to the client after encapsulation , the sending module then updates the content of the content sending pointer, so that the updated content sending pointer obtains the next data block in the data content storage area based on the position information of the next data block in the data content storage area, and after encapsulation Sent to the client until all data accessed by the client is sent.
13、 一种服务器, 其特征在于, 包括权利要求 7至 12之一所述的服务器端的数据发送装 置。 13. A server, characterized by comprising the server-side data sending device according to one of claims 7 to 12.
PCT/CN2012/081113 2012-09-07 2012-09-07 Data sending method and device at server end and server using device WO2014036718A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/081113 WO2014036718A1 (en) 2012-09-07 2012-09-07 Data sending method and device at server end and server using device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/081113 WO2014036718A1 (en) 2012-09-07 2012-09-07 Data sending method and device at server end and server using device

Publications (1)

Publication Number Publication Date
WO2014036718A1 true WO2014036718A1 (en) 2014-03-13

Family

ID=50236464

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/081113 WO2014036718A1 (en) 2012-09-07 2012-09-07 Data sending method and device at server end and server using device

Country Status (1)

Country Link
WO (1) WO2014036718A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0887478A (en) * 1994-09-16 1996-04-02 Nippon Telegr & Teleph Corp <Ntt> Inter-process message communication method
US20090100213A1 (en) * 2007-10-10 2009-04-16 Apple Inc. Systems and Methods for Managing Memory Core Surface
CN101782907A (en) * 2009-01-21 2010-07-21 英业达股份有限公司 Data scanning and inputting method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0887478A (en) * 1994-09-16 1996-04-02 Nippon Telegr & Teleph Corp <Ntt> Inter-process message communication method
US20090100213A1 (en) * 2007-10-10 2009-04-16 Apple Inc. Systems and Methods for Managing Memory Core Surface
CN101782907A (en) * 2009-01-21 2010-07-21 英业达股份有限公司 Data scanning and inputting method

Similar Documents

Publication Publication Date Title
US10700979B2 (en) Load balancing for a virtual networking system
US10411956B2 (en) Enabling planned upgrade/downgrade of network devices without impacting network sessions
US10698717B2 (en) Accelerator virtualization method and apparatus, and centralized resource manager
US11275530B2 (en) Method, system, and related device for NAS data access
RU2589398C2 (en) Data-fast-distribution method and device
WO2014094468A1 (en) System, method and browser client for enabling browser data synchronization
US20160330299A1 (en) Data distribution method and system and data receiving apparatus
JP2008542887A5 (en)
US11379405B2 (en) Internet small computer interface systems extension for remote direct memory access (RDMA) for distributed hyper-converged storage systems
WO2021073546A1 (en) Data access method, device, and first computer device
WO2018120397A1 (en) Reverse file uploading method and system
WO2019134403A1 (en) Method and apparatus for sending data packet, and computer-readable storage medium
JP5304674B2 (en) Data conversion apparatus, data conversion method and program
CN111225003B (en) NFS node configuration method and device
KR100936918B1 (en) TCP Offload Engine Apparatus and Method for System Call Processing for Static File Transmission
CN111404842B (en) Data transmission method, device and computer storage medium
WO2015085794A1 (en) Data transmission method, related apparatus, and communications system
JP5729659B2 (en) Media streaming method and media controller
WO2015062390A1 (en) Virtual machine migration method, device and system
CN113411363A (en) Uploading method of image file, related equipment and computer storage medium
CN105573801A (en) Method for realizing software upgrading in stacking system as well as device and system
WO2014036718A1 (en) Data sending method and device at server end and server using device
Shimano et al. An information propagation scheme for an autonomous distributed storage system in iSCSI environment
WO2014077451A1 (en) Network distributed file system and method using iscsi storage system
TW201312371A (en) Method and device for transmitting data from server side and server using the device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12884085

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12884085

Country of ref document: EP

Kind code of ref document: A1