Data transmission methods, devices, servers, media and products
By allocating memory space on demand at the target receiving end and creating a precisely matched communication domain, the problem of low data transmission efficiency between multiple media is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202511233290.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-08-29
AI Technical Summary
Existing technologies have low efficiency in data transmission between multiple media and require the pre-allocation of fixed memory space, resulting in resource waste and increased waiting time.
By sending memory space requests, memory space is allocated on demand, and communication domains are created according to different transmission scenarios to accurately match transmission needs and reduce unnecessary operations and resource consumption.
It improves the efficiency of data transmission between multiple media, avoids wasted memory space and transmission waiting, and enhances transmission stability and success rate.
Smart Images

Figure CN120743559B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to data transmission methods, devices, servers, media and products. Background Technology
[0002] With the rapid development of artificial intelligence technology, the parameters of large AI models are growing exponentially, and a single block of video memory can no longer hold all the model parameters and intermediate data generated during training and inference. To alleviate the problem of insufficient video memory, data needs to be transferred between multiple media such as video memory, RAM, and solid-state drives. In this context, efficient data transfer between multiple media has become a key challenge.
[0003] Currently, related technologies are based on communication libraries for multi-media data transmission, enabling data transmission between multiple media. However, these technologies only support a single transmission scenario and require pre-allocation of fixed memory space, which reduces the efficiency of multi-media data transmission. Summary of the Invention
[0004] This application provides a data transmission method, apparatus, server, medium, and product to at least solve the problem of low data transmission efficiency between multiple media in related technologies.
[0005] This application provides a data transmission method, comprising: establishing a connection with at least one target receiving end based on the connection address and port identifier of at least one target receiving end; after detecting the connection establishment, sending a memory space request to at least one target receiving end, so that at least one target receiving end obtains memory space parameters according to the memory space request, and encapsulates the memory space parameters into memory space data of a preset format; receiving the memory space data of the preset format sent by at least one target receiving end; generating communication domain creation requests for different transmission scenarios according to the transmission scenario with at least one target receiving end, and sending the communication domain creation requests to at least one target receiving end, so that at least one target receiving end creates a communication domain according to the communication domain creation requests; after detecting that at least one target receiving end has created a communication domain, transmitting the memory space data of the preset format and the data to be transmitted through the communication domain to at least one target receiving end, so that at least one target receiving end saves the data to be transmitted according to the memory space data of the preset format.
[0006] This application also provides a data transmission apparatus, comprising: a connection establishment module, configured to establish a connection with at least one target receiving end based on the connection address and port identifier of at least one target receiving end; a memory space request module, configured to send a memory space request to at least one target receiving end after detecting the connection establishment, so that at least one target receiving end obtains memory space parameters according to the memory space request and encapsulates the memory space parameters into memory space data of a preset format; a receiving module, configured to receive memory space data of a preset format sent by at least one target receiving end; a communication domain creation request module, configured to generate communication domain creation requests for different transmission scenarios based on the transmission scenario with at least one target receiving end, and send the communication domain creation requests to at least one target receiving end, so that at least one target receiving end creates a communication domain according to the communication domain creation requests; and a transmission module, configured to transmit memory space data of a preset format and data to be transmitted through the communication domain to at least one target receiving end after detecting that at least one target receiving end has created a communication domain, so that at least one target receiving end saves the data to be transmitted according to the memory space data of the preset format.
[0007] This application also provides a server, including: a memory for storing a computer program; and a processor for implementing any of the above-described data transmission methods when executing the computer program.
[0008] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described data transmission methods.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described data transmission methods.
[0010] This application improves the efficiency of data transmission between multiple media by establishing a connection with at least one target receiver based on its connection address and port identifier when transmitting data to at least one target receiver. First, by sending memory space requests, memory space for storing the data to be transmitted is pre-allocated to each of the at least one target receiver, achieving on-demand allocation and avoiding idle memory space. This reduces transmission waiting caused by memory space scheduling during subsequent transmission of other data, thus improving transmission efficiency. Second, it supports multiple transmission scenarios by creating communication domains according to different scenarios. By precisely matching the communication domain with specific transmission requirements, unnecessary operations and resource consumption are reduced, thereby improving transmission efficiency. Furthermore, pre-allocating memory space to the target receivers on demand avoids memory waste. Attached Figure Description
[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic diagram illustrating a scenario of the data transmission method provided in an embodiment of this application;
[0013] Figure 2 A flowchart illustrating the data transmission method provided in an embodiment of this application;
[0014] Figure 3 The data transmission method interaction process between the sending end and any target receiving end provided in the embodiments of this application;
[0015] Figure 4 This is a method framework diagram of the data transmission method provided in the embodiments of this application;
[0016] Figure 5 This is a schematic diagram of the structure of the data transmission device provided in the embodiments of this application;
[0017] Figure 6 This is a schematic diagram of the server structure provided in an embodiment of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0019] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0020] With the rapid development of artificial intelligence (AI) technology, the parameters of large AI models are growing exponentially, and a single block of video memory can no longer hold all the model parameters and intermediate data generated during training and inference. To alleviate the problem of insufficient video memory, data needs to be transferred between multiple media such as video memory, RAM, and solid-state drives (SSDs). Against this backdrop, efficient data transfer between multiple media has become a key challenge. Currently, related technologies are based on communication libraries for multi-media data transfer to achieve data transfer between multiple media. However, these technologies only support a single transmission scenario and require pre-allocation of fixed memory space, which reduces the efficiency of data transfer between multiple media.
[0021] To address the technical problems in related technologies, this application proposes the following technical concept: When transmitting data to at least one target receiving end, the efficiency of data transmission between multiple media is improved in two ways. First, by sending a memory space request, memory space for storing data in the target receiving end is requested in advance, enabling on-demand allocation and avoiding idle memory space due to pre-allocated fixed memory. This reduces transmission waiting caused by scheduling memory space resources during subsequent data transmission, thereby improving transmission efficiency. Second, multiple transmission scenarios are supported by creating communication domains according to different transmission scenarios. By precisely matching the communication domain with specific transmission requirements, unnecessary operations and resource consumption are reduced, thereby improving transmission efficiency.
[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] This section describes the specific application environment architecture or hardware architecture upon which the data transmission method depends. (References) Figure 1 , Figure 1 This is a schematic diagram illustrating a scenario of the data transmission method provided in an embodiment of this application. Figure 1 As shown, it includes a server 101 and at least one target receiver 102.
[0024] In this embodiment, server 101 establishes a connection with at least one target receiver 102 based on the connection address and port identifier of at least one target receiver 102. After detecting the connection establishment, server 101 sends a memory space request to at least one target receiver 102, so that at least one target receiver 102 obtains memory space parameters according to the memory space request and encapsulates the memory space parameters into memory space data in a preset format. Server 101 receives the memory space data in the preset format sent by at least one target receiver 102. Server 101 generates communication domain creation requests for different transmission scenarios based on the transmission scenario with at least one target receiver 102, and sends the communication domain creation requests to at least one target receiver 102, so that at least one target receiver 102 creates a communication domain according to the communication domain creation requests. After detecting that at least one target receiver 102 has created a communication domain, server 101 transmits the memory space data in the preset format and the data to be transmitted through the communication domain to at least one target receiver 102, so that at least one target receiver 102 saves the data to be transmitted according to the memory space data in the preset format.
[0025] Figure 2 This is a flowchart illustrating the data transmission method provided in an embodiment of this application, as shown below. Figure 2 As shown, embodiments of this application provide a data transmission method, which is described in detail below:
[0026] S201: Establish a connection with at least one target receiver based on the connection address and port identifier of at least one target receiver.
[0027] In this embodiment, an initialization operation is performed before executing step S201. At least one target receiver also needs to be initialized. Each target receiver calls an initialization function to create a sub-thread, which in turn creates a container server. The container server uses the connection address of the corresponding target receiver, and the container server's port identifier is pre-configured. The container server acts as a communication reception station; by specifying the container server's connection address and port identifier, connections can be established between the target receivers for communication.
[0028] S202: After detecting the establishment of a connection, a memory space request is sent to at least one target receiver so that at least one target receiver can obtain memory space parameters according to the memory space request and encapsulate the memory space parameters into memory space data in a preset format.
[0029] In this embodiment, the preset format memory space data is pointer-formatted memory space data.
[0030] In this embodiment, a memory space request is sent to at least one target receiving end, the request carrying the size of the memory space. The memory space size is determined based on the size of the data to be transmitted. After receiving the memory space request, at least one target receiving end allocates a block of memory in its own memory and saves the allocated memory space parameters to a MemInfo structure in the following format:
[0031] struct MemInfo{
[0032] address;
[0033] int64_t size;
[0034] }
[0035] Here, address represents the physical address of the requested memory space; size represents the size of the requested memory space, which is consistent with the size of the memory space carried in the memory space request.
[0036] In this embodiment, after at least one target receiving end saves the memory space parameters, it does not send the physical address and size of the memory space to the sending end's server. Instead, it sends a pointer to a MemInfo structure. Once the sending end's server receives this pointer-formatted memory space data, it knows which memory location on the at least one target receiving end the data to be transmitted should be sent to.
[0037] In this embodiment, memory space data is passed through a pointer to a MemInfo structure instead of directly passing the physical address. This design allows each target receiving end to update its memory space data directly within the MemInfo structure. The sending server does not need to re-acquire the memory space data; it can complete the transmission directly through the pointer to the MemInfo structure. This simplifies the physical address synchronization process, reduces additional communication overhead, and speeds up data transmission response.
[0038] S203: Receive memory space data in a preset format sent by at least one target receiver.
[0039] S204: Based on the transmission scenario with at least one target receiver, generate communication domain creation requests for different transmission scenarios, and send the communication domain creation requests to at least one target receiver so that at least one target receiver can create a communication domain according to the communication domain creation requests.
[0040] Specifically, based on the transmission scenario with at least one target receiver, the communication domain type is determined; a communication domain identifier is generated; the device number of the current device and the device numbers of each target receiver in at least one target receiver are set; a device information list is obtained based on the connection address and port identifier of the current device and the connection address and port identifier of each target receiver in at least one target receiver; and communication domain creation requests for different transmission scenarios are generated based on the communication domain type, communication domain identifier, device number of the current device, device numbers of each target receiver in at least one target receiver, and the device information list.
[0041] In this embodiment, if the transmission scenario with at least one target receiver is a one-to-many transmission, the communication domain type is a fixed communication domain; if the transmission scenario with at least one target receiver is a one-to-one transmission, the communication domain type is a dynamic communication domain.
[0042] In this embodiment, once a solid-state communication domain is created, it is not allowed to add or delete any of the target receivers in at least one target receiver. This is suitable for one-to-many transmission scenarios, such as simultaneously transmitting data to 10 target receivers, avoiding data transmission errors caused by adding or deleting target receivers. A dynamic communication domain allows the addition and deletion of any of the target receivers in at least one target receiver, making it suitable for one-to-one transmission scenarios. A dynamic communication domain allows multiple target receivers to share a single communication domain; for example, target receiver A, target receiver B, and target receiver C can all be in the same communication domain, reducing the total number of communication domains, lowering management overhead, and improving the efficiency of concurrent transmission by multiple target receivers.
[0043] In this embodiment, the communication domain identifier is a unique identifier for the communication domain and is created by the server at the sending end. Each target receiver at least once identifies its communication domain through the communication domain identifier, thus avoiding confusion with other communication domains.
[0044] In this embodiment, the device number of the current device is the server number of the sending end. The device number is used to identify the sending end and each target receiving end in the communication domain.
[0045] In this embodiment, the connection address and port identifier of the current device are the connection address and port identifier of the sending server. The device information list lists the connection addresses and port identifiers of the sending end and each target receiving end in the current communication domain, used to detect which target receiving ends exist in the current communication domain.
[0046] In this embodiment, a communication domain creation request is sent to each of the at least one target receivers. Upon receiving the request, each target receiver executes the creation of the communication domain, generates a handle for the domain, and saves the handle in the same way as it saves memory space parameters. During actual communication, a pointer to the handle is used to specify the communication domain. The handle stores information from the communication domain creation request and can be understood as a unique operation identifier for the created communication domain. When sending the communication domain creation request, the sending server first creates the communication domain and automatically generates a unique handle for it to identify the operation of that domain. Optionally, each target receiver can call a communication domain interface to complete the creation of the communication domain.
[0047] S205: After detecting that at least one target receiver has created a communication domain, the memory space data and the data to be transmitted in a preset format are transmitted to at least one target receiver through the communication domain, so that at least one target receiver can save the data to be transmitted according to the memory space data in the preset format.
[0048] Specifically, if the transmission scenario with at least one target receiver is a one-to-many transmission, then the memory space data and the data to be transmitted in the preset format are broadcast to at least one target receiver through the communication domain; if the transmission scenario with at least one target receiver is a one-to-one transmission, then the memory space data and the data to be transmitted in the preset format are transmitted to at least one target receiver through the communication domain in a point-to-point manner.
[0049] In this embodiment, the data to be transmitted includes source address information, data size, data transmission method, and data description information. The source address information is the data address in the sending server, i.e., the specific address of the data in the sending end; the data size indicates the size of the data to be transmitted; the data transmission method is broadcast transmission or point-to-point transmission; and the data description information describes the purpose of the data to be transmitted.
[0050] In this embodiment, memory space data in a preset format and data to be transmitted are transmitted to at least one target receiving end through a communication domain, so that each of the at least one target receiving end receives the memory space data in the preset format and data to be transmitted through the current communication domain. Since the memory space data in the preset format received by each target receiving end is pointer-formatted memory space data, it is necessary to obtain the actual memory space parameters according to the MemInfo structure pointed to by the memory space data in the preset format, and use the memory space corresponding to the memory space parameters to save the data to be transmitted. Each target receiving end will save the data description information in the data to be transmitted to a queue so that each target receiving end can detect the arrival of new data to be transmitted.
[0051] In this embodiment, the transmission must be performed in accordance with the transmission protocol.
[0052] Specifically, the transmission type of the data to be transmitted is obtained; the transmission protocol is determined based on the transmission type; and the transmission is performed according to the transmission protocol during the transmission of memory space data in the preset format and the data to be transmitted.
[0053] In this embodiment, the process of determining the transmission protocol is as follows: if the transmission type is data transfer between video memory, the transmission protocol is determined to be the graphics card distributed communication interface protocol; if the transmission type is data transfer from video memory to main memory, the transmission protocol is determined to be the graphics card runtime interface protocol; if the transmission type is data transfer from video memory to solid-state drive, the transmission protocol is determined to be the hardware-level data transfer protocol.
[0054] In this embodiment, the description is based on the scenario where the sending server and at least one target receiving end are not on the same server, i.e., cross-machine transmission. Cross-machine transmission also needs to comply with a distributed communication library protocol or a transmission control protocol. If the data to be transmitted is a data transfer between video memory, it means that the data is transferred from the video memory of the sending server to the video memory of at least one target receiving end; if the data is a data transfer from video memory to RAM, it means that the data is transferred from the video memory of the sending server to the RAM of at least one target receiving end; if the data is a data transfer from video memory to a solid-state drive, it means that the data is transferred from the video memory of the sending server to the solid-state drive of at least one target receiving end.
[0055] Optionally, the sender and at least one target receiver can be located on the same server, as different processes within the same server.
[0056] In summary, when transmitting data to at least one target receiver, a connection is established with at least one target receiver based on its connection address and port identifier. This improves the efficiency of data transmission between multiple media in two ways. First, by sending memory space requests, memory space for storing the data to be transmitted is requested in advance from each of the at least one target receiver, achieving on-demand allocation and avoiding idle memory space. This reduces transmission waiting caused by memory space scheduling when transmitting other data, thus improving transmission efficiency. Second, it supports multiple transmission scenarios. Communication domains are created according to different transmission scenarios, allowing for precise matching of communication domains with specific transmission needs, reducing unnecessary operations and resource consumption, thereby improving transmission efficiency. Furthermore, requesting memory space in advance from the target receiver for on-demand allocation avoids memory waste.
[0057] refer to Figure 3 , Figure 3The data transmission method interaction process between the sending end and any target receiving end provided in the embodiments of this application is described in detail below:
[0058] S301: The receiving end calls the initialization function to create a child thread.
[0059] S302: The receiving end's sub-thread creates a container server.
[0060] In this embodiment, the interaction between the sending end and the receiving end is all carried out through a container server created by a sub-thread.
[0061] S303: The sending end establishes a connection with the receiving end.
[0062] S304: The sending end sends a memory space request to the receiving end.
[0063] S305: The receiving end requests memory space parameters based on the memory space request and encapsulates the memory space into memory space data in a preset format.
[0064] S306: The receiving end sends memory space data in a preset format to the sending end.
[0065] S307: The sending end sends a communication domain creation request to the receiving end.
[0066] S308: The receiving end creates a communication domain based on the communication domain creation request.
[0067] S309: The sending end transmits the memory space data and the data to be transmitted in a preset format to the receiving end.
[0068] S310: The receiving end saves the data to be transmitted according to the preset format of the memory space data.
[0069] S311: The sending end releases transmission resources.
[0070] S312: The receiving end releases transmission resources.
[0071] refer to Figure 4 , Figure 4 This is a method framework diagram for the data transmission method provided in the embodiments of this application. The method framework includes an application layer 401, an interface layer 402 for application interaction, a core processing layer 403, a transport layer 404, and a communication library 405. The core processing layer 403 includes a memory information management module 4031, a communication domain connection information management module 4032, and a request processing service thread 4033.
[0072] In this embodiment, the application layer 401 is used to initiate business requirements such as data transmission, connection establishment, memory allocation, and communication domain creation; the application interaction interface layer 402 is used to convert business requirements into standard internal requests; and the core processing layer 403 is responsible for scheduling and managing internal requests. Specifically, the memory information management module 4031 manages data storage addresses and memory lifecycles; the communication domain connection information management module 4032 manages communication domains and transmission protocols; and the request processing service thread 4033 coordinates the memory information management module 4031 and the communication domain connection information management module 4032 to drive process handling.
[0073] In this embodiment, the transport layer 404 is used to convert the instructions of the core processing layer 403 into calls to the transport protocol; the communication library 405 is the transport carrier.
[0074] Based on the above embodiments, this embodiment describes the dynamic adjustment process in the dynamic communication domain, as detailed below:
[0075] If a communication domain already exists between at least one target receiver, execute steps Sa~Sb:
[0076] Sa: If the communication domain type is dynamic communication domain, and a communication domain already exists between at least one target receiver, then a communication domain destruction request is generated.
[0077] In this embodiment, if the current communication domain type is a dynamic communication domain, and an old communication domain is detected between each target receiver in at least one target receiver, a communication domain destruction request will be generated to destroy the old communication domain.
[0078] Sb: Send a communication domain destruction request and a communication domain creation request to at least one target receiver, so that each target receiver destroys the existing communication domain between the target receivers according to the communication domain destruction request, and recreates the communication domain according to the communication domain creation request.
[0079] In this embodiment, a communication domain destruction request and a communication domain creation request are sent together to at least one target receiving end, so that each target receiving end first destroys the old communication domain according to the communication domain destruction request. Then, a dynamic communication domain is recreated according to the communication domain creation request, wherein the sending end's server is a newly added device in the newly created dynamic communication domain. In addition, it is also necessary to update the information in the communication domain creation request stored in the communication domain handle, such as the device number.
[0080] If at least one of the target receivers is a failed target receiver, execute steps Sc~Sd:
[0081] Sc: If the communication domain type is dynamic communication domain, then the heartbeat detection method is used to determine whether there is a failed target receiver among at least one target receiver.
[0082] Specifically, heartbeat data packets are sent to at least one target receiver at a preset fixed period, so that at least one target receiver generates a response data packet based on the heartbeat data packet; if no response data packet is received from any of the at least one target receivers within a preset response time, then any target receiver is preliminarily determined to be a failed target receiver; heartbeat data packets are continuously sent to any target receiver at a preset fixed period, and if no response data packet is received from any target receiver, then it is determined that there is a failed target receiver among the at least one target receivers.
[0083] In this embodiment, a heartbeat detection method is used to confirm whether each of the at least one target receiver is alive. For example, a heartbeat data packet is sent to at least one target receiver every 100 milliseconds. If a target receiver does not return a response data packet within 200 milliseconds, it is initially determined that the target receiver may be faulty. Heartbeat data packets are continuously sent to the target receiver every 100 milliseconds. If there is still no response after multiple transmissions, the target receiver is finally confirmed to be faulty.
[0084] Sd: If it is determined that at least one of the target receivers is a failed target receiver, then update the communication domain with the at least one non-failed target receiver.
[0085] In this embodiment, if a failed target receiver is confirmed, the communication domain with at least one of the compliant target receivers is updated. For the communication domain of the failed target receiver, the information in the communication domain creation request stored in the communication domain handle is updated, including the device number.
[0086] In summary, for dynamic communication domains, dynamic adjustment is supported. When communication domains already exist among at least one target receiver, the old communication domains can be quickly updated by destroying them and creating new dynamic communication domains, maintaining the orderliness of the communication link and improving transmission efficiency. When there is a failed target receiver among at least one target receiver, updating the communication domains to remove the failed target receiver avoids the waste of resources caused by continuously transmitting data to the failed target receiver, while ensuring that the data to be transmitted is only transmitted to the valid target receiver, improving the transmission success rate and transmission stability.
[0087] Optionally, when the communication domain type is a dynamic communication domain, a backup mechanism can be triggered if a failed target receiver exists. Specifically, upon detecting a failed target receiver, a backup target receiver is triggered. The generated communication domain creation request is sent to both the valid target receiver and the backup target receiver among at least one target receiver, enabling the valid target receiver and the backup target receiver to create the communication domain. This allows the backup target receiver to replace the failed target receiver for transmission, avoiding transmission failures.
[0088] Based on the above embodiments, this embodiment describes the case where data to be transmitted is transmitted through the communication domain without sending a memory space request, as detailed below:
[0089] Se: Do not send memory space requests to at least one target receiver.
[0090] In this embodiment, no memory space request is actively sent to at least one target receiving end, thus eliminating the interaction step regarding memory space allocation with at least one target receiving end and reducing the additional request overhead before communication.
[0091] Sf: After detecting that at least one target receiver has created a communication domain, the data to be transmitted is transmitted to at least one target receiver through the communication domain, so that at least one target receiver can request memory space according to the data size and use the memory space to store the data to be transmitted.
[0092] In this embodiment, the data to be transmitted includes the data size.
[0093] In this embodiment, after detecting that at least one target receiving end has created a communication domain, the data to be transmitted is transmitted through this communication domain. Since no memory space is requested in advance, at least one target receiving end dynamically allocates a matching memory space based on the data size, and uses the matched memory space to store the data to be transmitted.
[0094] In summary, by not requesting memory space from each of the target receivers in advance, the preparation process before transmission is simplified. Each target receiver requests memory space based on the data size, which on the one hand ensures sufficient storage space and avoids wasting memory space, and on the other hand avoids pre-allocating fixed memory space, which could lead to insufficient memory space during subsequent data transmission. This reduces transmission waiting caused by memory space scheduling, thus improving transmission efficiency.
[0095] Based on the above embodiments, this embodiment describes the process of releasing and reloading memory space, as detailed below:
[0096] Sg: If, after detecting that at least one target receiver has created a communication domain, it fails to transmit the memory space data and the data to be transmitted in the preset format to at least one target receiver through the communication domain within a preset time, then a memory space release request is sent to at least one target receiver so that at least one target receiver releases the corresponding memory space according to the memory space release request.
[0097] In this embodiment, if at least one target receiving end creates a communication domain but fails to transmit the preset formatted memory space data and data to be transmitted through the communication domain within a preset time, it will proactively send a memory space release request to at least one target receiving end. Upon receiving the request, at least one target receiving end will release the memory space previously allocated for this transmission, preventing the memory space in at least one target receiving end from being occupied and allowing these resources to be reused by other tasks, thus improving resource utilization.
[0098] Sh: If, after detecting that at least one target receiver has released the corresponding memory space, the memory space data in a preset format and the data to be transmitted are transmitted to at least one target receiver through the communication domain, then at least one target receiver shall re-acquire the memory space parameters according to the memory space data in the preset format and use the newly acquired memory space parameters to save the data to be transmitted.
[0099] In this embodiment, if a transmission operation is required after at least one target receiver has released its corresponding memory space, the memory space data in a preset format and the data to be transmitted will be transmitted to the at least one target receiver through the communication domain. The at least one target receiver will then request a new memory space and use this new memory space to store the data to be transmitted. Even if the previous memory space is released, the data to be transmitted can still be stored normally based on the correct memory allocation, without affecting subsequent processing.
[0100] In this embodiment, each of the at least one target receiver updates the memory space parameters of the new memory space to the MemInfo structure, encapsulates the memory space parameters into memory space data in a preset format, and uses the preset format memory space data to save the data to be transmitted when the server at the sending end performs the next transmission.
[0101] In summary, if no data is sent for an extended period, the receiving end is allowed to release the acquired memory space parameters. When data needs to be sent, the receiving end is allowed to reacquire the memory space parameters and save the data. This ensures that the receiving end can both release memory space when idle and reacquire memory space to save data when needed, avoiding insufficient memory space during subsequent data transmissions due to memory resource scheduling issues caused by idle memory when no data is received. This further improves transmission efficiency.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0103] Figure 5 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application. Figure 5 As shown, embodiments of this application also provide a data transmission device, including: a connection establishment module 501, a memory space request module 502, a receiving module 503, a communication domain creation request module 504, and a transmission module 505.
[0104] The connection establishment module 501 is used to establish a connection with at least one target receiver based on the connection address and port identifier of at least one target receiver.
[0105] The memory space request module 502 is used to send a memory space request to at least one target receiving end after detecting the establishment of a connection, so that at least one target receiving end can obtain memory space parameters according to the memory space request and encapsulate the memory space parameters into memory space data in a preset format.
[0106] The receiving module 503 is used to receive memory space data in a preset format sent by at least one target receiving end.
[0107] The communication domain creation request module 504 is used to generate communication domain creation requests for different transmission scenarios based on the transmission scenario with at least one target receiving end, and send the communication domain creation requests to at least one target receiving end so that at least one target receiving end can create a communication domain according to the communication domain creation requests.
[0108] The transmission module 505 is used to transmit memory space data in a preset format and data to be transmitted through the communication domain after detecting that at least one target receiving end has created a communication domain, so that at least one target receiving end can save the data to be transmitted according to the memory space data in the preset format.
[0109] In one possible implementation, the communication domain creation request module 504 includes:
[0110] The determination submodule is used to determine the communication domain type based on the transmission scenario with at least one target receiver.
[0111] The first generation submodule is used to generate communication domain identifiers.
[0112] The settings submodule is used to set the device number of the current device and the device number of each target receiver in at least one target receiver.
[0113] The first acquisition submodule is used to acquire a list of device information based on the connection address and port identifier of the current device, and the connection address and port identifier of each target receiver in at least one target receiver.
[0114] The second generation submodule is used to generate communication domain creation requests for different transmission scenarios based on the communication domain type, communication domain identifier, device number of the current device, device numbers of each target receiver in at least one target receiver, and device information list.
[0115] In one possible implementation, determining the submodule includes:
[0116] The first determining unit is configured to determine the communication domain type as a fixed communication domain if the transmission scenario with at least one target receiver is a one-to-many transmission.
[0117] The second determining unit is configured to determine the communication domain type as dynamic communication domain if the transmission scenario with at least one target receiver is a one-to-one transmission.
[0118] In one possible implementation, the data transmission apparatus further includes a communication domain destruction request module, which includes:
[0119] The third generation submodule is used to generate a communication domain destruction request if the communication domain type is dynamic communication domain and a communication domain already exists between at least one target receiver.
[0120] The first sending submodule is used to send a communication domain destruction request and a communication domain creation request to at least one target receiving end, so that each target receiving end destroys the existing communication domain between the target receiving ends according to the communication domain destruction request, and recreates the communication domain according to the communication domain creation request.
[0121] In one possible implementation, the data transmission device further includes an update module, which comprises:
[0122] The judgment submodule is used to determine, if the communication domain type is dynamic communication domain, whether there is a failed target receiver among at least one target receivers by using the heartbeat detection method.
[0123] The update submodule is used to update the communication domain with the non-failed target receiver if it is determined that there is a failed target receiver among at least one target receiver.
[0124] In one possible implementation, the determination submodule includes:
[0125] The second sending submodule is used to send heartbeat data packets to at least one target receiver at a preset fixed period, so that at least one target receiver can generate a response data packet based on the heartbeat data packet.
[0126] The first determination submodule is used to preliminarily determine that any target receiver is a failed target receiver if no response data packet is received from any of the at least one target receivers within a preset response time.
[0127] The second determination submodule is used to continuously send heartbeat data packets to any target receiver at a preset fixed period. If no response data packet is received from any target receiver, it is determined that at least one of the target receivers is a failed target receiver.
[0128] In one possible implementation, the preset format memory space data is pointer-formatted memory space data.
[0129] In one possible implementation, the transmission module 505 includes:
[0130] The first transmission submodule is used to transmit memory space data and data to be transmitted in a preset format to at least one target receiver in a broadcast manner through the communication domain if the transmission scenario with at least one target receiver is a one-to-many transmission.
[0131] The second transmission submodule is used to transmit memory space data and data to be transmitted in a preset format to at least one target receiver in a point-to-point manner through the communication domain if the transmission scenario with at least one target receiver is a one-to-one transmission.
[0132] In one possible implementation, the data transmission apparatus further includes a transmission protocol determination module, which includes:
[0133] The second acquisition submodule is used to acquire the transmission type of the data to be transmitted.
[0134] The transmission protocol determination submodule is used to determine the transmission protocol based on the transmission type.
[0135] The third transmission submodule is used to transmit memory space data and data to be transmitted in a preset format according to the transmission protocol.
[0136] In one possible implementation, the transport protocol determination submodule includes:
[0137] The third determining unit is used to determine the transmission protocol as the graphics card distributed communication interface protocol if the transmission type is data transmission between video memory.
[0138] The fourth determining unit is used to determine the transmission protocol as the graphics card runtime interface protocol if the transmission type is data transmission from video memory to main memory.
[0139] The fifth determining unit is used to determine the transmission protocol as a hardware-level data transmission protocol if the transmission type is data transmission from video memory to solid-state drive.
[0140] In one possible implementation, the data to be transmitted includes a data size; the data transmission device further includes a storage module, which includes:
[0141] The third sending submodule is used to prevent sending memory space requests to at least one target receiver.
[0142] The storage submodule is used to transmit the data to be transmitted to at least one target receiver through the communication domain after detecting that at least one target receiver has created a communication domain, so that at least one target receiver can request memory space according to the data size and use the memory space to store the data to be transmitted.
[0143] In one possible implementation, the data transmission device further includes a memory space management module, which includes:
[0144] The memory space release submodule is used to detect that after at least one target receiving end creates a communication domain, it fails to transmit memory space data and data to be transmitted in a preset format to at least one target receiving end through the communication domain within a preset time. In this case, it sends a memory space release request to at least one target receiving end so that at least one target receiving end can release the corresponding memory space according to the memory space release request.
[0145] The reacquisition of memory space submodule is used to enable at least one target receiver to reacquire memory space parameters based on the preset format memory space data and the data to be transmitted to at least one target receiver through the communication domain after detecting that at least one target receiver has released the corresponding memory space. The reacquired memory space parameters are then used to save the data to be transmitted.
[0146] For a description of the features in the embodiment corresponding to the data transmission device, please refer to the relevant description in the embodiment corresponding to the data transmission method, which will not be repeated here.
[0147] Figure 6 This is a schematic diagram of the server structure provided in an embodiment of this application. Figure 6 As shown, the server provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the server further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus.
[0148] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to execute the above-described data transmission method embodiment.
[0149] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0150] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0151] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0152] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0153] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described data transmission method embodiments when it is run.
[0154] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0155] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data transmission method embodiments.
[0156] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data transmission method embodiments.
[0157] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0158] The foregoing has provided a detailed description of a data transmission method, apparatus, server, medium, and product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A data transmission method, characterized in that, include: Establish a connection with the at least one target receiver based on the connection address and port identifier of the at least one target receiver; After a connection is established, a memory space request is sent to the at least one target receiving end, so that the at least one target receiving end can obtain memory space parameters according to the memory space request and encapsulate the memory space parameters into memory space data in a preset format. The preset format memory space data is pointer-formatted memory space data; Receive memory space data in the preset format sent by the at least one target receiving end; Based on the transmission scenario with the at least one target receiver, a communication domain creation request for different transmission scenarios is generated, and the communication domain creation request is sent to the at least one target receiver so that the at least one target receiver creates a communication domain according to the communication domain creation request; wherein, the transmission scenario is a one-to-many transmission or a one-to-one transmission; The step of generating communication domain creation requests for different transmission scenarios based on the transmission scenario with the at least one target receiver includes: The communication domain type is determined based on the transmission scenario with the at least one target receiver; Determining the communication domain type based on the transmission scenario with the at least one target receiver includes: If the transmission scenario with the at least one target receiver is a one-to-many transmission, then the communication domain type is a fixed communication domain; wherein, after the fixed communication domain is created, it is not allowed to add or delete any of the target receivers among the at least one target receivers; If the transmission scenario with the at least one target receiver is a one-to-one transmission, then the communication domain type is a dynamic communication domain; wherein, the dynamic communication domain allows the addition and deletion of each target receiver among the at least one target receiver; After generating communication domain creation requests for different transmission scenarios, the process also includes: If the communication domain type is the dynamic communication domain, and a communication domain already exists between the target receivers in the at least one target receiver, then a communication domain destruction request is generated. The communication domain destruction request and the communication domain creation request are sent to the at least one target receiving end, so that each of the at least one target receiving end destroys the existing communication domain between the target receiving ends according to the communication domain destruction request, and recreates the communication domain according to the communication domain creation request; After detecting that the at least one target receiving end has created a communication domain, the memory space data in the preset format and the data to be transmitted are transmitted to the at least one target receiving end through the communication domain, so that the at least one target receiving end can save the data to be transmitted according to the memory space data in the preset format.
2. The method according to claim 1, characterized in that, The step of generating communication domain creation requests for different transmission scenarios based on the transmission scenario with the at least one target receiver includes: Generate communication domain identifier; Set the device number of the current device, and set the device number of each target receiver in the at least one target receiver; Based on the connection address and port identifier of the current device, and the connection address and port identifier of each of the at least one target receivers, obtain the device information list; Based on the communication domain type, the communication domain identifier, the device number of the current device, the device numbers of each target receiver among the at least one target receiver, and the device information list, a communication domain creation request for different transmission scenarios is generated.
3. The method according to claim 1, characterized in that, After transmitting the preset format memory space data and the data to be transmitted through the communication domain to the at least one target receiving end, the method further includes: If the communication domain type is a dynamic communication domain, then a heartbeat detection method is used to determine whether there is a failed target receiver among the at least one target receiver. If it is determined that there is a failed target receiver among the at least one target receivers, then the communication domain with the non-failed target receiver among the at least one target receivers is updated.
4. The method according to claim 3, characterized in that, The method of using heartbeat detection to determine whether there is a failed target receiver among the at least one target receiver includes: According to a preset fixed period, heartbeat data packets are sent to at least one target receiving end, so that the at least one target receiving end generates a response data packet based on the heartbeat data packets; If no response data packet is received from any of the at least one target receivers within the preset response time, then the target receiver is preliminarily determined to be a failed target receiver. According to the preset fixed period, heartbeat data packets are continuously sent to any of the target receivers. If no response data packet is received from any of the target receivers, it is determined that there is a failed target receiver among the at least one target receivers.
5. The method according to claim 1, characterized in that, The step of transmitting the preset format memory space data and the data to be transmitted through the communication domain to the at least one target receiving end includes: If the transmission scenario with the at least one target receiver is a one-to-many transmission, then the memory space data and the data to be transmitted in the preset format are broadcast to the at least one target receiver through the communication domain. If the transmission scenario with the at least one target receiver is a one-to-one transmission, then the memory space data in the preset format and the data to be transmitted are transmitted to the at least one target receiver in a point-to-point manner through the communication domain.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the transmission type of the data to be transmitted; Based on the transmission type, determine the transmission protocol; During the transmission of the memory space data and the data to be transmitted in the preset format, the transmission is carried out according to the transmission protocol.
7. The method according to claim 6, characterized in that, The step of determining the transmission protocol based on the transmission type includes: If the transmission type is data transmission between video memory, then the transmission protocol is determined to be the graphics card distributed communication interface protocol. If the transmission type is data transfer from video memory to main memory, then the transmission protocol is determined to be the graphics card runtime interface protocol. If the transmission type is data transfer from video memory to solid-state drive, then the transmission protocol is determined to be a hardware-level data transfer protocol.
8. The method according to any one of claims 1-7, characterized in that, The data to be transmitted includes the data size; Accordingly, after detecting the establishment of a connection, the process further includes: The memory space request is not sent to the at least one target receiver; After detecting that the at least one target receiving end has created a communication domain, the data to be transmitted is transmitted to the at least one target receiving end through the communication domain, so that the at least one target receiving end can request memory space according to the data size and use the memory space to store the data to be transmitted.
9. The method according to any one of claims 1-7, characterized in that, The method further includes: If, after the at least one target receiving end creates a communication domain, it fails to transmit the memory space data and the data to be transmitted in the preset format to the at least one target receiving end through the communication domain within a preset time, then a memory space release request is sent to the at least one target receiving end so that the at least one target receiving end can release the corresponding memory space according to the memory space release request. If, after detecting that the at least one target receiving end has released the corresponding memory space, the memory space data in the preset format and the data to be transmitted are transmitted to the at least one target receiving end through the communication domain, then the at least one target receiving end can re-acquire the memory space parameters according to the memory space data in the preset format, and use the newly acquired memory space parameters to save the data to be transmitted.
10. A server, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data transmission method as described in any one of claims 1-9 when executing the computer program.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data transmission method as described in any one of claims 1-9.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data transmission method as described in any one of claims 1-9.
Citation Information
Patent Citations
Memory allocation method and computing device
CN118656201A
Frequency converter communication method and device, industrial automation control system and medium
CN119383210A