A gateway distributed cache transmission system and method
Through the gateway distributed cache transmission system, the optimal gateway device is selected to handle the data upload and cache of gateway devices, which solves the problem of data being unable to be uploaded in large gateway environments, ensuring data integrity and efficient utilization of cache space.
Patent Information
- Application Number
- CN202510827700.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-06-20
AI Technical Summary
In a large gateway environment, poor network signal causes data to be unable to be uploaded to the server, occupying the device cache space and destroying data integrity.
The gateway distributed cache transmission system is adopted, and the optimal gateway device is selected in the off-network state through the search module, and the non-alarm data is cached. The alarm data is uploaded to the server of the optimal gateway device through a temporary process, and the cache space utilization is optimized before the network recovery.
It realizes efficiently uploading alarm data and maximizing cache space utilization in case of poor network signals, ensuring data integrity and reliability.
Smart Images

Figure CN120358281B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things, and in particular relates to a gateway distributed cache transmission system and method. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Gateways collect terminal data and upload it to the server platform, which analyzes the data. In large-scale gateway collection environments (e.g., dozens, hundreds, or even thousands of gateways), remote locations with few base stations or signal interference may prevent the gateways from properly connecting to the server, ultimately preventing data from being uploaded to the server platform.
[0004] When terminal data collected by the gateway cannot be uploaded to the server platform due to poor network signal, the gateway will cache the data in its own device to ensure data integrity. However, as the caching time increases, a large amount of cached data will appear, which will occupy the cache space reserved by the gateway device itself. To solve this problem, the existing technology generally uses a circular caching method to eliminate old cached data and save new cached data. This compromises data integrity and is not suitable for scenarios requiring complete data analysis. Summary of the Invention
[0005] In order to solve the technical problems existing in the above background technology, the present invention provides a gateway distributed cache transmission system and method, which can reasonably utilize the cache space of all gateway devices on site, cache all data as much as possible, and ensure data integrity.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A first aspect of the present invention provides a gateway distributed cache transmission system.
[0008] A gateway distributed cache transmission system includes: a plurality of distributed gateway devices of the same type that communicate with a server; each gateway device includes a collection module, a data cache module, a wireless transmission module, and a search module; each gateway device collects terminal device data through its own collection module and uploads it to the server through the wireless transmission module;
[0009] When any gateway device is in a normal data collection state and is disconnected from the network, the gateway device is recorded as gateway device A; if the terminal device data collected by gateway device A is non-alarm data, gateway device A is used to: cache the collected non-alarm data in its own data cache module;
[0010] If the terminal device data collected by gateway device A is alarm data, gateway device A is used to: search other gateway devices through the search module and determine the optimal gateway device, and after the optimal gateway device allows the response, send the alarm data to the optimal gateway device through the search module, and the optimal gateway device sends the alarm data to the server of gateway device A through a temporary process.
[0011] As an implementation mode, in the gateway device A, the optimal gateway device is determined based on parameters such as the current network signal strength, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within a set time.
[0012] As an implementation manner, in the gateway device A, the process of determining the optimal gateway device is:
[0013] For each gateway device searched by gateway device A, the value corresponding to each gateway device is calculated according to the preset screening principle formula, and the gateway device corresponding to the largest value is the optimal gateway device;
[0014] The screening principle formula is: ;
[0015] in, The maximum value of the alarm data upload frequency coefficient of all gateway devices searched by gateway device A. is the minimum value of the alarm data upload frequency coefficient of all gateway devices searched by gateway device A, and s is the alarm data upload frequency coefficient of the currently calculated gateway device; The maximum network signal strength of all devices searched by gateway device A. is the minimum network signal strength of all gateway devices searched by device A, and i is the network signal strength of the currently calculated gateway device; The maximum disconnection rate of all gateway devices searched by gateway device A. is the minimum disconnection rate of all gateway devices searched by gateway device A, and k is the currently calculated disconnection rate of the gateway device; 、 and are all constant coefficients.
[0016] As an implementation method, the optimal gateway device is used to: after the temporary process sends the alarm data of gateway device A, keep the temporary process connection alive for a set time period; if new alarm data from gateway device A is received within the preset time period, upload the new alarm data to the server of gateway device A and reset the time period; if no new alarm data from gateway device A is received within the set time period, the optimal gateway device disconnects from the server of gateway device A and closes the temporary process.
[0017] As an implementation method, when the network of gateway device A has not recovered within a set time period and the remaining cache space of its own data cache module reaches a first preset threshold, gateway device A is used to: search for other gateway devices through the search module, and determine the optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate of the searched gateway devices, and upload the data in gateway device A's own data cache module to the optimal gateway device.
[0018] As an embodiment, in the gateway device A, the process of determining the optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space usage rate of the searched gateway devices is as follows:
[0019] According to the formula , calculate the value corresponding to each gateway device searched;
[0020] The gateway device corresponding to the one with the largest value is selected as the optimal gateway device;
[0021] in, The maximum current cache space usage of all gateway devices searched by gateway device A. is the minimum current cache space usage of all gateway devices searched by device A, and p is the current cache space usage of the currently calculated gateway device; The maximum growth rate of the cache space of all gateway devices searched by gateway device A. is the minimum cache space growth rate of all gateway devices searched by gateway device A, and g is the currently calculated cache space growth rate of the gateway device; and are all constant coefficients.
[0022] As an implementation method, when the network of gateway device A has not recovered within a set time period and the remaining cache space of its own data cache module reaches a first preset threshold, and the remaining cache space of the determined optimal gateway device is less than a second preset threshold, gateway device A is used to: re-search other gateway devices through the search module, and re-determine the optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate of the searched gateway devices, and upload the data in the data cache module of gateway device A itself to the re-determined optimal gateway device.
[0023] In one embodiment, when the remaining cache space of all gateway devices that gateway device A can search for does not meet the set requirements, gateway device A is configured to: sort all the gateway devices it has searched for according to performance, select the gateway device with the best performance as the delegate of gateway device A, search, and determine the optimal gateway device corresponding to the delegate; wherein the performance of the gateway device is determined based on parameters such as the cache space growth rate per unit time and the current cache space usage rate;
[0024] If the gateway device delegated by gateway device A searches for the corresponding optimal gateway device, the delegated gateway device notifies gateway device A to send the subsequent cached data to the delegated gateway device, which then forwards the data to the corresponding optimal gateway device for storage.
[0025] If all the gateway devices searched by the gateway device delegated by gateway device A are unavailable, the delegated gateway device notifies gateway device A, and gateway device A re-delegates the corresponding gateway device to continue searching according to the performance order of all the gateway devices it has searched.
[0026] As an implementation method, when gateway device A recovers the network, gateway device A first uploads its own data to the server, and then retrieves the stored data from other devices according to the storage path in the order of data storage time, and uploads it to the server;
[0027] When gateway device A cannot restore the network and all gateway devices in the current area cannot continue to store data, the terminal device data stored in gateway device A will be uploaded to the server of gateway device A through a temporary process. At the same time, gateway device A clears the recorded storage time and storage path allowed by the gateway device.
[0028] A second aspect of the present invention provides a gateway distributed cache transmission method.
[0029] A gateway distributed cache transmission method, based on the above-mentioned gateway distributed cache transmission system, comprises:
[0030] Determine whether the network of the gateway device that is working properly for data collection is disconnected. If so, the gateway device is recorded as gateway device A;
[0031] If the terminal device data collected by the gateway device A is non-alarm data, the gateway device A caches the terminal device data it collects into its own data cache module;
[0032] If the terminal device data collected by gateway device A is alarm data, gateway device A searches for other gateway devices through the search module, and determines the optimal gateway device based on the current network signal strength of each gateway device searched by gateway device A, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within the set time. After the optimal gateway device allows the response, the alarm data is sent to the optimal gateway device through the search module, and the optimal gateway device sends the alarm data to the server of gateway device A through a temporary process.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] (1) The present invention aims at the situation where the network signal is disconnected in a large-scale gateway collection environment, and judges the type of the terminal device data collected. When the terminal device data collected by the gateway device is non-alarm data, the collected terminal device data is cached in its own data cache module; when the terminal device data collected by the gateway device is alarm data, other gateway devices are searched, and the optimal gateway device is determined based on parameters such as the current network signal strength, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within a set time. Then, the optimal gateway device sends the alarm data to the server of the gateway device through a temporary process, thereby achieving the effect of uploading higher priority alarm data to the server as quickly as possible by utilizing on-site resources.
[0035] (2) In the present invention, if the network of the gateway device is not restored within a set time period and the remaining cache space of its own data cache module reaches a first preset threshold, the gateway device searches for other gateway devices through the search module, and performs a terminal device data transfer operation or continues to search for other gateway devices based on the remaining cache space of the searched gateway device, thereby utilizing on-site resources to store as much cache data as possible, and uploading all data to the server when the device cannot restore the network, thereby ensuring the integrity of the data.
[0036] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0038] Figure 1 This is a schematic diagram of the structure of a gateway distributed cache transmission system according to an embodiment of the invention;
[0039] Figure 2 It is a schematic diagram of the structure of a gateway device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0041] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0042] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0043] Figure 1 A gateway distributed cache transmission system according to an embodiment of the present invention is provided, comprising: a plurality of distributed gateway devices of the same type communicating with a server; each gateway device comprises a collection module, a data cache module, a wireless transmission module and a search module, such as Figure 2 As shown; each gateway device collects terminal device data through its own acquisition module and uploads it to the server through the wireless transmission module.
[0044] In this embodiment, the acquisition module can be formed by using existing sensor elements and their peripheral circuits, which will not be described in detail here;
[0045] The data cache module of this embodiment can be composed of a cache memory, such as a ROM or other device;
[0046] The wireless transmission module of this embodiment corresponds to a specific wireless network. For example, when the wireless network is 4G, the wireless transmission module is a 4G network transmission module.
[0047] The search module of this embodiment includes but is not limited to Wifi / Lora and other methods, and can be configured according to the needs of those skilled in the art.
[0048] exist Figure 1In the figure, gateway devices B, C, D, E, F, G, H, and I are all gateway devices of the same type as gateway device A. Gateway device A can search for gateway devices B, C, H, and I through the search module; gateway device B can search for gateway devices E and F through the search module; gateway device C can search for gateway devices D and G through the search module; gateway device D can search for gateway devices C and G through the search module; gateway device E can search for gateway devices B and F through the search module; gateway device F can search for gateway devices B and E through the search module; gateway device G can search for gateway devices C and D through the search module; gateway device H can search for gateway device A through the search module; and gateway device I can search for gateway device A through the search module.
[0049] For example, gateway devices A, B, C, D, E, F, G, H, and I can all collect data normally and upload data to the server via a wireless network (such as 4G). Gateway device A can search for gateway devices B, C, H, and I through the Wifi / Lora search module, and gateway device B can search for gateway devices E and F through the Wifi / Lora search module. Each gateway device can search for other gateway devices near itself.
[0050] When any gateway device is in a normal data collection state and is disconnected from the network, the gateway device is recorded as gateway device A; if the terminal device data collected by gateway device A is non-alarm data, gateway device A is used to cache the collected non-alarm data in its own data cache module;
[0051] If the terminal device data collected by gateway device A is alarm data, gateway device A searches for other gateway devices through the search module, and determines the optimal gateway device based on the current network signal strength of each gateway device searched by gateway device A, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within the set time. After the optimal gateway device allows the response, the alarm data is sent to the optimal gateway device through the search module, and the optimal gateway device sends the alarm data to the server of gateway device A through a temporary process.
[0052] If the terminal device data collected by gateway device A is alarm data, the process of determining the optimal gateway device is as follows based on the current network signal strength, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within the set time:
[0053] For each gateway device searched by gateway device A, the value corresponding to each gateway device is calculated according to the preset screening principle formula, and the gateway device corresponding to the largest value is the optimal gateway device;
[0054] The screening principle formula is: ;
[0055] in, The maximum value of the alarm data upload frequency coefficient of all gateway devices searched by gateway device A. is the minimum value of the alarm data upload frequency coefficient of all gateway devices searched by gateway device A, and s is the alarm data upload frequency coefficient of the currently calculated gateway device; The maximum network signal strength of all devices searched by gateway device A. is the minimum network signal strength of all gateway devices searched by device A, and i is the network signal strength of the currently calculated gateway device; The maximum disconnection rate of all gateway devices searched by gateway device A. is the minimum disconnection rate of all gateway devices searched by gateway device A, and k is the currently calculated disconnection rate of the gateway device; 、 and are all constant coefficients, for example, is 0.2, is 0.3, is 0.5; 、 and The specific values of these three can be adjusted according to actual conditions and experience.
[0056] This embodiment determines the optimal gateway device through parameters such as the current network signal strength, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within a set time, which can avoid the loss of alarm data during transmission and ensure the integrity of the data.
[0057] Assume that the terminal device data collected by gateway device A is alarm data, and gateway device B is determined to be the optimal gateway device. Gateway device A then delegates gateway device B to initiate a temporary process to connect to gateway device A's server and upload the alarm data to gateway device A's server. After receiving gateway device A's delegation, gateway device B initiates a temporary process to connect to gateway device A's server and sends a permission response to gateway device A. After receiving the permission response from gateway device B, gateway device A sends the alarm data to gateway device B through the search module. After receiving the data, gateway device B sends the alarm data to gateway device A's server through a temporary process.
[0058] Among them, after the temporary process sends the alarm data of gateway device A, the optimal gateway device keeps the temporary process connection alive for a set time period (such as 10s). If new alarm data from gateway device A is received within the preset time period (such as 10s), the new alarm data is uploaded to the server of gateway device A and the set time period (such as 10s) is reset; if no new alarm data from gateway device A is received within the set time period (such as 10s), the optimal gateway device disconnects from the server of gateway device A and closes the temporary process.
[0059] When the network of gateway device A has not recovered within a set time period and the remaining cache space of its own data cache module reaches a first preset threshold (such as 90%), gateway device A is used to search for other gateway devices through the search module, and determine the optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate of the searched gateway devices, and upload the data in gateway device A's own data cache module to the optimal gateway device.
[0060] Specifically, the process of determining the optimal gateway device based on the parameters of the cache space growth rate per unit time and the current cache space usage rate of the searched gateway devices is as follows:
[0061] According to the formula , calculate the value corresponding to each gateway device searched;
[0062] The gateway device corresponding to the one with the largest value is selected as the optimal gateway device;
[0063] in, The maximum current cache space usage of all gateway devices searched by gateway device A. is the minimum current cache space usage of all gateway devices searched by device A, and p is the current cache space usage of the currently calculated gateway device; The maximum growth rate of the cache space of all gateway devices searched by gateway device A. is the minimum cache space growth rate of all gateway devices searched by gateway device A, and g is the currently calculated cache space growth rate of the gateway device; and are all constant coefficients. For example, and 0.6 and 0.4 respectively; and The specific value of can be adjusted according to actual conditions and experience. When the network of gateway device A has not been restored within a set time period and the remaining cache space of its own data cache module has reached a first preset threshold value (such as 90%), the parameters of the cache space growth rate per unit time and the current cache space utilization rate of the gateway device of this embodiment are used to determine the optimal gateway device, which can make full use of existing resources and achieve the effect of storing as much cache data as possible. When the network of gateway device A has not been restored within a set time period and the remaining cache space of its own data cache module has reached a first preset threshold value (such as 90%), and the remaining cache space of the determined optimal gateway device is less than a second preset threshold value (such as 30%), gateway device A is used to re-search other gateway devices through the search module, and re-determine the optimal gateway device based on the parameters of the cache space growth rate per unit time and the current cache space utilization rate of the searched gateway devices, and upload the data in the data cache module of gateway device A itself to the re-determined optimal gateway device.
[0064] For example, suppose the performance ranking of gateway devices is determined based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate, with gateway device B > gateway device C > gateway device H > gateway device I. When gateway device B is the optimal gateway device, gateway device A sends a request to gateway device B to temporarily store gateway device A's cached data. After receiving a response from gateway device B allowing it, gateway device A records the storage time and storage path currently allowed by the device. Gateway device A then begins sending subsequently collected normal data to gateway device B for storage. When the space in gateway device B's data cache module reaches 70% (or other capacity), gateway device B notifies gateway device A that it can no longer store data, and gateway device A searches again for other available nearby gateway devices.
[0065] The optimal gateway device is determined based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate. If the optimal gateway device is determined to be gateway device C, after gateway device A receives a response from gateway device C permitting storage, gateway device A records the storage time and storage path currently allowed by the gateway device and begins sending subsequent cached data to gateway device C. Similarly, when gateway device C is unable to continue storing data, gateway device A will inquire with devices H and gateway device I whether storage is possible. If so, the optimal gateway device is determined based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate, and then storage is performed.
[0066] When the remaining cache space of all gateway devices that gateway device A can search for does not meet the set requirements, all gateway devices found by gateway device A are sorted according to performance, and the gateway device with the best performance is selected as the delegate object of gateway device A to search and determine the optimal gateway device corresponding to the delegate object; the performance of the gateway device is determined based on parameters such as the cache space growth rate per unit time and the current cache space usage rate;
[0067] If the gateway device delegated by gateway device A searches for the corresponding optimal gateway device, the delegated gateway device notifies gateway device A to send subsequent cached data to the delegated gateway device, which then forwards the data to the corresponding optimal gateway device for storage.
[0068] For example, if gateway device B searches for available gateway devices E and F nearby, and the optimal gateway device determined by parameters such as the cache space growth rate per unit time and the current cache space usage rate is gateway device E, gateway device B will notify gateway device A to send subsequent cached data to gateway device B, and then gateway device B will forward it to gateway device E for storage. Gateway device A records the storage time and storage path allowed by the current device. If the space of the data cache module of gateway device E is stored to 70% (or other), gateway device E notifies gateway device B that it cannot continue to store data, and gateway device B notifies gateway device A that gateway device E cannot continue to store data. Gateway device B then searches for other available devices nearby again. When gateway device B searches for other available gateway devices, it will re-determine the corresponding optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space usage rate, and notify gateway device A that it can continue to transfer data to the corresponding optimal gateway device.
[0069] If all the gateway devices searched by the gateway device delegated by gateway device A are unavailable, the delegated gateway device notifies gateway device A, and gateway device A re-delegates the corresponding gateway device to continue searching according to the performance order of all the gateway devices it has searched.
[0070] For example, if gateway device B finds no available devices nearby, it notifies gateway device A. Gateway device A then delegates to gateway device C, which it found, to search for available devices nearby. If so, it determines the optimal gateway based on parameters such as the cache space growth rate per unit time and the current cache space usage rate. If all nearby gateway devices have been delegated, gateway device A delegates to gateway device B, which in turn delegates to gateway device E to search for available gateway devices nearby. This process repeats itself.
[0071] When gateway device A recovers the network, it will first upload its own data to the server, and then retrieve the stored data from other devices according to the storage path and the time of data storage, and upload it to the server.
[0072] When gateway device A is unable to restore the network and all gateway devices in the current area are unable to store data, a temporary process is used to upload the terminal device data stored on gateway device A to gateway device A's server. At the same time, gateway device A clears the recorded allowed storage time and storage path for gateway devices. For example, when gateway device A is unable to restore the network and all devices in the current area are unable to store data, gateway device A notifies gateway devices B and C to initiate a temporary process to connect to gateway device A's server. This process uploads gateway device A's cached data to gateway device A's server, and gateway device A clears the recorded allowed storage time and storage path for gateway devices. Gateway device A then instructs gateway device B to notify gateway devices E and F to initiate a temporary process to connect to gateway device A's server and upload gateway device A's cached data to gateway device A's server. After gateway device B uploads all of gateway device A's cached data to gateway device A's server, gateway device A sends its own cached data to gateway device B, which is then uploaded to gateway device A's server by gateway device B's temporary process. When the gateway device opens a temporary process to upload the data of gateway device A to the server of gateway device A, it closes the temporary process. This process repeats until all the cached data of gateway device A is uploaded to the server of gateway device A.
[0073] In one or more embodiments, a gateway distributed cache transmission method is further provided, which is based on the above-mentioned gateway distributed cache transmission system and includes:
[0074] Determine whether the network of the gateway device that is working properly for data collection is disconnected. If so, the gateway device is recorded as gateway device A;
[0075] If the terminal device data collected by the gateway device A is non-alarm data, the gateway device A caches the terminal device data it collects into its own data cache module;
[0076] If the terminal device data collected by gateway device A is alarm data, gateway device A searches for other gateway devices through the search module, and determines the optimal gateway device based on the current network signal strength of each gateway device searched by gateway device A, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within the set time. After the optimal gateway device allows the response, the alarm data is sent to the optimal gateway device through the search module, and the optimal gateway device sends the alarm data to the server of gateway device A through a temporary process.
[0077] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A gateway distributed cache transmission system, characterized in that: include: Several distributed gateway devices of the same type that communicate with the server; each gateway device includes a collection module, a data cache module, a wireless transmission module, and a search module; each gateway device collects terminal device data through its own collection module and uploads it to the server through the wireless transmission module; When any gateway device is in a normal data collection state and is disconnected from the network, the gateway device is recorded as gateway device A; If the terminal device data collected by the gateway device A is non-alarm data, the gateway device A is used to: cache the collected non-alarm data into its own data cache module; If the terminal device data collected by gateway device A is alarm data, gateway device A is configured to: search other gateway devices through a search module and determine the optimal gateway device; after the optimal gateway device allows a response, send the alarm data to the optimal gateway device through the search module; the optimal gateway device sends the alarm data to the server of gateway device A through a temporary process; In the gateway device A, the optimal gateway device is determined based on the current network signal strength, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within a set time; When the network of gateway device A has not recovered within a set time period and the remaining cache space of its own data cache module reaches a first preset threshold, gateway device A is used to: search for other gateway devices through the search module, and determine the optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate of the searched gateway devices, and upload the data in gateway device A's own data cache module to the optimal gateway device.
2. The gateway distributed cache transmission system according to claim 1, wherein: In the gateway device A, the process of determining the optimal gateway device is as follows: For each gateway device searched by gateway device A, the value corresponding to each gateway device is calculated according to the preset screening principle formula, and the gateway device corresponding to the largest value is the optimal gateway device; The screening principle formula is: ; in, The maximum value of the alarm data upload frequency coefficient of all gateway devices searched by gateway device A. is the minimum value of the alarm data upload frequency coefficient of all gateway devices searched by gateway device A, and s is the alarm data upload frequency coefficient of the currently calculated gateway device; The maximum network signal strength of all devices searched by gateway device A. is the minimum network signal strength of all gateway devices searched by device A, and i is the network signal strength of the currently calculated gateway device; The maximum disconnection rate of all gateway devices searched by gateway device A. is the minimum disconnection rate of all gateway devices searched by gateway device A, and k is the currently calculated disconnection rate of the gateway device; 、 and are all constant coefficients.
3. The gateway distributed cache transmission system according to claim 1, wherein: The optimal gateway device is used to: keep the temporary process connection alive for a set time period after the temporary process sends the alarm data of gateway device A. If new alarm data from gateway device A is received within the preset time period, the new alarm data will be uploaded to the server of gateway device A and the time period will be reset; if no new alarm data from gateway device A is received within the set time period, the optimal gateway device will disconnect from the server of gateway device A and close the temporary process.
4. The gateway distributed cache transmission system according to claim 1, wherein: In the gateway device A, the process of determining the optimal gateway device based on the parameters of the cache space growth rate per unit time and the current cache space usage rate of the searched gateway devices is as follows: According to the formula , calculate the value corresponding to each gateway device searched; The gateway device corresponding to the one with the largest value is selected as the optimal gateway device; in, The maximum current cache space usage of all gateway devices searched by gateway device A. is the minimum current cache space usage of all gateway devices searched by device A, and p is the current cache space usage of the currently calculated gateway device; The maximum growth rate of the cache space of all gateway devices searched by gateway device A. is the minimum cache space growth rate of all gateway devices searched by gateway device A, and g is the currently calculated cache space growth rate of the gateway device; and are all constant coefficients.
5. The gateway distributed cache transmission system according to claim 1, wherein: When the network of gateway device A has not recovered within a set time period and the remaining cache space of its own data cache module reaches a first preset threshold, and the remaining cache space of the determined optimal gateway device is less than a second preset threshold, gateway device A is used to: re-search other gateway devices through the search module, and re-determine the optimal gateway device based on parameters such as the cache space growth rate per unit time and the current cache space utilization rate of the searched gateway devices, and upload the data in the data cache module of gateway device A itself to the re-determined optimal gateway device.
6. The gateway distributed cache transmission system according to claim 1, wherein: When the remaining cache space of all the gateway devices that gateway device A can search for does not meet the set requirements, gateway device A is configured to: sort all the gateway devices it has searched for according to performance, select the gateway device with the best performance as the delegate object of gateway device A, search, and determine the optimal gateway device corresponding to the delegate object; wherein the performance of the gateway device is determined based on parameters such as the cache space growth rate per unit time and the current cache space usage rate; If the gateway device delegated by gateway device A searches for the corresponding optimal gateway device, the delegated gateway device notifies gateway device A to send the subsequent cached data to the delegated gateway device, which then forwards the data to the corresponding optimal gateway device for storage. If all the gateway devices searched by the gateway device delegated by gateway device A are unavailable, the delegated gateway device notifies gateway device A, and gateway device A re-delegates the corresponding gateway device to continue searching according to the performance order of all the gateway devices it has searched.
7. The gateway distributed cache transmission system according to claim 1, wherein: When gateway device A recovers from network failure, it will first upload its own data to the server, then retrieve the stored data from other devices according to the storage path and storage time, and upload it to the server. When gateway device A cannot restore the network and all gateway devices in the current area cannot continue to store data, the terminal device data stored in gateway device A will be uploaded to the server of gateway device A through a temporary process. At the same time, gateway device A clears the recorded storage time and storage path allowed by the gateway device.
8. A gateway distributed cache transmission method, characterized in that: A gateway distributed cache transmission system according to any one of claims 1 to 7, comprising: Determine whether the network of the gateway device that is working properly for data collection is disconnected. If so, the gateway device is recorded as gateway device A; If the terminal device data collected by the gateway device A is non-alarm data, the gateway device A caches the terminal device data it collects into its own data cache module; If the terminal device data collected by gateway device A is alarm data, gateway device A searches for other gateway devices through the search module, and determines the optimal gateway device based on the current network signal strength of each gateway device searched by gateway device A, the alarm data upload frequency coefficient per unit time, and the network disconnection rate within the set time. After the optimal gateway device allows the response, the alarm data is sent to the optimal gateway device through the search module, and the optimal gateway device sends the alarm data to the server of gateway device A through a temporary process.
Citation Information
Patent Citations
Data processing method and device and storage medium
CN110535965A
Data acquisition system and method, electronic equipment and storage medium
CN113190583A