Search

CN-122001871-A - File concurrent transmission method, device, equipment and storage medium based on equipment chain

CN122001871ACN 122001871 ACN122001871 ACN 122001871ACN-122001871-A

Abstract

The embodiment of the application discloses a file simultaneous transmission method, device, equipment and storage medium based on equipment chains. According to the technical scheme provided by the embodiment of the application, the file to be distributed is read by receiving the file distribution instruction according to the file distribution instruction by taking the preset data block length as a unit to obtain the data block, the data block comprises the data content, the data content in the data block is compressed to obtain the corresponding compressed data packet and generate the corresponding protocol header, the corresponding protocol header is combined with each compressed data packet to obtain the corresponding network data packet, the network data packet is sent to the corresponding receiving end in the equipment chain, so that the corresponding receiving end forwards the received network data packet to the downstream receiving end, and the data content extracted from the network data packet is written into the local file, the technical problem that the file simultaneous transmission work efficiency based on the equipment chain is low in the related art can be solved, and the file simultaneous transmission work efficiency based on the equipment chain is improved.

Inventors

  • LONG XIAOBIN
  • WANG DONGJIE

Assignees

  • 广州视源电子科技股份有限公司
  • 广州视睿电子科技有限公司

Dates

Publication Date
20260508
Application Date
20241105

Claims (10)

  1. 1. A file simultaneous transmission method based on a device chain, which is used for a first transmitting end, wherein any terminal device in the device chain is at most a transmitting end of a terminal device and/or is at most a receiving end of a terminal device, and a terminal device at the head of the device chain is used as the first transmitting end, and the method comprises: receiving a file distribution instruction, and reading a file to be distributed according to the file distribution instruction by taking the length of a preset data block as a unit to obtain a data block, wherein the data block comprises data content; Compressing the data content in the data block to obtain a corresponding compressed data packet, and generating a corresponding protocol header; Combining each compressed data packet with a corresponding protocol header to obtain a corresponding network data packet; And sending the network data packet to a corresponding receiving end in the equipment chain, so that the corresponding receiving end forwards the received network data packet to a downstream receiving end, and writing the data content extracted from the network data packet into a local file.
  2. 2. The method according to claim 1, wherein the method further comprises: In the process of reading the file to be distributed, calculating according to the data content read in each data block to obtain a corresponding verification value; after the reading is finished, calculating according to the verification values corresponding to all the data blocks to obtain a first verification value corresponding to the file to be distributed; Receiving a second verification value reported by each receiving end, wherein the second verification value is obtained based on verifying the data content in the local file after the corresponding receiving end receives the receiving end instruction; Comparing the first verification value with the second verification value to obtain a corresponding verification comparison result of each receiving end; And transmitting the verification comparison result to a corresponding receiving end in the equipment chain, so that the corresponding receiving end determines whether the receiving is successful or not based on the corresponding verification comparison result.
  3. 3. The method according to claim 1, wherein the method further comprises: In the process of reading the file to be distributed, calculating according to the read data content in each data block to obtain an MD5 value corresponding to each data block; after the reading is finished, calculating according to the MD5 values corresponding to all the data blocks to obtain a first MD5 value corresponding to the file to be distributed; Receiving a second MD5 value reported by each receiving end, wherein the second MD5 value is obtained based on checking the data content in the local file after the corresponding receiving end receives the receiving end instruction; Comparing whether the first MD5 value and the second MD5 value are the same or not to obtain an MD5 value comparison result corresponding to each receiving end, wherein the MD5 value comparison result comprises the same MD5 value or different MD5 values; And transmitting the MD5 value comparison result to a corresponding receiving end in the equipment chain, so that the corresponding receiving end determines that the receiving is successful when the MD5 value comparison result is the same as the MD5 value or determines that the receiving is unsuccessful when the MD5 value comparison result is different from the MD5 value.
  4. 4. The method of claim 1, wherein compressing the data content in the data block to obtain a corresponding compressed data packet and generating a corresponding protocol header comprises: Compressing the data content in the data block according to a preset compression algorithm to obtain a corresponding compressed data packet; generating a corresponding protocol header according to the identification information, the size information, the identification of the compression algorithm and the size information of the compressed data packet of the data block; Combining each compressed data packet with a corresponding protocol header to obtain a corresponding network data packet, including: and encoding the protocol header into a byte stream, and carrying out comprehensive encoding before the byte stream is added to the compressed data packet to obtain the network data packet.
  5. 5. The method of claim 1, wherein after receiving the file distribution instruction, comprising: Receiving a ready instruction reported by a receiving end in the equipment chain, wherein other terminal equipment in the equipment chain are all receiving ends of the first transmitting end; After determining that ready instructions reported by all receiving ends in the equipment chain are received, reading files to be distributed according to the file distribution instructions by taking the length of a preset data block as a unit; the sending the network data packet to a corresponding receiving end in the equipment chain includes: and sending the network data packet to a corresponding receiving end in the equipment chain according to preset upstream and downstream information, wherein the upstream and downstream information comprises upstream information and downstream information of each receiving end, the upstream information comprises equipment identification and communication address information of an upstream sending end corresponding to the receiving end, and the downstream information comprises equipment identification and communication address information of a downstream receiving end corresponding to the receiving end.
  6. 6. The file simultaneous transmission method based on the equipment chain is characterized by being used for a receiving end, wherein any terminal equipment in the equipment chain is at most a transmitting end of the terminal equipment and/or at most a receiving end of the terminal equipment, and the terminal equipment at the head of the equipment chain is used as a first transmitting end, and the method comprises the following steps: Receiving a network data packet transmitted by a corresponding upstream transmitting end according to the equipment chain, wherein the network data packet is obtained by combining a corresponding protocol header with a compressed data packet, the compressed data packet is obtained by compressing data content in a data block, the protocol header is generated according to a compression process of the data block, the data block is obtained by reading a file to be distributed by the first transmitting end according to a file distribution instruction by taking a preset data block length as a unit, and the data block comprises the data content; Carrying out consistency check on the protocol header in the network data packet; When the consistency check is passed, adding the network data packet into a first queue and a second queue; and sending the network data packet to a downstream receiving end through the first queue, and writing the data content extracted from the network data packet into a local file through the second queue.
  7. 7. The method of claim 6, wherein after receiving the network data packet transmitted by the corresponding upstream sender according to the device chain, the method comprises: After receiving the receiving end instruction, verifying the data content in the local file to obtain a second verification value; reporting the second verification value to the first sending end, so that the first sending end can compare the second verification value with the first verification value calculated by the first sending end to obtain a corresponding verification comparison result; and receiving the verification and comparison result transmitted by the first transmitting end, and determining whether the reception is successful or not according to the verification and comparison result.
  8. 8. The utility model provides a file is with transmitting device based on equipment chain, its characterized in that is used for first transmitting end, in the equipment chain, arbitrary terminal equipment is at most the transmitting end of a terminal equipment, and/or is at most the receiving end of a terminal equipment, the terminal equipment of chain head in the equipment chain is as first transmitting end, the file is with transmitting device based on equipment chain includes: The data block reading module is used for receiving a file distribution instruction, reading a file to be distributed according to the file distribution instruction by taking the length of a preset data block as a unit to obtain a data block, wherein the data block comprises data content; The data block compression module is used for compressing the data content in the data block to obtain a corresponding compressed data packet and generating a corresponding protocol header; the data block integration module is used for combining each compressed data packet with a corresponding protocol header to obtain a corresponding network data packet; And the data block sending module is used for sending the network data packet to a corresponding receiving end in the equipment chain, so that the corresponding receiving end forwards the received network data packet to a downstream receiving end, and writes the data content extracted from the network data packet into a local file.
  9. 9. A file co-transmission device based on a device chain, comprising: a memory and one or more processors; The memory is used 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-7.
  10. 10. A storage medium storing computer executable instructions which, when executed by a processor, are adapted to carry out the method of any one of claims 1 to 7.

