Gateway storage management method and device, electronic device, and storage medium

By obtaining device data storage requirements in the gateway, determining the target database and adjusting data point configuration, the gateway storage pressure and duplicate data problems are solved, and efficient data management and storage efficiency are achieved.

CN117950591BActive Publication Date: 2024-10-29BEIJING MICRO CONTROL IND GATEWAY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410070233.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2024-10-29
Estimated Expiration
2044-01-18

AI Technical Summary

Technical Problem

In the industrial Internet architecture, the local database storage space of the gateway is limited, resulting in high storage pressure, and the data uploaded to the cloud may contain duplicate and useless data, affecting storage efficiency.

Method used

In the maintenance mode of the gateway, obtain the data storage requirements of the device, determine the target database, conduct connectivity tests, and adjust the data point configuration according to the data storage strategy, including data type and storage mechanism, to achieve intelligent storage management of data.

Benefits of technology

Effectively manage gateway data storage to avoid duplicate data, improve storage efficiency, and ensure data security and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117950591B_ABST
    Figure CN117950591B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a storage management method, device, equipment and storage medium for a gateway. The method includes: in the maintenance mode of the gateway, obtaining the data storage requirements corresponding to the equipment in the gateway; determining the target database corresponding to the equipment based on the data storage requirements, and performing a connectivity test on the target database; if the target database is in a connected state, obtaining a data storage strategy that matches the target database; adjusting the data point configuration corresponding to the target database based on the data storage strategy, the data point being the time node for collecting data in the device and / or the trigger node for the trigger event. The embodiments of the present application can achieve effective management of the storage of data in the database, and ensure the intelligence of the data storage generated in the gateway, and effectively manage the data storage in the gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a gateway storage management method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of industrial technology, the application of industrial Internet technology is becoming more and more extensive. The industrial Internet architecture is usually composed of industrial equipment, gateways, edge computing devices and cloud platforms. The gateway is used to collect on-site data of industrial equipment and receive feedback information from edge computing devices, so a large amount of data will be generated. This data is usually stored in the local database of the gateway or uploaded to the cloud. The data storage of the gateway is not managed. Due to the small storage space of the local database, it is easy to cause greater storage pressure on the local database. Uploading to the cloud may cause a large amount of duplicate and useless data to occupy cloud storage resources, thereby affecting storage efficiency. Summary of the invention

[0003] To solve the above technical problems, embodiments of the present application provide a gateway storage management method and device, an electronic device, and a computer-readable storage medium.

[0004] According to one aspect of an embodiment of the present application, a gateway storage management method is provided, including: in a maintenance mode of the gateway, obtaining data storage requirements corresponding to a device in the gateway; determining a target database corresponding to the device based on the data storage requirements, and performing a connectivity test on the target database; if the target database is in a connected state, obtaining a data storage strategy that matches the target database; and adjusting a data point configuration corresponding to the target database based on the data storage strategy, the data point being a time node for collecting data in the device and / or a trigger node for a trigger event.

[0005] According to one aspect of an embodiment of the present application, adjusting the configuration of the data points corresponding to the target database based on the data storage strategy includes: parsing the data storage strategy, and determining a plurality of different data points based on the parsing results; selecting a storage type and a storage mechanism for the plurality of different data points; and adjusting the configuration of the plurality of different data points corresponding to the target database based on the storage type and the storage mechanism for the plurality of different data points.

[0006] According to one aspect of an embodiment of the present application, the storage mechanism includes a storage change range of a data point; the method also includes: if it is detected that the data change range on the data point reaches a preset storage change range, the corresponding data on the data point is updated and stored.

[0007] According to one aspect of an embodiment of the present application, the connectivity test of the target database includes: sending data request messages to the target database at a preset frequency, and recording a first timestamp corresponding to each sending of the data request message and counting the number of data request messages sent; receiving a reply message returned by the target database in response to the data request message, and recording a second timestamp corresponding to each reception of the reply message and counting the number of received reply messages; calculating the delay of the target database according to the first timestamp and the second timestamp, and calculating the packet loss rate of the target database according to the number of data request messages and the number of reply messages; determining the connectivity of the target database according to the delay of the target database and the packet loss rate of the target database.

[0008] According to one aspect of an embodiment of the present application, the method also includes: when the gateway is in operation, receiving a data query request sent by a user; parsing the data query request, generating a corresponding data configuration request based on the parsing result and sending it to the target database; and returning data corresponding to the data query request based on the target database.

