Cache processing method and device of gateway router and network equipment

By realizing data storage, automatic cleaning and dynamic rate adjustment in the gateway router, combined with the data integrity verification of the hash algorithm, the problems of network instability and insufficient data integrity verification in the existing technology are solved, and efficient and reliable data upload is achieved.

CN119922140AInactive Publication Date: 2025-05-02SHENZHEN SINOBRY ELECTRONICS LTD

Patent Information

Application Number
CN202510417609.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-05-02
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing gateway routers are difficult to effectively deal with when facing bandwidth fluctuations or network interruptions, and lack dynamic adjustment mechanisms to network status, resulting in unstable data transmission and insufficient integrity verification during data upload.

Method used

By implementing data storage and automatic cleaning mechanisms in front-end devices and gateway routers, the data transmission rate is dynamically adjusted, and data integrity verification is performed through hashing algorithms to ensure that data can be uploaded and automatically cleaned after network interruption is restored.

Benefits of technology

It realizes efficient and reliable data upload in an unstable network environment, avoids data loss and waste of storage space, and improves the stability and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922140A_ABST
    Figure CN119922140A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network communication, and discloses a cache processing method and device of a gateway router and network device.The method comprises the steps that front-end equipment temporarily stores data in local storage after a user submits the data, the front-end equipment and the gateway router continuously temporarily store the data in the network interruption period, and when network recovery is detected, the front-end equipment and the gateway router continuously store the data in the local storage period; the data uploading logic is automatically triggered, the front-end equipment sends the temporarily stored data to the gateway router, and after the data is successfully uploaded to the server, the front-end equipment and the gateway router automatically clean the temporarily stored data; the device comprises front-end equipment, a gateway router, a server and a data cleaning module, the network equipment comprises a processor and a memory which is in communication connection with the processor, wherein a computer program which can be executed by the processor is stored in the memory. By adopting the technical scheme of dynamic bandwidth regulation and control and data transmission rate adjustment, the technical effect of optimizing the data transmission rate in real time according to the network state is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a cache processing method, device and network equipment of a gateway router. Background Art

[0002] With the rapid development of Internet technology and the continuous growth of data volume, more and more enterprises and individual users need to upload large amounts of data to the cloud or remote servers. These data transmissions must not only ensure real-time and high efficiency, but also ensure the integrity and security of the data during transmission. Especially in scenarios such as mobile devices, IoT devices, and remote offices, frequent network fluctuations and interruptions make data transmission more complicated. Therefore, a cache processing method for a gateway router is needed to achieve efficient and reliable data upload in an unstable network environment.

[0003] Existing gateway router data transmission systems use fixed rates or static upload strategies based on network load for data transmission. These systems usually include multiple nodes such as front-end devices, network routers, and servers. The front-end devices are responsible for collecting and temporarily storing data, the routers are responsible for forwarding data and coordinating the upload process, and the servers receive and store data.

[0004] However, the existing gateway routers lack a dynamic adjustment mechanism for the network status. Since the network bandwidth and delay may change at any time, the fixed-rate upload solution is often difficult to effectively deal with bandwidth fluctuations or network interruptions, which can easily lead to data loss or upload failure. The traditional cache management system relies too much on manual intervention or completely ignores the automatic cleaning mechanism, resulting in the data after the upload being retained in the local storage for a long time, occupying valuable storage space, and the existing system lacks strict guarantees in the integrity verification during the data upload process, especially when the network is unstable or packet loss occurs, it is difficult to effectively verify the accuracy and integrity of the data. Therefore, the present invention provides a cache processing method, device and network equipment for a gateway router to solve the deficiencies in the prior art. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present invention provides a cache processing method, device and network equipment for a gateway router, which solves the problems that the existing gateway router lacks a dynamic adjustment mechanism for the network status, the fixed-rate upload solution is often difficult to effectively cope with bandwidth fluctuations or network interruptions, and the existing system lacks strict guarantees for integrity verification during data upload, especially when encountering network instability or packet loss.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: A cache processing method of a gateway router comprises the following steps: After the user submits the data, the front-end device temporarily stores the data in local storage and stops data transmission when a network interruption is detected, ensuring that the data that stops transmission is saved locally; During network interruption, the front-end device and gateway router continue to temporarily store data and record the progress of data upload; The front-end device periodically detects the network status, and automatically triggers the data upload logic when it detects that the network is restored; The front-end device reads the temporary data from the local storage and sends the temporary data to the gateway router through the API interface. The gateway router dynamically adjusts the transmission rate of the temporary data according to the network status and forwards the temporary data to the server; After the temporarily stored data is successfully uploaded to the server, the front-end device and gateway router automatically clear the temporarily stored data.

[0007] Preferably, the content of the user-submitted data includes: The form data entered by the user includes text, numbers, or files; Unique identifier of the data, used to distinguish data from different users or batches; The timestamp of the data, which is used to record the submission time of the data; The data priority is used to indicate the importance of the data and the order in which it is processed.

[0008] Preferably, the step of the front-end device and the gateway router continuously temporarily storing data includes: The gateway router dynamically allocates storage resources based on the importance of the data and the network status; The gateway router uses a hash algorithm to check the integrity of the temporarily stored data and records the verification results.

[0009] Preferably, the step of the front-end device regularly detecting the network status includes: The front-end device detects the network connection status at preset time intervals through a timer; When the network is detected to be restored, the front-end device continues to upload the unfinished data from the breakpoint according to the recorded data upload progress.

[0010] Preferably, the step of dynamically adjusting the data transmission rate of the gateway router includes: The gateway router calculates the optimal transmission rate based on the network bandwidth and server load; The gateway router dynamically adjusts the data transmission rate through the flow control algorithm to ensure efficient data upload.

[0011] Preferably, after receiving the temporarily stored data, the server verifies the data integrity by a hash algorithm, and the hash algorithm satisfies the following formula: ; in, is the hash value, is a hash function, For the received data.

[0012] Preferably, the step of automatically clearing temporarily stored data by the front-end device and the gateway router includes: The front-end device and the gateway router delete the successfully uploaded temporary data according to the confirmation signal from the server; The front-end device and gateway router release storage resources and update the data upload status.

[0013] Preferably, when the network is interrupted, the front-end device displays an offline prompt message to the user, prompting that the data has been temporarily stored. After the data is successfully uploaded, the front-end device displays an upload success prompt message to the user.

[0014] A cache processing device for a gateway router is also provided, comprising: Front-end equipment, used to temporarily store data in local storage after the user submits the data, and to stop data transmission when a network interruption is detected; The gateway router is used to receive the temporary data sent by the front-end device, dynamically adjust the data transmission rate according to the network status, and forward the data to the server; The server is used to receive data forwarded by the gateway router and verify the data integrity through the hash algorithm; The data cleaning module is used to automatically clean up the temporary data in the front-end device and gateway router after the data is successfully uploaded.

[0015] A network device is also provided, comprising a processor and a memory communicatively connected to the processor, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, a cache processing method of a gateway router can be implemented.

[0016] The present invention provides a cache processing method, device and network equipment for a gateway router, which has the following beneficial effects: 1. The present invention adopts a technical solution of dynamic bandwidth control and data transmission rate adjustment, achieving the technical effect of optimizing the data transmission rate in real time according to the network status; compared with the fixed-rate transmission solution in the prior art, the present invention can automatically adjust the upload speed according to the real-time network bandwidth situation, avoiding network congestion or data loss problems, and improving the stability and efficiency of data transmission.

[0017] 2. The present invention achieves the technical effect of automatically releasing local cache resources after successful uploading by introducing a technical solution of joint operation of the front-end device and the gateway router and automatic data cleaning. Compared with the solutions of manual cleaning or no cache cleaning in the prior art, the present invention not only reduces the storage occupancy of redundant data by automatically cleaning the cache, but also ensures the efficient use of system resources and avoids the waste of storage space.

[0018] 3. The technical solution of the present invention to perform data integrity verification through a hash algorithm achieves the technical effect of ensuring that the uploaded data is lossless and accurate; different from the existing methods that lack verification or use simple verification, the present invention uses a hash algorithm to verify data in the uploading and receiving links, which greatly reduces the risk of data tampering or loss and ensures the reliability of data transmission.

