CN112532700B - Data transmission method and related equipment - Google Patents

Data transmission method and related equipment Download PDF

Info

Publication number
CN112532700B
CN112532700B CN202011288707.9A CN202011288707A CN112532700B CN 112532700 B CN112532700 B CN 112532700B CN 202011288707 A CN202011288707 A CN 202011288707A CN 112532700 B CN112532700 B CN 112532700B
Authority
CN
China
Prior art keywords
data file
uploading
server
data
mac address
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
CN202011288707.9A
Other languages
Chinese (zh)
Other versions
CN112532700A (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.)
Vatti Co Ltd
Original Assignee
Vatti 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 Vatti Co Ltd filed Critical Vatti Co Ltd
Priority to CN202011288707.9A priority Critical patent/CN112532700B/en
Publication of CN112532700A publication Critical patent/CN112532700A/en
Application granted granted Critical
Publication of CN112532700B publication Critical patent/CN112532700B/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/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/283Processing of data at an internetworking point of a home automation network
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Computing Systems (AREA)
  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method for transmitting data and related equipment, wherein the method comprises the following steps: acquiring operation data in real time, and caching the operation data into a data file; acquiring an MAC address, and generating the uploading time of the data file by using the MAC address; and when the uploading time is up, uploading the data file to a server. According to the method and the device, the purpose of uploading the data file by actively timing peak staggering of the intelligent equipment is achieved by generating the uploading time of the respective operation data file based on the MAC address of the intelligent equipment, and the problem that a large amount of server resources are consumed during concurrent uploading of the data is solved.

Description