[0009] According to one aspect of an embodiment of the present application, the data query request includes a user identity identifier; the data corresponding to the data query request is returned based on the target database, including: if it is determined based on the user identity identifier that the user has browsing authority, then corresponding target response data is generated based on the query range in the data configuration request; wherein the query range includes: a query time range and a query data point; and a corresponding data file package is generated based on the target response data and sent to the user.

[0010] According to one aspect of an embodiment of the present application, the method further includes: setting key data points based on device attribute information corresponding to a database; if it is detected that the key data point information meets preset alarm information, generating alarm prompt information and pushing it to a corresponding terminal device.

[0011] According to one aspect of an embodiment of the present application, a storage management device for a gateway is provided, the device comprising: a first acquisition module, used to acquire data storage requirements corresponding to devices in the gateway in a maintenance mode of the gateway; a determination module, used to determine a target database corresponding to the device based on the data storage requirements, and perform a connectivity test on the target database; a second acquisition module, used to acquire a data storage strategy matching the target database if the target database is in a connected state; and a configuration module, used to adjust the data point configuration corresponding to the target database based on the data storage strategy, the data point being a time node for collecting data in the device and / or a trigger node for a trigger event.

[0012] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the storage management method of the gateway as described above.

[0013] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the storage management method of the gateway as described above.

[0014] In the technical solution provided in the embodiments of the present application, in the maintenance mode of the gateway, the database type corresponding to the database in the gateway is obtained to determine the corresponding database server based on the database type, and then the connectivity test of the database server is performed. If the database server is in a connected state, the database storage policy configured in the database server is obtained, and then the data point configuration of the database is adjusted according to the storage policy, so as to realize effective management of the database storage, ensure the intelligence of the data storage generated in the gateway, and effectively manage the data storage in the gateway.

[0015] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0017] Figure 1 is a schematic diagram of an implementation environment of storage management of a gateway shown in an exemplary embodiment of the present application;

[0018] Figure 2 is a flow chart of a gateway storage management method shown in an exemplary embodiment of the present application;

[0019] Figure 3 is a flowchart of a gateway storage management method shown in another exemplary embodiment of the present application;

[0020] Figure 4 is a flowchart of a gateway storage management method shown in another exemplary embodiment of the present application;

[0021] Figure 5 is a flowchart of a gateway storage management method shown in another exemplary embodiment of the present application;

[0022] Figure 6 is a flowchart of a gateway storage management method shown in another exemplary embodiment of the present application;

[0023] Figure 7 is a flowchart of a gateway storage management method shown in another exemplary embodiment of the present application;

[0024] Figure 8 is a block diagram of a storage management device of a gateway shown in an exemplary embodiment of the present application;

[0025] Fig. 9 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0029] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0030] First of all, it should be noted that the data storage of the gateway mainly involves the following aspects: Storage capacity: The gateway needs to have sufficient storage capacity to store data from various devices. Depending on different application scenarios, the storage capacity requirements of the gateway will vary; Data security: During the data storage process, the gateway needs to take a series of security measures to ensure that the data is not illegally accessed or leaked. This includes encrypting the data, setting access permissions, and regularly backing up data; Data backup and recovery: In order to prevent data loss, the gateway needs to have data backup and recovery functions. In this way, once an unexpected situation occurs, it can be quickly restored to a normal state through backup data; Data format and protocol: The data stored in the gateway needs to follow a certain format and protocol to facilitate data processing and transmission. For example, common data formats include CSV, JSON, XML, etc., while protocols include HTTP, FTP, SFTP, etc.; Data lifecycle management: Over time, the data stored in the gateway may lose its timeliness or no longer be needed. Therefore, the gateway needs to have data lifecycle management capabilities to regularly clean up and delete outdated or useless data; Data storage management interface: In order to facilitate management and maintenance, the gateway needs to provide data storage management interfaces. These interfaces can be used to view storage status, adjust storage configuration, upload and download data, etc.

[0031] In short, the data storage of the gateway needs to take into account security, reliability, scalability and other aspects. At the same time, with the continuous development of IoT technology, the requirements for the data storage capacity of the gateway are also increasing. Therefore, when selecting and designing the gateway, it is necessary to make comprehensive considerations based on actual needs.

