Resource downloading method and apparatus, and device and storage medium
Patent Information
- Application Number
- PCT/CN2026/084803
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-03-24
- Filing Date
- 2026-03-20
- Publication Date
- 2026-10-01
Smart Images

Figure CN2026084803_01102026_PF_FP_ABST
Abstract
Description
Resource download methods, devices, equipment and storage media
[0001] This application claims priority to Chinese Patent Application No. 202510355884.0, filed with the Chinese Patent Office on March 24, 2025, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of data processing technology, such as a resource download method, apparatus, device, and storage medium. Background Technology
[0003] With the continuous development of IoT technology, intelligent devices are being widely used in various scenarios. In shopping malls and supermarkets, IoT smart devices such as smart shopping carts typically require a sufficiently stable signal to ensure normal operation.
[0004] In the decentralized management scenario of related technologies, when smart devices have a large demand for downloading resources during operation, if they encounter unstable signals, they will request a large amount of download resource data from the backend server when the network recovers, which will cause network congestion and create a vicious cycle in the process of continuous retries.
[0005] Therefore, ensuring stable signals for smart devices during large resource downloads and avoiding download interruptions caused by network problems to ensure download efficiency has become an urgent issue to be addressed. Summary of the Invention
[0006] This application provides a resource download method, apparatus, device, and storage medium to ensure stable signals during the resource download process, avoid resource download interruptions, and improve resource download efficiency.
[0007] According to one aspect of this application, a resource download method is provided, applied to a resource download system, the resource download system including a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; the number of terminal devices under any AP device is at least two, including a master device and a slave device, the method being executed by the backend server, including:
[0008] In response to detecting at least one terminal device with a resource download requirement, historical device information uploaded by each terminal device in a historical period is obtained;
[0009] Based on the historical device information, determine the master and slave devices under each AP device, and generate a master device list corresponding to each AP device;
[0010] Download task information is generated, and the download task information and the master device list are sent to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles according to the master device list, and perform collaborative downloads between devices based on their own device roles and the download task information; the device roles are master devices or slave devices.
[0011] According to one aspect of this application, a resource download method is provided, applied to a resource download system, the resource download system including a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; the number of terminal devices under any AP device is at least two, including a master device and a slave device, the method being executed by the terminal devices, including:
[0012] Obtain the list of main devices and download task information issued by the backend server, and determine your own device role based on the list of main devices;
[0013] In response to determining its own device role as the main device, the device downloads resources from the background server according to the download task information.
[0014] After successfully downloading the resource, the backend server sends the downloaded resource information to the slave device, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the resource locally.
[0015] According to another aspect of this application, a resource downloading device is provided, applied to a resource downloading system, the resource downloading system including a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; the number of terminal devices under any AP device is at least two, including a master device and a slave device, the device being configured on the backend server, including:
[0016] The historical information acquisition module is configured to acquire historical device information uploaded by each terminal device in a historical period in response to detecting at least one terminal device that has a resource download requirement.
[0017] The master device list generation module is configured to determine the master and slave devices under each AP device based on the historical device information, and generate a master device list corresponding to each AP device.
[0018] The task information sending module is configured to generate download task information and send the download task information and the master device list to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles based on the master device list and perform inter-device collaborative downloads based on their own device roles and the download task information; the device roles are master devices or slave devices.
[0019] According to another aspect of this application, a resource download device is provided, applied to a resource download system, the resource download system including a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; the number of terminal devices under any AP device is at least two, including a master device and a slave device, and the device is configured on the terminal devices, including:
[0020] The device role determination module is configured to obtain the list of main devices and download task information issued by the backend server, and determine its own device role based on the list of main devices.
[0021] The resource download module is configured to download resources from the backend server in response to determining its own device role as the main device, based on the download task information.
[0022] The download information sending module is configured to send downloaded resource information to the slave device through the backend server after successfully downloading the downloaded resource, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the downloaded resource locally.
[0023] According to another aspect of this application, an electronic device is provided, comprising:
[0024] At least one processor; and
[0025] A memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the resource download method described in any embodiment of this application.
[0027] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the resource download method described in any embodiment of this application. Attached Figure Description
[0028] Figure 1A is a flowchart of a resource downloading method according to Embodiment 1 of this application;
[0029] Figure 1B is a schematic diagram of a resource download system according to Embodiment 1 of this application;
[0030] Figure 2 is a flowchart of a resource downloading method according to Embodiment 2 of this application;
[0031] Figure 3 is a flowchart of a resource downloading method according to Embodiment 3 of this application;
[0032] Figure 4 is a flowchart of a resource downloading method according to Embodiment 4 of this application;
[0033] Figure 5 is a schematic diagram of the interactive flow of a resource download method according to Embodiment 5 of this application;
[0034] Figure 6 is a schematic diagram of a resource download device according to Embodiment 6 of this application;
[0035] Figure 7 is a schematic diagram of a resource download device according to Embodiment 7 of this application;
[0036] Figure 8 is a schematic diagram of the structure of an electronic device that implements the resource download method of the present application. Detailed Implementation
[0037] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, for example, including, in addition to processes, methods, systems, products, or devices that include the series of steps or units shown in the embodiments of this application, other processes, methods, systems, products, and devices not listed in this series of steps or units, or other steps or units inherent to these processes, methods, systems, products, or devices.
[0038] Example 1
[0039] Figure 1A is a flowchart of a resource download method provided in Embodiment 1 of this application. This embodiment is applicable to the situation of collaborative download of large file resources between smart shopping devices in a shopping mall or supermarket shopping scenario. The method can be executed by a resource download device, which can be implemented in hardware and / or software and can be configured in a background server.
[0040] The method described in this application can be applied to a resource download system, as shown in Figure 1B, which illustrates the structure of such a system. This application can be used for scenarios involving resource downloads from terminal devices on different shopping platforms. For example, a shopping platform can access a backend server, and the number of shopping platforms accessing the backend server can be one or more, each belonging to a different supermarket / shopping mall scenario. The terminal devices in the shopping platform scenario can be smart terminal devices, such as smart shopping carts or self-service payment machines. The resource download system includes a backend server and terminal devices that communicate with the backend server via access point (AP) devices; there is at least one AP device; and the number of terminal devices under any given AP device is at least two, including a master device and a slave device.
[0041] The backend server can connect to each access point (AP) via routers and switches. Each AP has at least two terminal devices, and each AP has both a master device and a slave device. The master device is a terminal device used to interface with the backend server to obtain download resources. At any given download task time point, the master device's signal strength and other performance characteristics are superior to those of the slave devices. Each master device interfaces with at least one slave device. The master and slave devices are determined by the backend server based on the device information reported by the terminal devices under the same AP.
[0042] As shown in Figure 1A, this method can be executed by a backend server and includes:
[0043] S110. In response to detecting at least one terminal device with a resource download requirement, obtain historical device information uploaded by each terminal device in the historical period.
[0044] S120. Based on historical device information, determine the master and slave devices under each AP device, and generate a master device list corresponding to each AP device.
[0045] S130. Generate download task information and send the download task information and master device list to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles according to the master device list and perform collaborative downloads between devices based on their own device roles and download task information; the device role is master device or slave device.
[0046] For any terminal device assigned to any AP device, the terminal device periodically uploads its own device information to the backend server through the communication channel. The timing duration can be preset by relevant technical personnel; for example, the timing duration can be set to 1 minute.
[0047] In some embodiments, the communication channel between the terminal device and the backend server can be a broadband channel. In other embodiments, the communication channel can also be a narrowband channel. Narrowband channel communication has the advantages of low resource consumption, high efficiency, scalability, and ease of implementation. It is understood that data transmission between the terminal device and the backend server includes large data transmissions that occupy a significant amount of storage space and small data transmissions that occupy a relatively small amount of storage space. When the backend server and the terminal device transmit large data, such as large files like file blocks, broadband channel communication is typically used; while when the backend server and the terminal device transmit small data, such as parameters or lists, narrowband channel communication can be used to reduce resource consumption and improve transmission efficiency.
[0048] The backend server stores the device information uploaded by the terminal devices periodically, and when it detects that a terminal device has a resource download request, it retrieves the historical device information uploaded by all terminal devices in the historical time period.
[0049] Historical device information can include device signal strength and battery level. The backend server can select master and slave devices from among the terminal devices under the same AP device based on their signal strength and battery level. There must be at least one master and one slave device. The number of master devices is much smaller than the number of slave devices. Based on the determined master and slave devices, a master device list corresponding to the AP device is generated. This master device list may store at least one of the device identifiers of the master and slave devices. The device identifier is used to uniquely identify the terminal device.
[0050] Because different access points (APs) assign different terminal devices, the backend server can pre-group the historical device information of terminal devices under the same AP when determining the master device list, thereby obtaining the master and slave devices under the same AP. Since the master and slave devices determined for different APs are different, the master device lists corresponding to different APs will be different.
[0051] The backend server generates download task information, which may include the resource download address, resource expiration time, and resource size. If the file to be downloaded supports chunked downloading, the download task information will also include chunk information, chunk length, and chunk size. The resource to be downloaded may be, for example, a system or software upgrade package.
[0052] The backend server sends the download task information and the master device list to the corresponding terminal devices under the AP devices. Upon receiving the master device list, the terminal device determines its own role—whether it is a master or slave device—based on at least one of the master device identifier and slave device identifier recorded in the list. After determining its role, the terminal device completes the inter-device collaborative download according to the download task information.
[0053] For example, if the terminal device is the master device, it downloads the resources from the backend server. After the download is complete, the master device sends the resource information of the completed download to the slave device through the backend server. The slave device then retrieves the required download resources from the master device and performs the local download. If the terminal device is the slave device, it waits for the backend server to send the resource information for download. When it receives the resource information from the backend server, it retrieves the required download resources from the master device and performs the local download.
[0054] This application embodiment uses historical device information to determine the master and slave devices under each AP device, and generates a master device list corresponding to each AP device. The generated download task information and master device list are sent to the terminal devices under the corresponding AP devices. The terminal devices determine their own device role based on the master device list and perform collaborative downloading based on their own device role and download task information. This achieves unified determination and distribution of master and slave device roles under different AP devices, avoiding network congestion caused by frequent broadcast communication during the election process between terminal devices to determine device roles, and improving the stability of the resource download process. Collaborative downloading between master and slave devices allows a slave device to obtain the download resource from the master device and download it locally when it receives information about downloaded resources. This improves resource download efficiency and solves the network congestion caused by a large number of background server resource download requests in situations of decentralized management and unstable signals. It ensures signal stability during the resource download process, thereby effectively avoiding resource download interruptions.
[0055] Example 2
[0056] Figure 2 is a flowchart of a resource download method provided in Embodiment 2 of this application. This embodiment is an adjustment based on the above embodiments.
[0057] In some embodiments, historical device information includes AP device identification code, terminal device signal strength, terminal device battery level, and terminal device roaming records. Correspondingly, the step "determine the master and slave devices under each AP device based on historical device information" can be: "Grouping historical device information according to AP device identification code to obtain historical device information for terminal devices under the same AP device; filtering the historical device information of terminal devices under the same AP device based on the current time and the upload time of the historical device information to determine first device information; and filtering the historical device information of terminal devices under the same AP device based on a preset time and the upload time of the historical device information to determine second device information; determining the master and slave devices under the same AP device based on the terminal device signal strength and battery level in the first device information, and the terminal device roaming records in the second device information." This improves the determination of master and slave roles among terminal devices under the same AP.
[0058] For parts not described in detail in the embodiments of this application, please refer to the descriptions in other embodiments. As shown in Figure 2, the method includes the following steps:
[0059] S210. In response to detecting at least one terminal device with a resource download requirement, obtain historical device information uploaded by each terminal device in a historical period; the historical device information includes AP device identification code, terminal device signal strength, terminal device battery level, and terminal device roaming records.
[0060] S220. Based on the AP device identification code, the historical device information is grouped to obtain the historical device information of terminal devices under the same AP device.
[0061] S230A: Based on the current time and the upload time of historical device information, filter the historical device information of terminal devices under the same AP device to determine the first device information.
[0062] S230B: Based on the preset time and the upload time of historical device information, filter the historical device information of terminal devices under the same AP device to determine the second device information.
[0063] S240. Based on the terminal device signal strength and terminal device battery level in the first device information, and the terminal device roaming records in the second device information, determine the master device and slave device under the same AP device.
[0064] S250: Generate a list of master devices corresponding to each AP device.
[0065] S260. Generate download task information and send the download task information and master device list to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles according to the master device list and perform collaborative downloads between devices based on their own device roles and download task information; the device role is master device or slave device.
[0066] The AP device identifier is used to uniquely identify an AP device. For example, the AP device identifier can be the Media Access Control (MAC) address of the AP device. Since master and slave devices are selected relative to an AP device, the terminal device reports the AP device identifier of its own AP device for AP device grouping.
[0067] Terminal device battery level is used to characterize the terminal device's operating time. A higher battery level indicates a longer duration of service as a master device for slave devices; a lower battery level indicates a shorter duration of service as a master device for slave devices. Terminal device signal strength reflects the signal strength of the area where the terminal device is located; a stronger signal strength indicates higher service reliability, and a weaker signal strength indicates lower service reliability. Terminal device roaming records are generated when the terminal device roams, recording information such as area-related information and signal strength from the current signal area to other signal areas.
[0068] During a reporting cycle in which a terminal device reports its own device information to the backend server, there may or may not be device roaming. When device roaming occurs, a roaming record is generated; when device roaming does not occur, no roaming record is generated.
[0069] Since the master / slave role is determined relative to an AP device, historical device information can be grouped according to the AP device identifier to obtain the historical device information of terminal devices under the same AP device.
[0070] For example, historical device information is divided according to the same AP device identifier code to obtain at least one device information group. Each device information group corresponds to a different AP device identifier code; the terminal devices to which the historical device information under the same device information group belongs belong to the same AP device.
[0071] To avoid terminal device roaming during the selection of master and slave devices, for example, if a terminal device roams from AP device 1 to AP device 2, heartbeat detection is performed on the terminal devices. Terminal devices that have not reported device information for more than two heartbeat detection cycles need to have their device information deleted.
[0072] For the same AP device, based on the current time and the upload time of historical device information, the device information with the closest current time and upload time is selected as the first device information from the historical device information of each terminal device. In other words, the most recently uploaded historical device information of the terminal device at the current time point is selected as the first device information.
[0073] For the same AP device, based on a preset time and the upload time of historical device information, devices that meet the preset time range (e.g., within a preset T-hour period) are selected as the second device information from the historical information of each terminal device. The first device information is used to determine the terminal device's battery level and signal strength required for selecting the master and slave devices, and the second device information is used to determine the terminal device's roaming records required for selection. Based on the terminal device roaming records in the second device information, the number of roaming trips of the terminal device can be determined. It can be understood that the fewer the number of roaming trips, the lower the frequency or probability of the terminal device moving in that area, and the less likely transmission interruption will occur; the more the number of roaming trips, the higher the frequency or probability of the terminal device moving in that area, and the more likely transmission interruption will occur. Based on the terminal device's signal strength, battery level, and roaming records, the master and slave devices under the AP device are determined. For example, a terminal device with fewer roaming trips, higher battery level, and stronger signal strength can be selected as the master device.
[0074] In this embodiment, in the process of selecting master and slave devices, in addition to the factors mentioned above such as device power, signal strength and roaming times, the hardware performance of the device may also be included, such as computing power, memory or storage capacity and energy efficiency.
[0075] This embodiment pre-groups the historical device information of terminal devices under the same AP based on the AP device identification code, and then selects master and slave devices for the same AP device after grouping. When selecting master and slave devices, multiple factors such as terminal device signal strength, terminal device battery level and terminal device roaming count are comprehensively considered, which improves the accuracy of selecting master and slave device roles, thereby improving the processing efficiency of subsequent master and slave devices co-downloading resources.
[0076] To improve the accuracy of selecting master and slave devices under the same AP device, this embodiment also provides a precise master and slave device selection method, such as selecting by calculating device weight values. In an optional embodiment, the master and slave devices under the same AP device are determined based on the terminal device signal strength and terminal device battery level in the first device information, and the terminal device roaming records in the second device information, including:
[0077] Step a11: Determine the signal weight value based on the terminal device signal strength and preset signal weight parameters in the first device information.
[0078] Step a12: Determine the power weight value based on the terminal device power level in the first device information and the preset power weight parameters.
[0079] Step a13: Determine the roaming weight value based on the terminal device roaming record and preset roaming weight parameters in the second device information.
[0080] Step a2: Determine the device weight value of the terminal device under the same AP device based on the signal weight value, power weight value and roaming weight value.
[0081] Step a3: Determine the master and slave devices under the same AP device based on the device weight value of the terminal device.
[0082] Signal weight parameters, battery weight parameters, and roaming weight parameters can be preset by relevant technical personnel based on practical experience or experiments. Optionally, considering the direct impact of roaming frequency on the transmission process, the roaming weight parameter can be set greater than a preset weight parameter threshold; comprehensively considering the impact of battery power and signal strength on resource transmission and download respectively, the battery weight parameter is greater than the signal weight parameter. The sum of the weight parameters of roaming weight parameters, signal weight parameters, and battery weight parameters must satisfy the target weight parameter setting condition. Specifically, the target weight parameter setting condition is that the sum of the weight parameters equals 1.
[0083] For example, the device weight value for the next terminal device i under the same AP device. The calculation method can be as follows:
[0084] ;
[0085] Where α represents the preset signal weight parameter; β represents the preset battery weight parameter; and γ represents the preset roaming weight parameter. The values of α, β, and γ range from [0, 1]. k represents the roaming duration attenuation parameter, which can be preset by relevant technical personnel, and the value of k is greater than 0. This represents the terminal device's battery level, with a value range of [0, 100]. Indicates the signal strength of the terminal device; and These represent the maximum and minimum values of the Wi-Fi signal measurement, respectively. This represents the time elapsed since the roaming event of the j-th roaming record for the i-th terminal device occurred.
[0086] For example, the signal weight value of the aforementioned terminal device i Power weight value roaming weight value and device weight value The calculation methods for splitting are as follows:
[0087] ;
[0088] ;
[0089] ;
[0090] ;
[0091] For example, for each terminal device under the same AP device, the terminal device with the largest device weight value is designated as the master device of the AP device, and the other devices are slave devices; or, if there are multiple master devices, the top f terminal devices with the highest device weight values can be designated as the master devices of the AP device, and the other devices are slave devices; f is an integer greater than 1.
[0092] By providing a method for calculating the device weight value of a terminal device, the accuracy of selecting master and slave devices under the same AP is improved, thereby improving the processing efficiency of subsequent master and slave devices co-downloading resources.
[0093] Example 3
[0094] Figure 3 is a flowchart of a resource download method provided in Embodiment 3 of this application. This embodiment is applicable to the collaborative download of large file resources between smart shopping devices in a shopping mall or supermarket scenario. This method can be executed by a resource download device, which can be implemented in hardware and / or software and can be configured in a terminal device. As shown in Figure 3, this method can be executed by the terminal device, including:
[0095] S310: Obtain the list of main devices and download task information issued by the backend server, and determine its own device role based on the list of main devices.
[0096] S320: In response to determining its own device role as the main device, it downloads the download resources from the background server based on the download task information.
[0097] S330. After successfully downloading the resource, the backend server sends the downloaded resource information to the slave device, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the resource locally.
[0098] The terminal device obtains the master device list and download task information from the backend server. Based on the device identifier information recorded in the master device list, it determines whether its own device is the master device. If it is determined to be the master device, it can download resources from the backend server according to the download task information. Once the master device completes the resource download, it sends a message to the backend server indicating that the downloaded resources have been successfully downloaded. Upon receiving this message, the backend server confirms that the master device has completed the download. The backend server then sends the downloaded resource information to the slave device, which retrieves the download resources from the master device based on this information and downloads them locally.
[0099] The backend server can send downloaded resources to the master device via the Message Queuing Telemetry Transport (MQTT) protocol, and the master device can send information about downloaded resources to the backend server via the MQTT protocol.
[0100] In the aforementioned terminal device resource download process, the master device requests the download resource from the backend server to complete the download first. After the resource download is completed, the slave device retrieves the download resource from the master device instead of from the backend server. This significantly reduces the resource load on the backend server, avoids communication congestion, and improves the resource download efficiency of the terminal device.
[0101] In some embodiments, a large number of download resources can be downloaded in chunks. When download resources can be downloaded in chunks, the master device can continuously download the chunks and synchronize the downloaded chunks to the slave device for download. In this way, the slave device does not need to wait for the master device to download all the resources before it can download them, thus reducing the resource download time and improving efficiency.
[0102] In an optional embodiment, download resources are downloaded from a backend server according to download task information. After successful download, the backend server sends downloaded resource information to the slave device, enabling the slave device to retrieve the downloaded resources from the master device based on the downloaded resource information and perform local download of the resources, including:
[0103] Step b1: Based on the download task information, determine whether the download resource supports segmented download.
[0104] If the download task information includes resource chunk information of the downloaded resource, such as the resource chunk length, chunk start position, chunk end position, and chunk size, then it can be determined that the downloaded resource supports chunked downloading; if the download task information does not include resource chunk information of the downloaded resource, then it can be determined that the downloaded resource does not support chunked downloading.
[0105] Step b2: In response to the download resource supporting chunked download, obtain the chunked resources from the backend server according to the chunked information in the download task information, and download the chunked resources.
[0106] Chunk information can be information about the downloaded resources after being chunked. For example, if the master device determines that the downloaded resources support chunked download, it obtains the chunked resources from the backend server and downloads the chunked resources locally.
[0107] Step b31: After successfully downloading the segmented resources, the backend server sends the downloaded segmented information to the slave device, so that the slave device can obtain the segmented resources from the master device based on the downloaded segmented information and download the segmented resources locally.
[0108] After successfully downloading the resource chunks, the master device can send the downloaded chunk information to the backend server via the MQTT protocol. Upon receiving the downloaded chunk information, the backend server can send it to the slave device in real-time or periodically. After receiving the downloaded chunk information, the slave device retrieves the resource chunks from the master device and downloads them locally.
[0109] Step b32: Based on the segment information in the download task information, obtain the next segment resource from the background server and download the segment resource until all segments that make up the download resource have been downloaded.
[0110] When the main device completes the download of a segment of resources, it can obtain the next segment of resources from the background server until all segments of resources that make up the download resource have been downloaded.
[0111] While the master device is downloading resource chunks one by one, the slave device is also downloading resource chunks. The master and slave devices can download resources synchronously. The difference is that the resource chunks downloaded by the slave device are obtained from the master device as already downloaded resource chunks.
[0112] By using a block-based resource download method between master and slave devices, the master device can synchronize the downloaded blocks to the slave device without waiting for all blocks to be downloaded. This efficiently utilizes network resources, reduces download time, and improves download efficiency.
[0113] Example 4
[0114] Figure 4 is a flowchart of a resource download method provided in Embodiment 4 of this application. This embodiment is an adjustment based on the above embodiments.
[0115] In some embodiments, after the step "obtain the master device list and download task information sent by the backend server, and determine the device role based on the master device list", the following step is added: "In response to determining that the device role is a slave device, wait for the backend server to send the downloaded resource information; in response to receiving the downloaded resource information sent by the backend server, obtain the download resources from the master device based on the downloaded resource information, and download the download resources locally.", to improve the resource download method for slave devices.
[0116] For parts not described in detail in the embodiments of this application, please refer to the descriptions in other embodiments. As shown in Figure 4, the method includes the following steps:
[0117] S410: Obtain the list of master devices and download task information issued by the backend server, and determine the role of the device itself based on the list of master devices; in response to determining that the device itself is a master device, execute S420-S430; in response to determining that the device itself is a slave device, execute S440-S450.
[0118] S420. Based on the download task information, download the resources from the backend server.
[0119] S430. After successfully downloading the resource, the backend server sends the downloaded resource information to the slave device, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the resource locally.
[0120] S440, Waiting for the backend server to send the downloaded resource information.
[0121] S450, upon receiving the downloaded resource information from the backend server, obtains the download resources from the main device based on the downloaded resource information and performs local download of the download resources.
[0122] For example, if a terminal device determines that it is a slave device based on the device identifier in the obtained master device list, it waits for the backend server to send the downloaded resource information. When the slave device receives the downloaded resource information from the backend server, it obtains the downloaded resources from the master device based on the downloaded resource information and downloads the resources locally.
[0123] In the aforementioned terminal device resource download process, the master device requests the download resource from the backend server to complete the download first. After the resource download is completed, the slave device retrieves the download resource from the master device instead of from the backend server. This significantly reduces the resource load on the backend server, avoids communication congestion, and improves the resource download efficiency of the terminal device.
[0124] If the master device downloads the resource in chunks, the backend server sends the downloaded chunk information to the slave device. In an optional embodiment, after waiting for the backend server to send the downloaded resource information, the method further includes:
[0125] Step c1: In response to receiving the downloaded chunk information from the backend server, obtain the chunk resources from the master device and download the chunk resources locally.
[0126] Step c2: Based on the download task information, determine whether the download of all block resources has been completed.
[0127] The download task information records information such as the number of blocks of all resources, the block size of the resources, and the block length.
[0128] For example, each time the device finishes downloading a segmented resource, it can determine whether all segmented resources have been downloaded based on the segmented information recorded in the download task information.
[0129] Step c3: In response to the completion of downloading all block resources, merge the downloaded block resources to obtain merged resources, and verify the integrity of the merged resources.
[0130] If the device determines that the download of all resource chunks has been completed, then all downloaded resource chunks are merged to obtain merged resources. The merged resources undergo integrity verification to ensure their accuracy. For example, the download task information records the target digest value of the downloaded resources, which can be pre-generated using a digest generation algorithm. For instance, the digest generation algorithm can use Message Digest Algorithm 5 (MD5). The device generates a digest value for the merged resources based on the same digest generation algorithm to obtain a reference digest value; the reference digest value is then compared with the target digest value. If the reference digest value matches the target digest value, the integrity verification passes; otherwise, the integrity verification fails.
[0131] If the device has not finished downloading all the resource blocks, it will wait for the next resource block download cycle to complete before making a judgment, until it is determined that all resource blocks have been downloaded.
[0132] Step c4: In response to the successful integrity verification, send a download task completion message to the backend server.
[0133] If the integrity verification passes, a download task completion message can be sent to the backend server; if the integrity verification fails, a download task failure message can be sent to the backend server to request the backend server to verify the accuracy of the segmented resources and to attempt to download the resources again. During the second download attempt, the slave device can directly obtain the download resources from the backend server.
[0134] By using a block-based resource download method between master and slave devices, the master device can synchronize the downloaded blocks to the slave device without waiting for all blocks to be downloaded. This efficiently utilizes network resources, reduces download time, and improves download efficiency.
[0135] To avoid data congestion caused by frequent communication between the backend server and the terminal device, the slave device can directly obtain download resources from the master device based on the download task information, without waiting for the backend server to send information on the downloaded resources.
[0136] In an optional embodiment, after determining that its own device role is a slave device, the method further includes: determining the resource information to be downloaded based on the download task information; and sending the resource information to be downloaded to the master device so that the master device can provide feedback on the resource to be downloaded based on the resource information to be downloaded.
[0137] The slave device can determine which resource chunks need to be downloaded based on the download task information, and determine its own resource information to be downloaded based on the chunk information recorded in the download task information. The slave device sends the resource information to be downloaded directly to the master device. The master device determines the resource to be downloaded based on the resource information and checks whether it has completed the download of the resource. If it has completed the download of the resource, it sends the resource information back to the slave device; if it has not completed the download of the resource, it sends a message to the slave device indicating that it is waiting for the resource to be downloaded. After receiving the message, the slave device can request the resource to be downloaded from the master device again after a preset time period. The resource to be downloaded can be a complete resource or a resource chunk.
[0138] In the above embodiments, the slave device obtains the resources to be downloaded directly from the master device based on the download task information, which reduces the number of communication interactions with the backend server and avoids communication congestion. In addition, by directly obtaining the resources to be downloaded from the master device without waiting for the backend server to send them, the resource download efficiency of the slave device is improved.
[0139] During resource downloading, devices may roam, for example, from AP device A to AP device B. Therefore, this embodiment also provides a solution for resource downloading when a slave device roams. In an optional embodiment, the resource downloading process when a slave device roams is as follows:
[0140] Step d1: In response to detecting that its own device has roamed, determine the roaming AP devices after its own device has roamed.
[0141] When a device detects that it has roamed during the resource download process, the roaming AP device is identified. For example, if the device roams from AP device 1 to AP device 2, then the roaming AP device is AP device 2.
[0142] Step d2: Obtain the list of master devices for roaming AP devices from the backend server, and determine the master device under the roaming AP device based on the master device list.
[0143] Obtain the list of master devices corresponding to the roaming AP devices from the backend server, and determine the master device under the roaming AP device based on the device identification information in the master device list.
[0144] Step d3: Obtain the current resource download information of your own device, and determine the required resource information based on the download task information and the current resource download information.
[0145] The current resource download information can be resources that your device has already downloaded, such as partially downloaded chunks of resources.
[0146] Since the download task information records all the resource information that needs to be downloaded, the slave device can determine the resource information of the resources that it needs to download but has not yet downloaded based on the download task information and the current resource download information.
[0147] Step d4: Send the resource request information to the master device under the roaming AP device so that the master device under the roaming AP device can respond with the resource request information.
[0148] The slave device sends resource request information to the master device under the roaming AP device, and the master device under the roaming AP device sends the resource request information to the slave device.
[0149] The above embodiments solve the problem of resource download interruption during terminal device roaming by re-obtaining the list of master devices under the roaming AP device when the device detects that it is roaming, determining the resource information that it needs to download, and re-obtaining the required resources from the master devices under the roaming AP device.
[0150] To improve resource download efficiency and avoid resource download interruptions caused by sudden failure of a single master device, the number of master devices selected for the backend server can be multiple.
[0151] In some embodiments, there are multiple master devices; in response to the download resource supporting chunked download, each master device obtains different chunked resources from the background server for download according to the chunked information in the download task information.
[0152] When each master device downloads segmented resources, the segmented resources downloaded at the same download time point are different. When any master device completes the segmented resource download, the slave device can directly obtain the segmented resources from that master device without waiting for other master devices to complete the segmented resource download.
[0153] When a slave device actively requests a block of resources from a master device, if it fails to obtain the desired block of resources from a master device, it iterates through other master devices and requests the desired block of resources from them.
[0154] When all master devices are unable to provide resource downloads, a waiting phase begins. If the waiting time is reached, the master devices are requested to obtain resources again. If the download resources are not obtained after a preset number of attempts (N), the download resources are obtained directly from the backend server.
[0155] The above embodiments improve the resource utilization of the network environment. When a network interruption or signal instability occurs, resource transmission and download can continue from the breakpoint, thereby improving the reliability and efficiency of data transmission and download.
[0156] Example 5
[0157] Figure 5 is a schematic diagram of the interaction flow of a resource download method provided in Embodiment 5 of this application. Based on the above embodiments, this embodiment provides several exemplary examples. This embodiment takes an AP device including one master device and at least one slave device as an example, and the resources can be downloaded in blocks, to illustrate the first exemplary embodiment.
[0158] As shown in Figure 5, the method includes the following steps:
[0159] S1. In response to detecting at least one terminal device with a resource download request, the backend server obtains historical device information uploaded by each terminal device in the historical period.
[0160] S2. Based on historical device information, the backend server determines the master and slave devices under each AP device and generates a master device list corresponding to each AP device.
[0161] S3. The background server generates download task information and sends the download task information and master device list to the master and slave devices under the corresponding AP devices.
[0162] S4. The master device obtains the segmented resources from the background server based on the segmented information in the download task information, downloads the segmented resources, and sends the downloaded segmented information to the background server after the download is completed.
[0163] S5. Upon receiving the downloaded segment information from the backend server, the slave device obtains the segment resources from the master device based on the downloaded segment information (or based on the download task information) and downloads the segment resources locally.
[0164] S6. The slave device and master device perform integrity verification of the downloaded resource blocks. In response to the successful integrity verification, they report the download completion information to the backend server.
[0165] This embodiment uses an AP device comprising multiple master devices and at least one slave device as an example, and illustrates the second exemplary embodiment where resources can be downloaded in chunks. Assume the master devices include master device A, master device B, and master device C. Downloaded resources include chunk resources a, chunk resources b, and chunk resources c. When download task information is received from the backend server, master devices A, B, and C download different chunk resources. For example, at the same time, master device A downloads chunk resource a, master device B downloads chunk resource b, and master device C downloads chunk resource c. After each of the three master devices completes the download of its chunk resources for the current time period, it reports the downloaded chunk resource information to the backend server and simultaneously acquires other undownloaded chunk resources to continue downloading until all chunk resources are downloaded. Slave devices can actively acquire chunk resources from master devices A, B, and C based on the download task information, or they can acquire them from the master devices after receiving downloaded chunk information from the backend server. The downloaded chunk information includes the identifier of the master device that has completed downloading that chunk. When a device actively requests a block of resources from a master device, it can sequentially traverse the resource request process for master device A, master device B, and master device C until all the blocks of resources have been downloaded.
[0166] Example 6
[0167] Figure 6 is a schematic diagram of a resource download device provided in Embodiment 6 of this application. The resource download device provided in this embodiment is applicable to collaborative downloading of large file resources between smart shopping devices in a shopping mall or supermarket scenario. This resource download device can be implemented in hardware and / or software and can be configured on a backend server. As shown in Figure 6, the device includes: a historical information acquisition module 601, a main device list generation module 602, and a task information sending module 603.
[0168] The historical information acquisition module 601 is configured to acquire historical device information uploaded by each of the terminal devices in a historical period in response to detecting at least one terminal device that has a resource download requirement.
[0169] The master device list generation module 602 is configured to determine the master and slave devices under each AP device based on the historical device information, and generate a master device list corresponding to each AP device.
[0170] The task information sending module 603 is configured to generate download task information and send the download task information and the master device list to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles according to the master device list and perform inter-device collaborative downloads based on their own device roles and the download task information; the device roles are master devices or slave devices.
[0171] This application embodiment uses historical device information to determine the master and slave devices under each AP device, and generates a master device list corresponding to each AP device. The generated download task information and master device list are sent to the terminal devices under the corresponding AP devices. The terminal devices determine their own device role based on the master device list and perform collaborative downloading based on their own device role and download task information. This achieves unified determination and distribution of master and slave device roles under different AP devices, avoiding network congestion caused by frequent broadcast communication during the election process between terminal devices, and improving the stability of the resource download process. Collaborative downloading between master and slave devices allows the slave device to send the downloaded resources to the master device as soon as it receives the downloaded resource information, improving resource download efficiency and solving the network congestion caused by a large number of background server resource download requests in situations of decentralized management and unstable signals. This ensures signal stability during the resource download process and effectively avoids resource download interruptions.
[0172] Optionally, the historical device information includes the AP device identification code, terminal device signal strength, terminal device battery level, and terminal device roaming records; correspondingly, the master device list generation module 602 includes:
[0173] The information grouping unit is configured to group historical device information according to the AP device identification code to obtain historical device information of terminal devices under the same AP device;
[0174] The first information filtering unit is configured to filter historical device information of terminal devices under the same AP device based on the current time and the upload time of historical device information to determine the first device information; and...
[0175] The second information filtering unit is configured to filter the historical device information of terminal devices under the same AP device based on the preset time and the upload time of historical device information, and determine the second device information.
[0176] The master-slave device determination unit is configured to determine the master and slave devices under the same AP device based on the terminal device signal strength and terminal device battery level in the first device information and the terminal device roaming records in the second device information.
[0177] Optionally, the master / slave device determination unit is set as follows:
[0178] Based on the terminal device signal strength and preset signal weight parameters in the first device information, the signal weight value is determined; and,
[0179] Based on the terminal device battery level in the first device information and the preset battery weight parameters, a battery weight value is determined; and,
[0180] Based on the terminal device roaming records and preset roaming weight parameters of the second device information, the roaming weight value is determined;
[0181] Based on the signal weight value, the power weight value, and the roaming weight value, determine the device weight value of the terminal device under the same AP device;
[0182] Based on the device weight value of the terminal device, determine the master and slave devices under the same AP device.
[0183] Optionally, the roaming weight parameter is greater than a preset weight parameter threshold; the battery weight parameter is greater than the signal weight parameter; and the sum of the weight parameters of the roaming weight parameter, the signal weight parameter, and the battery weight parameter satisfies the target weight parameter setting condition.
[0184] The resource downloading device provided in this application embodiment can execute the resource downloading method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.
[0185] Example 7
[0186] Figure 7 is a schematic diagram of a resource download device provided in Embodiment 7 of this application. The resource download device provided in this embodiment is applicable to collaborative downloading of large file resources between smart shopping devices in a shopping mall or supermarket scenario. This resource download device can be implemented in hardware and / or software and can be configured on a terminal device. As shown in Figure 7, the device includes: a device role determination module 701, a resource download module 702, and a download information sending module 703.
[0187] The device role determination module 701 is configured to obtain the list of main devices and download task information issued by the backend server, and determine its own device role based on the list of main devices.
[0188] The resource download module 702 is configured to download resources from the background server in response to determining its own device role as the main device, based on the download task information.
[0189] The download information sending module 703 is configured to send downloaded resource information to the slave device through the background server after successfully downloading the downloaded resource, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the downloaded resource locally.
[0190] Optionally, resource download module 702 is set to:
[0191] Based on the download task information, determine whether the download resource supports segmented download;
[0192] In response to the fact that the download resource supports segmented download, the system obtains the segmented resources from the background server according to the segmented information in the download task information, and downloads the segmented resources.
[0193] Correspondingly, the download information sending module 703 is configured as follows:
[0194] After successfully downloading the resource chunk, the backend server sends the downloaded chunk information to the slave device, so that the slave device can obtain the resource chunk from the master device based on the downloaded chunk information and download the resource chunk locally; and,
[0195] Based on the block information in the download task information, the next block of resources is obtained from the background server and the block of resources is downloaded until all the blocks of resources constituting the download resource have been downloaded.
[0196] Optionally, the device further includes:
[0197] The resource waiting module is configured to, after obtaining the master device list and download task information issued by the backend server and determining its own device role based on the master device list, determine its own device role as a slave device and wait for the backend server to issue the downloaded resource information;
[0198] The resource acquisition module is configured to respond to the received downloaded resource information from the backend server, acquire the download resources from the main device based on the downloaded resource information, and download the download resources locally.
[0199] Optionally, the device further includes:
[0200] The chunk resource acquisition module is configured to, after waiting for the background server to send the downloaded resource information, respond to receiving the downloaded chunk information sent by the background server, obtain the chunk resources from the main device, and download the chunk resources locally;
[0201] The resource download judgment module is configured to determine whether the download of all block resources has been completed based on the download task information.
[0202] The resource merging module is configured to merge the downloaded resource blocks in response to the completion of downloading all resource blocks, obtain merged resources, and perform integrity verification on the merged resources.
[0203] The information sending module is configured to send download task completion information to the backend server in response to successful integrity verification.
[0204] Optionally, the device further includes:
[0205] The module for determining information to be downloaded is configured to determine the resource information to be downloaded based on the download task information after determining that its own device role is a slave device;
[0206] The download information sending module is configured to send the download resource information to the master device, so that the master device can provide feedback on the download resource based on the download resource information.
[0207] Optionally, the device further includes:
[0208] The roaming AP determination module is configured to determine the roaming AP devices after detecting that its own device has roamed.
[0209] The roaming master device determination module is configured to obtain the master device list of the roaming AP devices from the backend server, and determine the master device under the roaming AP devices based on the master device list;
[0210] The resource demand information determination module is configured to obtain the current resource download information of its own device, and determine the resource demand information based on the download task information and the current resource download information;
[0211] The resource demand information sending module is configured to send the resource demand information to the master device under the roaming AP device, so that the master device under the roaming AP device can respond with the resource demand based on the resource demand information.
[0212] Optionally, there may be multiple master devices; in response to the fact that the download resource supports segmented download, each master device obtains different segmented resources from the background server for download according to the segmented information in the download task information.
[0213] The resource downloading device provided in this application embodiment can execute the resource downloading method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.
[0214] Example 8
[0215] Figure 8 shows a schematic diagram of the structure of an electronic device 80 that can be used to implement embodiments of this application. The electronic device can represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples.
[0216] As shown in Figure 8, the electronic device 80 includes at least one processor 81 and a memory, such as a read-only memory (ROM) 82 or a random access memory (RAM) 83, communicatively connected to the at least one processor 81. The memory stores computer programs executable by the at least one processor. The processor 81 can perform various appropriate actions and processes based on the computer program stored in the ROM 82 or loaded from storage unit 88 into the RAM 83. The RAM 83 can also store various programs and data required for the operation of the electronic device 80. The processor 81, ROM 82, and RAM 83 are interconnected via a bus 84. An input / output (I / O) interface 85 is also connected to the bus 84.
[0217] Multiple components in electronic device 80 are connected to I / O interface 85, including: input unit 86, such as keyboard, mouse, etc.; output unit 87, such as various types of monitors, speakers, etc.; storage unit 88, such as disk, optical disk, etc.; and communication unit 89, such as network card, modem, wireless transceiver, etc. Communication unit 89 allows electronic device 80 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0218] Processor 81 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 81 include a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various special-purpose Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, Digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 81 performs the various methods and processes described above, such as resource download methods.
[0219] In some embodiments, the resource download method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 88. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 80 via ROM 82 and / or communication unit 89. When the computer program is loaded into RAM 83 and executed by processor 81, one or more steps of the resource download method described above may be performed. Alternatively, in other embodiments, processor 81 may be configured to perform the resource download method by any other suitable means (e.g., by means of firmware).
[0220] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard parts (ASSPs), system-on-chips (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0221] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0222] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. Examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disc-read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0223] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0224] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0225] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0226] It should be understood that the various forms of the process shown above can be used to rearrange, add, or delete steps. For example, the multiple steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
Claims
1. A resource download method, applied to a resource download system, the resource download system comprising a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; The number of terminal devices under any AP device is at least two, including a master device and a slave device. The method is executed by the backend server and includes: In response to detecting at least one terminal device with a resource download requirement, historical device information uploaded by each terminal device in a historical period is obtained; Based on the historical device information, determine the master and slave devices under each AP device, and generate a master device list corresponding to each AP device; Download task information is generated, and the download task information and the master device list are sent to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles according to the master device list, and perform collaborative downloads between devices based on their own device roles and the download task information; the device roles are master devices or slave devices.
2. The method according to claim 1, wherein, The historical device information includes AP device identification code, terminal device signal strength, terminal device battery level, and terminal device roaming records; The step of determining the master and slave devices under each AP device based on the historical device information includes: Based on the AP device identification code, the historical device information is grouped to obtain the historical device information of terminal devices under the same AP device; Based on the current time and the upload time of historical device information, the historical device information of terminal devices under the same AP device is filtered to determine the first device information; and... Based on the preset time and the upload time of historical device information, the historical device information of terminal devices under the same AP device is filtered to determine the second device information; Based on the terminal device signal strength and terminal device battery level in the first device information, and the terminal device roaming records in the second device information, the master and slave devices under the same AP device are determined.
3. The method of claim 2, wherein, The step of determining the master and slave devices under the same AP device based on the terminal device signal strength and battery level in the first device information, and the terminal device roaming records in the second device information, includes: Based on the terminal device signal strength and preset signal weight parameters in the first device information, the signal weight value is determined; and, Based on the terminal device battery level in the first device information and the preset battery weight parameters, a battery weight value is determined; and, Based on the terminal device roaming records and preset roaming weight parameters of the second device information, the roaming weight value is determined; Based on the signal weight value, the power weight value, and the roaming weight value, determine the device weight value of the terminal device under the same AP device; Based on the device weight value of the terminal device, determine the master and slave devices under the same AP device.
4. The method of claim 3, wherein, The roaming weight parameter is greater than a preset weight parameter threshold; the battery weight parameter is greater than the signal weight parameter; the sum of the weight parameters of the roaming weight parameter, the signal weight parameter, and the battery weight parameter satisfies the target weight parameter setting condition.
5. A resource download method, applied to a resource download system, the resource download system including a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; the number of terminal devices under any AP device is at least two, including a master device and a slave device, the method being executed by the terminal devices, including: Obtain the list of main devices and download task information issued by the backend server, and determine your own device role based on the list of main devices; In response to determining its own device role as the main device, the device downloads resources from the background server according to the download task information. After successfully downloading the resource, the backend server sends the downloaded resource information to the slave device, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the resource locally.
6. The method of claim 5, wherein, The step of downloading resources from the backend server according to the download task information includes: Based on the download task information, determine whether the download resource supports segmented download; In response to the fact that the download resource supports chunked downloading, the chunked resource is downloaded to the background server according to the chunked information in the download task information; After successfully downloading the resource, the backend server sends downloaded resource information to the slave device so that the slave device can retrieve the downloaded resource from the master device based on the downloaded resource information, including: After successfully downloading the resource chunk, the backend server sends the downloaded chunk information to the slave device, so that the slave device can obtain the resource chunk from the master device based on the downloaded chunk information and download the resource chunk locally; and, Based on the block information in the download task information, the next block of resources is obtained from the background server and the block of resources is downloaded until all the blocks of resources constituting the download resource have been downloaded.
7. The method according to claim 5, after obtaining the main device list and download task information issued by the backend server, and determining its own device role based on the main device list, the method further includes: Upon determining that its own device role is a slave device, it waits for the background server to send the downloaded resource information; In response to receiving the downloaded resource information from the backend server, the device obtains the download resources from the main device based on the downloaded resource information and performs local download of the download resources.
8. The method according to claim 7, after waiting for the background server to send the downloaded resource information, the method further includes: In response to receiving the downloaded chunk information from the backend server, the device obtains the chunk resources from the main device and downloads the chunk resources locally. Based on the download task information, determine whether the download of all block resources has been completed; In response to the completion of downloading all block resources, the downloaded block resources are merged to obtain merged resources, and the integrity of the merged resources is verified. Upon successful integrity verification, a download task completion message is sent to the backend server.
9. The method according to claim 7, wherein after determining that its own device role is a slave device, the method further comprises: Based on the download task information, determine the resource information to be downloaded; The system sends the information about the resource to be downloaded to the master device, so that the master device can provide feedback on the resource to be downloaded based on the information.
10. The method according to claim 7, further comprising: In response to detecting that its own device is roaming, determine the roaming AP devices after its own device has roamed; Obtain the list of master devices for the roaming AP devices from the backend server, and determine the master device under the roaming AP device based on the list of master devices; Obtain the current resource download information of its own device, and determine the required resource information based on the download task information and the current resource download information; The resource request information is sent to the master device under the roaming AP device so that the master device under the roaming AP device can respond with the resource request information.
11. The method of claim 6, wherein, The number of master devices is multiple; in response to the fact that the download resource supports segmented download, each master device obtains different segmented resources from the background server for download according to the segmented information in the download task information.
12. A resource download device, applied to a resource download system, the resource download system including a backend server and terminal devices communicatively connected to the backend server via access point (AP) devices; the number of AP devices is at least one; the number of terminal devices under any AP device is at least two, including a master device and a slave device, the device being configured on the backend server, comprising: The historical information acquisition module is configured to acquire historical device information uploaded by each terminal device in a historical period in response to detecting at least one terminal device that has a resource download requirement. The master device list generation module is configured to determine the master and slave devices under each AP device based on the historical device information, and generate a master device list corresponding to each AP device. The task information sending module is configured to generate download task information and send the download task information and the master device list to the terminal devices under the corresponding AP devices, so that the terminal devices can determine their own device roles based on the master device list and perform inter-device collaborative downloading based on their own device roles and the download task information; The device is either a master device or a slave device.
13. A resource downloading apparatus applied to a resource downloading system, the resource downloading system comprising a background server and a terminal device in communication connection with the background server through an access point (AP) device; the number of the AP devices is at least one. The number of terminal devices under any AP device is at least two, including a master device and a slave device. The device is configured on the terminal device and includes: The device role determination module is configured to obtain the list of main devices and download task information issued by the backend server, and determine its own device role based on the list of main devices. The resource download module is configured to download resources from the backend server in response to determining its own device role as the main device, based on the download task information. The download information sending module is configured to send downloaded resource information to the slave device through the backend server after successfully downloading the downloaded resource, so that the slave device can obtain the downloaded resource from the master device based on the downloaded resource information and download the downloaded resource locally.
14. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the resource download method of any one of claims 1-4, or to perform the resource download method of any one of claims 5-11.
15. A computer-readable storage medium storing computer instructions that, when executed by a processor, implement the resource download method of any one of claims 1-4, or perform the resource download method of any one of claims 5-11.