Novel practical training machine room data updating method
Through the differentiated comparison and parallel download technology of the P2P network, the problem of low data update efficiency in the training computer room is solved, and efficient data transmission and reliable data update are achieved.
Patent Information
- Application Number
- CN202410897954.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, when data is updated in the training computer room, the transmission time is extended due to the increase in hard disk data, and some machines are offline, resulting in low efficiency.
Using the P2P server data comparison index method, a differential data list is generated through differential comparison, and multiple P2P nodes are selected for parallel downloading to achieve data updates.
Reduce invalid data transmission time, improve data update efficiency, and ensure the reliability and availability of data transmission.
Smart Images

Figure CN118733602A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a new method for updating data in a training computer room. Background Art
[0002] In colleges and universities, with the increase of practical training courses, in order to meet the requirements of different practical training teaching, the software required to be equipped in the computer room is constantly increasing, resulting in a large number of software on the computer room, and many professional software occupy a large hard disk space. Therefore, when there are new software that needs to be modified due to setting problems, even if it is a small change, the entire partition needs to be transferred. Usually, a hard disk protection card with network transmission function and based on Client / Server mode can be used to complete this task.
[0003] The commonly used technology at present is to complete data update through a hard disk protection card with network transmission function. The problem is that as the hard disk data increases, the time for data transmission becomes longer and longer, and because some machines are offline, the efficiency is relatively low. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a new method for updating data in a training room. Through the P2P server data comparison index, data comparison is performed before data updating, thereby reducing the data transmission time occupied by invalid data and using the limited time for updating valid data.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions: A new method for updating data in a training room comprises the following steps: a. Each host sends a request to the central server through the P2P network to obtain the index file of the new version data and the P2P node list; b. Each host performs a differential comparison between the local index file of the old version of data and the index file of the new version of data to generate a differential data list; c. According to the difference data list, each host selects multiple P2P nodes from the P2P node list for information exchange and builds a P2P network list; d. Each host builds a data block resource list containing the data blocks to be downloaded and their corresponding P2P node information based on the difference data list and the P2P network list; e. The host downloads the difference data blocks in parallel from the P2P network according to the data block resource list to complete the data update.
[0006] Preferably, the implementation steps of step a include: a1. Each host starts the data update program and establishes a connection with the central server through the P2P network; a2. The host sends a data update request to the central server, which contains the host identification and current version information; a3. The central server responds to the host's request and returns the index file of the new version data and the P2P node list; a4. The host receives and stores the index file and P2P node list for use in subsequent steps.
[0007] Preferably, in step b, the differential comparison is achieved by: b1. Use the hash algorithm to calculate the hash values of the new and old versions of the data; b2. Compare hash values, determine data differences, and generate a list of difference data.
[0008] Preferably, in step c, the process of selecting a P2P node includes c1. evaluating the network status, load condition and data integrity of each P2P node; c2. Based on the evaluation results, select multiple P2P nodes and build a P2P network list.
[0009] Preferably, in step d, the process of constructing the data block resource list includes: d1. Analyze the difference data list and determine the data blocks to be downloaded; d2. Query the P2P network list to obtain the P2P node information corresponding to each data block; d3. Integrate the information and build a data block resource list containing data blocks and node information.
[0010] Preferably, in step e, the data downloading process includes: e1. Assign download priority to each data block according to the data block resource list; e2. Use multi-threading technology to download data blocks from multiple P2P nodes in parallel; e3. Implement the breakpoint resume function to ensure that the download can be resumed when the download is interrupted.
[0011] Preferably, the data downloading process also includes: e4. Monitor the data transmission rate and stability of each P2P node; e5. Dynamically adjust data download strategies based on monitoring results to optimize data transmission efficiency.
[0012] Preferably, after the data update is completed, the method further includes: f1. Verify the completeness and accuracy of updated data; f2. Update the local data index file so that differential comparison can be performed the next time the data is updated.
[0013] Preferably, the method further comprises the following steps: g1. Set up data backup nodes in the P2P network; g2. When data on a P2P node is damaged or lost, restore the data from the backup node to ensure data reliability and availability.
[0014] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a new training room data updating method. Through the P2P server data comparison index, data comparison is performed before data updating, thereby reducing the data transmission time occupied by invalid data and using the limited time for updating valid data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a flow chart of the method for updating data in a training room of the present invention. DETAILED DESCRIPTION
[0017] The present invention is further described in detail below with reference to the accompanying drawings.
[0018] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles of the present invention defined in the following description can be used for other embodiments, variations, improvements, equivalents, and other technical solutions that do not deviate from the spirit and scope of the present invention.
[0019] Those skilled in the art should understand that, in the disclosure of the present invention, the directions or positions indicated by the terms "longitudinal", "lateral", "up", "down", "left", "right", "front", "back", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. are based on the directions or positional relationships shown in the accompanying drawings, which are only simplified descriptions for the convenience of describing the present invention, and do not indicate or imply that the device or component referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, the above terms should not be understood as limitations on the present invention.
[0020] It is to be understood that the term "one" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element may be one, while in another embodiment, the number of the element may be multiple, and the term "one" should not be understood as a limitation on the quantity. Example
[0021] See also Figure 1 The present application provides a new method for updating data in a training room, the purpose of which is to compare data before updating data through a P2P server data comparison index, thereby reducing the data transmission time occupied by invalid data and using limited time on updating valid data.
[0022] Before implementing the data update method of the present application, it is necessary to build a P2P network so that each host can act as a server and client to upload and download data. At the same time, an efficient indexing mechanism is needed to identify and manage different versions of data and software updates. Among them, the efficient indexing mechanism can be to use DHT (distributed hash table) or other distributed indexing algorithms, and design a lightweight index file format, including key information such as software name, version number, data block hash value, data block size, etc. At the same time, a data block checksum mechanism is introduced to ensure that the transmitted data blocks are complete and have not been tampered with.
[0023] Furthermore, we use hash algorithms (such as SHA-256) to calculate the hash values of local data and server data, and compare the hash values to determine whether the data is the same. We use incremental update technology to only transmit the changed data blocks instead of the entire file or the entire data set, and design an efficient comparison algorithm to reduce the amount of calculation and memory usage during the comparison process. This allows for fast and accurate comparison of the local old version data and the new version data on the server to generate a minimized download list.
[0024] Furthermore, by introducing a node scoring mechanism, scoring nodes based on factors such as bandwidth, stability, and response time, P2P nodes with high scores are selected for data transmission; using multi-threading or multi-process technology, data blocks are downloaded from multiple nodes in parallel to improve data transmission throughput; and breakpoint resume function is implemented, so that when the connection is interrupted, downloading can be continued from the last download location to reduce repeated transmission. The best node is selected from the P2P network for data transmission, while optimizing the efficiency and stability of data transmission.
[0025] Furthermore, a data structure (such as a hash table or a red-black tree) is designed to store the data block resource list to achieve fast search and update. A heartbeat mechanism is introduced to regularly exchange information with P2P nodes to update the status of the data block resource list and the P2P node list. A real-time data block resource list is maintained to record the source and status of each data block so that the required data block can be quickly found and downloaded. When a data block is detected to be missing or damaged, it is automatically downloaded from other nodes and replaced to achieve automatic repair function.
[0026] Design a priority algorithm to set the priority of data blocks according to factors such as type, size, and dependency, introduce an intelligent scheduling mechanism, dynamically adjust the download strategy according to factors such as network conditions, node load, and data block priority, and implement a concurrent control mechanism to avoid network congestion or system resource exhaustion caused by downloading too many data blocks at the same time. Set the priority of the data blocks to be downloaded according to actual needs and the importance of the data blocks, and formulate corresponding download strategies.
[0027] Specifically, the present application provides a new method for updating data in a training room, comprising the following steps: a. Each host sends a request to the central server through the P2P network to obtain the index file of the new version data and the P2P node list; b. Each host performs a differential comparison between the local index file of the old version of data and the index file of the new version of data to generate a differential data list; c. According to the difference data list, each host selects multiple P2P nodes from the P2P node list for information exchange and builds a P2P network list; d. Each host builds a data block resource list containing the data blocks to be downloaded and their corresponding P2P node information based on the difference data list and the P2P network list; e. The host downloads the difference data blocks in parallel from the P2P network according to the data block resource list to complete the data update.
[0028] Preferably, the implementation steps of step a include: a1. Each host starts the data update program and establishes a connection with the central server through the P2P network; a2. The host sends a data update request to the central server, which contains the host identification and current version information; a3. The central server responds to the host's request and returns the index file of the new version data and the P2P node list; a4. The host receives and stores the index file and P2P node list for use in subsequent steps.
[0029] Preferably, in step b, the differential comparison is achieved by: b1. Use the hash algorithm to calculate the hash values of the new and old versions of the data; b2. Compare hash values, determine data differences, and generate a list of difference data.
[0030] Preferably, in step c, the process of selecting a P2P node includes c1. evaluating the network status, load condition and data integrity of each P2P node; c2. Based on the evaluation results, select multiple P2P nodes and build a P2P network list.
[0031] Preferably, in step d, the process of constructing the data block resource list includes: d1. Analyze the difference data list and determine the data blocks to be downloaded; d2. Query the P2P network list to obtain the P2P node information corresponding to each data block; d3. Integrate the information and build a data block resource list containing data blocks and node information.
[0032] Preferably, in step e, the data downloading process includes: e1. Assign download priority to each data block according to the data block resource list; e2. Use multi-threading technology to download data blocks from multiple P2P nodes in parallel; e3. Implement the breakpoint resume function to ensure that the download can be resumed when the download is interrupted.
[0033] e4. Monitor the data transmission rate and stability of each P2P node; e5. Dynamically adjust data download strategies based on monitoring results to optimize data transmission efficiency.
[0034] In addition, a new training room data updating method of the present application also includes: f1. Verify the completeness and accuracy of updated data; f2. Update the local data index file so that differential comparison can be performed the next time the data is updated.
[0035] In addition, a new training room data updating method of the present application also includes: g1. Set up data backup nodes in the P2P network; g2. When data on a P2P node is damaged or lost, restore the data from the backup node to ensure data reliability and availability.
[0036] It should be noted that, in this application, the P2P node evaluation process includes: 1. Network status assessment 1.1Measure the network latency from the current host to the P2P node, that is, the time it takes for a data packet to go from the sending point to the receiving point. Nodes with low latency usually provide faster response and data transmission speeds.
[0037] 1.2 Evaluate the available bandwidth of the P2P node, which determines the amount of data transfer that the node can handle. Nodes with high bandwidth are able to transfer data blocks faster.
[0038] 1.3 Measures the percentage of packets lost during network transmission. Nodes with low packet loss rates are more reliable and can reduce errors and retransmissions in data transmission.
[0039] 2. Load situation assessment 2.1 Check the CPU usage of the P2P node to determine its current ability to process tasks. Nodes with high CPU usage may not be able to process new data transmission requests in a timely manner.
[0040] 2.2 Evaluate the node's memory usage to ensure it has sufficient resources to handle data transfers.
[0041] 2.3 Understand the number of connections a node is currently handling to avoid selecting an overly busy node.
[0042] 3. Data integrity assessment 3.1 Use a hash algorithm (such as SHA-256) to calculate the hash value of the data block stored on the P2P node and compare it with the checksum provided by the central server or other reliable sources to ensure the integrity of the data.
[0043] 3.2 Evaluate the degree of data redundancy in the P2P network, that is, the number of copies of the same data block on multiple nodes. High redundancy can improve data reliability and availability.
[0044] 4. Comprehensive evaluation and selection 4.1 Assign a comprehensive weight to each P2P node based on the evaluation results of various aspects such as network status, load, data integrity and security.
[0045] 4.2 According to the comprehensive weight, select multiple P2P nodes to build a P2P network list. You can set a threshold or select the first N nodes with the highest weight to ensure the reliability and efficiency of data transmission.
[0046] It should be noted that in this application, the process of dynamically adjusting the data download strategy is described in detail: 1. Monitor the data transmission rate and stability of each P2P node While the host is downloading data blocks in parallel, it continuously monitors the real-time performance of each P2P node with which it is transmitting data.
[0047] The monitored data include the data transmission rate of each node (i.e. the amount of data transmitted per second), packet loss rate, delay time, etc. These data can reflect the network status and transmission stability of the node.
[0048] 2. Dynamically adjust data download strategies based on monitoring results to optimize data transmission efficiency: 2.1 Analysis of monitoring data: The host analyzes the collected monitoring data to determine the current status of each node. For example, if a node's data transmission rate suddenly drops or the packet loss rate increases, this may mean that the node's current network condition is poor.
[0049] 2.2 Evaluate node performance: Based on the monitoring data and analysis results, the host evaluates the performance of each node to determine which nodes are reliable and efficient and which nodes may have problems.
[0050] 2.3 Dynamic adjustment strategy: Increase / decrease parallel connections: If a node performs well, the host can increase the number of parallel connections with the node to speed up data transmission. Conversely, if a node performs poorly, the host can reduce the number of connections with the node or even completely disconnect the node to avoid affecting the overall data transmission efficiency.
[0051] Switching nodes: If a node continues to perform poorly, the host can try to select other nodes with better performance from the P2P network list for data transmission. This may require rebuilding the data block resource list and assigning new download priorities.
[0052] Adjusting data block priority: Based on the performance and download progress of the node, the host can dynamically adjust the download priority of each data block. For example, if a critical data block is being downloaded from a node with poor performance, the host can temporarily increase the priority of the data block and try to download the data block from other nodes in parallel to ensure that the critical data can be updated in time.
[0053] 3. Continuous monitoring and adjustment: During the entire data download process, the host will continue to monitor and adjust to ensure efficient and stable data transmission.
[0054] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functions and structural principles of the present invention have been demonstrated and explained in the embodiments, and the embodiments of the present invention may be deformed or modified in any way without departing from the principles.
Claims
1. A new method for updating data in a training room, characterized in that: The following steps are involved: a. Each host sends a request to the central server through the P2P network to obtain the index file of the new version data and the P2P node list; b. Each host performs a differential comparison between the local index file of the old version of data and the index file of the new version of data to generate a differential data list; c. According to the difference data list, each host selects multiple P2P nodes from the P2P node list for information exchange and builds a P2P network list; d. Each host builds a data block resource list containing the data blocks to be downloaded and their corresponding P2P node information based on the difference data list and the P2P network list; e. The host downloads the difference data blocks in parallel from the P2P network according to the data block resource list to complete the data update.
2. A new training room data updating method according to claim 1, characterized in that: The implementation steps of step a include: a1. Each host starts the data update program and establishes a connection with the central server through the P2P network; a2. The host sends a data update request to the central server, which contains the host identification and current version information; a3. The central server responds to the host's request and returns the index file of the new version data and the P2P node list; a4. The host receives and stores the index file and P2P node list for use in subsequent steps.
3. A new training room data updating method according to claim 2, characterized in that: In step b, the differential comparison is achieved by: b1. Use the hash algorithm to calculate the hash values of the new and old versions of the data; b2. Compare hash values, determine data differences, and generate a list of difference data.
4. A new training room data updating method according to claim 3, characterized in that: In step c, the process of selecting a P2P node includes: c1. Evaluate the network status, load and data integrity of each P2P node; c2. Based on the evaluation results, select multiple P2P nodes and build a P2P network list.
5. A new method for updating data in a training room according to claim 4, characterized in that: In step d, the process of constructing the data block resource list includes: d1. Analyze the difference data list and determine the data blocks to be downloaded; d2. Query the P2P network list to obtain the P2P node information corresponding to each data block; d3. Integrate the information and build a data block resource list containing data blocks and node information.
6. A new method for updating data in a training room according to claim 5, characterized in that: In the step e, the data block download process includes: e1. Assign download priority to each data block according to the data block resource list; e2. Use multi-threading technology to download data blocks from multiple P2P nodes in parallel; e3. Implement the breakpoint resume function to ensure that the download can be resumed when the download is interrupted.
7. A new method for updating data in a training room according to claim 6, characterized in that: The data block download process also includes: e4. Monitor the data transmission rate and stability of each P2P node; e5. Dynamically adjust data download strategies based on monitoring results to optimize data transmission efficiency.
8. A new method for updating data in a training room according to claim 1, characterized in that: After the data is updated, it also includes: f1. Verify the completeness and accuracy of updated data; f2. Update the local data index file so that differential comparison can be performed the next time the data is updated.
9. A new method for updating data in a training room according to claim 1 or 8, characterized in that: The following steps are also included: g1. Set up data backup nodes in the P2P network; g2. When data on a P2P node is damaged or lost, restore the data from the backup node to ensure data reliability and availability.
Citation Information
Cited By
File acquisition method and device, node equipment and computer readable storage medium
CN117424907A