[0019] 4. The present invention achieves the technical effect of end-to-end cache management by combining the multi-module collaborative work of the front-end device, gateway router and server; compared with the traditional technical solution of a single device completing the upload task, the multi-node collaborative mechanism of the present invention improves the flexibility and response speed of the system through effective division of labor and feedback, effectively reduces the delay and failure rate in the upload process, and improves the overall user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flow chart of the method steps of the present invention; Figure 2 is a diagram of the device architecture of the present invention; Figure 3 It is a schematic diagram of the network equipment of the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] Please see attached Figure 1 The embodiment of the present invention provides a cache processing method of a gateway router, comprising the following steps: S1. After the user submits the data, the front-end device temporarily stores the data in local storage and stops data transmission when a network interruption is detected to ensure that the data stopped from transmission is saved locally; S2. During the network interruption, the front-end device and gateway router continue to temporarily store data and record the progress of data upload; S3, the front-end device regularly detects the network status, and automatically triggers the data upload logic when it detects that the network is restored; S4. The front-end device reads the temporarily stored data from the local storage and sends the temporarily stored data to the gateway router through the API interface. The gateway router dynamically adjusts the transmission rate of the temporarily stored data according to the network status and forwards the temporarily stored data to the server. S5. After the temporarily stored data is successfully uploaded to the server, the front-end device and the gateway router automatically clear the temporarily stored data.

[0023] Regarding step S1, in this embodiment, after receiving the data submitted by the user, the front-end device first performs structured packaging processing on the data. The packaged data includes but is not limited to the following information fields: Business data entered by users, such as form information, can include text, numbers, uploaded file objects, etc. An identifier (ID) used to identify the ownership and uniqueness of the data, which can be in the form of a string, UUID, etc. Submission timestamp (Timestamp), used to record the specific time when data is generated or submitted; The data priority field (Priority) identifies the importance level of the data in the processing process; Optional source information or context parameters (such as device model, page source, etc.) are used to assist in determining data ownership and processing strategies.

[0024] Generally, after encapsulating the data, the front-end device first determines the current network connection status through preset logic. When the network connection is normal, the system can try to upload the encapsulated data to the server; but if it detects that the network is interrupted or the status is poor, the system automatically enters the "offline temporary storage" mode. As an option, the front-end device can use a local storage solution based on localStorage, sessionStorage or IndexedDB to write the data to be uploaded into the local cache space.

[0025] Specifically, in one possible implementation, the front-end device generates a corresponding local storage entry for each piece of data to be uploaded, and the storage key value includes the data unique identifier and its upload status mark. The upload status mark can be set to "to be uploaded", "uploading", "uploaded" and other states, which are used for subsequent upload logic judgment and breakpoint resume logic implementation. After data is encapsulated, it is stored in a serialized format. For example, JSON.stringify can be used for structure conversion to ensure the readability and integrity of the cached data.

[0026] In order to ensure the security and consistency of data during network disconnection, some embodiments can encrypt the local temporary data. Symmetric encryption algorithms (such as AES) can be used for encrypted storage, and the access rights of local data can be restricted through key management mechanisms. In some high-security application scenarios, asymmetric encryption can also be used to improve data tamper-proof capabilities.

[0027] In this embodiment, in order to ensure the data integrity in the subsequent data synchronization process, the front-end device will also calculate the corresponding data check value during the data temporary storage stage. A common practice is to use a hash algorithm, such as MD5 or SHA-256, to generate a corresponding hash value for each piece of data to be uploaded. . It can be specifically expressed as: ; in, Represents the hash value of the data, Indicates the selected hash function, such as SHA-256, Represents the original data to be uploaded (including form data, identifiers, timestamps, etc.).

[0028] The generated hash value will be stored locally together with the original data as a basis for subsequent server verification of data consistency.

[0029] In some embodiments, to prevent the browser from clearing the cache or the user from accidentally deleting local data, the system may store the cached data in a container with persistence support, such as IndexedDB or a hybrid local database, and may periodically perform storage validity checks and rewrites.

[0030] As a reinforcement measure, the front-end device can also be configured with a monitoring mechanism to dynamically manage the local cache space. For example, when it is detected that the number of cache entries or storage capacity reaches a preset threshold, the system can clear low-importance data according to priority, or issue a prompt requesting the user to maintain a network connection to complete data synchronization.