Data transmission method and related equipment
Technical Field
The application belongs to the technical field of communication, and particularly relates to a data transmission method and related equipment.
Background
With the development of a communication system, after an intelligent device is connected to the internet of things, a server generally collects and monitors running state information of a plurality of intelligent devices in a polling manner, but the polling manner consumes a large amount of server resources.
In view of this, how to efficiently and quickly upload device data to a server for storage becomes a problem to be solved urgently.
Disclosure of Invention
The application aims to provide a data transmission method and related equipment, which can actively upload the operation data of intelligent equipment in a peak-shifting manner, reduce the consumption and waste of server resources and achieve the purpose of collecting the operation data of a plurality of intelligent equipment.
In order to achieve the above purpose, the present application adopts the following technical scheme:
a method of transmitting data, the method being applied to a smart device, comprising:
acquiring operation data in real time, and caching the operation data into a data file;
acquiring an MAC address, and generating the uploading time of the data file by using the MAC address;
and when the uploading time is up, uploading the data file to a server.
Further, generating the upload time of the data file using the MAC address includes:
acquiring a random number and analyzing the acquired MAC address;
and calculating the analyzed MAC address to obtain a calculation result, and generating the uploading time for uploading the data file according to the random number and the calculation result.
Further, the method further comprises:
dividing the value of the MAC address into three sections of values corresponding to hours, minutes and seconds respectively, and carrying out binary conversion on each section of value;
and obtaining the uploading time from the MAC address which completes the binary conversion and the random number, wherein the uploading time comprises hours, minutes and seconds.
Further, when the uploading time is reached, uploading the data file to a server, including:
when the uploading time is up, connection is established with a server;
and obtaining the cached data file, compressing the data file, and uploading the compressed data file to a server through a preset protocol.
Further, the method further comprises:
if the uploading of the data file is successful, the cached data file which is not acquired is cleared;
and if the uploading of the data file fails, caching the acquired data file again, and uploading the data file when the uploading time is reached again.
Further, the method further comprises:
recording a transmission record formed by uploading the data file to the server, and storing the transmission record;
the transmission record includes device information, MAC address, upload time, and data file information.
A system for transmitting data, comprising a smart device and a server, wherein:
the intelligent device is used for acquiring an MAC address, acquiring operation data in real time, caching the operation data into a data file, and generating uploading time of the data file by utilizing the MAC address;
the intelligent device is further configured to upload the data file to the server;
the server is used for receiving the data file and storing the data file into a network storage space of the server.
Further, the intelligent device is further configured to compress the cached data file, and upload the compressed data file to the server through a preset protocol.
Further, the intelligent device is further configured to clear the cached data file that is not acquired when the data file is successfully uploaded; and caching the data files which are not uploaded again when the uploading of the data files fails.
Further, the intelligent device is further configured to record and upload a transmission record of the data file, and store the transmission record.
Further, the server is further configured to send an alarm when detecting that the storage space of the network storage space is insufficient, and perform space release processing on the network storage space.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method when the processor executes the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method.
The technical proposal provided by the embodiment of the application can be seen by
The purpose of uploading the data file by actively timing peak staggering of the intelligent equipment is achieved by generating the uploading time comprising time, minute and second of each operation data file based on the MAC address and the random number of the intelligent equipment, and the consumption and the waste of server resources are reduced; and the stability of successful transmission is ensured by uploading the data file through a preset transmission protocol, so that the purpose of automatically collecting the operation data by the mass intelligent equipment is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a flowchart of a method for transmitting data according to a first embodiment of the present application;
fig. 2 is a schematic structural diagram of a system for transmitting data according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Example 1
The embodiment of the application provides a method for transmitting data, which can actively stagger peaks to upload operation data of intelligent equipment and reduce consumption waste of server resources, as shown in fig. 1, and comprises the following steps:
s1, acquiring operation data in real time, and caching the operation data into a data file.
In this embodiment, before step S1, the method further includes creating a storage space for storing a data file of the operation data. And dividing an independent partition space in an archiving space of a FLASH memory chip local to the intelligent equipment to form the memory space.
Based on the above, after the storage space is created, real-time operation state information of the intelligent device is recorded by collecting each data point or hardware register in the intelligent device in real time, the operation state information can include connection information of the communication module and the router/server, communication state, access information such as bandwidth, operation records (taking a smoke machine as an example, on-off state, gear, oil pollution degree) and fault information of the intelligent device, and the intelligent device records the recorded operation state information in a text form and stores the recorded operation state information into a data file. Wherein the file name of the data file is the type and recording time of the running state information. For example, netstate_20201001_10_05.Log is a data file that records the network operating status of 10 minutes 10.1.am in 2020.
S2, acquiring an MAC address, and generating the uploading time of the data file by using the MAC address.
Step S2 may specifically include obtaining and resolving an MAC address of the intelligent device, randomly obtaining a random number at the same time, calculating the resolved MAC address to obtain a calculation result, and generating an uploading time for uploading the data file according to the random number and the calculation result.
In another embodiment of the present application, the step of calculating the upload time after obtaining the MAC address and the random number may specifically be: the MAC address is resolved to obtain a 12-bit 16-system number of the MAC address, which can be expressed as an ABCD-ABCD-ABCD, which corresponds to three sections of values of hour, minute and second respectively, each section of value is subjected to system conversion, and the uploading time is generated by combining a random number.
The step of calculating ABCD for example in "seconds" value segment is specifically: converting ABCD into 10 system number (HexToDec algorithm can be applied) to obtain a number a, dividing the number a by 65535 (65535 is maximum value FFFF of 16 system), multiplying by 60, applying round function to take integer, adding function random (0, 60) taking random number from 0-60, and finally obtaining "second" of uploading time, and similarly obtaining "minute" of uploading time. In addition, the calculating step of ABCD of the hour value section comprises the following steps: converting ABCD into 10 system numbers to obtain a number a, dividing the number a by 65535, multiplying the number a by 24, adding a function random (0, 24) for taking random numbers from 0 to 24, and finally obtaining the 'hour' of uploading time by applying a round function to take integers. And (3) piecing together according to the calculation result to obtain 'hours': minutes: second "upload time of data file of smart device.
The MAC is a physical communication address of the intelligent device, so that the method has the unique global characteristic, and the uploading time calculated based on the MAC can realize that the uploading time of each intelligent device is linearly distributed, so that peak staggering of the uploading time of automatic uploading of the data file can be realized.
And S3, uploading the data file to a server for storage when the uploading time is reached.
In this embodiment, when the upload time is reached, the intelligent device establishes a connection with the server. The server in this embodiment is an FTP server, and the intelligent device logs in to the FTP server, and uses a preset user name, password and port number to perform authentication, where the authentication successfully initiates data transmission.
Before uploading a data file, firstly obtaining the data file cached in a storage space of an intelligent device, compressing the data file to form a compressed package, then uploading the compressed package to a server through an FTP protocol (File Transfer Protocol ) of the embodiment, and storing the data file into a network storage space created in advance by the server after the server receives the data file, wherein the network storage space can be understood as a network hard disk array. The data transmitted by the FTP protocol has a power-off retransmission mechanism, so that the successful reliability of the transmission of the data file can be ensured.
In another embodiment of the present application, if the uploading of the data file by the intelligent device is successful, the cached data file which is not acquired is cleared, i.e. the data file in the storage space of the intelligent device is cleared; if the uploading of the data file fails, the acquired data file is cached again, namely, the data file in the storage space is reserved, and when the uploading time is reached again, namely, the next uploading period is reached again, the data file is uploaded again, so that the space capacity of the storage space of the intelligent equipment end is saved.
In other embodiments of the present application, when uploading the data file, a transmission record formed by uploading the data file to the server is recorded, and the transmission record is stored; the transfer record may include device information, MAC address, upload time, and data file information, such as device information, MAC address, transfer time, data file name, data file category, data file deposit address, etc.
According to the embodiment of the application, various operation data information of the intelligent equipment can be cached into the data file in the storage space, different uploading time is generated according to the respective MAC address and the random number, the data file is automatically uploaded to the server which establishes the connection relation with the intelligent equipment after being compressed according to the uploading time and according to the FTP protocol, the peak staggering of the automatic uploading time of the data file is realized, the purpose of collecting the data by adopting a polling mode for the intelligent equipment by the server is not required, the operation data of a huge amount of intelligent equipment can be simply and quickly collected, the reliability of the uploading process of the data file is ensured by the FTP protocol, namely, the consumption waste of server resources is reduced by the method for transmitting the data provided by the application, the reliability of the data transmission is ensured, the purpose of collecting the operation data of the huge amount of equipment is achieved, the operation and maintenance of a subsequent Internet of things system can be realized, the problem analysis is realized, and the foundation is laid for the data analysis.
Example two
This embodiment of the present application provides a system to which the method for transmitting data of the present application is applied, as shown in fig. 2, the system including a smart device 101 and a server 102, wherein:
the intelligent device 101 is configured to obtain a MAC address, obtain operation data in real time, cache the operation data into a data file, and generate an upload time of the data file by using the MAC address; the intelligent device 101 is further configured to upload the data file to the server 102, record a transmission record of uploading the data file at the same time, and store the transmission record;
the server 102 is configured to receive the data file and store the data file in the network storage space 103 of the server 102, where the server 102 decompresses the compressed packet of the data file after receiving the data file, and stores the decompressed packet in the network storage space 103, and the network storage space 103 further stores the transmission record.
The intelligent device 101 is further configured to compress the cached data file, and upload the compressed data file to the server 102 through a preset FTP protocol; when the uploading of the data file is successful, the cached data file which is not acquired is cleared; and caching the data files which are not uploaded again when the uploading of the data files fails.
In another embodiment of the present application, the server 102 is further configured to send an alarm when the storage space of the network storage space 103 is detected to be insufficient, and perform space release processing on the network storage space 103, where the network storage space 103 of the server may be released by adopting a mode of file compression, adding a network hard disk, transferring an old data file, or the like.
The system for transmitting data provided in the foregoing embodiment is used for implementing the method for transmitting data provided in the present application, the intelligent device 101 is used to automatically upload the data file composed of the running data to the server 102 according to the FTP protocol at regular time, that is, the consumption and waste of the resources of the server 102 are reduced through the uploading time of peak staggering, meanwhile, the reliability of data transmission is ensured through the FTP protocol, the purpose of collecting the running data of the mass device is achieved, and the server 102 always maintains the operation and the related maintenance of the FTP server, thereby ensuring successful reception of the data files of all the device ends, and implementing the method for transmitting data of the present application more effectively.
A schematic diagram of an embodiment of a computer device of the present disclosure is shown in fig. 3, which includes a memory 201 and a processor 202. Wherein the memory 201 may be a magnetic disk, flash memory, or any other non-volatile storage medium. The memory 201 is used to store instructions in the corresponding embodiments of the method of transmitting data described above. Processor 202 is coupled to memory 201 and may be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 202 is configured to execute the instruction stored in the memory 201, and can actively peak-shifting up the operation data of the intelligent device, so as to reduce consumption and waste of server resources.
In another embodiment, a computer readable storage medium has stored thereon computer program instructions which when executed by a processor perform the steps of the method of transmitting data. It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, or alternatives falling within the spirit and principles of the application.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, or alternatives falling within the spirit and principles of the application.