Description

File concurrent transmission method, device, equipment and storage medium based on equipment chain Technical Field The embodiment of the application relates to the technical field of information transmission, in particular to a file simultaneous transmission method, device, equipment and storage medium based on equipment chains. Background The switch equipment chain is to connect terminal equipment under a plurality of switches through a specific connection mode to form a logical network topology structure. Switch equipment chains are widely used in the fields of enterprise networks, data centers, industrial parks (for connecting various industrial equipment), smart cities (traffic, security, energy sources, etc.), finance, medical treatment, etc. In the related art, when a switch device chain performs file simultaneous transmission, data transmission is performed by taking the whole large file as a unit, and when partial data is lost in the transmission process, namely, the file received by a receiving end is incomplete, the whole large file is required to be retransmitted, so that the overall transmission efficiency of the file simultaneous transmission is relatively low. Disclosure of Invention The embodiment of the application provides a file simultaneous transmission method, device, equipment and storage medium based on an equipment chain, which can solve the technical problem of low file simultaneous transmission work efficiency based on the equipment chain in the related technology and improve the work efficiency of file simultaneous transmission based on the equipment chain. In a first aspect, an embodiment of the present application provides a method for file simultaneous transmission based on a device chain, where the method is used for a first sending end, and any one of terminal devices in the device chain is at most a sending end of one terminal device, and/or at most a receiving end of one terminal device, and a terminal device at a head of the device chain is used as the first sending end, where the method includes: receiving a file distribution instruction, and reading a file to be distributed according to the file distribution instruction by taking the length of a preset data block as a unit to obtain a data block, wherein the data block comprises data content; compressing the data content in the data block to obtain a corresponding compressed data packet, and generating a corresponding protocol header; combining each compressed data packet with a corresponding protocol header to obtain a corresponding network data packet; And sending the network data packet to a corresponding receiving end in the equipment chain, so that the corresponding receiving end forwards the received network data packet to a downstream receiving end, and writing the data content extracted from the network data packet into a local file. In the above-mentioned embodiment, when the file is transmitted simultaneously based on the device chain, the file to be distributed is read according to the file distribution instruction by taking the preset data block length as a unit to obtain the corresponding data block, and then the data block is used as a unit to transmit and count. And on the basis of transmitting and counting by taking the data block as a unit, the data content in the data block is compressed to obtain smaller unit transmission data quantity, so that the transmission speed is further improved, and the transmission work efficiency is further improved. In addition, the receiving end can simultaneously forward the network data packet and write the data content, and compared with the mode that all files can be transmitted to the downstream receiving end only after receiving is completed in the related technology, the waiting time of the downstream receiving end is greatly reduced, and the overall working efficiency of file simultaneous transmission is further improved. In an embodiment, the method for file concurrency based on the device chain further includes: In the process of reading the file to be distributed, calculating according to the data content read in each data block to obtain a corresponding verification value; After the reading is finished, calculating according to the verification values corresponding to all the data blocks to obtain a first verification value corresponding to the file to be distributed; receiving a second verification value reported by each receiving end, wherein the second verification value is obtained based on verifying the data content in the local file after the corresponding receiving end receives the receiving end instruction; Comparing the first verification value with the second verification value to obtain a corresponding verification comparison result of each receiving end; and transmitting the verification comparison result to a corresponding receiving end in the equipment chain, so that the corresponding receiving end determines whether the receiving is successful or