[0031] For step S2, in this embodiment, after the user submits the data, the front-end device has completed the preliminary data packaging and local temporary storage operations. In order to further deal with the data transmission interruption caused by network interruption, the system needs to establish a set of continuous cache and data progress recording mechanisms to support the subsequent data recovery transmission process. This mechanism not only requires the front-end device to have temporary storage capabilities, but also requires the gateway router to participate in data cache management during network interruption and record the upload status to provide a reliable upload baseline after the network is restored.

[0032] During the network interruption, the front-end device will continue to write the new data into the local cache area and store it in order based on the structure of data blocks or transaction units. The front-end device maintains a set of status indexes in the local storage structure, recording metadata such as the submission time, upload status mark, and current processing status of each piece of data. The status mark is used to quickly locate the starting position of data transmission when resuming transmission from a breakpoint.

[0033] Generally, in order to reduce the pressure on the front-end cache, the system can configure a local connection channel between the front-end device and the gateway router. As an option, the front-end device pushes the temporarily stored data to the gateway router regularly or on demand. The latter has higher local storage capacity and can serve as a transit cache node.

[0034] In a possible implementation, the gateway router also stores the received front-end data in batches and calculates the check value of each batch of data through a hash algorithm. The check value is used to verify the consistency of the data received by the subsequent server. The specific hash function form is as follows: ; in, Indicates The hash value of the data. Indicates the selected hash algorithm function, such as SHA-256, MD5, etc. Indicates The data content to be uploaded includes structured fields such as data body, timestamp, identifier, priority, etc.

[0035] In some embodiments, the gateway router can dynamically adjust the cache strategy in combination with the priority identification of the data. For example: High-priority data can be preferentially accessed in high-access frequency storage areas; Low-priority data can be automatically removed or marked as low upload priority when cache resources are insufficient; The system can set a cache upper limit. When the router's local cache occupancy reaches the preset threshold, the buffer cleanup strategy is triggered to free up space to ensure the ability to write critical data.

[0036] As a supplement, the system also introduces an upload progress tracking mechanism. The front-end device and the gateway router maintain upload status logs respectively. The log content can record the data identifier and its corresponding upload offset or status code in the form of key-value pairs. For example: UploadLog ; Among them, UploadLog is the status log structure of the upload progress. For the A unique identifier for a piece of data. Indicates the upload status of the corresponding data, such as offset value, breakpoint position, upload batch number, etc.

[0037] This information will serve as the key input parameter to trigger the upload logic after the network is restored, ensuring that data can continue to be uploaded at the original breakpoint, avoiding repeated transmission and improving network bandwidth utilization efficiency.

[0038] In some high-reliability scenarios, you can also enable the upload retry counter and failure log recording module to prevent repeated failed data from being retransmitted indefinitely. After reaching the maximum number of retries, the system can mark the data as "upload failure" and wait for manual intervention or system refresh strategy.

[0039] For step S3, in this embodiment, after the front-end device and the gateway router complete the temporary storage of data and the upload progress record, in order to realize the timely resumption of data transmission after the network is restored, the system needs to have an automatic detection and triggering mechanism for the network status. This mechanism requires that the front-end device can continuously perceive the changes in the network environment when the network is not connected, and automatically execute the upload process start operation as soon as the network is restored.

[0040] In this embodiment, the front-end device is provided with a network detection module for periodically determining the network connection status of the current device.

[0041] Generally, this module triggers the network connection status detection operation periodically through the timer component. As an option, the timing period can be set to 3 seconds, 5 seconds or other system default configuration time intervals. The specific frequency can be flexibly adjusted according to the performance of the front-end device and the real-time requirements of the business.

[0042] In a possible implementation, the front-end device sends a request packet (such as an HTTP GET request or a Ping packet) to a preset network detection target address to obtain a response. If a valid response data is received within a predetermined time, it is determined that the current network has been restored. On the contrary, if there is no response after multiple consecutive detection timeouts, the "network interruption" status mark is maintained. The judgment logic can be expressed in the following form: ; in, Indicates at a point in time The network status, the value is 1 means the network is available, 0 means the network is unavailable, Indicates the response status of the probe request. 1 indicates a valid response is received, and 0 indicates no response or timeout. Indicates the threshold of consecutive success times required for status confirmation, which can be 1 or more times.

[0043] Specifically, when the front-end device detects a preset number of successful responses in succession, the system considers the network to be restored. Immediately afterwards, the initialization process of the upload logic is triggered. At this time, the system retrieves the data records that have not yet been uploaded from the local cache and prepares to enter the data sending phase. After the network status is switched, the front-end device updates the local status mark, indicating that the current state is "uploadable", and sends a signal to the upload scheduling module.

