CN116708307A - Information transmission method and communication device - Google Patents

Information transmission method and communication device Download PDF

Info

Publication number
CN116708307A
CN116708307A CN202210173782.3A CN202210173782A CN116708307A CN 116708307 A CN116708307 A CN 116708307A CN 202210173782 A CN202210173782 A CN 202210173782A CN 116708307 A CN116708307 A CN 116708307A
Authority
CN
China
Prior art keywords
memory
tcp
client device
mss
sliding window
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210173782.3A
Other languages
Chinese (zh)
Inventor
王勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210173782.3A priority Critical patent/CN116708307A/en
Publication of CN116708307A publication Critical patent/CN116708307A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The embodiment of the disclosure provides an information transmission method and a communication device. The method comprises the following steps: the client device determines memory use information; the client device determines TCP parameters based on the memory usage information, wherein the TCP parameters comprise a TCP sliding window size and an MSS; the client device generates a connection request message based on TCP parameters; and the client device sends a connection request message to the server device to trigger the three-way handshake. In this way, the client device can dynamically adjust TCP parameters such as TCP sliding window size and MSS based on the memory usage information, reducing initial network traffic, reducing data throughput after connection establishment, and reducing memory consumption, thereby enabling the subsequent traffic to run smoothly.

Description

Information transmission method and communication device
Technical Field
The present disclosure relates to the field of communications, and more particularly, to an information transmission method and a communication device.
Background
To improve the data transmission throughput of the transmission control protocol (Transmission Control Protocol, TCP), high throughput TCP parameters are typically configured for the network protocol stack of the chip. This can make the chip performance better and can be applied to various different scenarios.
However, high throughput also implies higher memory consumption. Therefore, in a resource-constrained scenario such as memory, if the configuration is based on high-throughput TCP parameters, the configuration may cause a discrepancy with the actual traffic, and may even cause a traffic interruption.
Disclosure of Invention
The embodiment of the disclosure provides an information transmission scheme which can dynamically adjust TCP parameters, control data throughput after connection establishment and ensure stable operation of a service.
In a first aspect of the present disclosure, an information transmission method is provided. The method comprises the following steps: the client device determines memory use information; the client device determining TCP parameters based on the memory usage information, the TCP parameters including a TCP sliding window size and a maximum message Duan Daxiao (Maximum Segment Size, MSS); the client device generates a connection request message based on TCP parameters; and the client device sends a connection request message to the server device to trigger the three-way handshake.
In this way, the client device can dynamically adjust TCP parameters such as TCP sliding window size and MSS based on the memory usage information, reducing initial network traffic, reducing data throughput after connection establishment, and reducing memory consumption, thereby enabling the subsequent traffic to run smoothly.
In some embodiments of the first aspect, the client device determining the TCP parameters based on the memory usage information includes: the client device determines whether the memory residual quantity is lower than a memory threshold value based on the memory use information; if the memory residual quantity is not lower than the memory threshold value, the client device determines that the TCP sliding window size is equal to the preset TCP sliding window size, and MSS is equal to the preset MSS; if the memory remaining is below the memory threshold, the client device determines that the TCP sliding window size is less than the preset TCP sliding window size and the MSS is less than the preset MSS.
In some embodiments of the first aspect, the memory threshold is determined based on an attribute of a chip of the client device.
In some embodiments of the first aspect, further comprising: the client device sets at least one of the following based on the memory usage information: a transmit buffer size, or a receive buffer size.
In some embodiments of the first aspect, the determining, by the client device, the memory usage information includes: the network protocol stack of the client device determines the memory usage information by invoking a hardware abstraction layer (Hardware Abstraction Layer, HAL) interface.
In some embodiments of the first aspect, the network protocol stack is a lightweight transmission control protocol stack.
In some embodiments of the first aspect, the memory usage information indicates at least one of: the memory usage amount; memory utilization; the remaining amount of memory; or memory retention.
In some embodiments of the first aspect, the connection request message further includes an initial sequence number.
In some embodiments of the first aspect, further comprising: the client device establishes TCP connection with the server device through three-way handshake; and the client device and the server device perform data transmission.
In a second aspect of the present disclosure, a communication apparatus is provided. The device comprises: the first determining module is configured to determine memory use information; a second determining module configured to determine TCP parameters based on the memory usage information, the TCP parameters including a TCP sliding window size and an MSS; the generating module is configured to generate a connection request message based on TCP parameters; and the sending module is configured to send a connection request message to the server-side equipment so as to trigger three-way handshake. Optionally, the communication apparatus is a client device.
In some embodiments of the second aspect, the second determination module is configured to: determining whether the memory residual quantity is lower than a memory threshold value based on the memory use information; if the memory residual quantity is not lower than the memory threshold value, determining that the size of the TCP sliding window is equal to the size of a preset TCP sliding window, and enabling the MSS to be equal to the preset MSS; if the memory remaining amount is lower than the memory threshold, determining that the TCP sliding window size is smaller than the preset TCP sliding window size, and the MSS is smaller than the preset MSS.
In some embodiments of the second aspect, the memory threshold is determined based on an attribute of a chip of the client device.
In some embodiments of the second aspect, the apparatus further comprises a setting module configured to set at least one of: a transmit buffer size, or a receive buffer size.
In some embodiments of the second aspect, the first determination module is configured to: memory usage information is determined by invoking the HAL interface by the network protocol stack.
In some embodiments of the second aspect, the network protocol stack is a lightweight transmission control protocol stack.
In some embodiments of the second aspect, the memory usage information indicates at least one of: the memory usage amount; memory utilization; the remaining amount of memory; or memory retention.
In some embodiments of the second aspect, the connection request message further includes an initial sequence number.
In some embodiments of the second aspect, further comprising: the TCP establishment module is configured to establish TCP connection with the server equipment through three-way handshake; and the data transmission module is configured to perform data transmission with the server equipment.
In a third aspect of the present disclosure, there is provided a communication apparatus comprising a processor and a memory having stored thereon instructions that are executed by the processor, the instructions when executed by the processor cause the communication apparatus to: determining memory use information; based on the memory usage information, determining TCP parameters, wherein the TCP parameters comprise a TCP sliding window size and an MSS; generating a connection request message based on TCP parameters; and sending a connection request message to the server device to trigger the three-way handshake. Optionally, the communication apparatus is a client device.
In some embodiments of the third aspect, the instructions, when executed by the processor, cause the communication apparatus to implement: determining whether the memory residual quantity is lower than a memory threshold value based on the memory use information; if the memory residual quantity is not lower than the memory threshold value, determining that the size of the TCP sliding window is equal to the size of a preset TCP sliding window, and enabling the MSS to be equal to the preset MSS; if the memory remaining amount is lower than the memory threshold, determining that the TCP sliding window size is smaller than the preset TCP sliding window size, and the MSS is smaller than the preset MSS.
In some embodiments of the third aspect, the memory threshold is determined based on an attribute of a chip of the communication device.
In some embodiments of the third aspect, the instructions, when executed by the processor, cause the communication apparatus to implement: based on the memory usage information, at least one of the following is set: a transmit buffer size, or a receive buffer size.
In some embodiments of the third aspect, the instructions, when executed by the processor, cause the communication apparatus to implement: memory usage information is determined by the network protocol stack by invoking the HAL interface.
In some embodiments of the third aspect, the network protocol stack is a lightweight transmission control protocol stack.
In some embodiments of the third aspect, the memory usage information indicates at least one of: the memory usage amount; memory utilization; the remaining amount of memory; or memory retention.
In some embodiments of the third aspect, the connection request message further includes an initial sequence number.
In some embodiments of the third aspect, the instructions, when executed by the processor, cause the communication apparatus to implement: establishing TCP connection with the server device through three-way handshake; and transmitting data with the server equipment.
In a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement operations according to the method in the first aspect or any embodiment thereof.
In a fifth aspect of the present disclosure, a chip or chip system is provided. The chip or chip system comprises processing circuitry configured to perform operations according to the method of the first aspect or any embodiment thereof described above.
In a sixth aspect of the present disclosure, a computer program or computer program product is provided. The computer program or computer program product is tangibly stored on a computer-readable medium and comprises computer-executable instructions which, when executed, implement operations in accordance with the method in the first aspect or any embodiment thereof described above.
Drawings
The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, wherein like or similar reference numerals designate like or similar elements, and wherein:
FIG. 1 shows a schematic diagram of a scenario in which embodiments of the present disclosure can be applied;
fig. 2 illustrates a schematic flow diagram of an information transfer process according to some embodiments of the present disclosure;
fig. 3 illustrates a schematic flow diagram of an information transfer process according to some embodiments of the present disclosure;
FIG. 4 illustrates an interaction diagram of an information transfer process according to some embodiments of the present disclosure;
fig. 5 illustrates a schematic block diagram of a communication device according to some embodiments of the present disclosure; and
FIG. 6 shows a schematic block diagram of an example device that may be used to implement embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
In describing embodiments of the present disclosure, the term "comprising" and its like should be taken to be open-ended, i.e., including, but not limited to. The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first," "second," and the like, may refer to different or the same object. Other explicit and implicit definitions are also possible below.
The transmission control protocol (Transmission Control Protocol, TCP) is a connection-oriented, reliable, byte stream based transport layer communication protocol. To improve TCP data transmission throughput, high throughput TCP parameters, such as larger sliding window, send buffer, maximum message Duan Daxiao (Maximum Segment Size, MSS), higher thread priority, etc., are typically configured for the network protocol stack of the chip. Such a design can bring a competitive advantage to the chip. However, such designs have limitations, which are more pronounced on memory-constrained chips (such as internet of things chips) that are high throughput, meaning high memory resource consumption. For chips with limited resources such as memory, the module manufacturer or the client of the chip has little memory resources left after various applications are deployed. If the connection is still established with the server based on the network configuration with high throughput at this time, a large amount of data impact may directly cause the memory to be exhausted, and service interruption and other conditions occur. For example, in a network traffic scenario such as Over-the-Air (OTA) upgrades, the OTA upgrades may be discontinued.
At present, network parameters are generally statically configured globally according to high throughput, high performance requirements and the like on an internet of things chip. In the actual operation process, the network parameters cannot be dynamically adjusted, and the data transmission rate of a single TCP connection cannot be controlled. If the global parameters are adjusted, the overall TCP transmission performance of the Internet of things chip is affected, and software versions need to be recompiled and released, so that the delivery difficulty is increased. Because of the limited memory resources, the internet of things chip generally uses a light-weight network protocol stack, and compared with a full-function network protocol stack, the internet of things chip only realizes the basic communication capability of the network protocol stack. Whether a lightweight network protocol stack or a full-function network protocol stack, the current scheme cannot effectively and simultaneously consider memory use and throughput.
In view of this, embodiments of the present disclosure provide an information transmission scheme. The client device can determine the TCP parameters based on the memory usage information, so that the server device can ensure smooth operation of the service based on matching the TCP parameters with a proper rate.
Fig. 1 shows a schematic diagram of a scenario 100 in which embodiments of the present disclosure can be applied. Scenario 100 includes a client device 110 and a server device 120, and client device 110 is capable of communicating with server device 120.
As shown in fig. 1, client device 110 may include a chip 112. And the chip 112 includes an Application (APP) 1122, a network protocol stack 1124, and a hardware abstraction layer (Hardware Abstraction Layer, HAL) 1126.
The applications 1122 may include various applications installed on the client device 110, including, for example, network-related applications and the like.
The network protocol stack 1124 may include a program for being responsible for sending and receiving various types of network messages, as shown in FIG. 1, and may include a TCP Core 1125 portion. Illustratively, the network protocol stack 1124 may be a full function network protocol stack. Alternatively, the network protocol stack 1124 may be a lightweight network protocol stack, such as a lightweight TCP stack or a lightweight Internet protocol (Internet Protocol, IP) stack. For example, the Lightweight TCP stack and/or Lightweight IP stack may be collectively referred to as a Lightweight TCP/IP stack (LwIP).
HAL 1126 is an interface layer located between the kernel of the operating system of client device 110 and the hardware circuitry for the purpose of abstracting the hardware. Alternatively, the HAL may also be referred to as a HAL interface.
It should be noted that embodiments of the present disclosure are not limited in the type of client device 110, and may be, for example, a terminal device such as a desktop computer, a laptop computer, a smart phone, a smart speaker, a sweeper, etc. In some examples, the client device 110 may be implemented as an internet of things (Internet of Things, ioT) device, and accordingly, the chip 112 may be an internet of things chip. It should be appreciated that the present disclosure is not limited thereto and that client device 110 may be a non-internet of things device or the like, for example, which can promote business compatibility of network protocol stack 1124.
As shown in fig. 1, the client device 110 and the server device 120 are both in communication, and a connection needs to be established between each other before data transmission. TCP provides a reliable, connection-oriented, byte-streaming, transport layer service that enables a TCP connection to be established between client device 110 and server device 120 using a three-way-handshake. The process of initiating the three-way handshake and completing the three-way handshake is described below in connection with fig. 2-4.
Fig. 2 illustrates a schematic flow diagram of an information transfer process 200 according to some embodiments of the present disclosure. The process 200 shown in fig. 2 may be performed by the client device 110 shown in fig. 1.
At block 210, the client device 110 determines memory usage information for the client device 110.
In connection with FIG. 1, HAL interface 1126 may be invoked by network protocol stack 1124 to determine memory usage information for client device 110. Illustratively, the memory usage information may represent used memory of the client device 110, or the memory usage information may represent remaining memory (also referred to as unused memory) of the client device 110. For example, the used memory or the remaining memory may be represented as a specific memory size, or may be represented as a proportion of the total memory.
Optionally, the memory usage information indicates at least one of: the memory usage amount; memory utilization; the remaining amount of memory; or memory retention. The memory usage amount or the dimension of the memory remaining amount may be, for example, GB, MB, or the like. Memory usage or memory remainder may be expressed in terms such as percentages. It should be understood that the description of the memory usage information is merely illustrative, and the specific meaning or form of the memory usage information in the embodiments of the present disclosure is not limited, for example, other forms not listed in the present disclosure may be used.
Alternatively, the network protocol stack 1124 may be a full function network protocol stack, such as a network protocol stack on a Linux system. Optionally, the network protocol stack 1124 may be a lightweight network protocol stack, such as LwIP or the like.
Illustratively, the network protocol stack 1124 may determine memory usage information during its call connection (connect) interface preparation for initiating a TCP connection to the server device 120.
At block 220, client device 110 determines TCP parameters based on the memory usage information. The TCP parameters include a TCP sliding window size and a maximum message Duan Daxiao (MSS).
In an embodiment of the present disclosure, the chip 112 of the client device 110 may have a preset chip specification, including, for example, a preset TCP sliding window size and a preset MSS.
Specifically, the client device 110 may determine the memory remaining amount or the memory remaining rate based on the memory usage information. In some examples, client device 110 may determine whether the remaining amount of memory is below a memory threshold. If the memory remaining is not below the memory threshold, the client device 110 may determine that the TCP sliding window size is equal to the preset TCP sliding window size and the MSS is equal to the preset MSS. If the memory remaining is below the memory threshold, the client device 110 may determine that the TCP sliding window size is less than the preset TCP sliding window size and the MSS is less than the preset MSS. Or in some examples, client device 110 may determine whether the memory remaining rate is below a memory rate threshold. If the memory remaining rate is not below the memory rate threshold, the client device 110 may determine that the TCP sliding window size is equal to the preset TCP sliding window size and the MSS is equal to the preset MSS. If the memory remaining rate is below the memory rate threshold, the client device 110 may determine that the TCP sliding window size is less than the preset TCP sliding window size and the MSS is less than the preset MSS.
In some embodiments, the memory threshold or memory rate threshold is determined based on attributes of the chip of client device 110. It is understood that the memory threshold or memory rate threshold may be defined based on chip specifications, e.g., chips of different specifications may have different memory thresholds (or memory rate thresholds). Alternatively, the chip specification may include high throughput parameters preset during die assembly of the chip. It is appreciated that a scheme of determining TCP parameters based on a memory threshold and a memory rate threshold may be considered equivalent, and will be described below with reference to embodiments of memory thresholds.
For example, in some scenarios, after the deployment of the application is completed on the chip, the amount of memory remaining may already be small, and then a small TCP sliding window size and/or MSS may be set. For example, the determined TCP sliding window size may be equal to 10% of the preset TCP sliding window size, and the determined MSS may be equal to 10% of the preset MSS. It is to be understood that the examples herein are illustrative only and should not be construed as limiting the embodiments of the present disclosure.
In some examples, the TCP sliding window size may also be referred to simply as window size (window size) or other names, to which the present disclosure is not limited.
At block 230, client device 110 generates a connection request message based on the TCP parameters.
Specifically, the chip 112 of the client device 110 generates a connection request message including the TCP sliding window size and the MSS. Illustratively, parameters such as TCP sliding window size and MSS may also be referred to as handshake parameters, which are not limited by the present disclosure.
Optionally, the connection request message may further include at least one of the following: source port, destination port, or initial sequence number, etc. For example, the connection request message may also be referred to as a Synchronization (SYN) message, and the generation of the connection request message may also be understood as encapsulating the synchronization message.
At block 240, the client device 110 sends a connection request message to the server device 120 to trigger a three-way handshake.
Optionally, in some embodiments, the client device 110 may also set a transmit buffer size (so_sndbuf) and/or a receive buffer size (so_rcvbuf) based on the memory usage information, e.g., before block 240 or before block 230 or at other occasions, etc. For example, if the memory remaining is below the memory threshold (or the memory remaining rate is below the memory rate threshold), the ue 110 may reduce the transmit buffer size and/or the receive buffer size, thereby achieving the purpose of reducing the traffic. In this way, the network protocol stack in the embodiment of the disclosure can dynamically set the sending buffer size and/or the receiving buffer size based on the memory usage information, thereby realizing the dynamic setting of the handshake information.
In this way, in the embodiments of the present disclosure, the client device can dynamically adjust TCP parameters such as a TCP sliding window size and MSS based on the memory usage information, reducing initial network traffic, reducing data throughput after connection establishment, and reducing memory consumption, so that subsequent traffic can run smoothly. And since the scheme is only suitable for single TCP connection, the whole network throughput of the chip is not affected. And the application layer of the chip (such as application 1122) does not need to pay attention to the specific implementation inside the network protocol stack 1124, so that the usability of the interface can be improved. In addition, the adjusted parameters not only comprise MSS but also comprise TCP sliding window size, so that the data transmission rate can be reduced more effectively, in practical application, a user does not need to pay attention to the internal implementation of a network protocol stack of a chip, network service can run normally, and the usability of an interface is improved.
Fig. 3 illustrates a schematic flow diagram of an information transfer process 300 according to some embodiments of the present disclosure. The process 200 shown in fig. 3 may be performed by the client device 110 shown in fig. 1.
At block 310, the client device 110 determines memory usage information for the client device 110. Reference may be made to the embodiment described above in connection with portion 210 of fig. 2 for block 310, which is not repeated here for brevity.
At block 320, the client device 110 sets at least one of the following based on the memory usage information: a transmit buffer size, or a receive buffer size.
Specifically, the client device 110 may determine the memory remaining amount or the memory remaining rate based on the memory usage information. Further, client device 110 may dynamically modify the transmit buffer size and/or the receive buffer size based on the remaining amount of memory or the remaining memory rate. For example, if the remaining amount of memory (or memory remaining rate) is small, the transmit buffer size and the receive buffer size may be reduced. For example, if the memory remaining amount (or memory remaining rate) is large, the transmission buffer size and the reception buffer size may be increased. By such modification, the transmit buffer size and/or the receive buffer size can be dynamically modified to dynamically adjust subsequent traffic flows. For example, when the remaining amount of memory is small, the flow rate is reduced.
It will be appreciated that the memory usage information may refer to the embodiment described above in connection with fig. 2, and will not be described herein for brevity.
At block 330, the client device 110 generates a connection request message.
Illustratively, the connection request message may include at least one of: source port, destination port, initial sequence number, TCP sliding window size, MSS, etc. Alternatively, the size of the TCP sliding window in the connection request packet may be equal to or smaller than the preset TCP sliding window size. Alternatively, the MSS in the connection request message may be equal to or smaller than a preset MSS.
At block 340, the client device 110 sends a connection request message to the server device 120 to trigger a three-way handshake.
In this way, the client device in embodiments of the present disclosure is able to dynamically modify the transmit buffer size and/or the receive buffer size based on the memory usage information prior to initiating a TCP connection, thereby dynamically adjusting subsequent traffic flows. For example, when the memory remaining amount is small, the flow rate can be reduced. Thereby ensuring the stable operation of the subsequent service and avoiding the problem of service interruption caused by mismatching of the data volume and the memory.
It can be appreciated that further, the client device 110 can establish a TCP connection with the server device 120 through a three-way handshake; the client device 110 then performs data transmission with the server device 120. Illustratively, the procedure for establishing a TCP connection through a three-way handshake is shown in FIG. 4 below.
Fig. 4 illustrates a signaling interaction diagram of an information transfer process 400 according to some embodiments of the present disclosure. An embodiment of a three-way handshake is described in connection with process 400.
During the preparation phase prior to establishing a TCP connection, the server device 120 may create a socket handle, i.e., a socekt () function. The server device 120 may call a binding function (i.e., bind ()) to assign a local protocol address to the socket, which may bind a local address and port number for the socket, for example. The server device 120 may call a listening function (i.e., listen ()), program the socket with a passive connection listening socket, and passively wait for a connection request by the client device 110. The server device 120 may call an accept function (i.e., accept ()), take a completed connection from the head of the connection queue, block the accept () function if there is no completed connection in the queue, and further wait for the client connection.
Client device 110 may create a socket handle, i.e., a socekt () function. The client device 110 may then call a connect function (i.e., connect ()) to initiate the connection.
The processes 420, 440 and 460 shown in fig. 4 are involved in the TCP connection establishment process.
In process 420, client device 110 sends a connection request message to server device 120. In connection with the foregoing fig. 2, process 420 may be understood as the operation as at block 240 of fig. 2, and accordingly, it may be understood that prior to process 420, client device 110 may refer to steps as blocks 210 through 230 of fig. 2, generating a connection request message. In order to avoid repetition, a description thereof is omitted.
The connection request message sent in process 420 may be referred to as a synchronization message. The SYN flag may be set to 1 in this message, for example. For example, the client device 110 may select a random number as the first sequence number, i.e., the initial sequence number (Initial Sequence Number, ISN). It is understood that the connection request message may not carry data, but it consumes a sequence number.
In this manner, the server device 120 is able to receive a connection request message from the client device 110 during a determination that the accept () function is blocked and further waiting for the client connection.
At process 440, the server device 120 sends a synchronize and acknowledge (syn+ack) message to the client device. In this message, both the SYN flag and the ACK flag may be set to 1. The SYN segment in this message is used to synchronize the initial sequence number of the server device 120 to the client device 110, and the ACK segment in this message is used to indicate to the client device 110 that a connection request message has been received and expects the client device to give the next sequence number.
In process 460, client device 110 sends an ACK message to server device 120.
In this way, the TCP connection between client device 110 and server device 120 may be completed through the three-way handshake. It should be noted that the processes 420 to 460 described in connection with fig. 4 are only illustrative, and the present disclosure is not limited thereto, and specific implementations may refer to the related descriptions of the three-way handshake in the prior art, and are not explained in detail in this disclosure.
It will be appreciated that after the TCP connection is established, the client device 110 and the server device 120 are able to perform data transmission. In connection with 482 of fig. 4, client device 110 may invoke a write function (i.e., write ()) to send data to server device 120, and accordingly, server device 120 may invoke a read function (i.e., read ()) to read data from client device 110. Similarly, at 484, the server device 120 may call a write function (i.e., write ()) to send data to the client device 110, and accordingly, the client device 110 may call a read function (i.e., read ()) to read data from the server device 120.
As described in connection with the embodiment of fig. 2, since the client device 110 in the embodiment of the present disclosure determines TCP parameters based on the memory usage information, the flow of data in 482 and 484 of fig. 4 is adapted to the remaining memory, reducing memory consumption, thereby enabling smooth operation of traffic.
It should be understood that in embodiments of the present disclosure, the expressions "first," "second," "third," etc. are merely intended to indicate that multiple objects may be different, but do not exclude that the same is between two objects. The expressions "first", "second", "third", etc. should not be construed as limiting the embodiments of the present disclosure in any way.
It should also be understood that the manner, case, category, and division of embodiments in the embodiments of the present disclosure are for descriptive convenience only and should not be construed as being particularly limiting, and that the features of the various manners, categories, cases, and embodiments may be combined with one another in a logical manner.
It should also be understood that the above is only intended to assist those skilled in the art in better understanding the embodiments of the present disclosure, and is not intended to limit the scope of the embodiments of the present disclosure. Various modifications, variations, combinations, etc. may be made by those skilled in the art in light of the above teachings. Such modifications, variations, or combinations are also within the scope of embodiments of the present disclosure.
It should also be appreciated that the foregoing description focuses on differences between the various embodiments and that the same or similar features may be referred to or otherwise referred to herein for brevity and clarity.
Fig. 5 shows a schematic block diagram of a communication device 500 according to an embodiment of the disclosure. The apparatus 500 may be implemented in software, hardware, or a combination of both. In some embodiments, apparatus 500 may be a software or hardware apparatus that implements some or all of the functionality in client device 110 shown in fig. 1.
As shown in fig. 5, the apparatus 500 includes a first determination module 510, a second determination module 520, a generation module 530, and a transmission module 540. Optionally, the apparatus 500 further comprises a setting module 550.
The first determination module 510 is configured to determine memory usage information. The second determining module 520 is configured to determine TCP parameters including a TCP sliding window size and an MSS based on the memory usage information. The generation module 530 is configured to generate a connection request message based on the TCP parameters. The sending module 540 is configured to send a connection request message to the server device to trigger the three-way handshake.
Illustratively, the second determination module 520 may be configured to: determining whether the memory residual quantity is lower than a memory threshold value based on the memory use information; if the memory residual quantity is not lower than the memory threshold value, determining that the TCP sliding window size is equal to the preset TCP sliding window size and MSS is equal to the preset MSS; if the memory remaining amount is lower than the memory threshold, determining that the TCP sliding window size is smaller than the preset TCP sliding window size and the MSS is smaller than the preset MSS.
In some embodiments, the memory threshold is determined based on attributes of a chip of the client device.
Illustratively, the first determination module 510 may be configured to determine the memory usage information by invoking the HAL interface by the network protocol stack. Alternatively, the network protocol stack may be a lightweight transmission control protocol stack. Optionally, the memory usage information indicates at least one of: the memory usage amount; memory utilization; the remaining amount of memory; or memory retention.
Optionally, the setting module 550 as shown in fig. 5 may be configured to set at least one of the following based on the memory usage information: a transmit buffer size, or a receive buffer size.
Illustratively, the generating module 530 may be configured to generate a connection request message including at least one of: TCP sliding window size, MSS, and initial sequence number.
In some embodiments, apparatus 500 may further comprise a TCP setup module and a data transmission module (not shown in fig. 5). The TCP establishment module may be configured to establish a TCP connection with the server device through a three-way handshake. The data transmission module may be configured to transmit data with the server device.
Alternatively, the communication apparatus 500 may be implemented as an internet of things device, such as a device comprising an internet of things chip.
The apparatus 500 in fig. 5 can be used to implement the respective processes implemented by the client device 110 in connection with fig. 2 to 4, and are not described here again for brevity.
The division of the modules or units in the embodiments of the disclosure is schematically only one logic function division, and there may be another division manner in actual implementation, and in addition, each functional unit in the disclosed embodiments may be integrated in one unit, or may exist alone physically, or two or more units may be integrated into one unit. The integrated units may be implemented in hardware or in software functional units.
Fig. 6 shows a schematic block diagram of an example device 600 that may be used to implement embodiments of the present disclosure. Device 600 may be implemented as or included in client device 110 shown in fig. 1.
As shown, the apparatus 600 includes a central processing unit (Central Processing Unit, CPU) 601, a Read-Only Memory (ROM) 602, and a random access Memory (Random Access Memory, RAM) 603. The CPU 601 may perform various suitable actions and processes according to computer program instructions stored in the RAM 602 and/or RAM 603 or computer program instructions loaded from the storage unit 608 into the ROM 602 and/or RAM 603. In the ROM 602 and/or RAM 603, various programs and data required for the operation of the device 600 may also be stored. The CPU 601 and the ROM 602 and/or RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
CPU 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples that may be implemented include, but are not limited to, a graphics processing unit (Graphics Processing Unit, GPU), various dedicated artificial intelligence (Artificial Intelligence, AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (Digital Signal Processor, DSP), and any suitable processor, controller, microcontroller, etc., which may accordingly be referred to as a computing unit. The CPU 601 performs the respective methods and processes described above. For example, in some embodiments, the processes described above may be implemented as a computer software program tangibly embodied on a computer-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or RAM 603 and/or the communication unit 609. One or more steps of the processes described above may be performed when a computer program is loaded into the ROM 602 and/or RAM 603 and executed by the CPU 601. Alternatively, in other embodiments, CPU 601 may be configured to perform the processes described above in any other suitable manner (e.g., by means of firmware).
By way of example, device 600 in fig. 6 may be implemented as a computing device, or may be implemented as a chip or chip system in a computing device, as embodiments of the disclosure are not limited in this regard.
Embodiments of the present disclosure also provide a chip that may include an input interface, an output interface, and a processing circuit. In the embodiment of the disclosure, the interaction of the signaling or data can be completed by the input interface and the output interface, and the generation and the processing of the signaling or data information can be completed by the processing circuit.
Embodiments of the present disclosure also provide a chip system including a processor for supporting a computing device to implement the functions referred to in any of the above embodiments. In one possible design, the chip system may further include a memory for storing necessary program instructions and data that, when executed by the processor, cause the apparatus on which the chip system is installed to implement the method referred to in any of the embodiments above. The chip system may be formed from one or more chips, and may include chips and other discrete devices, for example.
Embodiments of the present disclosure also provide a processor for coupling with a memory, the memory storing instructions that, when executed by the processor, cause the processor to perform the methods and functions referred to in any of the embodiments above.
Embodiments of the present disclosure also provide a computer program product containing instructions which, when run on a computer, cause the computer to perform the methods and functions involved in any of the embodiments described above.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the methods and functions referred to in any of the embodiments above.
In general, the various embodiments of the disclosure may be implemented in hardware or special purpose circuits, software, logic or any combination thereof. Some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software, which may be executed by a controller, microprocessor or other computing device. While various aspects of the embodiments of the disclosure are illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, apparatus, systems, techniques or methods described herein may be implemented in, as non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof.
The present disclosure also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product comprises computer executable instructions, such as instructions included in program modules, being executed in a device on a real or virtual processor of a target to perform the processes/methods as described above with reference to the figures. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data types. In various embodiments, the functionality of the program modules may be combined or split between program modules as desired. Machine-executable instructions for program modules may be executed within local or distributed devices. In distributed devices, program modules may be located in both local and remote memory storage media.
Computer program code for carrying out methods of the present disclosure may be written in one or more programming languages. These computer program code may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the computer or other programmable data processing apparatus, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
In the context of this disclosure, computer program code or related data may be carried by any suitable carrier to enable an apparatus, device, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like. Examples of signals may include electrical, optical, radio, acoustical or other form of propagated signals, such as carrier waves, infrared signals, etc.
A computer readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of a computer-readable storage medium include an electrical connection with one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
Furthermore, although the operations of the methods of the present disclosure are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform. It should also be noted that features and functions of two or more devices according to the present disclosure may be embodied in one device. Conversely, the features and functions of one device described above may be further divided into multiple devices to be embodied.
The foregoing has described implementations of the present disclosure, and the foregoing description is exemplary, not exhaustive, and not limited to the implementations disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various implementations described. The terminology used herein was chosen in order to best explain the principles of each implementation, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand each implementation disclosed herein.

Claims (20)

1. An information transmission method, comprising:
the client device determines memory use information;
the client device determines Transmission Control Protocol (TCP) parameters based on the memory usage information, wherein the TCP parameters comprise a TCP sliding window size and a maximum message Duan Daxiao MSS;
the client device generates a connection request message based on the TCP parameters; and
and the client device sends the connection request message to the server device to trigger three-way handshake.
2. The method of claim 1, wherein the client device determining TCP parameters based on the memory usage information comprises:
the client device determines whether the memory residual quantity is lower than a memory threshold value based on the memory use information;
if the memory remaining amount is not lower than the memory threshold, the client device determines that the TCP sliding window size is equal to a preset TCP sliding window size, and the MSS is equal to a preset MSS;
and if the memory residual quantity is lower than the memory threshold value, the client device determines that the TCP sliding window size is smaller than the preset TCP sliding window size, and the MSS is smaller than the preset MSS.
3. The method of claim 2, wherein the memory threshold is determined based on an attribute of a chip of the client device.
4. A method according to any one of claims 1 to 3, further comprising:
the client device sets at least one of the following based on the memory usage information: a transmit buffer size, or a receive buffer size.
5. The method of any of claims 1 to 4, wherein the determining, by the client device, memory usage information includes:
and the network protocol stack of the client device determines the memory use information by calling a hardware abstraction layer HAL interface.
6. The method of claim 5, wherein the network protocol stack is a lightweight transmission control protocol stack.
7. The method of any one of claims 1 to 6, wherein the memory usage information indicates at least one of:
the memory usage amount;
memory utilization;
the remaining amount of memory; or (b)
Memory residual rate.
8. The method according to any one of claims 1 to 7, further comprising:
the client device establishes TCP connection with the server device through the three-way handshake; and
And the client device performs data transmission with the server device.
9. A communication device, comprising:
the first determining module is configured to determine memory use information;
a second determining module configured to determine a transmission control protocol TCP parameter based on the memory usage information, where the TCP parameter includes a TCP sliding window size and a maximum message Duan Daxiao MSS;
the generating module is configured to generate a connection request message based on the TCP parameters; and
and the sending module is configured to send the connection request message to the server-side equipment so as to trigger three-way handshake.
10. The apparatus of claim 9, wherein the second determination module is configured to:
determining whether the memory residual quantity is lower than a memory threshold value based on the memory use information;
if the memory residual quantity is not lower than the memory threshold value, determining that the TCP sliding window size is equal to a preset TCP sliding window size, wherein the MSS is equal to a preset MSS;
and if the memory residual quantity is lower than the memory threshold value, determining that the TCP sliding window size is smaller than the preset TCP sliding window size, and the MSS is smaller than the preset MSS.
11. The apparatus of claim 10, wherein the memory threshold is determined based on an attribute of a chip of the communication apparatus.
12. The apparatus according to any one of claims 9 to 11, further comprising a setting module configured to set at least one of: a transmit buffer size, or a receive buffer size.
13. The apparatus of any one of claims 9 to 12, wherein the first determination module is configured to:
the memory usage information is determined by invoking a Hardware Abstraction Layer (HAL) interface by a network protocol stack.
14. The apparatus of claim 13, wherein the network protocol stack is a lightweight transmission control protocol stack.
15. The apparatus of any one of claims 9 to 14, wherein the memory usage information indicates at least one of:
the memory usage amount;
memory utilization;
the remaining amount of memory; or (b)
Memory residual rate.
16. The apparatus according to any one of claims 9 to 15, further comprising:
the TCP establishment module is configured to establish TCP connection with the server equipment through the three-way handshake; and
And the data transmission module is configured to perform data transmission with the server-side equipment.
17. A communication device comprising a transceiver, a processor and a memory having stored thereon instructions to be executed by the processor, which when executed by the processor, cause the communication device to implement the method according to any of claims 1 to 8.
18. A computer readable storage medium storing computer executable instructions which when executed by a processor implement the method of any one of claims 1 to 8.
19. A computer program product comprising computer executable instructions thereon, which when executed implement the method according to any of claims 1 to 8.
20. A chip comprising processing circuitry configured to perform the method of any one of claims 1 to 8.
CN202210173782.3A 2022-02-24 2022-02-24 Information transmission method and communication device Pending CN116708307A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210173782.3A CN116708307A (en) 2022-02-24 2022-02-24 Information transmission method and communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210173782.3A CN116708307A (en) 2022-02-24 2022-02-24 Information transmission method and communication device

Publications (1)

Publication Number Publication Date
CN116708307A true CN116708307A (en) 2023-09-05

Family

ID=87836156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210173782.3A Pending CN116708307A (en) 2022-02-24 2022-02-24 Information transmission method and communication device

Country Status (1)

Country Link
CN (1) CN116708307A (en)

Similar Documents

Publication Publication Date Title
CN108494817B (en) Data transmission method, related device and system
WO2020199792A1 (en) Communication method and apparatus, computer-readable medium and electronic device
CN107770269B (en) A kind of service response method and its terminal
AU2019256257B2 (en) Processor core scheduling method and apparatus, terminal, and storage medium
WO2020063040A1 (en) Processor core configuration method and apparatus, terminal, and storage medium
US11689646B2 (en) Network packet processing method and apparatus and network server
US11112847B2 (en) Dual processor power saving architecture communications system
WO2024037296A1 (en) Protocol family-based quic data transmission method and device
WO2022143508A1 (en) Method for transmitting data in near field, device and system
US11182210B2 (en) Method for resource allocation and terminal device
WO2021174536A1 (en) Communication method and related apparatus
CN112491978B (en) Scheduling method and device
WO2024067529A1 (en) Rdma-based link establishment method and apparatus, and device and storage medium
CN116708307A (en) Information transmission method and communication device
CN113271336B (en) DPDK-based robot middleware DDS data transmission method, electronic equipment and computer-readable storage medium
CN112311694A (en) Priority adjustment method and device
EP4366367A1 (en) Resource negotiation method
CN111245794B (en) Data transmission method and device
WO2024060247A1 (en) Data exchange method and apparatus based on bluetooth communication, and device and storage medium
CN115955437B (en) Data transmission method, device, equipment and medium
WO2022062857A1 (en) Resource request method, resource configuration method, and related product
CN113225257B (en) UPF data processing method, system and storage medium
WO2022111173A1 (en) Network slice access method, device, and system, and storage medium
CN117615042A (en) Data communication method, device, computer equipment and storage medium
CN115604749A (en) Wireless data transmission method, system and wireless access point equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination