CN115002098A - File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium - Google Patents

File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium Download PDF

Info

Publication number
CN115002098A
CN115002098A CN202210520334.6A CN202210520334A CN115002098A CN 115002098 A CN115002098 A CN 115002098A CN 202210520334 A CN202210520334 A CN 202210520334A CN 115002098 A CN115002098 A CN 115002098A
Authority
CN
China
Prior art keywords
file
leader device
leader
local area
area network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210520334.6A
Other languages
Chinese (zh)
Inventor
刘青
周珊珊
张涛
刘迟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jutou Technology Zhuhai Co ltd
Original Assignee
Jutou Technology Zhuhai 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 Jutou Technology Zhuhai Co ltd filed Critical Jutou Technology Zhuhai Co ltd
Priority to CN202210520334.6A priority Critical patent/CN115002098A/en
Publication of CN115002098A publication Critical patent/CN115002098A/en
Pending legal-status Critical Current

Links

Images

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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a file publishing method, a computer device and a computer readable storage medium based on local area network autonomous discovery and election, the method comprises the steps that a plurality of terminal devices conduct network broadcasting in a local area network and join a preset group, the terminal devices in the preset group are divided into leader devices and non-leader devices through an election algorithm, the leader devices publish service access paths to the preset group, the non-leader device sends a file downloading request to the leader device through the service access path, the leader device downloads a preset file from the server side according to the file downloading request, and after the downloading of the preset file is completed, the non-leader device sends a notification of the completion of the downloading to the non-leader device, the non-leader device downloads the preset file from the leader device through the service access path, the method reduces the bandwidth occupation of the server and reduces the time for distributing the file to each terminal device.

Description

