CN116560824A - Data receiving method and device applied to Internet of things - Google Patents

Data receiving method and device applied to Internet of things Download PDF

Info

Publication number
CN116560824A
CN116560824A CN202210111642.3A CN202210111642A CN116560824A CN 116560824 A CN116560824 A CN 116560824A CN 202210111642 A CN202210111642 A CN 202210111642A CN 116560824 A CN116560824 A CN 116560824A
Authority
CN
China
Prior art keywords
size
memory
internet
data packet
things device
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
CN202210111642.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 CN202210111642.3A priority Critical patent/CN116560824A/en
Publication of CN116560824A publication Critical patent/CN116560824A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y10/00Economic sectors
    • G16Y10/75Information technology; Communication
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y20/00Information sensed or collected by the things
    • G16Y20/30Information sensed or collected by the things relating to resources, e.g. consumed power
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/50Safety; Security of things, users, data or systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/19Flow control; Congestion control at layers above the network layer
    • H04L47/193Flow control; Congestion control at layers above the network layer at the transport layer, e.g. TCP related
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Business, Economics & Management (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method and a device for receiving data, which can avoid memory resource waste and improve the utilization rate of memory resources while improving the communication success rate. The method comprises the following steps: the first Internet of things device and the second Internet of things device negotiate an upper limit of the size of a transmitted data packet according to a transmission layer security protocol; the first internet of things device receives first information from the second internet of things device, the first information being used to indicate the size of a first data packet to be sent by the second internet of things device; the first internet of things device dynamically adjusts the size of a first memory for storing a first data packet in the first internet of things device according to the first information.

Description

Data receiving method and device applied to Internet of things
Technical Field
The present disclosure relates to the field of communications, and more particularly, to a data receiving method and apparatus applied to the internet of things.
Background
With the development of the internet of things technology, the secure communication gradually becomes one of the most core communication capacities, is limited by hardware resources of the internet of things equipment, lightweight secure encryption and decryption software becomes the first choice of various manufacturers, and the mbedTLS is a free encryption and decryption communication open source software which is friendly to commerce, simple to transplant and convenient to modularly configure and is pursued by mainstream manufacturers. However, with the increase of application programs for encrypting and decrypting communication by using mbeddtls, the internet of things device still has a bottleneck of insufficient hardware resources. Among them, mbedTLS is a transport layer security (transport layer security, TLS) protocol developed by ARM corporation.
In typical TLS protocol communications, an internet of things device serves as a client (client) end, a cloud server serves as a server (server) end, and a client end actively initiates a TLS handshake to the server end, and in the handshake process, both parties negotiate information such as an encryption algorithm used in subsequent encrypted communications, online of the size of a transmitted data packet, and the like. The client is responsible for carrying out TLS handshake and communication with the server, namely a mbeddTLS module, and the negotiated data packet size is used as a basis for applying from the buffer area for storing the memory of the data packet sent by the server by the mbeddTLS module.
At present, the upper limit of the size of the packet negotiated between the mbeddtls module at the client and the server is 16K by default, and the value is larger for the internet of things equipment with limited memory, so that in order to reduce the memory pressure at the client as much as possible, the mbeddtls module carries an extension field to negotiate a smaller upper limit of the size of the packet when handshaking with the server, and the two steps are divided into four steps of 0.5K, 1K, 2K and 4K. The MBedTLS module at the client end negotiates the upper limit of the size of a data packet communicated by both parties with the server end, and two possible results exist: the negotiation fails or both parties negotiate successfully. If the negotiation fails, the mbeddtls module can only apply for the memory of the buffer according to the size of 16K by default, but in the communication of the internet of things, the size of the data packet is generally only 1K-4K and is far smaller than 16K, so that the serious problem of memory resource waste exists in the situation. If the negotiation is successful, the size of the buffer memory applied by the mbeddtls module is fixed, and in actual internet of things communication, the size of the data packet is not fixed and is smaller most of the time, so that the memory of the fixed buffer memory also causes waste of memory resources.
Disclosure of Invention
The application provides a data receiving method and device applied to the Internet of things, which can avoid memory resource waste and improve the utilization rate of memory resources while improving the communication success rate.
In a first aspect, a data receiving method applied to the internet of things is provided, where the method may be executed by a network device or a chip system on the network device side. The method comprises the following steps: the first Internet of things device and the second Internet of things device negotiate an upper limit of the size of a transmitted data packet according to a transmission layer security protocol; the first internet of things device receives first information from the second internet of things device, wherein the first information is used for indicating the size of a first data packet sent by the second internet of things device; and the first Internet of things device dynamically adjusts the size of a first memory for storing the first data packet in the first Internet of things device according to the first information.
Based on the technical scheme, the first internet of things device can determine the size of the first data packet sent by the second internet of things device according to the first information received from the second internet of things device, and dynamically adjust the size of the first memory for storing the first data packet according to the size of the first memory and the size of the first data packet which have been applied for. When the size of the first data packet is larger than the size of the first memory which is currently applied, applying for the larger first memory can improve the communication success rate; when the size of the first data packet is smaller than the size of the first memory which is currently applied, the smaller first memory can be applied, so that the waste of memory resources can be avoided, and the utilization rate of the memory resources can be improved. Therefore, compared with the prior art that the size of the memory used for storing the data packet is fixed, the embodiment of the application can flexibly adjust the size of the first memory according to the size of the current data packet, so that the communication success rate can be improved, memory resource waste can be avoided, and the utilization rate of memory resources can be improved.
With reference to the first aspect, in some implementations of the first aspect, the dynamically adjusting, by the first internet of things device, a size of the first memory according to the first information includes: when the size of the first data packet is larger than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to the size of the first data packet. Optionally, the adjusted size of the first memory may also be larger than the size of the first data packet. The larger first memory is applied, so that the communication success rate can be improved.
With reference to the first aspect, in some implementations of the first aspect, the dynamically adjusting, by the first internet of things device, a size of the first memory according to the first information includes: when the size of the first data packet is smaller than or equal to the size of the first memory, the first internet of things device determines the size of a target memory according to the size of the first data packet, the average value of the sizes of second data packets received in a period and the size of the available memory in the first internet of things device, wherein the second data packets are received by the first internet of things device before receiving the first information; the first internet of things device dynamically adjusts the size of the first memory according to the size of the target memory and the size of the first memory.
With reference to the first aspect, in some implementations of the first aspect, the dynamically adjusting, by the first internet of things device, the size of the first memory according to the size of the target memory and the size of the first memory includes: when the size of the target memory is larger than or smaller than that of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to that of the target memory; when the size of the target memory is equal to the size of the first memory, the first internet of things device does not adjust the size of the first memory.
Under the condition, the first Internet of things equipment determines the size of the target memory according to the size of the first data packet, the average value of the size of the second data packet received in a period and the size of the available memory in the first Internet of things equipment, and then the size of the first memory can be adaptively adjusted by comparing the size of the target memory with the size of the first data packet, so that the communication success rate is improved, and meanwhile, the memory resource waste is avoided.
With reference to the first aspect, in some implementations of the first aspect, the dynamically adjusting, by the first internet of things device, the size of the first memory according to the first information includes: when the size of the first data packet is smaller than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to the size of the first data packet; when the size of the first data packet is equal to the size of the first memory, the first internet of things device does not adjust the size of the first memory.
According to the scheme, the size of the data packet received each time can be kept consistent with the size of the first memory, a certain memory space is not reserved for the first memory, the waste of memory resources can be avoided, and the resource utilization rate is improved.
With reference to the first aspect, in certain implementation manners of the first aspect, the method further includes: the first internet of things device receives the first data packet from the second internet of things device.
In a second aspect, a communication apparatus is provided, where the apparatus may be applied to the first internet of things device in the first aspect, and the apparatus includes: a communication circuit for negotiating with the second physical network device an upper limit of a size of the transmitted data packet according to the transport layer security protocol; the communication circuit is further configured to receive first information from a second internet-enabled device, the first information being used to indicate a size of a first data packet sent by the second internet-enabled device; and the processing circuit is used for dynamically adjusting the size of a first memory used for storing the first data packet in the first Internet of things device according to the first information.
With reference to the second aspect, in some implementations of the second aspect, the processing circuit is specifically configured to, when a size of the first data packet is greater than a size of the first memory, adjust the size of the first memory, where the adjusted size of the first memory is equal to the size of the first data packet.
With reference to the second aspect, in certain implementations of the second aspect, the processing circuit is specifically configured to: when the size of the first data packet is smaller than or equal to the size of the first memory, determining the size of a target memory according to the size of the first data packet, the average value of the sizes of second data packets received in a period and the size of the available memory in the internet of things equipment where the processing circuit is located, wherein the second data packets are received by the communication circuit before receiving the first information; and dynamically adjusting the size of the first memory according to the size of the target memory and the size of the first memory.
With reference to the second aspect, in certain implementations of the second aspect, the processing circuit is specifically configured to: when the size of the target memory is larger than or smaller than that of the first memory, adjusting the size of the first memory, wherein the adjusted size of the first memory is equal to that of the target memory; and when the size of the target memory is equal to the size of the first memory, not adjusting the size of the first memory.
With reference to the second aspect, in certain implementations of the second aspect, the processing circuit is specifically configured to: when the size of the first data packet is smaller than the size of the first memory, adjusting the size of the first memory, wherein the adjusted size of the first memory is equal to the size of the first data packet; and when the size of the first data packet is equal to the size of the first memory, not adjusting the size of the first memory.
With reference to the second aspect, in certain implementations of the second aspect, the communication circuit is further configured to receive the first data packet from the second internet appliance.
In a third aspect, there is provided a communication device comprising: a processor and a memory for storing a computer program, the processor being for executing the computer program stored in the memory to cause the communication device to perform the method as in the first aspect or any possible implementation of the first aspect.
In a fourth aspect, there is provided a communication device comprising: the system comprises an input/output interface and a processor, wherein the input/output interface is used for acquiring input information and/or output information; the processor is configured to perform the method according to the first aspect or any possible implementation manner of the first aspect, process and/or generate output information according to input information.
In a fifth aspect, there is provided a computer readable storage medium storing a computer program; the computer program, when run on a computer, causes the computer to perform the method of the first aspect and any one of the possible implementations of the first aspect.
In a sixth aspect, there is provided a computer program product comprising instructions which, when executed by a computer, cause a communication device to implement the method of the first aspect and any one of the possible implementations of the first aspect.
Drawings
FIG. 1 is a schematic diagram of client-side and server-side handshake communications.
FIG. 2 is a flow chart of client-side and server-side handshake communications.
Fig. 3 is a flowchart illustrating negotiation of an upper limit of a transmitted packet size by the mbeddtls module in the client and the TLS communication circuit in the server.
FIG. 4 is a schematic flow chart of a client side and a server side of an embodiment of the present application.
Fig. 5 is a schematic flowchart of a data receiving method applied to the internet of things according to an embodiment of the present application.
Fig. 6 is a schematic diagram of the structure of the transmitted data specified by the TLS protocol.
Fig. 7 is a schematic flow chart of a method for resizing a first memory according to an embodiment of the present application.
Fig. 8 is a schematic flow chart of another embodiment of the present application for resizing a first memory.
Fig. 9 is a schematic block diagram of a communication device according to an embodiment of the present application.
Fig. 10 is a schematic block diagram of a communication device according to an embodiment of the present application.
Detailed Description
The technical solutions in the present application will be described below with reference to the accompanying drawings.
The embodiments of the present application may be applied to various communication systems, such as radio frequency identification (radio frequency Identification, RFID) systems, near field communication (near field communication, NFC) systems, wireless fidelity (wifi) systems, bluetooth (blue) systems, zigbee (zigbee) systems, narrowband-band-internet of things, NB-IoT) systems, long range (LoRa) wireless transmission systems, global system for mobile communications (global system for mobile communications, GSM), enhanced data rates for GSM evolution (enhanced data rate for GSM evolution, EDGE), wideband code division multiple access (wideband code division multiple access, WCDMA), code division multiple access 2000 (code division multiple access, CDMA 2000) systems, time division synchronous code division multiple access (time division multiple access-synchronization code division multiple access, TD-SCDMA), general packet radio service (general packet radio service, GPRS) systems, long term evolution (long term evolution, LTE) systems, advanced long term evolution (advanced long term evolution, LTE-a) systems, universal mobile communication systems ((universal mobile telecommunication system, UMTS), third generation partnership project (the 3rd generation partnership project,3GPP) related cellular systems, fifth generation (5th generation,5G) mobile communication systems, side Link (SL) systems, new communication systems, or the like.
The terminal device referred to in the embodiments of the present application may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem, which have wireless communication functions. The terminal may be a Mobile Station (MS), a subscriber unit (subscriber unit), a User Equipment (UE), a cellular phone (cellular phone), a smart phone (smart phone), a wireless data card, a personal digital assistant (personal digital assistant, PDA) computer, a tablet computer, a wireless modem (modem), a handheld device (handset), a laptop computer (laptop computer), a machine type communication (machine type communication, MTC) terminal, etc. Wherein the user device comprises a vehicle user device.
Illustratively, the network device may be an evolved Node B (eNB), a radio network controller (radio network controller, RNC), a Node B (Node B, NB), a base station controller (base station controller, BSC), a base transceiver station (base transceiver station, BTS), a home base station (home evolved NodeB, or home Node B, HNB), a Base Band Unit (BBU), an Access Point (AP) in a wireless fidelity (wireless fidelity, WIFI) system, a wireless relay Node, a wireless backhaul Node, a transmission point (transmission point, TP), or a transmission receiving point (transmission and reception point, TRP), etc., may be a gNB or a transmission point (e.g., TRP or TP) in a new air interface (new radio, NR), one or a group (including a plurality) of antenna panels of a base station in NR, or may be a network Node (including a plurality) constituting the gNB or transmission point, for example, a base band unit (building baseband unit, BBU) or a distributed unit (tri) etc., or a network Node (BBU), or may be an evolved network Node (d) in a vehicle-mounted PLMN, or may be a network device as a network device in the future, or may be a network device. The network device in the embodiment of the application is an internet of things device, such as a smart watch, a sweeping robot, a sharing bicycle and the like.
With the development of the internet of things technology, the secure communication gradually becomes one of the most core communication capacities, is limited by hardware resources of the internet of things equipment, lightweight secure encryption and decryption software becomes the first choice of various manufacturers, and the mbedTLS is a free encryption and decryption communication open source software which is friendly to commerce, simple to transplant and convenient to modularly configure and is pursued by mainstream manufacturers. Where mbedTLS is a lightweight implementation of one transport layer security (transport layer security, TLS) protocol developed for embedded devices.
However, with the increase of application programs for encrypting and decrypting communication by using the mbeddtls, the internet of things equipment still has a bottleneck of insufficient hardware resources, and researches show that the existing memory allocation method of the mbeddtls does not fully utilize the hardware resources, so that the communication efficiency is low, the resources are wasted, and the further development of the internet of things technology is hindered.
In typical TLS protocol communications, an internet of things device is used as a client (client) end, and a cloud server is used as a server (server) end, where the client end integrates an open source library of mbeddtls to provide encryption and decryption communications capability, and mbeddtls provides symmetric/asymmetric encryption and decryption, an x.509 certificate and interfaces related to TLS communications, and an application program (APP) at the client end invokes the interfaces to complete encryption and decryption communications with the server end.
And actively initiating TLS handshake to the server by the client, and negotiating information such as an encryption algorithm used in subsequent encryption communication, online of the size of a transmitted data packet and the like by both parties in the handshake process. The client is responsible for carrying out TLS handshake and communication with the server, namely a mbeddTLS module, and the negotiated data packet size is used as a basis for applying from the buffer area for storing the memory of the data packet sent by the server by the mbeddTLS module.
As shown in fig. 1, a schematic diagram of a client-side handshake communication with a server-side is shown. The client end actively initiates a TLS handshake to the server end, and in the handshake process, both sides negotiate the upper limit and other information of the size of the transmitted data packet, and a TLS communication circuit in the server end transmits the data packet to the client end after the handshake.
At present, the upper limit of the size of a packet negotiated by the mbeddTLS module at the client end and the server end is 16K by default, and the value is larger for the Internet of things equipment with limited memory, so that in order to reduce the memory pressure at the client end as much as possible, the mbeddTLS module carries an extension field to negotiate a smaller upper limit of the size of the packet when handshaking with the server end and is divided into four gears of 0.5K, 1K, 2K and 4K; for example, the mbedTLS module carries a "max_fragment_length" field to negotiate a smaller upper packet size limit.
As shown in fig. 2, a flow chart of client-side handshake communication with server-side is shown. In the TLS handshake negotiation phase, the client and the server mutually send "HELLO", perform key exchange (key exchange) and certificate verification (certificate verify), and negotiate an upper limit of the size of the transmitted data packet. After the negotiation is completed, the application data slicing transmission is performed.
The cone tls module at the client end negotiates with the server end about the upper limit of the size of the data packet transmitted by both parties, and there are two possible results: the negotiation fails or both parties negotiate successfully. However, either negotiation success or failure has its own drawbacks.
As shown in fig. 3, a flow chart of negotiating an upper limit of a transmitted packet size by the mbeddtls module in the client and the TLS communication circuit in the server is shown.
The client sends 'HELLO' to the server and negotiates the upper limit of the size of the transmitted data packet. If the upper limit negotiation of the size of the transmitted data packet is successful, the mbeddtls module in the client applies for smaller memory, for example, applies for memory with a size of 0.5K, 1K, 2K or 4K, and the TLS recording layer transmits data according to the upper limit of the applied memory size. If the upper limit negotiation of the size of the transmitted data packet fails, a mbeddTLS module in the client end defaults to apply for a memory with the size of 16K, and a TLS recording layer transmits data according to the upper limit of the applied memory with the size of 16K; because the size of the data packet actually transmitted is only 1K-4K, more memory resources are wasted. Wherein, mbeddtls is a specific implementation of a standard TLS protocol, which itself includes a TLS handshake protocol and a TLS recording layer protocol, and the TLS recording layer protocol is responsible for encrypted transmission. The TLS recording layer may be understood as part of the mbeddtls.
(1) The server has no response or negotiation failure condition:
in the actual communication process, due to server end server configuration or TLS protocol version difference and other reasons, the negotiation failure of both parties can be met under a certain probability. In this case, the mbeddtls module applies for the memory of the buffer area only according to the size of 16K by default, but in real internet of things communication, the size of the data packet is generally only 1K-4K, which is far smaller than 16K, and in this case, there are serious problems of memory resource waste and low communication success rate. It should be understood that if the mbeddtls module applies for the buffer memory according to the size of 16K, and the actual packet size is smaller than 16K, the memory resource is wasted. If the mbeddtls module applies for memory from the server where the mbeddtls module is located according to the size of 16K, if the available memory of the client is actually less than 16K, the memory application fails, which results in disconnection of the communication link between the client and the server, thereby resulting in low communication success rate.
In the practical cloud platform docking, developers often encounter the problem of authentication failure of client end and server end, and for this reason, the memory size of the 16K cache area applied by default by the mbeddTLS module has to be changed to 4K or less, so as to temporarily avoid the problem of memory resource waste.
(2) Case of successful negotiation between both parties:
the upper limit of the size of the transmitted data packet negotiated by the client end and the server end is limited to 0.5K, 1K, 2K or 4K, once negotiation is successful, the buffer memory is applied by the mbeddTLS module according to the negotiation result, the size of the buffer memory applied by the mbeddTLS module is fixed in the scene, and in actual Internet of things communication, the size of the data packet is not fixed and is smaller most of the time, so that the buffer memory applying for the fixed size still has the defect of memory resource waste.
Therefore, the embodiment of the application provides a data receiving method applied to the Internet of things, which can avoid memory resource waste and improve the utilization rate of memory resources while improving the communication success rate.
The first internet of things device in the embodiment of the application may be a client terminal, and the second internet of things device may be a server terminal. .
As shown in FIG. 4, a schematic flow chart of the client side and server side of an embodiment of the present application are shown.
The first Internet of things device (client) first handshakes with the second Internet of things device (server), negotiates the upper limit of the size of the transmitted data packet, and applies for the initial first memory. If the negotiation is successful, the initial first memory applied by the first internet of things equipment can be 0.5K, 1K, 2K or 4K, and the second internet of things equipment sends a data packet to the first internet of things equipment according to the negotiation size; if the negotiation fails, the initial first memory is not applied for the initial first memory according to the default fixed size of 16K, but is changed to a more reasonable value, such as 4K. And after the initial first memory is determined, entering a communication stage, and in the subsequent actual data transmission process, adaptively adjusting the first memory for storing the data packet sent by the second internet of things device in the first internet of things device according to the method provided by the application.
As shown in fig. 5, a schematic flow chart of a method 500 for receiving data according to an embodiment of the present application is shown.
510, the first internet of things device handshakes with the second internet of things device, negotiating an upper limit of the size of the transmitted data packet according to the TLS protocol; the mbeddtls module in the first internet of things device applies for an initial first memory from the first internet of things device.
The first internet of things device receives 520 first information from the second internet of things device, the first information indicating a size of a first data packet sent by the second internet of things device. The first information is information indicated by a length (length) field of the first data packet, and the length field indicates the size of the first data packet to be transmitted currently according to RFC5246 specification. The first information is first analyzed before the first data packet arrives at the first internet of things device, and before the first internet of things device receives the first data packet sent by the second internet of things device.
As shown in fig. 6, a schematic diagram of the structure of the transmitted data specified by the TLS protocol is shown. The TLS header includes a type (type) field, a version (version) field, and a length (length) field of the packet, and the TLS payload includes data information of the packet. For the transmission of each data packet, the bit information of the length field arrives at the first internet of things device before the bit information of the data packet, in other words, the second internet of things device sends the length field of the data packet to the first internet of things device and then sends the data information of the data packet to the first internet of things device.
530, the first internet of things device dynamically adjusts the size of a first memory in the first internet of things device for storing the first data packet according to the first information, where the first memory is applied to the first internet of things device by a mbeddtls module in the first internet of things device. Specifically, the first internet of things device dynamically adjusts the size of the first memory according to the size of the first data packet and the size of the first memory.
The implementation mode is as follows:
for example, when the size of the first data packet is greater than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory may be equal to the size of the first data packet; optionally, the size of the adjusted first memory may also be larger than the size of the first data packet. A mbeddTLS module in the first Internet of things device applies for a first memory with the adjusted size of the first memory to the first Internet of things device; that is, when the size of the first data packet is greater than the first memory, the mbeddtls module in the first internet of things device may apply for the first larger memory to the first internet of things device to store the first data packet.
For example, when the size of the first data packet is smaller than or equal to the size of the first memory, the first internet of things device determines the size of the target memory according to the size of the first data packet, the average value of the sizes of the one or more second data packets received in the period, and the size of the available memory in the first internet of things device. Specifically, the first internet of things device determines the size of the target memory according to the size of the first data packet, the average value of the sizes of one or more second data packets received in a period, the size of the available memory in the first internet of things device, and RFC specification constraints. The size of the target memory is the size of the optimal memory. Among them, RFC is a series of memos issued by the internet engineering task force (internet engineering task force, IETE).
The second data packet is received by the first internet of things device before the first information is received, that is, the second data packet is received by the first internet of things device before the first data packet is received.
The first Internet of things device dynamically adjusts the size of the first memory according to the size of the target memory and the size of the first memory. Optionally, when the size of the target memory is greater than or less than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to the size of the target memory; under the situation, the mbeddtls module in the first internet of things device needs to apply for the first memory with the adjusted size of the first memory to the first internet of things device, that is, the mbeddtls module in the first internet of things device applies for the larger or smaller first memory to the first internet of things device, where the size of the larger or smaller first memory is equal to the size of the target memory. Optionally, when the size of the target memory is equal to the size of the first memory, the first internet of things device does not adjust the size of the first memory, and the mbeddtls module in the first internet of things device does not need to apply for a larger or smaller first memory to the first internet of things device.
It should be understood that, in addition to providing encryption and decryption communication capability, the first internet of things device (mbeddts tls module) may continuously track the size of the available memory in the internet of things device/internet of things chip and the size of the data packet that has been transmitted in the recording period, where the first internet of things device may perform weight determination by integrating the above information, the size of the first data packet to be currently transmitted and RFC specification constraints, and finally determine the size of the target memory, and adjust the current size of the first memory according to the size of the target memory, so as to implement adaptive adjustment of the current size of the first memory.
The weight determination method adopted in the embodiment of the present application does not specify a specific method. Common subjective assignment methods for weight determination, such as expert consultation, analytic hierarchy process (analytic hierarchy process, AHP), and rating scoring, may be used.
Optionally, the first internet of things device receives the first data packet from the second internet of things device, and stores the first data packet in the first memory of the adjusted size of the first memory. It should be appreciated that, in the case where the first internet of things device does not resize the first memory, the first internet of things device stores the first data packet in the resized first memory.
Optionally, if the first internet of things device adjusts the size of the first memory, the first internet of things device may send second information to the second internet of things device, where the second information includes the adjusted size of the first memory and is used to instruct the second internet of things device to send a data packet to the first internet of things device according to the adjusted size of the first memory, in other words, the second information is used to instruct the second internet of things device to send a subsequent data packet to the first internet of things device, where an upper limit of the size of the subsequent data packet is equal to the adjusted size of the first memory.
As shown in fig. 7, a schematic flow chart of adjusting the size of the first memory according to an embodiment of the present application is shown. The mbeddtls module (first internet of things device) identifies the size of the current data packet (the size of the first data packet) for a single data packet transmission. The mbeddtls module determines whether the size of the current data packet is larger than the size of the current first memory, and if the size of the current data packet is larger than the size of the current first memory, the mbeddtls module applies for the larger first memory. If the size of the current data packet is smaller than or equal to the size of the current first memory, the mbeddTLS module determines the size of the optimal memory (the size of the target memory) through weighting judgment according to the size of the current data packet, the average value of the sizes of the data packets counted in the period, the size of the available memory of the Internet of things equipment/chip and RFC specification constraint; the mbeddTLS module dynamically adjusts the size of the first memory by comparing the current size of the first memory with the size of the optimal memory, and if the size of the first memory is adjusted, applies for the first memory with the size of the optimal memory. And finally, receiving and storing the current data packet by the mbeddTLS module to finish the transmission of the current data packet.
The implementation mode II is as follows:
the first internet of things device adjusts the size of the first memory when the size of the first data packet is smaller than the size of the first memory, and the adjusted size of the first memory is equal to the size of the first data packet; under the situation, in order to avoid memory resource waste, the mbeddtls module in the first internet of things device applies for the first memory with the size of the first data packet to the first internet of things device, that is, the mbeddtls module in the first internet of things device applies for the smaller first memory to the first internet of things device.
For example, when the size of the first data packet is greater than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to the size of the first data packet; under the situation, in order to avoid communication failure caused by insufficient memory, the mbeddtls module in the first internet of things device applies for the first memory with the size of the first data packet to the first internet of things device, that is, the mbeddtls module in the first internet of things device applies for the larger first memory to the first internet of things device.
For example, when the size of the first data packet is equal to the size of the first memory, the first internet of things device does not adjust the size of the first memory.
According to the scheme, the size of the data packet received each time can be kept consistent with the size of the first memory, a certain memory space is not reserved for the first memory, the waste of memory resources can be avoided, and the resource utilization rate is improved. Moreover, the scheme is suitable for scenes with very small memory in the Internet of things equipment/Internet of things chip.
Optionally, the first internet of things device receives the first data packet from the second internet of things device, and stores the first data packet in the first memory of the adjusted size of the first memory. It should be appreciated that, in the case where the first internet of things device does not resize the first memory, the first internet of things device stores the first data packet in the resized first memory.
Optionally, if the first internet of things device adjusts the size of the first memory, the first internet of things device may send second information to the second internet of things device, where the second information includes the adjusted size of the first memory and is used to instruct the second internet of things device to send a data packet to the first internet of things device according to the adjusted size of the first memory, in other words, the second information is used to instruct the second internet of things device to send a subsequent data packet to the first internet of things device, where an upper limit of the size of the subsequent data packet is equal to the adjusted size of the first memory.
As shown in fig. 8, another schematic flow chart of the embodiment of the present application for resizing the first memory is shown. The mbeddtls module (first internet of things device) identifies the size of the current data packet (the size of the first data packet) for a single data packet transmission. The mbeddTLS module judges whether the size of the current data packet is equal to the size of the current first memory, and if the size of the current data packet is larger than or smaller than the size of the current first memory, the mbeddTLS module reappears the first memory with the size of the current data packet. If the size of the current data packet is equal to the size of the current first memory, the mbeddtls module does not adjust the size of the current first memory. And finally, receiving and storing the current data packet by the mbeddTLS module to finish the transmission of the current data packet.
In the technical scheme provided by the embodiment of the application, the first internet of things device can determine the size of the first data packet sent by the second internet of things device according to the first information received by the second internet of things device, and dynamically adjust the size of the first memory for storing the first data packet according to the size of the first memory and the size of the first data packet which have been applied for. When the size of the first data packet is larger than the size of the first memory which is currently applied, applying for the larger first memory can improve the communication success rate; when the size of the first data packet is smaller than the size of the first memory which is currently applied, the smaller first memory can be applied, so that the waste of memory resources can be avoided, and the utilization rate of the memory resources can be improved. Therefore, compared with the prior art that the size of the memory used for storing the data packet is fixed, the embodiment of the application can flexibly adjust the size of the first memory according to the current size of the data packet, so that the communication success rate can be improved, memory resource waste can be avoided, and the utilization rate of memory resources can be improved.
The embodiment of the application proposes a communication device, as shown in fig. 9, and a schematic block diagram of a communication device 900 of the embodiment of the application is shown. The apparatus may be a first internet of things device in an embodiment of the present application. The communication device 900 includes:
a communication circuit 910, configured to negotiate with the second physical network device an upper limit of a size of the transmitted data packet according to the transport layer security protocol;
the communication circuit 910 is further configured to receive first information from the second internet-enabled device, where the first information is used to indicate a size of a first data packet sent by the second internet-enabled device;
and the processing circuit 920 is configured to dynamically adjust a size of a first memory in the first internet of things device for storing the first data packet according to the first information.
Optionally, the processing circuit 920 is specifically configured to adjust the size of the first memory when the size of the first data packet is larger than the size of the first memory, where the adjusted size of the first memory is equal to the size of the first data packet.
Optionally, the processing circuit 920 is specifically configured to:
when the size of the first data packet is smaller than or equal to the size of the first memory, determining the size of a target memory according to the size of the first data packet, the average value of the sizes of second data packets received in a period and the size of the available memory in the internet of things equipment where the processing circuit is located, wherein the second data packets are received by the communication circuit before receiving the first information;
And dynamically adjusting the size of the first memory according to the size of the target memory and the size of the first memory.
Optionally, the processing circuit 920 is specifically configured to:
when the size of the target memory is larger than or smaller than that of the first memory, adjusting the size of the first memory, wherein the adjusted size of the first memory is equal to that of the target memory;
and when the size of the target memory is equal to the size of the first memory, not adjusting the size of the first memory.
Optionally, the processing circuit 920 is specifically configured to:
when the size of the first data packet is smaller than the size of the first memory, adjusting the size of the first memory, wherein the adjusted size of the first memory is equal to the size of the first data packet;
and when the size of the first data packet is equal to the size of the first memory, not adjusting the size of the first memory.
Optionally, the communication circuit 910 is further configured to receive the first data packet from the second internet appliance.
The embodiment of the application provides a communication device 1000, as shown in fig. 10, and a schematic block diagram of the communication device 1000 of the embodiment of the application is shown.
The communication device 1000 includes: a processor 1010, a memory 1020, and a communication interface 1030;
memory 1020 is used to store executable instructions;
the processor 1010 is coupled to the memory 1020 through the communication interface 1030, and the processor 1010 is configured to invoke and execute the executable instructions in the memory 1020 to implement the methods of the embodiments of the present application. The communication device may be a first internet of things device or a second internet of things device in embodiments of the present application.
The processor 1010 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the method embodiments described above may be performed by an integrated processor of hardware in the processor or by instructions in the form of software. The processor may be a general purpose processor, a digital signal processor (digital signal processor, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
Optionally, the embodiment of the application further provides a communication device, which includes an input/output interface and a processor, where the input/output interface is used to obtain input information and/or output information; the processor is configured to perform the method in the method embodiment described above, process and/or generate output information according to the input information.
The present application also provides a computer-readable storage medium having stored thereon a computer program for implementing the method in the above method embodiments. The computer program, when run on a computer, enables the computer to implement the method of the method embodiments described above.
Embodiments of the present application also provide a computer program product comprising computer program code for causing the method of the above-described method embodiments to be performed when said computer program code is run on a computer.
The embodiment of the application also provides a chip, which comprises a processor, wherein the processor is connected with a memory, the memory is used for storing a computer program, and the processor is used for executing the computer program stored in the memory, so that the chip executes the method in the embodiment of the method.
It should be understood that, in the embodiments of the present application, the numbers "first" and "second" … are merely for distinguishing different objects, such as for distinguishing different devices, and are not limited to the scope of the embodiments of the present application, but are not limited thereto.
In addition, the term "and/or" in this application is merely an association relationship describing an association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship; the term "at least one" in the present application may mean "one" and "two or more", for example, A, B and C may mean: the seven cases are that A alone, B alone, C alone, A and B together, A and C together, C and B together, A and B together, and C together.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation is not to be considered as beyond the scope of this application.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system, apparatus and unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. The data receiving method applied to the Internet of things is characterized by comprising the following steps of:
the first Internet of things device and the second Internet of things device negotiate an upper limit of the size of a transmitted data packet according to a transmission layer security protocol;
the first internet of things device receives first information from the second internet of things device, wherein the first information is used for indicating the size of a first data packet sent by the second internet of things device;
and the first Internet of things device dynamically adjusts the size of a first memory for storing the first data packet in the first Internet of things device according to the first information.
2. The method of claim 1, wherein the first internet of things device dynamically adjusting the size of the first memory according to the first information comprises:
when the size of the first data packet is larger than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to the size of the first data packet.
3. The method according to claim 1 or 2, wherein the first internet of things device dynamically adjusts the size of the first memory according to the first information, comprising:
When the size of the first data packet is smaller than or equal to the size of the first memory, the first internet of things device determines the size of a target memory according to the size of the first data packet, the average value of the sizes of second data packets received in a period and the size of the available memory in the first internet of things device, wherein the second data packets are received by the first internet of things device before receiving the first information;
the first internet of things device dynamically adjusts the size of the first memory according to the size of the target memory and the size of the first memory.
4. The method of claim 3, wherein the first internet of things device dynamically adjusting the size of the first memory according to the size of the target memory and the size of the first memory, comprising:
when the size of the target memory is larger than or smaller than that of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to that of the target memory;
when the size of the target memory is equal to the size of the first memory, the first internet of things device does not adjust the size of the first memory.
5. The method according to claim 1 or 2, wherein the first internet of things device dynamically adjusting the size of the first memory according to the first information, comprises:
when the size of the first data packet is smaller than the size of the first memory, the first internet of things device adjusts the size of the first memory, and the adjusted size of the first memory is equal to the size of the first data packet;
when the size of the first data packet is equal to the size of the first memory, the first internet of things device does not adjust the size of the first memory.
6. The method according to any one of claims 1 to 5, further comprising:
the first internet of things device receives the first data packet from the second internet of things device.
7. A communication device, comprising:
a communication circuit for negotiating with the second physical network device an upper limit of a size of the transmitted data packet according to the transport layer security protocol;
the communication circuit is further configured to receive first information from the second internet-enabled device, the first information being used to indicate a size of a first data packet sent by the second internet-enabled device;
And the processing circuit is used for dynamically adjusting the size of a first memory used for storing the first data packet in the first Internet of things device according to the first information.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
the processing circuit is specifically configured to adjust the size of the first memory when the size of the first data packet is greater than the size of the first memory, where the adjusted size of the first memory is equal to the size of the first data packet.
9. The apparatus according to claim 7 or 8, wherein the processing circuit is specifically configured to:
when the size of the first data packet is smaller than or equal to the size of the first memory, determining the size of a target memory according to the size of the first data packet, the average value of the sizes of second data packets received in a period and the size of the available memory in the internet of things equipment where the processing circuit is located, wherein the second data packets are received by the communication circuit before receiving the first information;
and dynamically adjusting the size of the first memory according to the size of the target memory and the size of the first memory.
10. The apparatus of claim 9, wherein the processing circuit is specifically configured to:
When the size of the target memory is larger than or smaller than that of the first memory, adjusting the size of the first memory, wherein the adjusted size of the first memory is equal to that of the target memory;
and when the size of the target memory is equal to the size of the first memory, not adjusting the size of the first memory.
11. The apparatus according to claim 7 or 8, wherein the processing circuit is specifically configured to:
when the size of the first data packet is smaller than the size of the first memory, adjusting the size of the first memory, wherein the adjusted size of the first memory is equal to the size of the first data packet;
and when the size of the first data packet is equal to the size of the first memory, not adjusting the size of the first memory.
12. The device according to any one of claims 7 to 11, wherein,
the communication circuit is further configured to receive the first data packet from the second internet-enabled device.
13. A communication device, comprising: a processor and a memory for storing a computer program, the processor for executing the computer program stored in the memory to cause the communication device to perform the method of any one of claims 1 to 6.
14. A communication device, comprising: an input-output interface and a processor;
the input/output interface is used for acquiring input information and/or output information;
the processor is configured to perform the method of any one of claims 1 to 6, process and/or generate the output information in dependence on the input information.
15. A computer-readable storage medium, comprising:
the computer readable medium stores a computer program;
the computer program, when run on a computer, causes the computer to perform the method of any of claims 1 to 6.
16. A computer program product comprising a computer program which, when executed, causes the method of any one of claims 1 to 6 to be implemented.
CN202210111642.3A 2022-01-29 2022-01-29 Data receiving method and device applied to Internet of things Pending CN116560824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210111642.3A CN116560824A (en) 2022-01-29 2022-01-29 Data receiving method and device applied to Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210111642.3A CN116560824A (en) 2022-01-29 2022-01-29 Data receiving method and device applied to Internet of things

Publications (1)

Publication Number Publication Date
CN116560824A true CN116560824A (en) 2023-08-08

Family

ID=87498811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210111642.3A Pending CN116560824A (en) 2022-01-29 2022-01-29 Data receiving method and device applied to Internet of things

Country Status (1)

Country Link
CN (1) CN116560824A (en)

Similar Documents

Publication Publication Date Title
US11937309B2 (en) Communication method, apparatus, and system
US11272568B2 (en) Command reception method and apparatus and communication system
US11477307B2 (en) Media access control protocol data unit processing method and apparatus
CN110505714B (en) Multi-link communication method, equipment and terminal
US11412571B2 (en) Communication method and communications apparatus to deliver first data to an upper layer
US20190357105A1 (en) Method and apparatus for reducing interruption delay, and user device
RU2697941C1 (en) Integrity protection control of logical channel control packet data unit
EP3678437B1 (en) Method for conflict resolution and terminal device
US20220368782A1 (en) Baseband chip and method for layer 2 downlink data processing
WO2020125753A1 (en) Uplink data compression in mobile communications
JP2020532888A (en) Data transmission method, terminal equipment and network equipment
CN109688179B (en) Communication method and communication device
JP6992093B2 (en) Methods and equipment for transmitting data
EP4391491A1 (en) Perception data acquisition method and apparatus, perception data reporting method and apparatus, and device, storage medium and program product
US20220217549A1 (en) Communication Method, Apparatus, and System
US20210092637A1 (en) Method of supporting data replication, transmitting terminal device and receiving terminal device
CN116560824A (en) Data receiving method and device applied to Internet of things
EP4311350A1 (en) Wireless communication method, terminal device and network device
US20240284527A1 (en) Connection establishment and data transmission methods and apparatuses, and communication device
WO2024140600A1 (en) Communication method, communication apparatus, and communication system
WO2023239365A1 (en) Apparatus and method for service data unit segment reassembly
CN116017738A (en) Method and apparatus for wireless communication
CN116801253A (en) Communication method and device

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