[0032] The relationship between the gateway and the device is: the gateway is a converter that connects the device side and the platform, responsible for converting the data format of the device side into a format that the platform can understand, and forwarding commands from the platform to the device side. The device side refers to the program or hardware that actually runs on the physical device, which is connected to the platform through the gateway. The platform manages and controls the operation of the device side by providing functions and services through the server side. In addition, the IoT gateway is a hardware or software component that connects controllers, sensors, and other smart devices to the cloud. It can manage sub-devices, maintain topological relationships with sub-devices, and synchronize the topological relationship to the cloud. At the same time, the IoT gateway is a translator used to convert between systems with different communication protocols, data formats, or languages.

[0033] Figure 1 FIG. 1 is a schematic diagram of an implementation environment for storage management of a gateway according to an exemplary embodiment of the present application. Figure 1As shown, in the maintenance mode of the gateway, the gateway 120 obtains the data storage requirements corresponding to the device 110, and determines the corresponding target database based on the data storage requirements of the device 110, and performs a connectivity test on the target database. After the target database connectivity test passes, the gateway 120 obtains a data storage strategy that matches the target database; based on the data storage strategy, the data point configuration corresponding to the target database is adjusted, wherein the data point can be a time node for collecting data in the device 110 and / or a trigger node for a trigger event.

[0034] The industrial Internet architecture is usually composed of industrial equipment, gateways, edge computing devices and cloud platforms. The gateway is used to collect on-site data of industrial equipment and receive feedback information from edge computing devices, so a large amount of data will be generated. This data is usually stored in the local database of the gateway or uploaded to the cloud, and the data storage of the gateway is not managed. Since the storage space of the local database is small, it is easy to cause greater storage pressure on the local database. Uploading to the cloud may cause a large amount of duplicate and useless data to occupy cloud storage resources, thereby affecting storage efficiency.

[0035] The problems pointed out above are generally applicable in general gateway scenarios. To solve these problems, the embodiments of the present application respectively propose a gateway storage management method, a gateway storage device, an electronic device, a computer-readable storage medium and a computer program product. These embodiments will be described in detail below.

[0036] See also Figure 2 , Figure 2 is a flowchart of a gateway storage method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.

[0037] like Figure 2 As shown, in an exemplary embodiment, the specific implementation process of the storage management method of the gateway includes at least steps S210 to S240, which are described in detail as follows:

[0038] Step S210: in the maintenance mode of the gateway, obtaining data storage requirements corresponding to the devices in the gateway.

[0039] It should be noted that the maintenance mode of the gateway is a mode that suspends certain functions to perform maintenance or deal with specific problems. Depending on the type and function of the gateway, the maintenance mode may have different characteristics and functions.

[0040] Generally speaking, the maintenance mode of the gateway can suspend some alarm processing and automatic service request creation functions. This helps to avoid unnecessary alarm interference during maintenance, making maintenance work more focused and efficient. At the same time, maintenance mode can also provide a safer environment for the device to perform necessary maintenance and troubleshooting operations.

[0041] In step S210, enter the maintenance mode in the gateway, find the corresponding database, enter the database configuration page, first select the type of database, the built-in MySQL database in the gateway, and you can also use an external database. Currently, three databases are supported: MySQL, sqlserver, and PostgreSQL. In this embodiment, MySQL is taken as an example.

[0042] You can get the following content: Database type: MySQL; Database name: Custom; Database server: fill in the IP address of the database server. Here we take the local IP as an example. The button after the IP is to test the ping link; Port number: the port number of the database server; User name, password, storage days, whether the data is overwritten, whether the data is stored when it is not read, etc. Among them, whether the data is overwritten means whether to overwrite the previous data when the storage reaches the storage days or the storage space is full. Checking means overwriting, and not checking means stopping storage when the above conditions are met.

[0043] Step S220: determining a target database corresponding to the device based on the data storage requirement, and performing a connectivity test on the target database.

[0044] Following the above-mentioned database configuration embodiment, the target database corresponding to the data storage requirement can be determined by the IP address of the database server filled in and a connectivity test can be performed on the target database, wherein the connectivity test content of the target database includes: detecting whether the network connection with the target database is normal, detecting whether the target database is running normally, connecting to the database using a database management tool, and trying to execute some simple query statements to test the connectivity of the database; connecting to the database using a command line tool (such as a MySQL command line client) and executing some simple query statements to test the connectivity of the database; ensuring that the firewall settings do not block connection requests to the database server; checking whether the database connection parameters (such as host name, port number, user name, password, etc.) used in the application or script are correct; and using third-party testing tools (such as SQL Server Profiler, MySQL EnterpriseMonitor, etc.) to test and monitor the connectivity and performance of the database. All of these methods can be used to test the connectivity of the database and ensure that the application or script can successfully connect to the database and execute query statements.