[0044] In some embodiments, in order to prevent short-term jitter in the network status from being mistakenly judged as network recovery, the system can also set a de-jitter mechanism or a stability judgment mechanism, for example, requiring two or three consecutive detections to return valid responses before confirming that the network has been stably restored.

[0045] As an enhancement method, the network detection module can also combine the browser's native navigator.onLine attribute as an auxiliary judgment standard, and refer to the system-level network stack return value and the business request level response during the judgment process to improve the accuracy and robustness of the judgment.

[0046] During the implementation process, the network detection module can mount the initialization logic in the page lifecycle hook function. For example, in a front-end application built on the uni-app framework, the timer can be enabled in lifecycle events such as onLaunch or onShow, and the platform-specific network status monitoring API can be used to further supplement the real-time monitoring capability.

[0047] For step S4, in this embodiment, after the front-end device completes the detection of network status recovery and automatically triggers the upload logic, in order to achieve orderly transmission of cached data and data reception and processing on the server side, the present invention further proposes a data synchronization mechanism from the front-end to the gateway router and then to the server. This mechanism not only requires the front-end to be able to accurately extract the temporarily stored data, but also relies on the gateway router to have the ability to dynamically adjust the upload rate to adapt to the current network bandwidth status and server processing capacity, and avoid network congestion or system overload.

[0048] In this embodiment, after receiving the network recovery signal, the front-end device first reads all the data items to be uploaded in the local temporary storage area.

[0049] In general, data reading operations are performed in a sequential or batch extraction manner. The front end can sort the data according to the timestamp, priority field or upload status mark to control the upload order. After each piece of data is read, its unique identifier (ID), original content, timestamp, priority mark and corresponding check hash value are attached to form a standardized upload data structure.

[0050] As an option, the front-end device sends the above structured data to the gateway router through a predefined API interface via HTTP, WebSocket or MQTT. The interface transmission process can use POST or PUT, and carry additional information such as device identification and batch number through the request header for the gateway to parse.

[0051] In a possible implementation, after receiving the data packet sent by the front end, the gateway router first performs format analysis and basic verification.

[0052] Specifically, the gateway router first extracts the identifier and check field of the data, and compares the local cache table to see if there are duplicate upload items. If there are no duplicate items, it enters the cache processing flow.

[0053] After the data enters the router cache module, the system dynamically adjusts the data transmission rate based on the current network status (such as real-time bandwidth) and the current server load level. This adjustment process can be described by the following mathematical model: ; in, Indicates the currently allocable data transfer rate. is the current available bandwidth (in bit / s), is the number of concurrent connections on the front end. is the maximum allowed processing load of the server, The current processing load of the server. It is the unit data processing weight coefficient, which is used to describe the average load contribution of a single data processing to the server.

[0054] This rate adjustment strategy ensures that the transmission rate is maximized when the bandwidth is high and the server is idle, while limiting the upload frequency under low bandwidth or high load conditions to avoid system crashes or service unavailability.

[0055] In some embodiments, the router side can also be configured with a traffic control algorithm, such as a token bucket algorithm or a sliding window mechanism, to achieve refined rate control. In the specific implementation, the system generates a token that limits the upload rate in each time period, and the front-end data upload task needs to obtain enough tokens before initiating the next upload request, thereby achieving a stable and orderly data transmission strategy.

[0056] In addition, before forwarding data to the server, the gateway router can also re-check each batch of uploaded data, including re-calculating the hash value and comparing it with the checksum submitted by the front end. If the check is consistent, the data enters the forwarding queue and is ready to be sent to the server. Data can be sent using a secure connection protocol (such as HTTPS), and integrity check fields, data signature information, or timestamps can be attached to the request body for further verification on the server side.

[0057] For step S5, in this embodiment, the release of local cache space and the synchronous update of upload status are realized through system feedback confirmation signal, forming a complete data life cycle closed loop. Especially in business scenarios with high requirements for data security and data consistency, this step is of great significance for the effective management of system resources and the avoidance of data redundancy.

