CN113114606B - Method and device for collecting distribution data - Google Patents

Method and device for collecting distribution data Download PDF

Info

Publication number
CN113114606B
CN113114606B CN202010023186.8A CN202010023186A CN113114606B CN 113114606 B CN113114606 B CN 113114606B CN 202010023186 A CN202010023186 A CN 202010023186A CN 113114606 B CN113114606 B CN 113114606B
Authority
CN
China
Prior art keywords
terminal
data
protocol
data packet
udp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010023186.8A
Other languages
Chinese (zh)
Other versions
CN113114606A (en
Inventor
虞海明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202010023186.8A priority Critical patent/CN113114606B/en
Publication of CN113114606A publication Critical patent/CN113114606A/en
Application granted granted Critical
Publication of CN113114606B publication Critical patent/CN113114606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for collecting distribution data, and relates to the technical field of logistics. One embodiment of the method comprises the following steps: the receiving terminal sends a delivery data message based on UDP protocol; analyzing the distribution data packet from the distribution data packet; and caching the distribution data packet into a data buffer window. On one hand, the implementation mode can avoid frequently creating connection, greatly reduce the message length, reduce the network resource consumption and improve the transmission speed; in addition, based on a data buffering mechanism, protocol reliability can be ensured.

Description

Method and device for collecting distribution data
Technical Field
The invention relates to the technical field of logistics, in particular to a method and a device for collecting distribution data.
Background
The distribution terminal integrated machine (POS machine) collects data of the position of a device terminal every second, and the data is used as a coordinate point of a distribution member track to be uploaded to a server. The client requests track data for an incremental or full period of time for presentation to the client to display the current dispatcher location and the dispatch track.
In the prior art, the POS machine adopts HTTP (Hyper Text Transport Protocol, hypertext transfer protocol) short connection to upload the acquired coordinate data in real time, and the server stores and provides a relevant data interface to finally display the distribution personnel track on the client.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
(1) Since the HTTP short connection must contain header information, the data message is long, consuming a lot of network resources.
(2) The HTTP protocol is slow to transfer.
Disclosure of Invention
In view of this, the embodiment of the invention provides a method and a device for collecting distribution data, which can avoid frequently creating connection, greatly reduce message length, reduce network resource consumption and improve transmission speed; in addition, based on a data buffering mechanism, protocol reliability can be ensured.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method for collecting distribution data, including:
the receiving terminal sends a delivery data message based on UDP protocol;
analyzing the distribution data packet from the distribution data packet;
and caching the distribution data packet into a data buffer window.
Optionally, after buffering the delivery data packet in the data buffer window, the method further includes:
judging whether the quantity of the distributed data packets in the data buffer window in preset time meets a first preset condition or not;
if yes, the terminal is controlled to send a delivery data packet cached to the next data buffer window by adopting a UDP protocol;
otherwise, updating the retransmission times of the terminal, and controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window.
Optionally, before controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window, the method further includes:
and determining UDP availability according to the updated retransmission times, and if the UDP availability is smaller than a preset first threshold, adjusting the message protocol of the terminal to be a TCP protocol.
Optionally, after adjusting the message protocol of the terminal to the TCP protocol, the method further includes:
and detecting UDP availability periodically, and adjusting the message protocol of the terminal to UDP protocol when the UDP availability is larger than a preset second threshold.
Optionally, the delivery data packet includes the following fields: a terminal identification field, a verification field, a dispatcher identification field, a longitude field and a latitude field; wherein each field occupies four bytes.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for collecting delivery data, including:
the receiving unit is used for receiving the delivery data message sent by the terminal based on the UDP protocol;
an analysis unit for analyzing the delivery data packet from the delivery data packet;
and the caching unit caches the distribution data packet to a data buffering window.
Optionally, the apparatus further comprises: the switching unit is used for judging whether the quantity of the distributed data packets in the data buffer window in preset time meets a first preset condition after the distributed data packets are buffered to the data buffer window;
if yes, the terminal is controlled to send a delivery data packet cached to the next data buffer window by adopting a UDP protocol;
otherwise, updating the retransmission times of the terminal, and controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window.
Optionally, the switching unit is further configured to: and before the terminal is controlled to retransmit the delivery data packet corresponding to the data buffer window, determining UDP availability according to the updated retransmission times, and if the UDP availability is smaller than a preset first threshold, adjusting the message protocol of the terminal to be TCP protocol.
Optionally, the switching unit is further configured to: after the message protocol of the terminal is adjusted to be the TCP protocol, the UDP availability is detected periodically, and when the UDP availability is larger than a preset second threshold, the message protocol of the terminal is adjusted to be the UDP protocol.
Optionally, the delivery data packet includes the following fields: a terminal identification field, a verification field, a dispatcher identification field, a longitude field and a latitude field; wherein each field occupies four bytes.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device for delivery data collection, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: by sending the message based on the UDP protocol, on one hand, the frequent establishment of connection can be avoided, the message length is greatly reduced, the network resource consumption is reduced, and the transmission speed is improved; on the other hand, the hardware resource consumption of the receiving end analysis message can be reduced, and the system stability is improved. In addition, based on a data buffering mechanism, protocol reliability can be ensured. Based on the availability and the periodic detection mechanism, specifically, when the UDP availability is smaller than a preset first threshold, the message protocol of the terminal is adjusted to be the TCP protocol, and when the UDP availability is larger than a preset second threshold, the message protocol of the terminal is adjusted to be the UDP protocol, so that the switching of the transmission protocol can be realized, and the high availability of the protocol is ensured.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a method for distributing data collection according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of network protocol conversion in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a UDP protocol message in an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main components of a device for distributing data collection in an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the prior art, the POS machine adopts HTTP short connection to upload the acquired coordinate data in real time, and the following problems exist: (1) Because the HTTP short connection must contain header information, the data message length is large, consuming a lot of network resources; (2) the HTTP protocol transmission speed is slow. In the invention, the terminal adopts UDP (User Datagram Protocol ) protocol to send the message by default.
According to one aspect of an embodiment of the present invention, a method of distribution data acquisition is provided.
FIG. 1 is a schematic diagram of a main flow of a method for collecting distribution data according to an embodiment of the present invention, and as shown in FIG. 1, the method for collecting distribution data includes:
step S101, a receiving terminal sends a delivery data message based on UDP protocol;
step S102, analyzing the delivery data packet from the delivery data packet;
step S103, the distribution data packet is cached to a data buffer window.
By sending the message based on the UDP protocol, on one hand, the frequent establishment of connection can be avoided, the message length is greatly reduced, the network resource consumption is reduced, and the transmission speed is improved; on the other hand, the hardware resource consumption of the receiving end analysis message can be reduced, and the system stability is improved. In addition, based on a data buffering mechanism, protocol reliability can be ensured.
Optionally, after buffering the delivery data packet in the data buffer window, the method further includes: judging whether the quantity of the distributed data packets in the data buffer window in preset time meets a first preset condition or not; if yes, the terminal is controlled to send a delivery data packet cached to the next data buffer window by adopting a UDP protocol; otherwise, updating the retransmission times of the terminal, and controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window.
The first preset condition can be selectively set according to actual conditions. In some embodiments, the first preset condition is that the number of the delivered data packets in the data buffer window in the preset time is equal to the buffer threshold of the data buffer window, for example, the buffer threshold of the data buffer window is N, and the number of the delivered data packets in the data buffer window in the preset time is also equal to N. In other embodiments, the first preset condition is that a ratio between the number of data packets delivered in the data buffer window and the buffer threshold of the data buffer window within a preset time is greater than or equal to a set ratio threshold, for example, the buffer threshold of the data buffer window is N, and the number of data packets delivered in the data buffer window within the preset time is also equal to 90% N.
And when the quantity of the distributed data packets in the data buffer window within the preset time meets the first preset condition, the current data buffer window is considered to be completely acquired, and the next data buffer window is slid to continuously acquire the distributed data.
When the quantity of the distributed data packets in the data buffer window in the preset time does not meet the first preset condition, updating the retransmission times of the terminal, and conveniently determining the UDP availability according to the retransmission times; and controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window, so that the delivery data can be acquired to the maximum extent, and the problem of data loss caused by failure in receiving part of the delivery data packet is prevented.
Optionally, before controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window, the method further includes: and determining the UDP availability according to the updated retransmission times, and if the UDP availability is smaller than a preset first threshold, adjusting the message protocol of the terminal to be a TCP protocol, see FIG. 2. When the UDP availability is smaller than a preset first threshold, the fact that the UDP protocol is unsuitable for sending the delivery data is indicated, for example, the transmission speed is low or the transmission fails, and the message protocol of the terminal is adjusted to the TCP protocol, so that the terminal can send the delivery data through the TCP protocol, the transmission speed is improved, and the reliability and the high availability of the protocol are guaranteed.
Optionally, after adjusting the message protocol of the terminal to the TCP protocol, the method further includes: and detecting UDP availability periodically, and adjusting the message protocol of the terminal to UDP protocol when the UDP availability is larger than a preset second threshold. By means of periodic detection, when the network environment is suitable for transmitting delivery data by adopting the UDP protocol, the message protocol of the terminal can be timely adjusted to the UDP protocol, so that on one hand, the frequent establishment of connection due to the adoption of the TCP protocol is avoided, the message length is greatly reduced, the network resource consumption is reduced, and the transmission speed is improved; on the other hand, the hardware resource consumption of the receiving end analysis message can be reduced, and the system stability is improved.
It should be noted that, the first threshold and the second threshold mentioned in the present invention may be selectively set according to actual situations. Typically, the first threshold is less than the second threshold. In an alternative embodiment of simultaneously adopting the first threshold and the second threshold to control the switching of the transmission protocol, assuming that the current UDP availability is T, the UDP protocol is currently used for transmitting the message, and T > the second threshold > the first threshold, if T is reduced to T ', the second threshold is more than or equal to T '. Gtoreq.first threshold, the UDP protocol is still used for transmitting the message until T ' < first threshold, and the TCP protocol is used for transmitting the message instead. Assuming that the current UDP availability is T, the TCP protocol is currently used for transmitting the message, and the second threshold value is greater than the first threshold value and greater than T, if T is increased to T', the second threshold value is greater than or equal to the first threshold value, the TCP protocol is still used for transmitting the message until the second threshold value is reached, and the UDP protocol is used for transmitting the message.
The invention can realize the switching of the transmission protocol based on the availability and the periodic detection mechanism, and ensure the high availability of the protocol.
Optionally, the delivery data packet includes the following fields: a terminal identification field, a verification field, a dispatcher identification field, a longitude field and a latitude field; wherein each field occupies four bytes. FIG. 3 is a schematic diagram of a UDP protocol message in an embodiment of the present invention, as shown in FIG. 3, the first 4 bytes of the delivery data message are stored CID; byte 5-8 stores RSN; byte 9-12 stores operators No; bytes 13-116 store longitude; bytes 17-20 store the latency. CID, client ID, represents the unique identity of the terminal. The RSN (Robust Security Network ) is used to verify user legitimacy. The RSN is an authentication identifier issued after a dispatcher logs in the system, the data carries the identifier in login timeliness to indicate that the user is legal, and if the identifier is inconsistent with the server, the RSN needs to be re-logged in and re-acquired. In FIG. 3, operator No represents the dealer identity, longitude represents accuracy, and latitude represents latitude.
The UDP protocol message of the invention can greatly reduce the message length, reduce the network resource consumption and improve the transmission speed; the hardware resource consumption of the receiving end analysis message is reduced, and the system stability is improved.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for implementing the above method.
Fig. 4 is a schematic diagram of main components of an apparatus for collecting distribution data according to an embodiment of the present invention, and as shown in fig. 4, an apparatus 400 for collecting distribution data includes:
a receiving unit 401 for receiving the delivery data message sent by the terminal based on the UDP protocol;
a parsing unit 402, configured to parse the distribution packet from the distribution packet;
the buffering unit 403 buffers the delivery data packet into a data buffer window.
Optionally, the apparatus further comprises: the switching unit is used for judging whether the quantity of the distributed data packets in the data buffer window in preset time meets a first preset condition after the distributed data packets are buffered to the data buffer window;
if yes, the terminal is controlled to send a delivery data packet cached to the next data buffer window by adopting a UDP protocol;
otherwise, updating the retransmission times of the terminal, and controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window.
Optionally, the switching unit is further configured to: and before the terminal is controlled to retransmit the delivery data packet corresponding to the data buffer window, determining UDP availability according to the updated retransmission times, and if the UDP availability is smaller than a preset first threshold, adjusting the message protocol of the terminal to be TCP protocol.
Optionally, the switching unit is further configured to: after the message protocol of the terminal is adjusted to be the TCP protocol, the UDP availability is detected periodically, and when the UDP availability is larger than a preset second threshold, the message protocol of the terminal is adjusted to be the UDP protocol.
Optionally, the delivery data packet includes the following fields: a terminal identification field, a verification field, a dispatcher identification field, a longitude field and a latitude field; wherein each field occupies four bytes.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device for delivery data collection, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method provided by the first aspect of embodiments of the present invention.
Fig. 5 illustrates an exemplary system architecture 500 of a method of delivery data acquisition or apparatus of delivery data acquisition to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages (e.g., delivery data upload request, delivery track request), etc. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and process the received data such as the distribution track query request, and feed back the processing result (for example, distribution track information—only an example) to the terminal device.
It should be noted that, the method for collecting distribution data according to the embodiment of the present invention is generally executed by the server 505, and accordingly, the device for collecting distribution data is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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 fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage 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. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor comprising: the receiving unit is used for receiving the delivery data message sent by the terminal based on the UDP protocol; an analysis unit for analyzing the delivery data packet from the delivery data packet; and the caching unit caches the distribution data packet to a data buffering window. The names of these units do not in any way limit the unit itself, for example, the receiving unit may also be described as "unit buffering the distribution data packet into a data buffer window".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: the receiving terminal sends a delivery data message based on UDP protocol; analyzing the distribution data packet from the distribution data packet; and caching the distribution data packet into a data buffer window.
According to the technical scheme provided by the embodiment of the invention, the method has the following advantages or beneficial effects: by sending the message based on the UDP protocol, on one hand, the frequent establishment of connection can be avoided, the message length is greatly reduced, the network resource consumption is reduced, and the transmission speed is improved; on the other hand, the hardware resource consumption of the receiving end analysis message can be reduced, and the system stability is improved. In addition, based on a data buffering mechanism, protocol reliability can be ensured. Based on the availability and the periodic detection mechanism, specifically, when the UDP availability is smaller than a preset first threshold, the message protocol of the terminal is adjusted to be the TCP protocol, and when the UDP availability is larger than a preset second threshold, the message protocol of the terminal is adjusted to be the UDP protocol, so that the switching of the transmission protocol can be realized, and the high availability of the protocol is ensured.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A method of dispensing data acquisition, comprising:
the receiving terminal sends a delivery data message based on UDP protocol; wherein the first 4 bytes of the delivery data message store the terminal identification field, the 5 th to 8 th bytes store the check field, the 9 th to 12 th bytes store the dispatcher identification field, the 13 th to 16 th bytes store the longitude field, and the 17 th to 20 th bytes store the latitude field; the check field is RSN and is used for checking the validity of the user; the RSN is an authentication mark issued after a dispatcher logs in the system, the mark is carried by data in login time to indicate that a user is legal, and if the mark is inconsistent with a server, the RSN needs to be logged in again to acquire again;
analyzing the distribution data packet from the distribution data packet;
caching the distribution data packet into a data buffer window;
and analyzing and processing the received distribution data, and feeding back distribution track information to the terminal.
2. The method of claim 1, wherein after buffering the delivery data packet into the data buffer window, further comprising:
judging whether the quantity of the distributed data packets in the data buffer window in preset time meets a first preset condition or not;
if yes, the control terminal adopts UDP protocol to send the delivery data packet buffered to the next data buffer window;
otherwise, updating the retransmission times of the terminal, and controlling the terminal to retransmit the distribution data packet corresponding to the data buffer window.
3. The method of claim 2, wherein prior to controlling the terminal to retransmit the delivery data packet corresponding to the data buffer window, further comprising:
and determining UDP availability according to the updated retransmission times, and if the UDP availability is smaller than a preset first threshold, adjusting the message protocol of the terminal to be a TCP protocol.
4. The method of claim 3, further comprising, after adjusting the message protocol of the terminal to a TCP protocol:
and detecting UDP availability periodically, and adjusting the message protocol of the terminal to UDP protocol when the UDP availability is larger than a preset second threshold.
5. A device for dispensing data acquisition, comprising:
the receiving unit is used for receiving the delivery data message sent by the terminal based on the UDP protocol; wherein the first 4 bytes of the delivery data message store the terminal identification field, the 5 th to 8 th bytes store the check field, the 9 th to 12 th bytes store the dispatcher identification field, the 13 th to 16 th bytes store the longitude field, and the 17 th to 20 th bytes store the latitude field; the check field is RSN and is used for checking the validity of the user; the RSN is an authentication mark issued after a dispatcher logs in the system, the mark is carried by data in login time to indicate that a user is legal, and if the mark is inconsistent with a server, the RSN needs to be logged in again to acquire again;
an analysis unit for analyzing the delivery data packet from the delivery data packet;
a buffer unit for buffering the delivery data packet to a data buffer window;
the device is also for: and analyzing and processing the received distribution data, and feeding back distribution track information to the terminal.
6. The apparatus as recited in claim 5, further comprising: the switching unit is used for judging whether the quantity of the distributed data packets in the data buffer window in preset time meets a first preset condition after the distributed data packets are buffered to the data buffer window;
if yes, the control terminal adopts UDP protocol to send the delivery data packet buffered to the next data buffer window;
otherwise, updating the retransmission times of the terminal, and controlling the terminal to retransmit the distribution data packet corresponding to the data buffer window.
7. The apparatus of claim 6, wherein the switching unit is further to: and before the terminal is controlled to retransmit the delivery data packet corresponding to the data buffer window, determining UDP availability according to the updated retransmission times, and if the UDP availability is smaller than a preset first threshold, adjusting the message protocol of the terminal to be TCP protocol.
8. An electronic device for delivery data acquisition, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-4.
CN202010023186.8A 2020-01-09 2020-01-09 Method and device for collecting distribution data Active CN113114606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010023186.8A CN113114606B (en) 2020-01-09 2020-01-09 Method and device for collecting distribution data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010023186.8A CN113114606B (en) 2020-01-09 2020-01-09 Method and device for collecting distribution data

Publications (2)

Publication Number Publication Date
CN113114606A CN113114606A (en) 2021-07-13
CN113114606B true CN113114606B (en) 2023-09-01

Family

ID=76708759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010023186.8A Active CN113114606B (en) 2020-01-09 2020-01-09 Method and device for collecting distribution data

Country Status (1)

Country Link
CN (1) CN113114606B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004073273A1 (en) * 2003-02-17 2004-08-26 Samsung Electronics Co., Ltd. Harq reordering method for wcdma enhanced uplink dedicated channel
CN101834879A (en) * 2010-02-09 2010-09-15 北京中科大洋科技发展股份有限公司 Intelligent efficient video/audio data transmission method adapted to different network environments
CN102904689A (en) * 2012-10-15 2013-01-30 哈尔滨工业大学深圳研究生院 Improved method for transmission control protocol based on network coding
CN102968705A (en) * 2012-11-05 2013-03-13 北京京东世纪贸易有限公司 Method and device for processing information
CN107368986A (en) * 2017-06-23 2017-11-21 深圳市盛路物联通讯技术有限公司 A kind of logistics information processing method and system
CN107483647A (en) * 2017-09-28 2017-12-15 贵州苗都现代医药物流经营有限公司 A kind of calculating architecture device for Internet of Things storage logistics information
WO2018121742A1 (en) * 2016-12-30 2018-07-05 北京奇虎科技有限公司 Method and device for transmitting stream data
CN110516984A (en) * 2018-05-21 2019-11-29 北京京东振世信息技术有限公司 Method and apparatus for generating Distribution path information
CN110547019A (en) * 2017-04-25 2019-12-06 高通股份有限公司 Flexible scheduling in new wireless (NR) networks

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150227890A1 (en) * 2014-02-07 2015-08-13 Kristin Kaye Bednarek Communications system and smart device apps supporting segmented order distributed distribution system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004073273A1 (en) * 2003-02-17 2004-08-26 Samsung Electronics Co., Ltd. Harq reordering method for wcdma enhanced uplink dedicated channel
CN101834879A (en) * 2010-02-09 2010-09-15 北京中科大洋科技发展股份有限公司 Intelligent efficient video/audio data transmission method adapted to different network environments
CN102904689A (en) * 2012-10-15 2013-01-30 哈尔滨工业大学深圳研究生院 Improved method for transmission control protocol based on network coding
CN102968705A (en) * 2012-11-05 2013-03-13 北京京东世纪贸易有限公司 Method and device for processing information
WO2018121742A1 (en) * 2016-12-30 2018-07-05 北京奇虎科技有限公司 Method and device for transmitting stream data
CN110547019A (en) * 2017-04-25 2019-12-06 高通股份有限公司 Flexible scheduling in new wireless (NR) networks
CN107368986A (en) * 2017-06-23 2017-11-21 深圳市盛路物联通讯技术有限公司 A kind of logistics information processing method and system
CN107483647A (en) * 2017-09-28 2017-12-15 贵州苗都现代医药物流经营有限公司 A kind of calculating architecture device for Internet of Things storage logistics information
CN110516984A (en) * 2018-05-21 2019-11-29 北京京东振世信息技术有限公司 Method and apparatus for generating Distribution path information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
航空货运动态舱位控制模型研究;桂云苗;朱金福;;预测(第06期);全文 *

Also Published As

Publication number Publication date
CN113114606A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
KR20220062101A (en) Information transmission method, apparatus, readable medium and electronic device
US9503498B2 (en) Web page script management
US9882959B2 (en) Managing requests to a high utilization website
US8990429B2 (en) HTTP-based synchronization method and apparatus
CN103347092A (en) Method and device for recognizing cacheable file
US20180091631A1 (en) Systems and methods for writing prioritized http/2 data to a socket buffer
CN112003945A (en) Service request response method and device
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN107357526B (en) Method and apparatus for processing network data, server, and storage medium
CN110798495B (en) Method and server for end-to-end message push in cluster architecture mode
US11463549B2 (en) Facilitating inter-proxy communication via an existing protocol
CN110324384B (en) Data pushing method and device
CN113364887A (en) File downloading method based on FTP, proxy server and system
CN113114606B (en) Method and device for collecting distribution data
US10931791B2 (en) Method and apparatus for processing request
CN112948138A (en) Method and device for processing message
CN111800223A (en) Method, device and system for generating sending message and processing receiving message
CN113094002B (en) Message processing method, device, electronic equipment and computer medium
CN115496544A (en) Data processing method and device
CN113079055B (en) AGV operation data dynamic acquisition method and device
CN112306791B (en) Performance monitoring method and device
CN113138943B (en) Method and device for processing request
CN113132447A (en) Reverse proxy method and system
CN113238808A (en) Message pushing method and device
CN113778909B (en) Method and device for caching data

Legal Events

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