[0045] Step S230: If the target database is in a connected state, a data storage strategy matching the target database is obtained.

[0046] If the target database corresponding to the device is connected after testing, the data storage strategy that matches the target database can be obtained, where the data storage strategy includes: the full name of the data point, automatically generated, storage type: Int, Float, String; change storage: when checked, it means that the data is stored when it changes; change range: that is, the percentage of change, such as filling in '5' means that the change is stored when it is '5%'; cyclic storage: when checked, it means storage in cycles; cycle (ms): data is stored in this number of milliseconds as a cycle; after configuring the above parameters, the data storage strategy is generated.

[0047] Among them, the roll call is the unique identifier of the record. When the roll call changes on the data collection side, it can be updated manually; change storage and cyclic storage can be selected at the same time.

[0048] Step S240: adjusting the data point configuration corresponding to the target database based on the data storage strategy, wherein the data point is a time node for collecting data in the device and / or a trigger node for a trigger event.

[0049] Specifically, the configuration of the data points that match the target database can be adjusted according to the data storage strategy generated above, where the data point can be the time point of the data in the acquisition device, or the trigger node of the trigger event in the device. Exemplarily, just check the data points to be stored, name: the full name of the data point, automatically generated; storage type: Int, Float, String; change storage: when checked, it means that the data is stored when it changes; change range: that is, the percentage of change, such as filling in '5' means that the change is '5%'. Cyclic storage: when checked, it means storage in cycles; cycle (ms): store data at this number of milliseconds.

[0050] In this embodiment, the database type corresponding to the database in the gateway is obtained to determine the corresponding database server based on the database type, and then a connectivity test is performed on the database server. If the database server is in a connected state, the database storage policy configured in the database server is obtained, and then the data point configuration of the database is adjusted according to the storage policy to achieve effective management of the database storage, and to ensure the intelligence of the data storage generated in the gateway, so as to effectively manage the data storage in the gateway.

[0051] For further information, please refer to Figure 3In one of the exemplary embodiments provided in the present application, the specific implementation process of adjusting the data point configuration corresponding to the target database based on the data storage strategy may also include steps S310 to S330, which are described in detail as follows:

[0052] Step S310, analyzing the data storage strategy, and determining a plurality of different data points based on the analysis result;

[0053] Step S320, selecting a storage type and a storage mechanism for the multiple different data points;

[0054] Step S330: adjusting the configuration of the multiple different data points corresponding to the target database based on the storage types and storage mechanisms of the multiple different data points.

[0055] Specifically, the data storage strategy generated in step S230 can be parsed, ClientID: choose whether to configure the client ID according to the actual situation, if it is configured, just fill it in directly; Username: MQTT server username; Password: MQTT server password; HostName: MQTT server address; Port: MQTT server service port number; Version: version, no special requirements, the default is fine; QOSsubscribe: QOSsubscribe, no special requirements, the default is fine; QOSpublished: QOSpublished, no special requirements, the default is fine; KeepAlive(s): heartbeat period, in seconds; cleanSession: whether to clear the session, false for no, true for Yes; pKey (supplier product series number*): fill in according to the actual situation, which will be included in the topic; sn (IoT gateway number*): fill in according to the actual situation, which will be included in the topic; compld (manufacturer ID): fill in according to the actual situation, which can be left blank; encr (encryption method): fill in according to the actual situation; ConnType (device communication method): the communication method in the message is indicated, which can be customized; (MAC address): device MAC address, which can be left blank; seriaNum (number of available serial ports on the gateway): fill in according to the actual situation, which can be left blank; ethNum (number of available network ports on the gateway): fill in according to the actual situation, which can be left blank; Feedback timeout (ms): unresponsive communication interruption time, in milliseconds; storage space occupied by a single offline file: in bytes and storage space occupied by all offline files: in bytes, etc.

[0056] Then, based on the analysis results, multiple different data points in the device and the storage types and storage mechanisms corresponding to the data points are determined, and then the configurations of the multiple different data points corresponding to the target database are adjusted according to the storage types and storage mechanisms of the multiple different data points on the device, thereby realizing the configuration of the data storage of the device in the gateway, ensuring that during the normal operation of the device, the gateway can reasonably and effectively store the data generated by the operation of the device, thereby ensuring the management of the data storage in the gateway.