File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium
Technical Field
The invention relates to the technical field of data transmission, in particular to a file publishing method based on local area network autonomous discovery and election, a computer device and a computer readable storage medium.
Background
When a terminal device needs to obtain a file from an internet server, the file is usually actively downloaded by the terminal device after interaction through a related protocol (such as HTTP, FTP). The traditional many-to-one mode can complete the transmission of the file within a limited time under the conditions of small file length, small terminal quantity and good network state. However, in the digital advertisement system, not only a large number of broadcast control terminals exist in the same local area network, but also the same video file is often required to be obtained from the internet server at the same time, and especially when the file length is large, if the traditional many-to-one transmission mode is used, the congestion of an internet exit is easy to occur, and the bottleneck situation of the server I/O occurs, so that the downloading speed is greatly reduced, and the file transmission cannot be completed within a limited time.
Disclosure of Invention
The invention aims to provide a file publishing method based on local area network autonomous discovery and election, which can accelerate the downloading speed.
A second object of the present invention is to provide a computer apparatus applied to the above file distribution method.
A third object of the present invention is to provide a computer-readable storage medium storing the above-mentioned file distribution method.
In order to achieve the first object, the present invention provides a file publishing method based on local area network autonomous discovery and election, wherein: a plurality of terminal devices perform network broadcasting in a local area network and join a preset group; dividing a plurality of terminal devices in a preset group into leader devices and non-leader devices through an election algorithm; the leader device publishes the service access path to a preset group; the non-leader device sends a file downloading request to the leader device through a service access path; the leader device downloads a preset file from the server according to the file downloading request, and sends a downloading completion notification to the non-leader device after the preset file is downloaded; the non-leader device downloads the preset file from the leader device through the service access path.
According to the scheme, the terminal devices in the local area network can be found through network broadcasting, the proper leader device is selected through the election algorithm to download the preset file from the server, and the non-leader device obtains the preset file from the leader device through the local area network, so that the bandwidth occupation of the server is reduced, and the time for releasing the file to each terminal device is reduced.
The method further comprises the step that the plurality of terminal devices in the preset group are divided into at least one leader device and a non-leader device through a Raft algorithm.
The leader device downloads the preset file from the server side in a multithreading slicing mode.
Therefore, the bandwidth of the server side can be fully utilized, and the downloading speed is increased.
The method comprises the following steps that after a non-leader device sends a file downloading request to at least one leader device through a service access path, the leader device receives the file downloading request in the JSON format through an HTTP protocol and executes the file downloading request.
The method further comprises the step that when the non-leader device downloads the preset file from the leader device through the service access path, the preset file is downloaded from the leader device through an SMB protocol or an HTTP protocol.
The further scheme is that a plurality of terminal devices perform network broadcasting in the local area network through a Jgroups tool and join a preset group.
Further, the leader device publishes the service access path to a preset group through a JGroups tool.
In order to achieve the second object, the present invention provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the file publishing method based on local area network autonomous discovery and election.
In order to achieve the third object described above, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program runs, the file publishing method is realized.
Drawings
Fig. 1 is a flowchart of a file publishing method based on autonomous discovery and election of a local area network according to the present invention.
The invention is further explained with reference to the drawings and the embodiments.
Detailed Description
The method includes the steps that a plurality of terminal devices in the local area network are brought into the same preset group, the terminal devices in the preset group are divided into leader devices and non-leader devices according to an election algorithm, the leader devices download preset files from a server side, and the non-leader devices download the preset files from the leader devices.
The embodiment of the file publishing method based on the autonomous discovery and election of the local area network comprises the following steps:
referring to fig. 1, step S1 is first executed, and a plurality of terminal devices perform network broadcast in a local area network and join a preset group. Specifically, the terminal device performs network broadcast in the local area network, other terminal devices receiving the broadcast signal return an identification signal, the terminal device sending the network broadcast signal determines that other terminal devices exist according to the identification signal, and all the terminal devices are brought into the same preset group through the JGroups tool. It should be noted that the terminal device may be a broadcast control terminal such as a television, a tablet computer, and a smart phone.
Step S2 is performed, and the plurality of terminal devices are divided into leader devices and non-leader devices by an election algorithm. Specifically, a leader device and a non-leader device are selected from a plurality of terminal devices in the preset group through a Raft algorithm, namely the terminal devices classify the leader device and the non-leader device, the leader device is responsible for downloading the preset file, and the non-leader device downloads the preset file from the leader device. The specific process of adopting the Raft algorithm to select the leader device and the non-leader device can refer to the invention patent in china with the publication number CN109660367A, and it should be noted that the preset file can be a video file and/or an audio file. When the leader device is disconnected, that is, the non-leader device is not subjected to heartbeat information (heartbeat) sent by the leader device within a certain time, at this time, the plurality of terminal devices initiate election again, and reselect a new leader device, so that the process of file release can be ensured to be continuously performed.
Step S3 is performed, and the leader device publishes the service access path into a preset group. Thus, the non-leader device can communicate with the leader device through the service access path, i.e., the leader device initiates the file download and sharing service, and can receive requests of the non-leader device through the service access path.
Step S4 is executed, and the non-leader device sends a file download request to the leader device through the service access path. Specifically, the non-leader device acquires a service access path from a preset group, and sends a file download request based on an SMB protocol or an HTTP protocol to the leader device from the service access path.
And executing the step S5, the leader device downloads the preset file from the server according to the file downloading request, and after completing downloading the preset file, sends a notification of completion of downloading to the non-leader device. Specifically, the leader device receives a file downloading request in a JSON format through an HTTP protocol, and downloads a preset file from the server side. Optionally, the preset file is downloaded from the server side in a multi-thread fragmented downloading mode, the multi-thread fragmented downloading is to divide the preset file into a plurality of fragments, and each fragment is downloaded through one thread, so that the interface bandwidth of the server side can be fully utilized, and the preset file can be downloaded more quickly. In addition, for the file content of the same URL or ID, the file content is downloaded once and stored to the leader device, so that the bandwidth of a server end and the storage capacity of the leader device are prevented from being occupied by multiple times of downloading. After completing the downloading of the preset file, the leader device sends a notification of completion of the downloading to the non-leader device through the JGroups tool.
Step S6 is performed, and the non-leader device downloads the preset file from the leader device through the service access path. Specifically, after receiving the notification of completion of downloading through the Jgroups tool, the non-leader device sends a file downloading request based on the SMB protocol or the HTTP protocol to the leader device through the service access path, so as to receive the preset file from the leader device.
How the download speed is increased is further explained below: in this embodiment, there are 10 terminal devices in the lan, and they all need to download 1000MB of the same video file from the server, so the total download amount is 10000MB, and as known from "white paper for development of broadband in china" published by the institute of information and communications in 2021, 9 months, the average available download rate of the fixed broadband in china is 51.2Mbps, that is, about 6.4MB/s, and therefore, if each terminal device downloads the video file from the server, the time for completing the entire download can be 1563 seconds. If the terminal device downloads the video file through the above steps S1 to S6, it can be seen that 1 leader terminal has a time of completing the downloading of 1000/6.4 to 156 seconds, and then 9 non-leader terminals download 1000MB video files from the leader terminal, respectively, and if the time is calculated at a transmission speed of 100MB/S in the gigabit lan, 90 seconds are required, that is, the time of completing the downloading is 246 seconds. In summary, the download amount of the terminal device downloaded from the server is reduced from 10000MB to 1000MB, so that the server resource occupation and the data traffic cost are greatly reduced, the total download time is reduced from 1563 seconds to 246 seconds, and the file publishing speed is greatly increased.
The embodiment of the computer device comprises:
the computer device of the embodiment includes a processor and a memory, the memory stores computer programs, and the processor implements the steps of the file publishing method based on the local area network autonomous discovery and election when executing the computer programs.
The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the computer apparatus may include more or fewer components, or combine certain components, or different components, e.g., the computer apparatus may also include input-output devices, network access devices, buses, etc.
For example, the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, and so on. A general purpose processor may be a microcontroller or the processor may be any conventional processor or the like. The processor is the control center of the computer device and is connected to various parts of the whole computer device by various interfaces and lines.
The memory may be used to store computer programs and/or modules, and the controller may implement various functions of the computer apparatus by executing or otherwise executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. For example, the memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (e.g., a sound receiving function, a sound-to-text function, etc.), and the like; the storage data area may store data (e.g., audio data, text data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
A computer-readable storage medium:
the modules integrated by the computer apparatus of the above embodiments, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on such understanding, all or part of the processes in the embodiment of the file publishing method based on the local area network autonomous discovery and election can also be completed by instructing relevant hardware through a computer program, and the computer program can be stored in a computer readable storage medium, and when the computer program is executed by a controller, the steps of the embodiment of the file publishing method based on the local area network autonomous discovery and election can be realized. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The storage medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.
In summary, the terminal devices in the lan are discovered through network broadcasting, a suitable leader device can be selected to download the preset file from the server, and the non-leader device obtains the preset file from the leader device through lan transmission, so that the time for releasing the file to each terminal device is reduced while the bandwidth occupation of the server is reduced. The computer device and the computer readable storage medium of the invention realize the file publishing method based on the local area network autonomous discovery and election.

Claims (9)

1. The file publishing method based on the local area network autonomous discovery and election is characterized by comprising the following steps:
a plurality of terminal devices perform network broadcasting in a local area network and join a preset group;
the terminal devices in the preset group are divided into leader devices and non-leader devices through an election algorithm;
the leader device publishing a service access path into the preset group;
the non-leader device issuing a file download request to the leader device over the service access path;
the leader device downloads a preset file from a server according to the file downloading request, and sends a downloading completion notification to the non-leader device after the preset file is downloaded;
the non-leader device downloads the preset file from the leader device through the service access path.
2. The local area network autonomous discovery and election based file publishing method recited in claim 1, wherein:
and dividing the plurality of terminal devices into at least one leader device and the non-leader device through a Raft algorithm.
3. The local area network autonomous discovery and election based file distribution method of claim 1, wherein:
and the leader device downloads the preset file from the server side in a multithreading slicing mode.
4. The local area network autonomous discovery and election based file publishing method recited in claim 1, wherein:
and after the non-leader device sends a file downloading request to at least one leader device through the service access path, the leader device receives the file downloading request in the JSON format through an HTTP protocol and executes the file downloading request.
5. The local area network autonomous discovery and election based file publishing method recited in claim 1, wherein:
and when the non-leader device downloads the preset file from the leader device through the service access path, downloading the preset file from the leader device through an SMB protocol or an HTTP protocol.
6. The local area network autonomous discovery and election based file distribution method according to any one of the claims 1 to 5, characterized in that:
and a plurality of terminal devices perform network broadcasting in the local area network through a Jgroups tool and join the terminal devices into the preset group.
7. The local area network autonomous discovery and election based file publication method of claim 6, wherein:
the leader device publishes the service access path into the preset group through the Jgroups tool.
8. A computer device comprising a processor and a memory, wherein:
the memory stores a computer program which, when executed by the processor, implements the local area network autonomous discovery and election based file publication method according to any one of the preceding claims 1 to 7.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that:
the computer program when running implements the method for file distribution based on autonomous discovery and election over local area networks according to any one of the preceding claims 1 to 7.
CN202210520334.6A 2022-05-13 2022-05-13 File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium Pending CN115002098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210520334.6A CN115002098A (en) 2022-05-13 2022-05-13 File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210520334.6A CN115002098A (en) 2022-05-13 2022-05-13 File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115002098A true CN115002098A (en) 2022-09-02

Family

ID=83028136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210520334.6A Pending CN115002098A (en) 2022-05-13 2022-05-13 File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115002098A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116684406A (en) * 2023-07-31 2023-09-01 北京朝歌数码科技股份有限公司 Content downloading method of intranet equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190158440A1 (en) * 2017-11-17 2019-05-23 International Business Machines Corporation Receiving and sharing files in a group messaging environment
CN111835856A (en) * 2020-07-17 2020-10-27 北京百度网讯科技有限公司 File downloading method, device, equipment and storage medium
CN112527369A (en) * 2020-12-31 2021-03-19 神思电子技术股份有限公司 Resource updating method of intelligent terminal
CN113382065A (en) * 2021-06-08 2021-09-10 京东方科技集团股份有限公司 File downloading method, device, system, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190158440A1 (en) * 2017-11-17 2019-05-23 International Business Machines Corporation Receiving and sharing files in a group messaging environment
CN111835856A (en) * 2020-07-17 2020-10-27 北京百度网讯科技有限公司 File downloading method, device, equipment and storage medium
CN112527369A (en) * 2020-12-31 2021-03-19 神思电子技术股份有限公司 Resource updating method of intelligent terminal
CN113382065A (en) * 2021-06-08 2021-09-10 京东方科技集团股份有限公司 File downloading method, device, system, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116684406A (en) * 2023-07-31 2023-09-01 北京朝歌数码科技股份有限公司 Content downloading method of intranet equipment

Similar Documents

Publication Publication Date Title
CN108063769B (en) Method and device for realizing content service and content distribution network node
US20180309694A1 (en) Method for distributing available bandwidth of a network amongst ongoing traffic sessions run by devices of the network, corresponding device
CN109981751B (en) File transmission method and system, computer equipment and storage medium
CN105379295A (en) Streaming of segmented content
US20240106890A1 (en) Peer-to-peer network scheduling method and system
WO2022166593A1 (en) Pont-to-point network scheduling method and system
US20180205802A1 (en) Cache Aware Streaming
CN111541711B (en) Live broadcast data mixing method and device based on edge calculation
CN115002098A (en) File publishing method based on local area network autonomous discovery and election, computer device and computer readable storage medium
US12009982B2 (en) Network slice allocation method, terminal and storage medium
CN105592318A (en) System, device and method for realizing HLS channel replaying service
US20210281624A1 (en) Balance of initial frame and limitation of traffic
CN107682205B (en) Online message publishing method and device and electronic equipment
CN109286641B (en) File transmission method and device
US20090222890A1 (en) Method and apparatus for providing streaming service based on p2p and streaming service system using the same
CN110213330B (en) Pre-push system, method, device, electronic equipment and computer readable medium
CN112995783A (en) Advertisement insertion method, electronic device and storage medium
CN108337302B (en) Wireless network caching method, device, equipment and medium based on communication scheduling
CN109347967A (en) A kind of method and device obtaining audio, video data
CN109343880B (en) RN packet updating method and device and readable storage medium
KR20110109610A (en) Cloud computing network system and file distribution method of the same
CN112925946B (en) Service data storage method and device and electronic equipment
CN113055444A (en) File sharing method and related device thereof
CN115473806B (en) Resource download control method, device, electronic equipment and computer readable medium
US10270883B2 (en) Scheduling downloads

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