Claims (11)

1. A method of transmitting data, the method being applied to a smart device, comprising:
acquiring operation data in real time, and caching the operation data into a data file;
acquiring the MAC address, generating the uploading time of the data file by using the MAC address, and the method comprises the following steps:
acquiring a random number and analyzing the acquired MAC address;
calculating the analyzed MAC address to obtain a calculation result, and generating uploading time for uploading the data file according to the random number and the calculation result;
when the uploading time is up, uploading the data file to a server;
recording a transmission record formed by uploading the data file to the server, and storing the transmission record;
the transmission record includes device information, MAC address, upload time, and data file information.
2. The method of transmitting data according to claim 1, wherein the method further comprises:
dividing the value of the MAC address into three sections of values corresponding to hours, minutes and seconds respectively, and carrying out binary conversion on each section of value;
and obtaining the uploading time from the MAC address which completes the binary conversion and the random number, wherein the uploading time comprises hours, minutes and seconds.
3. A method of transmitting data according to claim 1 or 2, wherein uploading the data file to a server when an upload time is reached comprises:
when the uploading time is up, connection is established with a server;
and obtaining the cached data file, compressing the data file, and uploading the compressed data file to a server through a preset protocol.
4. A method of transmitting data according to claim 3, wherein the method further comprises:
if the uploading of the data file is successful, the cached data file which is not acquired is cleared;
and if the uploading of the data file fails, caching the acquired data file again, and uploading the data file when the uploading time is reached again.
5. A system for transmitting data, characterized in that the method of any of claims 1-4 is applied, comprising a smart device and a server, wherein:
the intelligent device is used for acquiring an MAC address, acquiring operation data in real time, caching the operation data into a data file, and generating uploading time of the data file by utilizing the MAC address;
the intelligent device is further configured to upload the data file to the server;
the server is used for receiving the data file and storing the data file into a network storage space of the server.
6. The system for transmitting data according to claim 5, wherein: the intelligent device is further configured to compress the cached data file, and upload the compressed data file to the server through a preset protocol.
7. The system for transmitting data according to claim 6, wherein: the intelligent device is further used for clearing the cached data file which is not acquired when the data file is successfully uploaded; and caching the data files which are not uploaded again when the uploading of the data files fails.
8. The system for transmitting data according to claim 7, wherein: the intelligent device is also used for recording and uploading the transmission record of the data file and storing the transmission record.
9. The system for transmitting data according to claim 8, wherein: the server is further used for sending out an alarm when the shortage of the storage space of the network storage space is detected, and performing space release processing on the network storage space.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 4 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
CN202011288707.9A 2020-11-17 2020-11-17 Data transmission method and related equipment Active CN112532700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011288707.9A CN112532700B (en) 2020-11-17 2020-11-17 Data transmission method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011288707.9A CN112532700B (en) 2020-11-17 2020-11-17 Data transmission method and related equipment