[0057] Further, based on the above embodiment, in one of the exemplary embodiments provided in the present application, the above storage mechanism includes the storage change range of the data point; the specific implementation process of the storage management method of the above gateway may also include the following steps, which are described in detail as follows:

[0058] If it is detected that the data change range at the data point reaches the preset storage change range, the corresponding data at the data point is updated and stored.

[0059] Following the above-mentioned embodiment, if the data change amplitude of the above-mentioned set data point is monitored to reach the preset change amplitude corresponding to the configuration of the data point, the data corresponding to the data point is updated and stored in the target database. Exemplarily, when the data generated at multiple different data points corresponding to the target database are monitored, if the data on the monitored data point is compared with the data collected in the previous cycle, when the comparison result indicates that the change amplitude of the data on the data point reaches the preset change amplitude of the data point, the monitored data is updated and stored in the target database corresponding to the data point; in some feasible embodiments, if the data on the monitored data point is compared with the preset data, when the comparison result indicates that the change amplitude of the data on the data point reaches the preset change amplitude of the data point, the monitored data is updated and stored in the target database corresponding to the data point.

[0060] In this embodiment, the data generated by the devices in the gateway are effectively updated, thereby improving the intelligence and effectiveness of the storage management of the gateway.

[0061] Further, based on the above embodiment, please refer to Figure 4 In one of the exemplary embodiments provided in the present application, the specific implementation process of the connectivity test on the target database may further include steps S410 to S440, which are described in detail as follows:

[0062] Step S410, sending a data request message to the target database at a preset frequency, and recording a first timestamp corresponding to each sending of the data request message and counting the number of the data request messages sent;

[0063] Step S420, receiving a reply message returned by the target database in response to the data request message, and recording a second timestamp corresponding to each reception of the reply message and counting the number of the received reply messages.

[0064] Specifically, within a preset period, a data request message for transmitting data can be sent to the target database at a preset frequency, wherein the data request message can be a detection packet containing no data or a small amount of data, and the data request message can be sent to the target database multiple times within a period at a preset frequency, and the timestamp corresponding to the data request message sent to the target database is recorded as the first timestamp, and the number of data request messages sent to the target database within the preset period is recorded.

[0065] On the other hand, within a preset period, a reply message is received from the target database in response to the above data request message, and the number of reply messages received within the preset period and the timestamp corresponding to the received reply message are recorded as a second timestamp.

[0066] Step S430, calculating the delay of the target database according to the first timestamp and the second timestamp, and calculating the packet loss rate of the target database according to the number of data request messages and the number of reply messages;

[0067] Step S440: Determine the connectivity of the target database according to the delay of the target database and the packet loss rate of the target database.

[0068] Exemplarily, within the same cycle, the delay corresponding to the target database is determined by recording the first timestamp of sending a data request message to the target database and the second timestamp of receiving a reply message corresponding to the data request message. If multiple data request messages are sent to the target database within the same cycle, the delay corresponding to the target database can be determined based on the average delay corresponding to the multiple data request messages, or the median delay, the mode delay, etc. On the other hand, the packet loss rate corresponding to the target database is determined by the number of data request messages sent to the target database within a preset period and the number of reply messages received.

[0069] Then, the connectivity of the target database can be determined according to the latency and packet loss rate of the target database for the data request message within a preset period. Exemplarily, if the latency of the target database does not reach a preset latency threshold within the preset period, it is determined that the target database is in a connected state; or, if the packet loss rate of the target database does not reach a preset packet loss rate threshold within the preset period, it is determined that the target database is in a connected state; or, if the latency of the target database does not reach a preset latency threshold within the preset period, and the packet loss rate does not reach a preset packet loss rate threshold, it is determined that the target database is in a connected state.

[0070] In this embodiment, the connectivity of the target database is determined by the packet loss rate and delay of the target data, so as to ensure the accuracy of the test results, and further facilitate the effectiveness and intelligence of the storage of data on the gateway.

[0071] Further, based on the above embodiment, please refer to Figure 5 In one of the exemplary embodiments provided in the present application, the specific implementation process of the storage management method of the above gateway may also include steps S510 to S530, which are described in detail as follows:

[0072] Step S510, receiving a data query request sent by a user in a gateway operation state;

