Data transmission method, device, equipment, and storage medium
By dynamically adjusting the cache area capacity and release strategy, combining data type and task type, the problem of poor flexibility of the cache mechanism is solved, the reliability and efficiency of data transmission is improved, and network fluctuations are adapted to network fluctuations and packet loss is avoided.
Patent Information
- Application Number
- CN202510435493.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-04-09
AI Technical Summary
When existing data transmission methods face network fluctuations and congestion, the cache mechanism is poorly flexible, resulting in low data transmission reliability. Especially when the Internet of Things devices are connected in large quantities, network load increases, which is prone to packet loss and errors.
By dynamically adjusting the capacity and release strategies of the first-level cache area and the second-level cache area based on the data type and network prediction status, and selecting the target cache area in combination with the data transmission task type, flexible cache management is achieved.
It improves cache utilization efficiency, ensures priority transmission of key data, avoids packet loss problems caused by network congestion, improves the reliability and flexibility of data transmission, and adapts to frequent fluctuations in network status.
Smart Images

Figure CN119946704B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data transmission technology, and more specifically, relates to data transmission methods and devices, equipment, and storage media. Background Art
[0002] In the digital age, data transmission has become a core component of information technology, widely used in cloud computing, the Internet of Things (IoT), the Industrial Internet, financial transactions, and other scenarios. With the explosive growth of data volumes and the diversification of application scenarios, traditional data transmission methods still suffer from low reliability. In particular, with the massive influx of IoT devices, network loads are constantly increasing, and network congestion has become a common problem. This, in turn, can lead to packet loss or errors during data transmission, reducing data transmission reliability.
[0003] Existing technologies use a cache mechanism to cope with the impact of network fluctuations on data transmission. However, existing data cache transmission methods have the problem of poor flexibility and lack of a flexible cache management mechanism, making it difficult to achieve efficient cache utilization and improve data transmission reliability. Summary of the Invention
[0004] The purpose of this application is to provide a data transmission method and apparatus, equipment, and storage medium to improve the flexibility of the cache mechanism and thereby ensure the reliability of data transmission.
[0005] A first aspect of the embodiments of the present application provides a data transmission method, including:
[0006] Determine the cache type based on the data type of the data to be transmitted;
[0007] Determining cache area capacities and cache data release strategies for multiple cache areas corresponding to the cache type based on a network prediction state; the multiple cache areas include a first-level cache area and a second-level cache area; the cache area capacity of the first-level cache area is smaller than the cache area capacity of the second-level cache area;
[0008] Based on the data transmission task type, a target cache area is determined from the first-level cache area and the second-level cache area, the data to be transmitted is stored in the target cache area, and the data to be transmitted is sent to a data recipient; and the data in the target cache area is released based on the cache data release policy.
[0009] According to a second aspect of the present application, a data transmission device is provided, including:
[0010] A data classification cache module is used to determine the cache type based on the data type of the data to be transmitted;
[0011] a dynamic cache module, configured to determine, based on a network prediction state, a cache area capacity and a cache data release strategy for a plurality of cache areas corresponding to the cache type; the plurality of cache areas comprising a first-level cache area and a second-level cache area; the cache area capacity of the first-level cache area being smaller than the cache area capacity of the second-level cache area;
[0012] A data transmission module is used to determine a target cache area from the first-level cache area and the second-level cache area based on the data transmission task type, store the data to be transmitted in the target cache area, and send the data to be transmitted to a data recipient; and release the data in the target cache area based on the cache data release policy.
[0013] In a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned data transmission method when executing the computer program.
[0014] In a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned data transmission method are implemented.
[0015] The beneficial effects of the data transmission method, device, equipment, and storage medium provided by the embodiments of the present application are: the present application divides the cache type according to the data type, thereby improving the pertinence of the cache mechanism. Different types of data have different requirements for cache, and this method can flexibly adapt to make cache utilization more efficient. The present application distinguishes between the first-level cache area (small capacity) and the second-level cache area (large capacity), and dynamically allocates storage resources in combination with the data type and task type, thereby ensuring the priority transmission of critical data and responding to sudden traffic shocks, effectively avoiding packet loss problems caused by network congestion.
[0016] This application determines the cache area capacity and cache data release strategy based on the predicted network status, which can better deal with problems such as wireless network signals being susceptible to interference, frequent fluctuations in network status, and network congestion. When it is predicted that the network status is poor, the capacity of the first-level cache area and the second-level cache area is reasonably adjusted, and a suitable release strategy is formulated to ensure that important data can be transmitted in time when the network is restored, thereby improving the reliability of data transmission. This application determines the target cache area from the first-level cache area and the second-level cache area based on the type of data transmission task, ensuring the accuracy of data storage and transmission, further improving the flexibility of the cache mechanism, and comprehensively ensuring the reliability of the data transmission process. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 A flowchart of a data transmission method provided in one embodiment of the present application;
[0019] Figure 2 A diagram of device interaction provided in one embodiment of the present application;
[0020] Figure 3 A structural block diagram of a data transmission device provided in one embodiment of the present application;
[0021] Figure 4 A schematic block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0022] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0023] In order to make the purpose, technical solutions and advantages of this application clearer, specific embodiments will be described below with reference to the accompanying drawings.
[0024] Please refer to Figure 1 , Figure 1 This is a flow chart of a data transmission method provided in one embodiment of the present application. The method may include S101 to S103.
[0025] S101: Determine a cache type based on the data type of data to be transmitted.
[0026] like Figure 2 As shown, in this embodiment, the data transmission method is applied to the data sender, which sends the data to be transmitted to the data receiver. The data sender can be a server 10, and the data receiver can be a computer 11, a smart phone 12, an Internet of Things device 13, etc.
[0027] In this embodiment, determining the cache type based on the data type of the data to be transmitted includes:
[0028] If the data type of the data to be transmitted is text data, the buffer type is determined to be a text buffer area.
[0029] If the data type of the data to be transmitted is image data, the cache type is determined to be an image cache area.
[0030] In this embodiment, determining the cache type based on the data type of the data to be transmitted further includes:
[0031] If the data type of the data to be transmitted is audio data, the buffer type is determined to be an audio buffer area.
[0032] In this embodiment, the data to be transmitted refers to a collection of data transmitted over the network. Data types are categorized based on the content characteristics of the data to be transmitted, and can include text, images, audio, and other data. Cache types are cache storage units optimized for different data types, with different data types corresponding to different cache storage units. The text cache area, image cache area, and audio cache area have different cache capacities, read and write speeds, and storage formats.
[0033] For example, different data types correspond to different cache areas. The text cache area can use SRAM, organize index data with the help of hash tables, and store it in character encodings such as UTF-8, with fast read and write speeds. In addition to SRAM, the image cache area also uses GPU video memory expansion. Due to the large amount of image data, high-bandwidth transmission is required. Standard formats such as JPEG are used and compressed, and the cache is managed by content. The audio cache area uses DRAM with a dedicated chip cache, which is low-cost and large-capacity. It is stored in formats such as MP3, selects encoding according to the scenario, and uses stream caching technology to ensure continuous data transmission.
[0034] For example, the data sender reads the data to be transmitted and can identify the data type based on the file extension, data header identifier, or data structure characteristics analyzed by rule-based or machine learning algorithms. After determining the data type, the data sender maps text data to the text cache area, image data to the image cache area, and audio data to the audio cache area according to established mapping rules. Based on the characteristics of different cache areas, the data to be transmitted is stored in the corresponding format. During the storage process, the data sender will reasonably allocate storage space based on the capacity limit of the cache area to ensure that the data is stored completely and does not exceed the cache capacity.
[0035] S102: Determine cache area capacities and cache data release strategies for multiple cache areas corresponding to the cache type based on the network prediction state. The multiple cache areas include a first-level cache area and a second-level cache area. The cache area capacity of the first-level cache area is smaller than the cache area capacity of the second-level cache area.
[0036] In this embodiment, the predicted network status refers to the estimated network quality for the next period of time, derived from analyzing historical network data and real-time network monitoring indicators such as signal strength, network latency, and packet loss rate. The predicted network status can be quantified using network quality scores, network status levels, and other metrics. The cache area capacity refers to the maximum amount of data that can be stored in the cache space. The cache data release policy specifies the conditions under which data in the cache area will be released, such as when a certain storage period has been reached or when the cache area is full.
[0037] Each cache type has a corresponding level 1 cache area and a level 2 cache area. The level 1 cache area has a smaller capacity than the level 2 cache area, but its response speed is faster than the level 2 cache area. The level 1 cache area can be used to temporarily store data that needs to be processed quickly. The level 2 cache area can be used to store large amounts of data.
[0038] For example, an on-chip cache can be used to implement the cache area, where the cache area is integrated within the processor chip. Specifically, it is divided into a first-level cache (L1 Cache) and a second-level cache (L2 Cache). The first-level cache is extremely fast, and the L2 cache has a relatively large capacity, which is used to compensate for the insufficient L1 cache capacity. The on-chip cache is close to the processor and has fast access speeds, which can significantly reduce the time the processor waits for data and improve operational efficiency. On-chip cache is widely used in various computer processors, such as personal computers and servers.
[0039] For example, the data sender continuously collects and analyzes network data to derive a predicted network status. When the network is performing well, data transmission is relatively smooth. Due to its fast response time, the first-level cache area can be configured with a smaller capacity to quickly process small amounts of urgently needed data. The second-level cache area, with its larger capacity, is used to store data that may be needed later. When the network is deteriorating, to cope with network fluctuations, the capacity of each cache area and the time limit for releasing cached data can be adjusted to ensure efficient use of cache space and storage of new data.
[0040] S103: Determine a target cache area from the first-level cache area and the second-level cache area based on the data transmission task type, store the data to be transmitted in the target cache area, send the data to be transmitted to the data receiver, and release the data in the target cache area based on the cache data release policy.
[0041] In this embodiment, the data transmission task type refers to the different properties and requirements of the data transmission task, and can be divided into real-time data transmission tasks and standard data transmission tasks. Real-time data transmission tasks have extremely high requirements for the timeliness of data transmission, while standard data transmission tasks have relatively low real-time requirements. The target cache area refers to the area selected from the first-level cache area and the second-level cache area based on the data transmission task type to store the data to be transmitted.
[0042] In this embodiment, the data sender selects the most appropriate target cache area from the L1 and L2 cache areas based on the characteristics of the data transmission task. For tasks requiring high real-time performance, the fast-response L1 cache area is selected; for more general tasks, the large-capacity L2 cache area is selected. After the data transmission is completed, the data in the target cache area is released according to a pre-defined cache data release policy to ensure efficient use of cache space.
[0043] As can be seen from the above, this embodiment determines the cache type based on the data type, fully utilizing the characteristics of each cache area. This makes data storage more efficient and improves the ability to process different types of data. This embodiment dynamically adjusts the cache area capacity and release strategy based on the predicted network status, balancing rapid data processing with large-scale storage. When the network status is poor, timely adjustments can cope with fluctuations, ensure the effective use of cache space, and avoid data backlogs or loss caused by network problems.
[0044] This embodiment precisely selects target cache areas for different data transmission task types. Real-time tasks use the first-level cache area to ensure timely data transmission; standard tasks use the second-level cache area, enabling stable storage and transmission of large amounts of data. After the transfer is complete, cached data is released according to the policy, further optimizing cache resources and improving data transmission performance and reliability.
[0045] In one embodiment of the present application, determining cache area capacities of multiple cache areas corresponding to a cache type based on a network prediction state includes:
[0046] If the predicted network state is a level 1 network state, the cache area capacity of the level 1 cache area is determined to be a first capacity, and the cache area capacity of the level 2 cache area is determined to be a second capacity. The first capacity is smaller than the second capacity.
[0047] If the predicted network state is a Level 2 network state, the first capacity is adjusted based on the network quality score and the first adjustment coefficient to obtain a third capacity, which is used as the cache area capacity of the Level 1 cache area. The second capacity is adjusted based on the network quality score and the second adjustment coefficient to obtain a fourth capacity, which is used as the cache area capacity of the Level 2 cache area.
[0048] The absolute value of the first adjustment coefficient is smaller than the absolute value of the second adjustment coefficient.
[0049] The network quality score of the first-level network status is greater than that of the second-level network status.
[0050] In this embodiment, the primary network state indicates that the network quality is stable, characterized by high bandwidth, low latency, and low packet loss rate, ensuring fast and reliable data transmission. The secondary network state indicates that the network quality is fluctuating, with issues such as limited bandwidth, high latency, and high packet loss rate, resulting in reduced data transmission reliability. The first adjustment coefficient and the second adjustment coefficient are both preset coefficients used to adjust the capacity of the primary and secondary cache areas based on the network quality score in the secondary network state. Given that the capacity of the secondary cache area is more affected in the secondary network state, the absolute value of the first adjustment coefficient is smaller than the absolute value of the second adjustment coefficient.
[0051] For example, the network status can affect data transmission and processing efficiency. In a first-level network state, the network quality is good and the data transmission efficiency is high. At this time, the main function of the cache is to provide fast data access to cope with sudden high-concurrency requests. Therefore, the first-level cache area can be set to a relatively small capacity (first capacity) to efficiently process small amounts of urgently needed data with its fast response characteristics; the second-level cache area can be set to a larger capacity (second capacity) to store data that may be used later.
[0052] In the secondary network state, the network quality is poor, and data transmission may experience delays, packet loss, and other problems. To cope with network fluctuations and ensure system stability and data availability, the cache area capacity needs to be dynamically adjusted based on the network quality score.
[0053] For example, the L2 cache area is used to store large amounts of data, which has relatively low timeliness. When network conditions are poor, due to slow data transmission speeds, a large amount of data accumulates in the L2 cache area, leading to a shortage of cache space. Therefore, the capacity of the L2 cache area needs to be significantly adjusted to adapt to network changes.
[0054] The L1 cache area is used to temporarily store data that requires rapid processing, and therefore requires a high level of response speed. Significantly adjusting the capacity of the L1 cache area while in a L2 network state would affect the system's real-time processing capabilities. Therefore, the absolute value of the first adjustment coefficient is smaller than the absolute value of the second adjustment coefficient, resulting in a relatively small adjustment of the L1 cache area capacity to ensure real-time performance.
[0055] For example, network monitoring data such as signal strength, network latency, and packet loss rate are collected in real time. This data is processed using methods such as neural networks, decision trees, or statistical analysis to calculate a network quality score for a future period. Based on the network quality score, the network status is classified into a primary network state and a secondary network state. When the predicted result is a primary network state, the capacity of the primary cache area is set to a first capacity, and the capacity of the secondary cache area is set to a second capacity. When the predicted result is a secondary network state, the capacities of the primary and secondary cache areas are adjusted based on the network quality score and a preset adjustment coefficient.
[0056] The first and second adjustment coefficients can be preset based on the actual network environment and data transmission requirements. Appropriate adjustment coefficient values can be determined through historical data analysis and simulation experiments to ensure that the cache capacity can be reasonably adjusted under the secondary network state while taking into account the system's real-time performance and data storage requirements.
[0057] In this embodiment, adjusting the first capacity based on the network quality score and the first adjustment coefficient to obtain the third capacity includes: adjusting the first capacity based on the network quality score, the first adjustment coefficient and the first capacity allocation function to obtain the third capacity.
[0058] Adjusting the second capacity based on the network quality score and the second adjustment coefficient to obtain the fourth capacity includes: adjusting the second capacity based on the network quality score, the second adjustment coefficient and the second capacity allocation function to obtain the fourth capacity.
[0059] The first capacity allocation function is:
[0060]
[0061] Among them, C3 represents the third capacity, C1 represents the first capacity, α1 represents the first adjustment coefficient, the first adjustment coefficient is a positive number, NQF represents the network quality score, NQF base Indicates the network status classification threshold, NQF max Indicates the maximum value of the network quality score.
[0062] The second capacity allocation function is:
[0063]
[0064] Wherein, C4 represents the fourth capacity, C2 represents the second capacity, α2 represents the second adjustment coefficient, and the second adjustment coefficient is a positive number.
[0065] In this embodiment, when NQF is less than NQF base (Secondary Network Status), Less than 1, If it is less than 1, the first-level cache capacity and the second-level cache capacity will be reduced.
[0066] The dynamic cache capacity adjustment mechanism of this embodiment achieves refined allocation of cache resources through intelligent perception of network status. In a secondary network, capacity is adjusted based on network quality scores. By subtly adjusting the primary cache and significantly expanding the secondary cache, this strategy prevents over-adjustment of the primary cache from impacting real-time performance while effectively alleviating storage pressure on the secondary cache caused by network fluctuations. Combined with a predictive model to proactively perceive network changes, the data sender can automatically optimize the cache structure when the network is unstable, significantly improving data transmission stability and resource utilization, and achieving a dynamic balance between performance and storage requirements.
[0067] In one embodiment of the present application, after sending the data to be transmitted to the data recipient, the method further includes:
[0068] If the predicted network state is the secondary network state, the sent data is stored in the retransmission buffer area.
[0069] If a data reception confirmation is received within the first response time, the data reception confirmation is parsed to obtain a first hash value. The data reception confirmation is sent by the data receiver. The first hash value is a hash value generated by the data receiver based on the received data.
[0070] The first hash value is matched with the second hash value corresponding to the sent data. If the match is successful, the data in the retransmission buffer area is released.
[0071] If the match fails, the data in the retransmission buffer area is sent to the data receiver.
[0072] In this embodiment, the data transmission method further includes:
[0073] If the data reception confirmation is not received within the first response time, the data in the retransmission buffer area is sent to the data receiver.
[0074] In this embodiment, the retransmission buffer area is a buffer area used to temporarily store sent data in a secondary network state, so as to enable retransmission or data consistency verification when problems occur in data transmission.
[0075] The first response time is the time limit set by the data sender for the data receiver to return a data receipt confirmation message. The data receipt confirmation message is the message sent by the data receiver to the sender after receiving the data, informing the sender that the data has been received. The first hash value is the hash value generated by the data receiver using a hash algorithm based on the received data, used to verify the integrity and consistency of the data. The second hash value is the hash value generated by the sender using the same hash algorithm based on the data to be sent before sending the data.
[0076] Exemplarily, network data is monitored in real time, and when it is determined to be in a secondary network state, the sent data is stored in the retransmission cache area. The first response time is started immediately after the data is sent. Within the first response time, wait for the data reception confirmation sent by the data receiver. If the confirmation is received, the first hash value is parsed and matched with the second hash value stored locally by the sender. If the match is successful, the corresponding data in the retransmission cache area is released. If the match fails, the data is taken out from the retransmission cache area and sent to the data receiver again, and the timing is restarted. If the data reception confirmation is not received within the first response time, the data is taken out from the retransmission cache area and sent to the data receiver, and the timing is restarted until the data is successfully transmitted or the maximum number of retransmissions is reached.
[0077] This embodiment significantly improves transmission reliability in a secondary network state through the synergistic effect of hash checking and retransmission caching. Hash matching ensures data consistency, caching already sent data reduces duplicate transmission overhead, and a timeout retransmission mechanism quickly addresses packet loss. This dynamic response strategy reduces network burden while ensuring accurate delivery of critical data, achieving a balance between efficiency and reliability in weak network environments.
[0078] In one embodiment of the present application, determining a cache data release policy corresponding to a cache type based on a network prediction state includes:
[0079] If the predicted network state is a first-level network state, the cache data release time limit corresponding to the cache type is determined to be a first release time limit.
[0080] If the predicted network state is a secondary network state, the cache data release time limit corresponding to the cache type is determined to be the second release time limit.
[0081] The network quality score of the first-level network state is greater than the network quality score of the second-level network state. The first release time limit is greater than the second release time limit.
[0082] In this embodiment, the first release time limit refers to the time limit for releasing cached data corresponding to the cache type in the first-level network state. The second release time limit refers to the time limit for releasing cached data corresponding to the cache type in the second-level network state.
[0083] In this embodiment, network status affects the stability and speed of data transmission. In a Level 1 network, network quality is good, data transmission is smooth, and cached data can be retained for a longer period of time, improving data access efficiency. In a Level 2 network, network quality is poor. To cope with possible network fluctuations, cache space needs to be released more frequently to ensure sufficient storage space for new data. The network quality score is a quantitative value that evaluates network status or quality.
[0084] For example, if the network state is level 1, the cache data release time limit corresponding to the cache type is determined to be the first release time limit. If the network state is level 2, the cache data release time limit corresponding to the cache type is determined to be the second release time limit. When the cache data storage reaches the corresponding release time limit, the cache data is released to make room for new data storage.
[0085] This embodiment implements cache lifecycle management and control by dynamically adapting to network status. The release time limit is extended in the primary network, fully utilizing the high-quality network characteristics to retain high-frequency data, reducing repeated download overhead and improving cache hit rates. In the secondary network, the time limit is shortened to proactively prevent the risk of cache backlogs caused by network fluctuations and ensure critical data storage space. This differentiated management and control mechanism not only optimizes bandwidth resource utilization but also enhances the system's ability to resist fluctuations, enabling synergistic linkage between cache strategies and network quality, significantly reducing storage redundancy while stabilizing data transmission, and achieving both resource efficiency and service quality improvements.
[0086] In one embodiment of the present application, determining a target cache area from a first-level cache area and a second-level cache area based on a data transmission task type includes:
[0087] If the data transmission task type is a real-time data transmission task, the first-level cache area is used as the target cache area.
[0088] If the data transmission task type is a common data transmission task, the secondary cache area is used as the target cache area.
[0089] The real-time priority of a real-time data transmission task is higher than that of a common data transmission task.
[0090] The response speed of the first-level cache area is greater than that of the second-level cache area.
[0091] In this embodiment, real-time data transmission tasks can include video calls and real-time monitoring data transmission. Data must be transmitted and processed immediately, otherwise the normal operation of the business will be affected. Ordinary data transmission tasks can include file downloads and email sending, which do not require high immediacy of data transmission and can tolerate a certain delay.
[0092] In this embodiment, the data sender selects a cache area that matches the real-time requirements of the data transmission task. Real-time data transmission tasks require high response speeds, so the fast-response L1 cache area is selected to ensure rapid data reading and transmission. Ordinary data transmission tasks, which have lower real-time requirements, select the larger L2 cache area to fully utilize its larger storage space and improve cache utilization.
[0093] For example, after receiving a data transmission task, the data sender first analyzes the task's nature, including whether it has strict time constraints, to determine whether it is a real-time data transmission task or a standard data transmission task. If it is a real-time data transmission task, the first-level cache area is determined as the target cache area; if it is a standard data transmission task, the second-level cache area is set as the target cache area. The data to be transmitted is stored in the selected target cache area and awaits subsequent transmission operations.
[0094] This embodiment improves data transmission efficiency by precisely matching task types with cache characteristics. Real-time tasks prioritize the use of the first-level cache, ensuring low latency and high responsiveness, ensuring smooth operation in scenarios like video calls. Ordinary tasks are assigned to the second-level cache, leveraging its large capacity and improving storage space utilization. This differentiated scheduling avoids performance degradation for real-time tasks due to cache contention, while preventing ordinary tasks from frequently occupying fast cache resources, thereby optimizing both system throughput and service quality.
[0095] Corresponding to the data transmission method of the above embodiment, Figure 3 This is a structural block diagram of a data transmission device provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown. Figure 3 The data transmission device 20 includes: a data classification cache module 21, a dynamic cache module 22 and a data transmission module 23.
[0096] The data classification cache module 21 is configured to determine a cache type based on the data type of the data to be transmitted.
[0097] The dynamic cache module 22 is configured to determine the cache area capacity and cache data release policy of multiple cache areas corresponding to the cache type based on the network prediction state. The multiple cache areas include a first-level cache area and a second-level cache area. The cache area capacity of the first-level cache area is smaller than the cache area capacity of the second-level cache area.
[0098] The data transmission module 23 is used to determine the target cache area from the first-level cache area and the second-level cache area based on the data transmission task type, store the data to be transmitted in the target cache area, and send the data to be transmitted to the data recipient; release the data in the target cache area based on the cache data release policy.
[0099] In one embodiment of the present application, the dynamic cache module 22 is specifically configured to, if the predicted network state is a level 1 network state, determine the cache area capacity of the level 1 cache area to be a first capacity, and determine the cache area capacity of the level 2 cache area to be a second capacity, wherein the first capacity is smaller than the second capacity.
[0100] If the predicted network state is a Level 2 network state, the first capacity is adjusted based on the network quality score and the first adjustment coefficient to obtain a third capacity, which is used as the cache area capacity of the Level 1 cache area. The second capacity is adjusted based on the network quality score and the second adjustment coefficient to obtain a fourth capacity, which is used as the cache area capacity of the Level 2 cache area.
[0101] The absolute value of the first adjustment coefficient is smaller than the absolute value of the second adjustment coefficient.
[0102] The network quality score of the first-level network status is greater than that of the second-level network status.
[0103] In one embodiment of the present application, the data transmission device 20 further includes: a data verification module configured to:
[0104] If the predicted network state is the secondary network state, the sent data is stored in the retransmission buffer area.
[0105] If a data reception confirmation is received within the first response time, the data reception confirmation is parsed to obtain a first hash value. The data reception confirmation is sent by the data receiver. The first hash value is a hash value generated by the data receiver based on the received data.
[0106] The first hash value is matched with the second hash value corresponding to the sent data. If the match is successful, the data in the retransmission buffer area is released.
[0107] If the match fails, the data in the retransmission buffer area is sent to the data receiver.
[0108] In one embodiment of the present application, the data transmission device 20 further includes: a data retransmission module, configured to send the data in the retransmission buffer area to the data receiver if no data reception confirmation is received within the first response time.
[0109] In one embodiment of the present application, the data classification cache module 21 is specifically configured to determine that the cache type is a text cache area if the data type of the data to be transmitted is text data.
[0110] If the data type of the data to be transmitted is image data, the cache type is determined to be an image cache area.
[0111] In one embodiment of the present application, the dynamic cache module 22 is further configured to determine that the cache data release time limit corresponding to the cache type is a first release time limit if the predicted network state is a first-level network state.
[0112] If the predicted network state is a secondary network state, the cache data release time limit corresponding to the cache type is determined to be the second release time limit.
[0113] The network quality score of the first-level network state is greater than the network quality score of the second-level network state. The first release time limit is greater than the second release time limit.
[0114] In one embodiment of the present application, the data transmission module 23 is specifically configured to use the first-level cache area as the target cache area if the data transmission task type is a real-time data transmission task.
[0115] If the data transmission task type is a common data transmission task, the secondary cache area is used as the target cache area.
[0116] The real-time priority of a real-time data transmission task is higher than that of a common data transmission task.
[0117] The response speed of the first-level cache area is greater than that of the second-level cache area.
[0118] See also Figure 4 , Figure 4 This is a schematic block diagram of an electronic device provided in one embodiment of the present application. Figure 4 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of the modules in the above-mentioned device embodiments, such as Figure 3 The functions of the data classification cache module 21, dynamic cache module 22 and data transmission module 23 are shown.
[0119] It should be understood that in the embodiment of the present application, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0120] The input device 302 may include a touchpad, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.
[0121] The memory 304 may include a read-only memory and a random access memory, and provides instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.
[0122] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present application can execute the implementation methods described in the first and second embodiments of the data transmission method provided in the embodiments of the present application, and can also execute the implementation methods of the electronic device 300 described in the embodiments of the present application, which will not be repeated here.
[0123] In another embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, which includes program instructions. When the program instructions are executed by the processor, all or part of the process in the above-mentioned embodiment method is implemented. The computer program can also be used to instruct related hardware to complete the process. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0124] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0125] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0126] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or can be an electrical, mechanical or other form of connection.
[0128] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0129] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0130] The above are only specific embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A data transmission method, characterized in that: include: Determine the cache type based on the data type of the data to be transmitted; Determining cache area capacities and cache data release strategies for multiple cache areas corresponding to the cache type based on a network prediction state; the multiple cache areas include a first-level cache area and a second-level cache area; the cache area capacity of the first-level cache area is smaller than the cache area capacity of the second-level cache area; determining a target cache area from the first-level cache area and the second-level cache area based on a data transmission task type, storing the data to be transmitted in the target cache area, and sending the data to be transmitted to a data recipient; Releasing the data in the target cache area based on the cache data release policy; Determining cache area capacities of multiple cache areas corresponding to the cache type based on the network prediction state includes: If the predicted network state is a level 1 network state, determining the cache area capacity of the level 1 cache area as a first capacity; determining the cache area capacity of the level 2 cache area as a second capacity; the first capacity is smaller than the second capacity; If the predicted network state is a Level 2 network state, adjusting the first capacity based on the network quality score and the first adjustment coefficient to obtain a third capacity, and using the third capacity as the cache area capacity of the Level 1 cache area; adjusting the second capacity based on the network quality score and the second adjustment coefficient to obtain a fourth capacity, and using the fourth capacity as the cache area capacity of the Level 2 cache area; The absolute value of the first adjustment coefficient is smaller than the absolute value of the second adjustment coefficient; The network quality score of the first-level network state is greater than the network quality score of the second-level network state.
2. The data transmission method according to claim 1, wherein: After the data to be transmitted is sent to the data recipient, it also includes: If the predicted network state is the secondary network state, the sent data is stored in the retransmission buffer area; If a data reception confirmation is received within the first response time, the data reception confirmation is parsed to obtain a first hash value; the data reception confirmation is sent by the data receiver; the first hash value is a hash value generated by the data receiver based on the received data; Matching the first hash value with a second hash value corresponding to the sent data, and if the match succeeds, releasing the data in the retransmission buffer area; If the match fails, the data in the retransmission buffer area is sent to the data receiver.
3. The data transmission method according to claim 2, wherein: Also includes: If no data reception confirmation is received within the first response time, the data in the retransmission buffer area is sent to the data receiver.
4. The data transmission method according to claim 1, wherein: The determining of the cache type based on the data type of the data to be transmitted includes: If the data type of the data to be transmitted is text data, determining the cache type to be a text cache area; If the data type of the data to be transmitted is image data, the cache type is determined to be an image cache area.
5. The data transmission method according to claim 1, wherein: Determining a cache data release strategy corresponding to the cache type based on the network prediction state includes: If the predicted network state is a first-level network state, determining that the cache data release time limit corresponding to the cache type is a first release time limit; If the predicted network state is a secondary network state, determining that the cache data release time limit corresponding to the cache type is a second release time limit; The network quality score of the first-level network state is greater than the network quality score of the second-level network state; and the first release time limit is greater than the second release time limit.
6. The data transmission method according to claim 1, wherein: The determining of the target cache area from the first-level cache area and the second-level cache area based on the data transmission task type includes: If the data transmission task type is a real-time data transmission task, the first-level cache area is used as the target cache area; If the data transmission task type is a common data transmission task, the secondary cache area is used as the target cache area; The real-time priority of the real-time data transmission task is higher than the real-time priority of the common data transmission task; The response speed of the first-level cache area is greater than the response speed of the second-level cache area.
7. A data transmission device, characterized in that: include: A data classification cache module is used to determine the cache type based on the data type of the data to be transmitted; a dynamic cache module, configured to determine, based on a network prediction state, a cache area capacity and a cache data release strategy for a plurality of cache areas corresponding to the cache type; the plurality of cache areas comprising a first-level cache area and a second-level cache area; the cache area capacity of the first-level cache area being smaller than the cache area capacity of the second-level cache area; a dynamic cache module, specifically configured to, if the predicted network state is a level one network state, determine a cache area capacity of a level one cache area as a first capacity; and determine a cache area capacity of a level two cache area as a second capacity; wherein the first capacity is smaller than the second capacity; If the predicted network state is a level 2 network state, adjusting the first capacity based on the network quality score and the first adjustment coefficient to obtain a third capacity, and using the third capacity as the cache area capacity of the level 1 cache area; Adjusting the second capacity based on the network quality score and the second adjustment coefficient to obtain a fourth capacity, and using the fourth capacity as the cache area capacity of the secondary cache area; The absolute value of the first adjustment coefficient is smaller than the absolute value of the second adjustment coefficient; The network quality score of the first-level network state is greater than the network quality score of the second-level network state; A data transmission module is used to determine a target cache area from the first-level cache area and the second-level cache area based on the data transmission task type, store the data to be transmitted in the target cache area, and send the data to be transmitted to a data recipient; and release the data in the target cache area based on the cache data release policy.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Transmission method and equipment of composite video data
CN103841432A
Resource caching management method, system and device
CN106997351A