Publications (2)

Publication Number Publication Date
CN112532700A CN112532700A (en) 2021-03-19
CN112532700B true CN112532700B (en) 2023-09-05

Family

ID=74980810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011288707.9A Active CN112532700B (en) 2020-11-17 2020-11-17 Data transmission method and related equipment

Country Status (1)

Country Link
CN (1) CN112532700B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114585048B (en) * 2022-03-11 2023-12-08 可瑞尔科技(扬州)有限公司 Control method, device, equipment and medium for multi-equipment time-sharing connection to WiFi

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110300151A (en) * 2019-05-22 2019-10-01 深圳壹账通智能科技有限公司 Method for uploading data file and system
CN110635898A (en) * 2019-08-30 2019-12-31 深圳壹账通智能科技有限公司 Encryption method and encryption system
CN110995836A (en) * 2019-11-29 2020-04-10 安徽江淮汽车集团股份有限公司 Log management method, device, storage medium and device based on Internet of vehicles platform
CN111611142A (en) * 2020-05-19 2020-09-01 深圳Tcl数字技术有限公司 Information collection method, device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030041097A1 (en) * 2001-07-11 2003-02-27 Alexander Tormasov Distributed transactional network storage system
US8886615B2 (en) * 2011-11-08 2014-11-11 Xerox Corporation Web service performance optimization by adaptively using compression

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110300151A (en) * 2019-05-22 2019-10-01 深圳壹账通智能科技有限公司 Method for uploading data file and system
CN110635898A (en) * 2019-08-30 2019-12-31 深圳壹账通智能科技有限公司 Encryption method and encryption system
CN110995836A (en) * 2019-11-29 2020-04-10 安徽江淮汽车集团股份有限公司 Log management method, device, storage medium and device based on Internet of vehicles platform
CN111611142A (en) * 2020-05-19 2020-09-01 深圳Tcl数字技术有限公司 Information collection method, device and storage medium