[0073] Step S520, parsing the data query request, generating a corresponding data configuration request based on the parsing result and sending it to the target database;

[0074] Step S530: returning data corresponding to the data query request based on the target database.

[0075] Specifically, following the above embodiment, when it is determined that the target database is in a connected state, the operation state of the gateway can be turned on, and a data query request sent by a user can be received, wherein the data query request is initiated for a device in the gateway or for the gateway itself. The data query request can be parsed, and then a data configuration request corresponding to the data query request can be sent to the target database, and then the data corresponding to the data query request can be returned by the target database.

[0076] Exemplarily, when the gateway switches from maintenance status to operation status, the operation data or real-time communication messages of the device in the connected state of the target database can be obtained, wherein the offline messages of the device can also be obtained, and the corresponding messages of the required query data can be generated with the target database and returned to the user, wherein the returned query data can be presented in the form of a line graph and a list, and the line graph supports zooming, and the local data can be enlarged by selecting with the mouse.

[0077] In this embodiment, by parsing the data access request initiated by the user, the returned target response data is made more accurate and presented in the form of a line graph and a list, which facilitates the intuitiveness and appreciation of the data results and improves the user experience.

[0078] Further, based on the above embodiment, please refer to Figure 6 In one of the exemplary embodiments provided in the present application, the data query request includes a user identity; the specific implementation process of returning the data corresponding to the data query request based on the target database may also include the following steps S610 and S620, which are described in detail as follows:

[0079] Step S610: if it is determined based on the user identity that the user has browsing authority, then corresponding target response data is generated based on the query range in the data configuration request; wherein the query range includes: a query time range and a query data point;

[0080] Step S620: Generate a corresponding data file package based on the target response data and send it to the user.

[0081] Specifically, the data query request sent by the user carries the identity of the client that sends the data query request, wherein the identity of the client can be a user account, account ID, client device number, MAC address, IP address, SN code value, etc., and then the browsing permission corresponding to the user can be determined based on the identity, wherein the browsing permission is the access permission corresponding to the user account, so as to determine whether the user has the browsing permission corresponding to the data query request initiated by the user.

[0082] If it is determined that the identity identifier corresponding to the user determines that the user has the corresponding browsing permission, the corresponding target response data can be generated according to the query scope in the data configuration request, wherein the data query scope includes the time range of the data query and the corresponding data points to be queried, and the target response data corresponding to the data query request initiated by the user is generated.

[0083] For example, if the corresponding query content in the data query request is "search for the operating data of device A within the time range of November 1, 2023 to November 30, 2023", the response data corresponding to the data query request can be queried based on the target database corresponding to device A and returned to the user.

[0084] In this embodiment, by authenticating the user's identity, the security of the data stored in the target database is guaranteed, and the intelligence of the gateway data storage is improved.

[0085] Further, based on the above embodiment, please refer to Figure 7 In one of the exemplary embodiments provided in the present application, the specific implementation process of the storage management method of the above gateway may also include step S710 and step S720, which are described in detail as follows:

[0086] Step S710, setting key data points based on device attribute information corresponding to the database;

[0087] Step S720: If it is detected that the key data point information meets the preset alarm information, an alarm prompt information is generated and pushed to the corresponding terminal device.

[0088] Specifically, different key data points can be set for the gateway according to the attribute information corresponding to the device in the gateway, wherein the key data point can also be used as an alarm data point, that is, the data generated by the key data point is monitored. Specifically, in the configuration mode of the gateway, the alarm node of the target device is set, wherein the alarm node is set differently depending on the nature, function and operation mode of the target device. Therefore, the alarm node is the corresponding variable in the communication information of the target device, and the alarm threshold information corresponding to the alarm node is set. After monitoring that the operation information of the target device reaches above the alarm threshold information, the corresponding alarm information is generated and sent to the corresponding terminal.

[0089] Exemplarily, the alarm node of the target device is determined according to the properties of the target device, and the alarm threshold information of the variable corresponding to the alarm node is set, so that when the variable on the early warning node reaches above the corresponding alarm threshold, the corresponding alarm information is generated and sent to the corresponding terminal.

