Resource tracking transmission methods, equipment, systems and storage media for point-to-point networks
By maintaining a state log table and broadcasting information in a peer-to-peer network, monitoring state changes, and querying and sharing resources after state changes based on mapping relationships, the number of source sites and fragmented transmission are increased. This solves the problem of inconvenience and waste caused by resource state changes in peer-to-peer networks, and improves resource download efficiency and reliability.
Patent Information
- Application Number
- CN202411646706.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In peer-to-peer networks, changes in the status of downloaded resources make it difficult for other sites to track and request sharing, leading to inconvenience and waste in resource sharing.
By maintaining a status log table, broadcasting the original name and file hash value of resources, monitoring status changes, querying and sharing resources with changed status based on mapping relationships, increasing the number of source sites, and adopting resource fragmentation transmission.
This ensures that requesting sites can accurately track and share resources after status changes, improving resource download efficiency and sharing reliability, and solving the problems of inconvenience and waste caused by resource status changes.
Smart Images

Figure CN119583562B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital information transmission, and more particularly to a resource tracking transmission method for a peer-to-peer network, a computer device, a peer-to-peer network system, and a computer-readable storage medium. Background Technology
[0002] With the rapid development of internet technology, peer-to-peer (P2P) networks, as an efficient and decentralized resource-sharing method, are widely used in file sharing, video streaming, and other fields. The download speed of resources in a P2P network is closely related to the number of sites sharing the same resource. Specifically, the more sites sharing the same resource, the more resource fragments can be provided, thus increasing download speed.
[0003] However, in peer-to-peer networks, the status of downloaded resources is not static. Often, after downloading, status changes (such as renaming or changing storage paths) occur, making it difficult for other sites to track and request shared resources. This leads to inconvenience and waste of resources. While these status changes alter the resource's identifier (such as filename or path), they do not change the resource's inherent attributes and content. Furthermore, the resource is difficult to categorize back into its original type, reducing the number of sites sharing the same resource and consequently impacting the overall download speed and efficiency of similar resources across the network.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this application is to provide a resource tracking and transmission method, computer device, peer-to-peer network system, and computer-readable storage medium for peer-to-peer networks, aiming to ensure that even if the status of locally downloaded resources changes in a peer-to-peer network, the requesting site can still accurately track and request shared downloaded resources after the status change.
[0006] To achieve the above objectives, this application provides a resource tracking transmission method for a point-to-point network, comprising the following steps:
[0007] The local site maintains a status record table corresponding to the downloaded resources, recording the original name, original storage path and file hash value of each downloaded resource as the original status information; and packages the original name and file hash value into broadcast information and broadcasts it to the peer-to-peer network.
[0008] When the local site detects a status change operation for a downloaded resource, it records the mapping relationship between the original status information and the new status information in the status log table; the status change operation includes at least one of renaming and storage path change;
[0009] In a peer-to-peer network, the requesting site searches for the corresponding broadcast information based on the original name of the resource to be downloaded, and verifies the file hash value in the broadcast information; when the verification passes, the requesting site initiates a sharing request for the downloaded resource to the local site.
[0010] When a local site receives a sharing request from a requesting site, if the download resource targeted by the sharing request has undergone a status change, it will query the download resource locally based on the mapping relationship in the status record table.
[0011] The local site shares the downloaded resources it finds with the requesting site, and if the status change operation of the downloaded resources at least includes renaming, the local site also shares metadata containing the current name of the downloaded resources with the requesting site.
[0012] While receiving download resources shared by local sites, the requesting site also searches for other sites in the peer-to-peer network that possess the corresponding download resources based on the metadata. Upon confirming that other sites possess the same download resources, the requesting site initiates a sharing request to these other sites to increase the number of source sites for the download resources. If the requesting site also finds other sites that possess unnamed download resources, it simultaneously initiates a sharing request to further increase the number of source sites for the download resources. During the process of receiving download resources, the requesting site divides the download resources into different resource fragments and obtains the corresponding resource fragments from each source site.
[0013] To achieve the above objectives, this application also provides a computer device, the computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the steps of the resource tracking and transmission method for peer-to-peer networks as described above.
[0014] To achieve the above objectives, this application also provides a peer-to-peer network system, which includes at least three stations, each of which is a computer device as described above.
[0015] To achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the resource tracking and transmission method for peer-to-peer networks as described above.
[0016] The resource tracking and transmission method, computer equipment, peer-to-peer network system, and computer-readable storage medium provided in this application ensure that, even if the status of the downloaded resource at a local site changes, the requesting site can still accurately track and request the shared downloaded resource after the status change in a peer-to-peer network. This is achieved through methods such as maintaining a status log table, broadcasting information, monitoring status changes, resource sharing, increasing the number of source sites, and efficient resource fragmentation transmission. This fully utilizes the resource redundancy of the peer-to-peer network, improves resource download efficiency and sharing reliability, and solves the problems of inconvenience and resource waste caused by resource status changes. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the steps of a resource tracking and transmission method for a point-to-point network in one embodiment of this application;
[0018] Figure 2 This is a schematic diagram of the internal architecture of a computer device according to an embodiment of this application.
[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] Furthermore, descriptions using terms such as "first" and "second" in this application are for descriptive purposes only (e.g., to distinguish identical or similar features) and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" and "second" may explicitly or implicitly include at least one of those features. Additionally, technical solutions from different embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If a combination of technical solutions is contradictory or impossible to implement, such a combination should be considered nonexistent and not within the scope of protection claimed in this application.
[0022] Reference Figure 1 In one embodiment, the resource tracking transmission method for a point-to-point network includes:
[0023] Step S10: The local site maintains a status record table corresponding to the downloaded resources, recording the original name, original storage path and file hash value of each downloaded resource as the original status information; and packages the original name and file hash value into broadcast information and broadcasts it to the peer-to-peer network.
[0024] Step S20: When the local site detects a status change operation for the downloaded resource, it records the mapping relationship between the original status information and the new status information in the status record table; the status change operation includes at least one of renaming and storage path change;
[0025] Step S30: In the peer-to-peer network, the requesting station searches for the corresponding broadcast information based on the original name of the downloaded resource and verifies the file hash value in the broadcast information; when the verification passes, the requesting station initiates a sharing request for the downloaded resource to the local station.
[0026] Step S40: When the local site receives a sharing request initiated by the requesting site, if the download resource targeted by the sharing request has undergone a status change, the local site queries the download resource based on the mapping relationship in the status record table.
[0027] Step S50: The local site shares the queried download resources with the requesting site, and when the status change operation of the queried download resources includes at least renaming, the local site also shares metadata containing the current name of the download resources with the requesting site.
[0028] Step S60: While the requesting site receives the download resources shared by the local site, it also searches for other sites in the peer-to-peer network that have the corresponding download resources based on the metadata. When it confirms that other sites have the same download resources, it initiates a sharing request to other sites to increase the number of source sites for the download resources. If the requesting site also finds other sites that have unnamed download resources, it initiates a sharing request simultaneously to increase the number of source sites for the download resources. During the process of receiving download resources, the requesting site divides the download resources into different resource fragments and obtains the corresponding resource fragments from each source site.
[0029] In this embodiment, the execution terminal can be any station in a peer-to-peer network, and each station can be a computer device.
[0030] As described in step S10, in a peer-to-peer network, the local site first needs to create and maintain a status record table, which records detailed information about all downloaded resources. The structure of the status record table may include the following fields:
[0031] (1) Original name: The initial filename of the resource (e.g., example.txt);
[0032] (2) Original storage path: The complete path of the resource in local storage (e.g., / home / user / downloads / example.txt);
[0033] (3) File hash value: The unique hash value of the resource, which can be generated using algorithms such as MD5, SHA-1 or SHA-256, and is used to verify the integrity of the file;
[0034] (4) Creation time: Records the time when the resource was first downloaded;
[0035] (5) Last update time: Records the time when the resource status was last changed.
[0036] Whenever a new resource is downloaded, the local site will automatically perform the following operations: obtain the original name, original storage path, and file hash value of the resource; insert the obtained information into the status record table as the original status information to ensure complete record.
[0037] After inserting a new record into the status log table, the local site needs to generate a corresponding broadcast message. The broadcast message typically includes the original name of the downloaded resource and the file hash value.
[0038] Broadcast messages can be in key-value pair format, for example:
[0039]
[0040] The local site broadcasts the generated broadcast information through the peer-to-peer network. The broadcast can be sent to all nodes in the network; or, based on a strategy (such as node connectivity, resource popularity, etc.), the broadcast can be selected for a subset of nodes to reduce network load.
[0041] Broadcast information can be transmitted using broadcast mechanisms such as UDP (Open Systems Interconnection), TCP (Transmission Control Protocol), or DHT (Distributed Hash Table).
[0042] Upon receiving a broadcast message, other nodes can verify the message to ensure its validity and that it has not been tampered with. Furthermore, if the received broadcast message contains new resource information, they will update their local status log table.
[0043] As described in step S20, the local site needs to monitor the status changes of downloaded resources in real time. Status change operations may include:
[0044] Rename operation: The resource file name changes.
[0045] Storage path change: The path to the resource storage has changed.
[0046] Among these methods, monitoring status changes can utilize file event notification mechanisms provided by the operating system or file system, such as inotify in Linux or FileSystemWatcher in Windows, to capture file creation, modification, deletion, renaming, and other events in real time.
[0047] When a status change operation is detected, the local site retains the original name, original storage path, and file hash value of the downloaded resource in the status record table. Simultaneously, it needs to obtain the new name and / or new storage path of the downloaded resource, and then add a new record to the status record table, recording the mapping relationship between the original status information and the new status information. A programming example is as follows:
[0048] {
[0049] "resource_id":"12345",
[0050] "original_name":"example.txt",
[0051] "original_path":" / home / user / downloads / example.txt",
[0052] "new_name":"example_new.txt",
[0053] "new_path":" / home / user / downloads / new_folder / example_new.txt",
[0054] "file_hash":"5d41402abc4b2a76b9719d911017c592",
[0055] "status":"renamed",
[0056] "last_update_time":"2024-10-06T07:07:07.360Z"
[0057] }
[0058] As described in step S30, in a peer-to-peer network, when a requesting site needs to obtain specific download resources from a local site, in order to ensure the legality and integrity of the resources, the requesting site needs to first search for and verify the broadcast information.
[0059] The requesting site first needs to determine the specific information of the resource to be downloaded, including the resource name and file hash value. The requesting site can search for broadcast messages containing the target resource information through a peer-to-peer network and receive broadcast messages from local sites or other sites.
[0060] Optionally, the requesting site can listen for broadcast information throughout the entire network and receive broadcasts from all sites. Alternatively, the requesting site can selectively receive broadcasts from only some nodes based on a certain strategy (such as priority, inter-node connectivity, etc.).
[0061] The requesting site matches received broadcast messages to find broadcasts containing target resource information. Specifically, it checks if the resource name in the broadcast message matches the target resource name. If a name match is detected, it further verifies if the file hash value in the broadcast message matches the file hash value of the target resource.
[0062] After matching the broadcast information of the target resource, the requesting site needs to verify the file hash value in the broadcast information to ensure the integrity and consistency of the resource. Generally, when the requesting site obtains the download link of the target resource, it will also obtain the corresponding file hash value.
[0063] The requesting site compares the file hash value of the previously obtained target resource with the file hash value in the broadcast information. If the hash values match, it means the file is intact and has not been tampered with, and the subsequent download operation can continue.
[0064] If the hash values are inconsistent, the requesting site can take the following measures:
[0065] Re-verify: Re-verify the source and integrity of the broadcast information;
[0066] The user is prompted that the file may have been tampered with or is incomplete, and it is recommended to obtain the resource again.
[0067] Error Log: Records error information for subsequent analysis and troubleshooting.
[0068] Optionally, once the file hash value verification is successful, the requesting site can initiate a resource sharing request to the local site. That is, the requesting site generates request information containing target resource information (such as the original name, file hash value, etc.) and sends the request information to the local site via a peer-to-peer network. The sending method can be direct peer-to-peer communication or forwarding via routing nodes.
[0069] As described in step S40, when the local site receives a sharing request initiated by the requesting site for the target download resource, the local site parses the sharing request and obtains the original name and file hash value.
[0070] The local site queries the status log table to check if there is any record in the status log table related to the download resource targeted by the sharing request.
[0071] If the status log table contains the record, further check whether the downloaded resource has undergone a status change (such as renaming or storage path change).
[0072] Optionally, if the downloaded resource has not changed status, the local site can directly share the corresponding download resource with the requesting site.
[0073] Optionally, if the downloaded resource's status changes, the local site retrieves the resource's current status information (such as the new name and new storage path) based on the mapping relationship in the status record table. That is, the local site extracts the mapping relationship from the original status information (such as the original name and original storage path) to the new status information (such as the new name and new storage path) from the status record table, updates the query condition from the original name to the new name, and uses the new storage path to locate the resource. Based on the retrieved current status information, the local site searches for and retrieves the downloaded resource with the changed status in local storage.
[0074] As described in step S50, after successfully locating and obtaining the download resource, the local site begins uploading the queried download resource to share with the requesting site. Specifically, the local site transmits the queried download resource to the requesting site via a peer-to-peer connection or a relay node.
[0075] Optionally, if the status change operation of the downloaded resource found includes at least renaming, the local site will generate metadata containing the current name of the resource while sharing the downloaded resource, and transmit the metadata data to the requesting site.
[0076] As described in step S60, the requesting site receives the download resources transmitted by the local site through a peer-to-peer connection or relay node.
[0077] At this point, the requesting site will also simultaneously use the original name of the downloaded resource to search for other sites with the same download resource in the peer-to-peer network (i.e., other sites besides the local site, whose download resources are generally unnamed).
[0078] Optionally, if the requesting site has received metadata corresponding to the downloaded resource transmitted by the local site, the requesting site will also use the metadata (i.e., search using the new name of the downloaded resource) to search for other sites in the peer-to-peer network that have the same downloaded resource (the downloaded resources owned by these sites have been renamed).
[0079] When querying other sites, the requesting site can broadcast the query request in the peer-to-peer network, requesting other sites to report whether they possess a download resource that matches the original name or metadata of the target resource. When the requesting site receives responses from other sites, it verifies whether the resource of each responding site is consistent with the received resource using the file hash value. For each site confirmed to possess the same download resource, the requesting site synchronously initiates a sharing request to it to increase the number of source sites for the download resource (the specific verification and sharing request process can be referred to as the process of the requesting site verifying and sharing requests to the local site as described in steps S30 to S40, and will not be repeated here).
[0080] Optionally, the requesting site may divide the download resource into multiple resource fragments, with each source site potentially corresponding to at least one fragment. A suitable fragmentation algorithm (such as fixed-size fragmentation or dynamic fragmentation) can be selected to divide the download resource into multiple fragments; a corresponding resource fragment is allocated to each source site to ensure that each site is responsible for transmitting a portion of the resource.
[0081] Then the requesting site sends a sharding request to each source site, requests the corresponding resource shards, receives the resource sharding data from each source site, and stores it in the local temporary storage area.
[0082] After receiving all resource fragments, the requesting site merges them into a complete download resource. This involves sorting all received resource fragments according to their fragment number or identifier; merging the sorted fragments in sequence to generate a complete download resource file; and finally, performing hash verification on the merged complete resource file to ensure its integrity.
[0083] In one embodiment, by maintaining a status log table, broadcasting information, monitoring status changes, sharing resources, increasing the number of source sites, and efficiently fragmenting and transmitting resources, it is ensured that in a peer-to-peer network, even if the status of the downloaded resources at a local site changes, the requesting site can still accurately track and request the shared downloaded resources after the status change (especially suitable for scenarios where resources are frequently renamed or moved in a peer-to-peer network). This fully utilizes the resource redundancy of the peer-to-peer network, improves resource download efficiency and sharing reliability, and solves the problems of sharing inconvenience and resource waste caused by resource status changes.
[0084] In one embodiment, based on the above embodiments, the resource tracking transmission method for point-to-point networks further includes:
[0085] The requesting site allocates corresponding resource fragment sizes to each source site based on the size of the data to be received in the downloaded resource and the transmission score of each source site.
[0086] The transmission score is calculated by weighting and summing the online activity and average upload speed of the source site.
[0087] In this embodiment, the requesting site first determines the total data size of the download resource to be received; at the same time, the requesting site counts the number of source sites that have been discovered and are ready to share the same download resource (including not only download resources with the same name, but also resources with different names but the same content; after the above steps S10 to S50, it is possible to classify the renamed download resources and the download resources with the original name as the same data and share them synchronously).
[0088] Simultaneously, the requesting site determines the online activity and average upload speed of each source site. Each source site independently records the duration of its connection to the peer-to-peer network within a preset time period (e.g., half a day, a day) and feeds it back to the requesting site to calculate the corresponding online activity. The requesting site can also measure the average upload speed of the source sites, i.e., the amount of data that can be uploaded per unit time (or directly obtain the upload speed limited by the source site itself as the average upload speed).
[0089] Among these, higher online activity indicates a more reliable and faster-responding site; higher upload speed indicates higher site transmission efficiency.
[0090] Optionally, depending on specific needs, different weights can be assigned to online activity and average upload speed to calculate a transmission score for each source site. For example, p i =X×W1+V×W2.
[0091] Where, p i Let X be the transmission score of the current source site (i.e., the transmission score of the i-th source site), X be the online activity level, V be the average upload speed, W1 be the weight corresponding to the online activity level, and W2 be the weight corresponding to the average upload speed.
[0092] Optionally, the requesting site calculates the default resource shard size allocated to each source site based on the total data size and the number of source sites. An example formula is shown below:
[0093] m = L / Z;
[0094] Where m is the default shard size, L is the number of source sites, and Z is the total data size.
[0095] Then, based on the transmission scores of each source site, the actual fragment size for each site is adjusted. Sites with high transmission scores will be allocated larger fragments to more efficiently utilize their high upload speeds and online activity.
[0096] M = m × p i / P;
[0097] Where M is the actual fragment size and P is the total transmission score of all source sites.
[0098] In this way, resource fragment sizes are dynamically allocated based on the performance of each source site, improving overall download efficiency. By maximizing the use of sites with high transmission scores, the download process is ensured to be as efficient and fast as possible. Furthermore, reasonable fragment allocation achieves load balancing, preventing some sites from being overloaded while others are idle. The requesting site can then rationally allocate resource fragments based on the transmission performance of each source site, thereby improving overall download efficiency.
[0099] In other alternative solutions, a base fragment size can be set, and after calculating the transmission score corresponding to each source site, the resource fragment size is allocated to each source site. The source site with the higher transmission score receives more base fragments. Finally, the resource fragment size allocated to each source site is the number of base fragments allocated to it, multiplied by the base fragment size.
[0100] The base number of fragments can be calculated by dividing the size of the data to be received from the downloaded resource by the base fragment size. It should be understood that the base number of fragments should be an integer. If there is a remainder when the size of the data to be received is divided by the base fragment size, the remainder is rounded down to one (i.e., if the remainder is not zero, the calculated value is incremented by one).
[0101] Optionally, the requesting site first sets a base chunk size (e.g., 1MB, 2MB, etc.), which can be adjusted according to the network environment and the size of the resource. Then, based on the total data size of the portion of the downloaded resource to be received and the set base chunk size, the number of base chunks is calculated.
[0102] Next, similar to the previous scheme, the transmission score for each source site is calculated, including a weighted sum of online activity and average upload speed.
[0103] Based on the transmission score of each source site, a corresponding number of basic fragments are allocated to each site. Sites with higher transmission scores are allocated more basic fragments.
[0104] Optionally, the base shard size can be negatively correlated with the number of source sites, that is, the more source sites there are, the smaller the base shard size should be, in order to avoid overloading a single site.
[0105] This method, by setting a base fragment size, offers greater flexibility and can be adjusted according to actual conditions, ensuring efficient resource utilization and further guaranteeing load balancing to prevent overload of certain sites. The requesting site can then rationally allocate resource fragment sizes based on the transmission performance of each source site, improving overall download efficiency.
[0106] In one embodiment, based on the above embodiments, before the step of the requesting site allocating corresponding resource fragment sizes to each source site according to the data size of the download resource to be received and according to the transmission score of each source site, the method further includes:
[0107] Artificial intelligence models are pre-trained and deployed at service sites on peer-to-peer networks;
[0108] Based on an artificial intelligence model, this study analyzes the impact of different weight combinations of online activity and average upload speed on the transmission success rate and transmission rate of resource fragments when combined with different resource fragment sizes.
[0109] Based on the analysis results of the artificial intelligence model, under the premise of ensuring the transmission success rate, the weight combination with the highest transmission rate is selected to calculate the transmission score, and the resource fragment size corresponding to the weight combination is determined as the base fragment size.
[0110] The selected online activity and average upload speed are weighted and combined with the base fragment size, and then distributed to each site in the peer-to-peer network.
[0111] Among them, when the requesting site allocates the corresponding resource fragment size to each source site, the source site with the higher transmission score receives more basic fragments; the resource fragment size corresponding to each source site is calculated based on the basic fragment size and the number of allocated basic fragments.
[0112] In this embodiment, an artificial intelligence model is pre-trained on the service site of the peer-to-peer network. This model can analyze the impact of different weight combinations of online activity and average upload speed on the transmission success rate and transmission rate of resource fragments under different resource fragment sizes. The model will output the transmission success rate and transmission rate under various combinations, as well as select the optimal weight combination and base fragment size.
[0113] The model training and deployment process is as follows:
[0114] (1) Data collection
[0115] Collect historical data from each site in the peer-to-peer network, including but not limited to: the online activity of each site; the average upload speed of each site; the usage of different resource fragment sizes; the transmission success rate of each transmission; and the transmission rate of each transmission.
[0116] The collected data is then cleaned and preprocessed, including removing outliers and noisy data, imputing missing values, and standardizing or normalizing the data. Finally, the data is divided into training, validation, and test sets.
[0117] For example, data from the past year can be collected from peer-to-peer networks, including online activity, average upload speed, resource fragment size, transmission success rate, and transmission rate for each site. After data preprocessing (which may include data cleaning, removal of outliers and noisy data; imputation of missing values, and data standardization), the data is divided into a training set (70%), a validation set (15%), and a test set (15%).
[0118] (2) Model Selection
[0119] Choose a neural network model (such as a multilayer perceptron or a deep neural network) as the type of artificial intelligence model.
[0120] (3) Model Training
[0121] Define the objective function of the model, which can be to maximize the transmission rate and transmission success rate. Then, train the model using training data to optimize the model's parameters; and use optimization algorithms such as gradient descent to minimize the objective function. For example, use the Adam optimization algorithm to minimize the loss function of transmission rate and transmission success rate.
[0122] The trained model is validated using validation set data, and hyperparameters such as learning rate and regularization parameters are adjusted. Finally, the model is tested, evaluated, and accepted using the test set.
[0123] (4) Model Deployment
[0124] The trained model is deployed to a service site on a peer-to-peer network. The service site can periodically collect new data, update and retrain the model to adapt to changes in the network environment and resource requirements.
[0125] Load the pre-trained AI model and ensure that the model can run on the peer-to-peer network service site.
[0126] After deploying the model, prepare the input data, including the online activity and average upload speed of each site, as well as different resource fragment sizes. Input the data into the model to predict the transmission success rate and transmission speed under different weight combinations and resource fragment sizes.
[0127] Optionally, different weight combinations of online activity and average upload speed, as well as grids with different resource chunk sizes, can be generated. For example, weight combinations could include 0.1:0.9, 0.2:0.8, 0.3:0.7, 0.4:0.6, and 0.5:0.5, and resource chunk sizes could include [1MB, 2MB, 3MB, ..., 10MB]. Then, different weight combinations and resource chunk sizes are cross-combined to obtain different test groups (e.g., a weight combination of 0.1:0.9, corresponding to resource chunk sizes of [1MB, 2MB, 3MB, ..., 10MB], can result in ten test groups).
[0128] The model is used to predict the transmission success rate and transmission rate for each combination of weights and resource fragment sizes. Results with a transmission success rate higher than a certain threshold (e.g., 95%) are selected from the prediction results. From the selected results, the weight combination with the highest transmission rate is chosen, and the corresponding resource fragment size is obtained.
[0129] The selected weight combination is used to calculate the transmission score of each site; the selected resource fragment size is used as the base fragment size for subsequent allocation of resource fragment sizes.
[0130] Based on the analysis results of the artificial intelligence model, and while ensuring a high transmission success rate, the weight combination with the highest transmission rate can be selected for calculating the transmission score. Simultaneously, the base fragment size corresponding to this weight combination is determined as the optimal base fragment size.
[0131] The selected online activity and average upload speed are weighted and combined with the base fragment size, then distributed to each site via a peer-to-peer network. Each site, upon receiving these parameters, stores them and uses them for subsequent resource fragment size allocation.
[0132] The requesting site allocates corresponding resource fragment sizes to each source site based on the size of the data to be received in the downloaded resource and the transmission score of each source site. Among them, the source site with a higher transmission score receives more basic fragments; finally, the resource fragment size allocated to each source site is the number of basic fragments allocated to it multiplied by the basic fragment size.
[0133] In this way, by analyzing the impact of different weight combinations and resource fragment sizes through artificial intelligence models, we can ensure that the transmission rate is maximized while maintaining a high success rate. Furthermore, by dynamically adjusting the weight combinations and base fragment sizes, we can ensure efficient transmission even when network conditions and resource requirements change.
[0134] In one embodiment, the requesting site can reasonably allocate resource fragment sizes based on the transmission performance of each source site to improve overall download efficiency. At the same time, through optimization by an artificial intelligence model, it can further ensure the maximization of transmission success rate and transmission speed.
[0135] In one embodiment, based on the above embodiments, before the step of the local site sharing the queried download resource with the requesting site, and when the status change operation of the queried download resource includes at least renaming, the local site also sharing metadata containing the current name of the download resource with the requesting site, the method further includes:
[0136] If the status change operation of the downloaded resource found includes at least renaming and the local site has previously shared the corresponding downloaded resource with other sites, then when generating the metadata, the site information of the other sites will also be added.
[0137] In the status record table, local sites must have at least renamed download resources for status change operations, and be associated with site information that has shared the corresponding download resources.
[0138] In this embodiment, before the local site shares the queried download resources with the requesting site, if the status change operation of the queried download resources includes at least renaming, and the local site has previously shared the corresponding download resources with other sites, then when generating metadata, the local site will also add the site information of the other sites.
[0139] By adding site information from other sites to the metadata, the requesting site can more quickly find sites that have the same renamed download resource, thus providing the requesting site with more resource site sources and improving the reliability and speed of download resources.
[0140] In the local site's status log table, status change operations at least include renamed download resources, and are associated with information about sites that have shared the corresponding download resources. This association allows the local site to quickly and accurately obtain and add relevant site information when generating metadata, thereby ensuring that the requesting site can access more resource sources.
[0141] While receiving download resources, the requesting site can directly initiate sharing requests to other sites based on the site information contained in the metadata, thereby increasing the number of source sites for the download resources.
[0142] Of course, if the requesting site also finds other sites with unnamed download resources, it will also initiate a sharing request simultaneously to increase the number of source sites for the download resources.
[0143] In one embodiment, by incorporating information from other sites into the metadata, the efficiency and reliability of resource sharing in a peer-to-peer network are further enhanced. This method is particularly suitable for scenarios where resources are frequently updated, improving the speed and reliability of resource downloads.
[0144] In one embodiment, based on the above embodiments, the resource tracking transmission method for a point-to-point network further includes:
[0145] If the status change operation of the downloaded resource found includes at least renaming, then after the requesting site successfully receives the corresponding downloaded resource, the local site will associate the site information of the requesting site with the new status information of the corresponding downloaded resource in the status record table.
[0146] When other sites initiate a sharing request for the corresponding download resource, the local site also adds the site information associated with the corresponding download resource when generating the metadata.
[0147] In this embodiment, if the status change operation of the downloaded resource found includes at least renaming, after the requesting site successfully receives the corresponding downloaded resource, the local site will associate the requesting site's site information with the new status information of the corresponding downloaded resource in the status record table. By associating the information of the requesting site with the new status information of the resource, the local site can record which sites have successfully received and possess the renamed downloaded resource, thereby providing more resource sources in subsequent sharing requests.
[0148] Optionally, when other sites initiate a sharing request for the corresponding download resource (i.e., a resource that has been previously renamed), the local site will also include the site information associated with the download resource when generating metadata. By including other site information in the metadata, more resource sources can be provided to the requesting site, thereby improving the reliability and speed of downloading resources.
[0149] While receiving download resources, the requesting site can directly initiate sharing requests to other sites based on the site information contained in the metadata, thereby increasing the number of source sites for the download resources. Of course, if the requesting site also finds other sites with unnamed download resources, it will also simultaneously initiate sharing requests to increase the number of source sites for the download resources.
[0150] In this way, by associating the information of the site that successfully received the resource with the new status information after the resource status changes, and adding this information when generating metadata, the efficiency and reliability of resource sharing in peer-to-peer networks are further enhanced.
[0151] In one embodiment, based on the above embodiments, after the step of associating the local site with the site information of the requesting site and the new status information of the corresponding download resource in the status record table when the requesting site successfully receives the corresponding download resource, if the status change operation of the queried download resource includes at least renaming, the method further includes:
[0152] When the corresponding download resource is completely deleted from the local site, the relevant information of the deleted download resource is retained in the status log table;
[0153] When a request is received from a requesting site for sharing a deleted download resource, information about sites that have successfully received the corresponding download resource is sent to the requesting site.
[0154] In this embodiment, when a download resource that has been renamed on the local site is completely deleted, the local site will retain relevant information about the deleted download resource in the status log table.
[0155] When a local site receives a sharing request from a requesting site for a deleted download resource, it sends information about sites that have successfully received the resource. By providing this information, the local site ensures that the requesting site can obtain the resource from other sites, thus preventing resource access interruption due to the deletion of the local resource.
[0156] After receiving the site information sent by the local site, the requesting site can directly initiate sharing requests to other sites based on this information, thereby increasing the number of source sites for downloading resources.
[0157] Of course, if the requesting site also finds other sites with unnamed download resources, it will also initiate a sharing request simultaneously to increase the number of source sites for the download resources.
[0158] In this way, by retaining relevant information when a resource is deleted and providing information about the sites that successfully received the resource when a sharing request for the deleted resource is received, the efficiency and reliability of resource sharing in peer-to-peer networks are further enhanced.
[0159] In one embodiment, based on the above embodiments, the resource tracking transmission method for point-to-point networks further includes:
[0160] When a local site receives multiple requests from other sites for the same download resource, the requests are sorted according to the average upload speed of each site.
[0161] Based on the ranking results from highest to lowest, each requesting site is polled in turn to see if it is willing to share download resources with other sites; if a requesting site does not agree, the next requesting site is polled; if a requesting site agrees, the requesting site is marked as the target site.
[0162] The local site shares download resources with the target site, and the target site then shares download resources with other sites.
[0163] In this embodiment, when the local site receives sharing requests from multiple requesting sites for the same download resource, the local site sorts them according to the average upload speed of each requesting site. Based on this average upload speed sorting, sites with higher upload speeds can be prioritized as the starting point for resource sharing, thereby improving overall download efficiency.
[0164] Based on the sorting results, the local site starts with the requesting site with the highest average upload speed and proceeds to poll each requesting site in turn to see if they are willing to share download resources with other sites. If a requesting site does not agree to share, the local site will move on to the next requesting site and continue polling; if a requesting site agrees to share, the local site will mark that requesting site as the target site. Through polling and polling, the local site ensures that sites that are willing to share and have a high average upload speed are selected as target sites, thereby maximizing sharing efficiency and resource utilization.
[0165] The local site shares downloaded resources with the target site. Once the target site receives the resource, it shares it with other requesting sites through its own upload network. By selecting a target site for resource sharing, the local site's workload is reduced, while leveraging the target site's high upload speed accelerates downloads on other sites.
[0166] Other requesting sites obtain download resources from the target site. The target site can provide resources to multiple requesting sites simultaneously, thereby improving overall download efficiency. Moreover, when there are multiple requesting sites besides the target site, the target site, acting as a local site, can also use the above scheme to poll for sites willing to share and with higher average upload speeds as the target site.
[0167] In this way, a hierarchical resource-sharing network can be formed, where each layer can efficiently select sites with higher upload speeds as the starting point for sharing, thereby further improving overall download efficiency. Specifically, within each layer, requesting sites are sorted according to their upload speeds, and sites willing to share and with higher upload speeds are selected in a round-robin fashion as new target sites. This further optimizes the hierarchical structure and efficiency of resource sharing in peer-to-peer networks, ensuring rapid dissemination and efficient utilization of resources within the network while reducing the network burden on each layer of sites.
[0168] In peer-to-peer networks, resource sharing and transmission are core functions. However, in reality, some sites are only willing to download resources but not share them, which not only affects the download experience of other sites but also hinders the overall maintenance of the peer-to-peer network. Therefore, when multiple sites simultaneously request the same download resource, how to efficiently and fairly allocate resources becomes an important issue. This embodiment aims to optimize the resource sharing mechanism, promote more sites to participate in sharing, improve the overall efficiency and stability of the network, and achieve more efficient resource transmission by considering the upload speed and sharing willingness of requesting sites.
[0169] In one embodiment, efficient tracking and management of downloaded resources in a peer-to-peer network is achieved, ensuring resource integrity and reliability while also increasing resource availability and download efficiency. Furthermore, the resource sharing and transmission process is further optimized through the processing of multiple requesting sites.
[0170] Furthermore, this application also provides a computer device whose internal architecture can be as follows: Figure 2 As shown, the system includes a processor, memory, communication interface, and input interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores data called by the computer programs. The communication interface is used for data communication with external terminals. The input interface is used to receive signals input from external devices. When the computer program is executed by the processor, it implements a resource tracking and transmission method for a point-to-point network as described in the above embodiment.
[0171] Those skilled in the art will understand that Figure 2 The structures shown are merely block diagrams of a portion of the structures related to the present application and do not constitute a limitation on the computer devices to which the present application is applied. For example, in some alternative embodiments, the computer device may further include an output interface (not shown in the figures), and the output interface is also connected to the system bus and used to output corresponding signals to peripherals.
[0172] In this context, any station in a peer-to-peer network can be any of the computer devices described above.
[0173] Furthermore, this application also proposes a peer-to-peer network system, which includes at least three stations, each of which is a computer device as described in the above embodiments. Since this peer-to-peer network system adopts all the technical solutions of all the above embodiments, it possesses at least all the technical effects brought about by the technical solutions of the above embodiments, and will not be elaborated upon here.
[0174] Furthermore, this application also proposes a computer-readable storage medium comprising a computer program that, when executed by a processor, implements the steps of the resource tracking transmission method for a peer-to-peer network as described in the above embodiments. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0175] In summary, the resource tracking and transmission method, computer equipment, peer-to-peer network system, and computer-readable storage medium provided in this application embodiment ensure that, even if the status of the downloaded resource at a local site changes, the requesting site can still accurately track and request the shared downloaded resource after the status change in the peer-to-peer network. This is achieved through methods such as maintaining a status log table, broadcasting information, monitoring status changes, resource sharing, increasing the number of source sites, and efficient resource fragmentation transmission. This fully utilizes the resource redundancy of the peer-to-peer network, improves resource download efficiency and sharing reliability, and solves the problems of inconvenience and resource waste caused by resource status changes.
[0176] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0177] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0178] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A resource tracking and transmission method for a point-to-point network, characterized in that, include: The local site maintains a status record table corresponding to the downloaded resources, recording the original name, original storage path and file hash value of each downloaded resource as the original status information; Additionally, the original name and file hash value are packaged into a broadcast message and broadcast to the peer-to-peer network; When the local site detects a status change operation for a downloaded resource, it records the mapping relationship between the original status information and the new status information in the status log table; the status change operation includes at least one of renaming and storage path change; In a peer-to-peer network, the requesting site searches for the corresponding broadcast information based on the original name of the resource to be downloaded, and verifies the file hash value in the broadcast information; when the verification passes, the requesting site initiates a sharing request for the downloaded resource to the local site. When a local site receives a sharing request from a requesting site, if the download resource targeted by the sharing request has undergone a status change, it will query the download resource locally based on the mapping relationship in the status record table. The local site shares the downloaded resources it finds with the requesting site, and if the status change operation of the downloaded resources at least includes renaming, the local site also shares metadata containing the current name of the downloaded resources with the requesting site. While receiving download resources shared by local sites, the requesting site also searches for other sites in the peer-to-peer network that have the same download resources based on the metadata. When it confirms that other sites have the same download resources, it initiates a sharing request to other sites to increase the number of source sites for the download resources. If the requesting site finds other sites with the same download resources based on the original name of the download resources, it simultaneously initiates a sharing request to increase the number of source sites for the download resources. During the process of receiving download resources, the requesting site divides the download resources into different resource fragments and obtains the corresponding resource fragments from each source site.
2. The resource tracking and transmission method for point-to-point networks as described in claim 1, characterized in that, The resource tracking and transmission method for the point-to-point network further includes: The requesting site allocates corresponding resource fragment sizes to each source site based on the size of the data to be received in the downloaded resource and the transmission score of each source site. The transmission score is calculated by weighting and summing the online activity and average upload speed of the source site.
3. The resource tracking and transmission method for point-to-point networks as described in claim 2, characterized in that, Before the step of the requesting site allocating corresponding resource fragment sizes to each source site based on the data size of the portion of the downloaded resource to be received and based on the transmission scores of each source site, the method further includes: Artificial intelligence models are pre-trained and deployed at service sites on peer-to-peer networks; Based on an artificial intelligence model, this study analyzes the impact of different weight combinations of online activity and average upload speed on the transmission success rate and transmission rate of resource fragments when combined with different resource fragment sizes. Based on the analysis results of the artificial intelligence model, under the premise of ensuring the transmission success rate, the weight combination with the highest transmission rate is selected to calculate the transmission score, and the resource fragment size corresponding to the weight combination is determined as the base fragment size. The selected online activity and average upload speed are weighted and combined with the base fragment size, and then distributed to each site in the peer-to-peer network. Among them, when the requesting site allocates the corresponding resource fragment size to each source site, the source site with the higher transmission score receives more basic fragments; the resource fragment size corresponding to each source site is calculated based on the basic fragment size and the allocated basic fragment size.
4. The resource tracking transmission method for a point-to-point network as described in any one of claims 1-3, characterized in that, Before the step of the local site sharing the queried download resource with the requesting site, and when the status change operation of the queried download resource includes at least renaming, the local site also sharing metadata containing the current name of the download resource with the requesting site, the method further includes: If the status change operation of the downloaded resource found includes at least renaming and the local site has previously shared the corresponding downloaded resource with other sites, then when generating the metadata, the site information of the other sites will also be added. In the status record table, local sites must have at least renamed download resources for status change operations, and be associated with site information that has shared the corresponding download resources.
5. The resource tracking transmission method for a point-to-point network as described in any one of claims 1-3, characterized in that, The resource tracking and transmission method for the point-to-point network further includes: If the status change operation of the downloaded resource found includes at least renaming, then after the requesting site successfully receives the corresponding downloaded resource, the local site will associate the site information of the requesting site with the new status information of the corresponding downloaded resource in the status record table. When other sites initiate a sharing request for the corresponding download resource, the local site also adds the site information associated with the corresponding download resource when generating the metadata.
6. The resource tracking and transmission method for point-to-point networks as described in claim 5, characterized in that, If the status change operation of the downloaded resource retrieved includes at least renaming, then after the step of the local site associating the site information of the requesting site with the new status information of the corresponding downloaded resource in the status record table after the requesting site successfully receives the corresponding downloaded resource, the method further includes: When the corresponding download resource is completely deleted from the local site, the relevant information of the deleted download resource is retained in the status log table; When a request is received from a requesting site for sharing a deleted download resource, information about sites that have successfully received the corresponding download resource is sent to the requesting site.
7. The resource tracking and transmission method for point-to-point networks as described in claim 1, characterized in that, The resource tracking transmission method for the point-to-point network further includes: When a local site receives multiple requests from other sites for the same download resource, the requests are sorted according to the average upload speed of each site. Based on the ranking results from highest to lowest, each requesting site is polled in turn to see if it is willing to share download resources with other sites; if a requesting site does not agree, the next requesting site is polled; if a requesting site agrees, the requesting site is marked as the target site. The local site shares download resources with the target site, and the target site then shares download resources with other sites.
8. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the resource tracking transmission method for a peer-to-peer network as described in any one of claims 1 to 7.
9. A peer-to-peer network system, characterized in that, The peer-to-peer network system includes at least three stations, each of which is a computer device as described in claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the resource tracking transmission method for a peer-to-peer network as described in any one of claims 1 to 7.
Citation Information
Patent Citations
File uploading method and device, file downloading method and device, computer equipment and storage medium
CN112565393A
File cloud synchronization method and system and electronic equipment
CN115757312A