Time-series database connection system and method for electrolytic hydrogen production systems
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-08-14
Smart Images

Figure CN122570586A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of big data processing and industrial automation applications. Background Technology
[0002] As the hydrogen production industry rapidly evolves towards large-scale and intelligent operations, the large-scale commercial deployment of electrolyzer arrays, represented by alkaline water electrolysis and proton exchange membrane water electrolysis, coupled with the inherent volatility and intermittent supply characteristics of hydrogen production from wind and solar renewable energy sources, and the widespread application of multi-hydrogen production site cluster collaborative scheduling models, has resulted in unprecedented dynamics and complexity in the operation of hydrogen production systems. To ensure the safe and stable operation of electrolyzers, extend the lifespan of key components, and achieve synergistic optimization of hydrogen production efficiency and energy consumption, hydrogen production data management is rapidly evolving from traditional offline recording and manual inspection and analysis to a data-driven decision-making model based on real-time acquisition, automatic storage, and intelligent analysis. Against this backdrop, high-performance time-series database technology has become a key underlying infrastructure supporting intelligent manufacturing and full-chain digital management of green hydrogen.
[0003] In hydrogen production, hundreds of core process parameters, such as individual cell voltage, current density, membrane stack temperature, hydrogen and oxygen pressure on the anode and cathode sides, electrolyte flow rate and concentration, hydrogen purity, and system energy efficiency, are continuously generated as time-series data streams at high frequencies ranging from milliseconds to seconds. This time-series data precisely records the dynamic evolution of the electrolyzer throughout its entire lifecycle, from cold start-up and full-load operation to dynamic power point tracking, and is a core data asset for achieving state awareness and refined management of the hydrogen production system. Therefore, high-performance, highly reliable time-series database technology is an indispensable core component of a data-driven hydrogen production system.
[0004] Currently, time-series databases such as InfluxDB, TimescaleDB, and Prometheus are widely used in the hydrogen production industry. However, the following technical challenges remain when deeply integrating existing time-series databases into hydrogen production applications and station control systems:
[0005] Data consistency and reliability challenges: In high-concurrency write scenarios, it is difficult to guarantee the consistency and reliability of time-series data across multiple time scales in an electrolysis hydrogen production system.
[0006] Data model design is complex: Time series data has multi-dimensional characteristics (time stamp, indicators, tags), and traditional methods are difficult to design storage models efficiently.
[0007] Write and query performance bottlenecks: Performance drops significantly under high-concurrency write scenarios, and complex queries have high response latency, failing to meet real-time requirements.
[0008] Low data conversion efficiency: The JSON format data returned by the database needs to be parsed manually, which increases the development burden.
[0009] Steep learning curve: Users find it difficult to quickly master SQL syntax and database interfaces, resulting in low integration efficiency.
[0010] Lack of Natural Language Interaction: There is a lack of ability to directly manipulate the database using natural language, resulting in a high barrier to entry for on-site personnel. (Invention Content)
[0011] This invention aims to address the problems of poor natural language interactivity and low efficiency when integrating existing time-series databases with hydrogen production application systems. It proposes a time-series database connection system and method for electrolytic hydrogen production systems.
[0012] The time-series database connection system for electrolytic hydrogen production systems described in this invention includes:
[0013] The translator module is used to receive operation instructions from the client via Python function calls, convert the received operation instructions into SQL statements, and then send them to the time series database.
[0014] The natural language processing interface integrates the Language Chain and GPT (Generative Pre-trained Transformer) models to convert natural language sent by the client into SQL statements; transmit the SQL statements to a time-series database; and simultaneously receive JSON-formatted results returned by the database, convert the received JSON-formatted results into natural language, and return them to the client.
[0015] The converter module is used to receive JSON format data returned by the time series database, convert the received JSON format data into a Python object, and return the Python object to the client.
[0016] A time-series database connection method for electrolytic hydrogen production systems includes:
[0017] The translator converts Python function calls into SQL statements and sends them to the time-series database.
[0018] The system converts natural language queries sent by the client into SQL statements via a natural language interface and transmits them to the time series database. Simultaneously, it receives JSON format results returned by the database, converts the received JSON format results into natural language, and returns them to the client.
[0019] The converter transforms the JSON data returned by the time series database into a target Python object and returns it to the client.
[0020] This invention enables developers to directly read and write hydrogen production data using Python by setting up a translator, eliminating the need to manually write underlying database SQL statements and improving the development efficiency of hydrogen production monitoring and analysis functions. By setting up a converter, JSON results returned from the time-series database are automatically converted into Python objects such as Pandas DataFrames, reducing the cost of secondary data conversion and improving the maintainability of hydrogen production applications. By setting up a natural language processing interface, it allows on-site personnel in hydrogen production to directly ask natural language questions such as "the period of abnormal tank temperature at a certain site yesterday," which the system automatically converts into database queries and returns the results, significantly lowering the barrier to entry. This invention is deeply integrated with the Python ecosystem (following PEP 249) and can seamlessly connect to tools such as Pandas and TensorFlow, shortening the link from data access to model application. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the time-series database connection system for electrolytic hydrogen production systems described in this invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0023] Specific implementation method one: Refer to Figure 1 This embodiment specifically describes a time-series database connection system for electrolytic hydrogen production systems, which includes:
[0024] The translator module is used to receive operation instructions from the client via Python function calls, convert the received operation instructions into SQL statements, and then send them to the time series database.
[0025] The natural language processing interface integrates LangChain and GPT (Generative Pre-trained Transformer) models to convert natural language queries sent by the client into SQL statements and transmit them to a time-series database. At the same time, it receives JSON format results returned by the database and converts the received JSON format results into natural language and returns them to the client.
[0026] The converter module is used to receive JSON format data returned by the time series database, convert the received JSON format data into a Python object, and return the Python object to the client.
[0027] The system described in this invention conforms to the PEP 249 standard and is seamlessly integrated with the Pandas and TensorFlow toolchains of the Python ecosystem, supporting the direct loading of query results into Pandas DataFrames for data analysis and machine learning.
[0028] Furthermore, in this invention, the translator module includes: a function mapping unit and a syntax verification unit;
[0029] The function mapping unit is used to parse the Python function and generate the corresponding SQL statement;
[0030] The syntax verification unit is used to check whether the generated SQL statement conforms to the time-series database syntax specification. If it does not conform, the SQL statement is adjusted until it conforms to the time-series database syntax specification and then transmitted to the time-series database.
[0031] Furthermore, in this invention, the converter module converts the JSON data into:
[0032] Pandas DataFrame (with timestamps automatically converted to datetime type), CSV file (with numeric type automatic conversion), or Python dictionary.
[0033] Furthermore, in this invention, the natural language processing interface implements a query method:
[0034] Receive natural language questions and generate structured SQL question statements; distribute the SQL question statements to a time series database through a database connection pool; and reconstruct the JSON results returned by the time series database into natural language and return them to the client.
[0035] Specific Implementation Method Two: The time-series database connection method for electrolytic hydrogen production systems described in this implementation method includes:
[0036] The translator converts Python function calls into SQL statements and sends them to the time-series database.
[0037] The system converts natural language queries sent by the client into SQL statements via a natural language interface and transmits them to the time series database. Simultaneously, it receives JSON format results returned by the database, converts the received JSON format results into natural language, and returns them to the client.
[0038] The converter transforms the JSON data returned by the time series database into a target Python object and returns it to the client.
[0039] Furthermore, in this invention, the Python function call includes data insertion, update, deletion, or query operations.
[0040] This invention achieves unified access, hierarchical connection, categorized querying, and stable support for multi-source time-series data of hydrogen production by setting up a translator, converter, and natural language processing interface. Specifically:
[0041] The translator allows staff to directly read and write hydrogen production data using Python, reducing the workload of manually writing underlying database statements and improving development efficiency.
[0042] The converter quickly transforms query results into Python objects such as Pandas DataFrame, reducing the cost of secondary data transformation and improving the maintainability of business applications.
[0043] The natural language processing interface allows staff to directly ask questions such as "the period when the temperature of a certain station was abnormal yesterday," and the system automatically converts them into database queries and returns the results, significantly reducing the barrier to entry and improving data utilization efficiency.
[0044] Seamless integration with the Python ecosystem (in accordance with PEP 249) allows hydrogen production companies to directly use time-series query results for scenarios such as Pandas data analysis and TensorFlow machine learning, shortening the link from data access to model application.
[0045] The client described in this implementation seamlessly integrates with the Python ecosystem, adhering to PEP 249, and can seamlessly integrate with existing Python tools such as Pandas and TensorFlow. Users can use familiar Python toolchains to process and analyze time-series data. Pandas integration supports directly loading query results as Pandas DataFrames, allowing users to easily perform data analysis and processing using Pandas. The specific structure comprises three parts: a translator, a transformer, and a natural language interface.
[0046] In summary, the translator's main task is to convert user-initiated Python function calls (such as queries, inserts, updates, and deletes) into standard SQL statements. These SQL statements can then directly interact with the time-series database to perform corresponding database operations. Specifically, the process is as follows: The Python client application sends operation requests through Python functions provided by the time-series database connection method, device, and system. The translator parses the client's Python function calls, extracting key information such as the operation type and parameters. Based on its internal function mapping table, the translator associates the Python function with its corresponding SQL statement, parsing the Python function into the corresponding SQL statement. The translator uses a syntax parser to analyze the user-provided SQL statement or Python function parameters, further checking whether the generated SQL statement conforms to the time-series database's syntax rules and throwing exceptions when errors are found. The time-series database connection method, device, and system send the SQL statement to the time-series database through its connection interface.
[0047] After receiving the SQL statement, the time-series database performs the corresponding operations, transforming it into standard JSON format data, which is then returned to the translator via a client interface. The translator then passes the received JSON data to the converter via a function call.
[0048] In essence, the converter transforms query data output in standard JSON format into user-friendly Python objects (such as Pandas DataFrames, CSV files, or Python dictionaries). Specifically, the converter receives JSON data in standard format and uses Python's JSON module or parsing library to parse the JSON data into Python dictionaries or lists. Users can call the converter's functions `to csv` or `to pandas` as needed, and the converter will then convert the parsed data to the target format (e.g., Pandas DataFrame, CSV file, or Python dictionary) according to the user's requirements. When converting to a Pandas DataFrame, timestamp strings are converted to datetime types; when converting to a CSV file, numeric strings are converted to float or int types. If the JSON data format is incorrect or an error occurs during the conversion process, the converter will throw an exception and provide detailed error information. Finally, the converter returns the conversion result to the user.
[0049] The time-series database connection device for electrolytic hydrogen production systems described in this invention comprises two core components: a translator and a converter, and can integrate a natural language processing interface. These three components work together to achieve efficient connection and usability processing of electrolytic hydrogen production operation data between Python applications and the time-series database.
[0050] 1. Translator
[0051] The translator's main task is to convert database operations (including queries, inserts, updates, and deletes) initiated by users through Python function calls into standard SQL statements.
[0052] In the electrolytic hydrogen production scenario, the relevant operational objects include time-series data across multiple time scales, such as electrolyzer voltage, current density, cell temperature, hydrogen pressure, flow rate, and purity. The specific operational procedure is as follows:
[0053] Python client applications issue operation requests using the Python functions provided in this invention.
[0054] The translator parses the request and extracts key information such as operation type, time range, device identifier (e.g., site / slot group / device), and parameter fields.
[0055] The translator associates Python functions with their corresponding SQL statements based on its internal function mapping table and generates SQL statements.
[0056] The syntax validation unit checks whether the generated SQL statement conforms to the syntax specifications of the time-series database. If an error is found, an exception is thrown.
[0057] Through the connection interface of the time series database, SQL statements that conform to the specifications are sent to the time series database for execution.
[0058] 2. Converter
[0059] The converter is responsible for converting the standard JSON format query results returned by the time series database into user-friendly Python objects (such as Pandas DataFrames, CSV files, and Python dictionaries).
[0060] The specific operating procedure is as follows:
[0061] The converter receives JSON data in standard format and parses it into a Python dictionary or list using Python's json module or parsing library.
[0062] Users can call functions in the converter, such as to_csv() or to_pandas(), according to task requirements.
[0063] The converter transforms the parsed data into the target format according to the user's requirements:
[0064] When converting to a Pandas DataFrame, the timestamp string is automatically converted to the datetime type.
[0065] When converting to a CSV file, the numeric string will be automatically converted to float or int type.
[0066] If the JSON data is not formatted correctly or an error occurs during the conversion process, the converter will throw an exception and provide detailed error information.
[0067] The converter returns the conversion results to the user for subsequent processing such as monitoring dashboards, energy consumption analysis, operation reports, and historical traceability in hydrogen production scenarios.
[0068] 3. Natural Language Processing Interface
[0069] This interface integrates LangChain and the GPT model, enabling zero-code database interaction:
[0070] Users can ask natural language questions through a Python client, such as: "What was the average cell temperature of the electrolyzer at the No. 1 hydrogen production station over the past week?"
[0071] The LangChain framework calls the GPT model to transform natural language problems into structured SQL query statements.
[0072] The device of this invention distributes the generated SQL queries to a time-series database for execution through a pre-configured database connection pool.
[0073] After the time-series database returns results in standardized JSON format, LangChain, in collaboration with the GPT model, performs intelligent parsing and semantic reconstruction of the results:
[0074] Data augmentation: Automatically supplement units and process semantics (such as ℃, Nm³ / h).
[0075] Dynamic template generation: Select an answer template based on the query intent (such as monitoring query, energy efficiency analysis).
[0076] Natural Language Generation: Outputs readable conclusions for hydrogen production and maintenance personnel.
[0077] Finally, the answer is returned to the user client through an asynchronous communication interface, and multimodal output such as text, visualization charts (Matplotlib / Grafana) or API responses (JSON / XML) is supported.
[0078] Specific application scenarios
[0079] 1. Programming Interface Application
[0080] This invention provides a variety of commonly used Python-style APIs for interacting with different time-series databases.
[0081] Unified connection: Use the connect() method to automatically identify the database type and establish a connection via the URL.
[0082] Query execution: Supports direct execution of SQL statements, or direct conversion of query results into DataFrames via pandas.read_sql.
[0083] Data sharing: Supports batch data exchange via CSV files, remote procedure calls (RPC) via shared buffers, and direct communication between applications via small formatted messages.
[0084] 2. Machine Learning Applications
[0085] Taking time series forecasting as an example, this invention can greatly simplify the data pipeline:
[0086] Historical data of hydrogen production targets are collected, and data is read using a time-series database.
[0087] By calling the to_pandas() method, the query results are directly converted into a Pandas DataFrame, thus optimizing the data type.
[0088] Models were trained using libraries such as Scikit-learn and TensorFlow to predict target variables such as hydrogen production, tank temperature change trends, and energy consumption.
[0089] The entire process requires only a few lines of Python code, significantly improving the development efficiency of hydrogen production prediction models.
[0090] 3. Natural Language Query
[0091] This invention enables personnel at hydrogen production sites to complete data queries with low or no coding through a closed-loop design of natural language → SQL → JSON → natural language. It is applicable to business scenarios such as monitoring of electrolytic hydrogen production, energy efficiency analysis, operation optimization, and historical traceability.
[0092] The embodiments described above are merely specific implementations of the present invention, used to illustrate the principles and applications of the present invention, and are not intended to limit the present invention. Based on the principles and spirit disclosed in this invention, those skilled in the art can make various modifications or variations to the embodiments, or conceive other different implementation methods, without departing from the essential scope of the present invention. These modifications, variations, or other implementation methods should all be considered to be within the protection scope defined by the appended claims. It should also be understood that the technical features in different embodiments described in this specification can be combined with each other as long as they do not conflict. The technical features in the claims can also be combined in ways different from those described in the specific embodiments of this specification, and these combinations should also fall within the protection scope of the present invention.
Claims
1. A time-series database connection system for electrolytic hydrogen production systems, characterized in that, include: The translator module is used to receive operation instructions from the client via Python function calls, convert the received operation instructions into SQL statements, and then send them to the time series database. The natural language processing interface integrates LangChain and GPT models to convert natural language queries sent by the client into SQL statements and transmit them to the time series database. At the same time, it receives JSON format results returned by the database and converts the received JSON format results into natural language and returns them to the client. The converter module is used to receive JSON format data returned by the time series database, convert the received JSON format data into a Python object, and return the Python object to the client.
2. The time-series database connection system for electrolytic hydrogen production systems according to claim 1, characterized in that, The translator module includes: The function mapping unit is used to parse Python functions and generate corresponding SQL statements. The syntax verification unit is used to check whether the generated SQL statement conforms to the time series database syntax specification. If it does not conform to the time series database syntax specification, the syntax of the SQL statement is adjusted until the SQL statement conforms to the time series database syntax specification, and then the SQL statement is transmitted to the time series database.
3. The time-series database connection system for electrolytic hydrogen production systems according to claim 1 or 2, characterized in that, The converter module also supports converting JSON data into Pandas DataFrames, CSV files, or Python dictionaries.
4. A time-series database connection method for electrolytic hydrogen production systems, characterized in that, The method includes: The translator converts Python function calls into SQL statements and sends them to the time-series database. The system converts natural language queries sent by the client into SQL statements via a natural language interface and transmits them to the time series database. Simultaneously, it receives JSON format results returned by the database, converts the received JSON format results into natural language, and returns them to the client. The converter transforms the JSON data returned by the time series database into a target Python object and returns it to the client.
5. The time-series database connection method for electrolytic hydrogen production systems according to claim 4, characterized in that, The Python function calls include data insertion, update, deletion, or query operations.