[0058] In this embodiment, after receiving and verifying the temporarily stored data, the server generates a confirmation signal and feeds it back to the upload source node. The confirmation signal may include a unique data identifier (such as a data ID or transaction number), a receiving status code, a timestamp information, and an optional hash check result field.

[0059] Generally, after receiving the confirmation signal, the front-end device and the gateway router will call their respective local cleaning modules to perform the cleaning operation of the corresponding data items. Specifically: The front-end device queries the local storage for the entry corresponding to the identifier in the confirmation signal. If the entry exists and its upload status has been updated to "upload successful" or "confirmation completed", the cache clearing instruction is executed to remove the data record from the local storage.

[0060] The gateway router also maintains the upload queue and its status mapping table in the local cache area. When the confirmation signal is returned, the system matches the identifier through the index, updates the corresponding item status to "confirmed", and releases the storage block it occupies.

[0061] As an option, the local upload log (UploadLog) will be updated during the system cleanup process. The log entry structure is as follows: ; in, For the Status log entries for data upload progress, For the A unique identifier for a piece of data. is the initial upload time of the data. Return confirmation time for the server, Marks the upload status, such as "Uploaded", "Waiting for Confirmation", "Cleared", etc.

[0062] This log record is not only used for subsequent tracing and debugging, but also can be used for error checking and transaction rollback judgment in large-scale data upload.

[0063] In one possible implementation, to improve the security of the cleaning process, the front-end device and the router will recalculate the hash value of the local data before executing the data deletion. and the confirmation hash value returned by the server The system performs the cleanup operation only when the following conditions are met: ; in, Indicates the hash check value of the locally stored data. Indicates the server-side verification hash value of the same data.

[0064] If the above conditions are not met, the system will terminate the cleaning process and mark the data item as "hash inconsistent", entering the manual intervention or retransmission retry mechanism.

[0065] In some embodiments, the system can also set an active cleanup strategy based on the utilization rate of local storage resources. When the cache occupancy reaches a preset ratio, the system can batch request the server to confirm the data status and uniformly execute cleanup instructions for the confirmed items, thereby improving the overall upload efficiency and freeing up valuable storage space.

[0066] In addition, some implementations support linking the cleanup operation with the front-end UI prompt module. When the data is successfully uploaded and cleaned up, the system will display a prompt message to the user saying "Upload successful, cache cleared" to enhance the user's confidence in data security and the transparency of system interaction.

[0067] The cache processing device of a gateway router described below and the cache processing method of a gateway router described above can be referred to each other.

[0068] Please see attached Figure 2 The present invention also provides a cache processing device for a gateway router, comprising: The front-end device is used to temporarily store the data in local storage after the user submits the data, and stop the data transmission when the network is disconnected; in general, after the user triggers the data submission event, this module stores the data in a structured manner in the local cache area, and configures a unique identification, timestamp, priority and status mark field for each data. As an option, the front-end device is also equipped with a network monitoring module, which immediately stops the upload action when a network disconnection event is detected, and records the breakpoint position to prepare for subsequent transmission.

[0069] The gateway router is used to receive the temporarily stored data sent by the front-end device, dynamically adjust the data transmission rate according to the network status, and forward the data to the server; specifically, it adjusts the data forwarding rate in real time by analyzing the current network bandwidth, the number of front-end connections and the server feedback delay to avoid network congestion or data packet loss due to overload. In some embodiments, the module also integrates a data preprocessing function to perform basic verification and compression encoding on the front-end uploaded data to improve transmission efficiency.

[0070] The server is used to receive data forwarded by the gateway router and verify the data integrity through the hash algorithm. Specifically, the system executes a hash function (such as SHA-256) on each received data and compares it with the original hash value attached to the data packet. If they are consistent, the data status is updated to "upload successful"; otherwise, the data is marked as "pending retransmission".

[0071] The data cleaning module is used to automatically clean up the temporary data in the front-end device and gateway router after the data is successfully uploaded; in a possible implementation, the module performs a second confirmation of the hash value and unique identifier of the uploaded data based on a two-way verification mechanism to ensure that the cleaning operation is only performed on the data that is actually successfully uploaded. In some implementations, the cleaning action can also link the upload log system and the local storage release mechanism to achieve fully automatic cache maintenance and system resource recovery.

[0072] The device of this embodiment can be used to execute the above method embodiment, and its principles and technical effects are similar, which will not be repeated here.