[0090] It should be noted that the configuration mode of the gateway refers to the way to configure, manage and optimize the gateway through specific software or tools. According to different needs and scenarios, the configuration modes of the gateway can be divided into the following types: Command Line Interface (CLI): Enter commands to configure and manage the gateway through the command line. This method requires a certain technical background and experience; Graphical User Interface (GUI): Configure and manage through the graphical interface. This method is relatively easy to operate and suitable for users without technical background; Remote Management Interface (Remote Management Interface): Manage and configure the gateway remotely. This method can easily achieve remote management and monitoring; API interface: Program and configure the gateway through the API interface. This method is suitable for users with certain technical capabilities. In actual applications, it is necessary to select the appropriate configuration mode according to specific needs and scenarios to achieve efficient, stable and secure network communication and data processing. At the same time, it is also necessary to pay attention to the security and stability of the gateway to ensure that the gateway can resist network attacks and unexpected situations and ensure the security and integrity of data.

[0091] Exemplarily, in the configuration mode of the gateway, the operating status of the target device is monitored, and when the target device is monitored to have a preset alarm operating status, a corresponding alarm message is generated, and the alarm message is sent to the corresponding terminal, and a prompt is given on the terminal in the form of a web page prompt, an email prompt, and a personal account push, so that relevant personnel can deal with the faulty target device in a timely manner, improve the fault handling capability, and ensure normal use.

[0092] In this embodiment, by setting the alarm node and alarm threshold information, alarm information can be generated efficiently and quickly when a device fails, and by setting the alarm threshold, the flexibility and adaptability of the gateway to alarm prompts for different devices can be ensured, thereby improving the intelligence of the gateway.

[0093] Figure 8 is a block diagram of a gateway storage management device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown is specifically configured in the gateway 120. The device may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.

[0094] like Figure 8 As shown, the storage management device of the exemplary gateway includes: a first acquisition module 810, which is used to obtain the data storage requirements corresponding to the equipment in the gateway in the maintenance mode of the gateway; a determination module 820, which is used to determine the target database corresponding to the equipment based on the data storage requirements, and perform a connectivity test on the target database; a second acquisition module 830, which is used to obtain the data storage strategy that matches the target database if the target database is in a connected state; a configuration module 840, which is used to adjust the data point configuration corresponding to the target database based on the data storage strategy, and the data point is the time node for collecting data in the device and / or the trigger node of the trigger event.

[0095] According to one aspect of an embodiment of the present application, the above-mentioned configuration module 840 further specifically includes: a parsing unit, used to parse the data storage strategy and determine multiple different data points based on the parsing results; a selection unit, used to select the storage type and storage mechanism of the multiple different data points; and an adjustment unit, used to adjust the configuration of multiple different data points corresponding to the target database based on the storage type and storage mechanism of the multiple different data points.

[0096] According to one aspect of an embodiment of the present application, the storage management device of the above-mentioned gateway also includes: an update module, which is used to update and store the corresponding data on the data point if it is detected that the data change range on the data point reaches a preset storage change range.

[0097] According to one aspect of an embodiment of the present application, the storage management device of the above-mentioned gateway also includes: a first sending module, used to send data request messages to the target database at a preset frequency, and record a first timestamp corresponding to each sending of the data request message and count the number of data request messages sent; a first receiving module, used to receive a reply message returned by the target database in response to the data request message, and record a second timestamp corresponding to each reception of the reply message and count the number of received reply messages; a calculation module, used to calculate the delay of the target database according to the first timestamp and the second timestamp, and calculate the packet loss rate of the target database according to the number of data request messages and the number of reply messages; a connectivity determination module, used to determine the connectivity of the target database according to the delay of the target database and the packet loss rate of the target database.

[0098] According to one aspect of an embodiment of the present application, the storage management device of the above-mentioned gateway also includes: a second receiving module, used to receive a data query request sent by a user when the gateway is in operation; a generating module, used to parse the data query request, and generate a corresponding data configuration request based on the parsing result and send it to the target database; a returning module, used to return data corresponding to the data query request based on the target database.

[0099] According to one aspect of an embodiment of the present application, the above-mentioned return module further specifically includes: a generation unit, which is used to generate corresponding target response data based on the query range in the data configuration request if it is determined based on the user identity that the user has browsing permissions; wherein the query range includes: a query time range and a query data point; a second sending module, which is used to generate a corresponding data file package based on the target response data and send it to the user.

[0100] According to one aspect of an embodiment of the present application, the storage management device of the above-mentioned gateway also includes: a setting module, which is used to set key data points based on the device attribute information corresponding to the database; an alarm module, which is used to generate alarm prompt information and push it to the corresponding terminal device if it is detected that the key data point information meets the preset alarm information.