Also Published As

Publication number Publication date
CN112532700A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
US10652265B2 (en) Method and apparatus for network forensics compression and storage
CN104410692A (en) Method and system for uploading duplicated files
WO2021068891A1 (en) Method, system, electronic device, and storage medium for storing and collecting temperature data
CN106027595A (en) Access log processing method and system for CDN node
CN112532700B (en) Data transmission method and related equipment
CN111177094A (en) Log data processing method and device, electronic equipment and storage medium
CN111083008A (en) Nginx-based traffic collection and analysis method
CN111930599A (en) Operation and maintenance data processing method and device of cloud service system and storage medium
CN101515945A (en) On-line application method and system of P2P resource files
CN103297547B (en) The P2P system constructing cloud based on DHT is used to store the method for auxiliary system
WO2011160884A1 (en) A method, a system, a server, a device, a computer program and a computer program product for transmitting data in a computer network
CN111694766B (en) CAN data acquisition method and device
WO2021147319A1 (en) Data processing method, apparatus, device, and medium
CN111565132B (en) Overtime detection method and system for bidirectional forwarding detection message
CN113630442B (en) Data transmission method, device and system
CN114785805B (en) Data transmission method, device, electronic equipment and storage medium
JP2001077813A (en) Network information management system, network information management method and recording medium recording its processing program
CN112003749B (en) Host information adding method, system and electronic equipment
CN111125479B (en) Statistical method, device, computer equipment and storage medium for site access
CN108805741B (en) Fusion method, device and system of power quality data
CN112202742A (en) Data processing method of rolling mill equipment based on 5G network and related equipment
CN114629894A (en) Internet of things data transmission method and device
CN110708208B (en) Monitoring data acquisition method and device, storage medium and terminal
CN115361262B (en) Method and system for realizing FTP (File transfer protocol) reporting of transmission equipment performance file
CN114257643B (en) Log transmission method and system

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