[0073] The network device described below and the cache processing method of the gateway router described above can be referred to each other.

[0074] Please see attached Figure 3 The present invention also provides a network device, comprising: a processor and a memory communicatively connected to the processor, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, a cache processing method of a gateway router can be implemented.

[0075] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A cache processing method for a gateway router, characterized in that: The following steps are involved: After the user submits the data, the front-end device temporarily stores the data in local storage and stops data transmission when a network interruption is detected, ensuring that the data that stops transmission is saved locally; During network interruption, the front-end device and gateway router continue to temporarily store data and record the progress of data upload; The front-end device periodically detects the network status, and automatically triggers the data upload logic when it detects that the network is restored; The front-end device reads the temporary data from the local storage and sends the temporary data to the gateway router through the API interface. The gateway router dynamically adjusts the transmission rate of the temporary data according to the network status and forwards the temporary data to the server; After the temporarily stored data is successfully uploaded to the server, the front-end device and gateway router automatically clear the temporarily stored data.

2. A cache processing method for a gateway router according to claim 1, characterized in that: The content of the user submitted data includes: The form data entered by the user includes text, numbers, or files; Unique identifier of the data, used to distinguish data from different users or batches; The timestamp of the data, which is used to record the submission time of the data; The data priority is used to indicate the importance of the data and the order in which it is processed.

3. A cache processing method for a gateway router according to claim 1, characterized in that: The steps of the front-end device and the gateway router continuously storing data temporarily include: The gateway router dynamically allocates storage resources based on the importance of the data and the network status; The gateway router uses a hash algorithm to check the integrity of the temporarily stored data and records the verification results.

4. The cache processing method of a gateway router according to claim 1, characterized in that: The step of the front-end device regularly detecting the network status comprises: The front-end device detects the network connection status at preset time intervals through a timer; When the network is detected to be restored, the front-end device continues to upload the unfinished data from the breakpoint according to the recorded data upload progress.

5. The cache processing method of a gateway router according to claim 1, characterized in that: The step of dynamically adjusting the transmission rate of temporarily stored data according to the network status of the gateway router comprises: The gateway router calculates the optimal transmission rate based on the network bandwidth and server load; The gateway router dynamically adjusts the data transmission rate through the flow control algorithm to ensure efficient data upload.

6. The cache processing method of a gateway router according to claim 1, characterized in that: After receiving the temporarily stored data, the server verifies the data integrity through a hash algorithm, and the hash algorithm satisfies the following formula: ; in, is the hash value, is a hash function, For the received data.

7. A cache processing method for a gateway router according to claim 1, characterized in that: The steps of automatically cleaning up temporarily stored data by the front-end device and the gateway router include: The front-end device and the gateway router delete the successfully uploaded temporary data according to the confirmation signal from the server; The front-end device and gateway router release storage resources and update the data upload status.

8. The cache processing method of a gateway router according to claim 1, characterized in that: When the network is interrupted, the front-end device displays an offline prompt message to the user, prompting that the data has been temporarily stored. After the data is successfully uploaded, the front-end device displays an upload success prompt message to the user.

9. A cache processing device for a gateway router, applied to a cache processing method for a gateway router according to any one of claims 1 to 8, characterized in that: include: Front-end equipment, used to temporarily store data in local storage after the user submits the data, and to stop data transmission when a network interruption is detected; The gateway router is used to receive the temporary data sent by the front-end device, dynamically adjust the data transmission rate according to the network status, and forward the data to the server; The server is used to receive data forwarded by the gateway router and verify the data integrity through the hash algorithm; The data cleaning module is used to automatically clean up the temporary data in the front-end device and gateway router after the data is successfully uploaded.

10. A network device, characterized in that: The invention comprises a processor and a memory which is communicatively connected to the processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, a cache processing method for a gateway router according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Secure file transmission management method and system

    CN109428899A

  • Remote upgrading method and device, electronic equipment and storage medium

    CN111813424A

  • Data sharing method and data sharing system

    CN115776491A

  • Breakpoint cache processing method and system of preposed data gateway

    CN117041349A

  • Online music playing method and system based on automatic caching mechanism

    CN119396783A

Cited By

  • Data caching and transmission method based on TCP / IP (Transmission Control Protocol / Internet Protocol)

    CN120980049A