[0101] It should be noted that the storage management device of the gateway provided in the above embodiment and the storage management method of the gateway provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In actual application, the storage management device of the gateway provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0102] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the gateway storage management method provided in the above-mentioned embodiments.

[0103] Fig. 9 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig. 9 The computer system 900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0104] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 to the random access memory (RAM) 903, such as executing the method described in the above embodiment. In the RAM 903, various programs and data required for system operation are also stored. The CPU 901, ROM 902 and RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0105] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed so that a computer program read therefrom is installed into the storage section 908 as needed.

[0106] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 909, and / or installed from a removable medium 911. When the computer program is executed by a central processing unit (CPU) 901, various functions defined in the system of the present application are executed.

[0107] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0108] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0110] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the storage management method of the gateway as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0111] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the storage management method of the gateway provided in each of the above embodiments.

[0112] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A gateway storage management method, characterized in that: include: In the maintenance mode of the gateway, obtaining data storage requirements corresponding to the devices in the gateway; The maintenance mode includes suspending maintenance of target functions of the grid based on gateway type and function; Determine the target database corresponding to the device based on the data storage requirements, and perform a connectivity test on the target database; the connectivity test includes performing a connectivity test on the target database of the gateway and the storage requirements corresponding to the target database; If the target database is in a connected state, obtaining a data storage strategy matching the target database; The data point configuration corresponding to the target database is adjusted based on the data storage strategy, and the data point is a time node for collecting data in the device and / or a trigger node for a trigger event.

2. The method according to claim 1, characterized in that The adjusting the data point configuration corresponding to the target database based on the data storage strategy includes: parsing the data storage strategy, and determining a plurality of different data points based on the parsing result; selecting a storage type and a storage mechanism for the plurality of different data points; The configuration of the multiple different data points corresponding to the target database is adjusted based on the storage type and storage mechanism of the multiple different data points.

3. The method according to claim 2, characterized in that The storage mechanism includes a storage variation range of the data points; the method further includes: If it is detected that the data change range at the data point reaches the preset storage change range, the corresponding data at the data point is updated and stored.

4. The method according to claim 1, characterized in that The performing connectivity test on the target database includes: Sending a data request message to the target database at a preset frequency, and recording a first timestamp corresponding to each sending of the data request message and counting the number of the data request messages sent; Receive a reply message returned by the target database in response to the data request message, and record a second timestamp corresponding to each reception of the reply message and count the number of received reply messages; Calculating the delay of the target database according to the first timestamp and the second timestamp, and calculating the packet loss rate of the target database according to the number of data request messages and the number of reply messages; The connectivity of the target database is determined according to the delay of the target database and the packet loss rate of the target database.

5. The method according to claim 1, characterized in that The method further comprises: When the gateway is in operation, it receives data query requests sent by users; Parsing the data query request, generating a corresponding data configuration request based on the parsing result and sending it to the target database; The data corresponding to the data query request is returned based on the target database.

6. The method according to claim 5, characterized in that The data query request includes a user identity; and returning data corresponding to the data query request based on the target database includes: If it is determined based on the user identity that the user has browsing authority, then corresponding target response data is generated based on the query range in the data configuration request; wherein the query range includes: a query time range and a query data point; A corresponding data file package is generated based on the target response data and sent to the user.

7. The method according to claim 1, characterized in that The method further comprises: Set key data points based on the device attribute information corresponding to the database; If it is detected that the key data point information meets the preset alarm information, an alarm prompt information is generated and pushed to the corresponding terminal device.

8. A storage management device for a gateway, characterized in that: The device comprises: A first acquisition module is used to acquire data storage requirements corresponding to devices in the gateway in a maintenance mode of the gateway; the maintenance mode includes suspending maintenance of target functions of the grid based on gateway type and function; A determination module, used to determine the target database corresponding to the device based on the data storage requirement, and perform a connectivity test on the target database; the connectivity test includes performing a connectivity test on the target database of the gateway and the storage requirement corresponding to the target database; A second acquisition module, configured to acquire a data storage strategy matching the target database if the target database is in a connected state; A configuration module is used to adjust the data point configuration corresponding to the target database based on the data storage strategy, wherein the data point is a time node for collecting data in the device and / or a trigger node for a trigger event.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the gateway storage management method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the storage management method for a gateway according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for detecting table information in database, computer equipment and storage medium

    CN113722325A

  • Page display method and device, terminal and storage medium

    CN117240482A