Data acquisition, storage and query system for power equipment production

By designing a data collection, storage and query system for power equipment, the problems of data leakage and errors in the data collection and storage process in the existing technology are solved, the automation and security of data collection are realized, and the security of high-voltage electrical data is ensured. sex and consistency.

CN118820271AActive Publication Date: 2024-10-22HANGZHOU JUNLANG SOFTWARE TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410867057.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-10-22
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

Existing power equipment lacks a universal solution in the data collection and storage process, resulting in data leakage and summary errors, and manual entry is cumbersome, making it difficult to ensure data security and consistency.

Method used

A data collection, storage and query system including a collection module, a storage module and a query module is designed. The collection module collects data on the PC and encrypts the transmission. The storage module uses multi-layer encrypted storage and off-site backup. The query module The group ensures communication security through digital certificates and random matching.

Benefits of technology

It realizes the automation and security of data collection and storage, reduces labor costs, avoids data leaks and errors, and ensures the security and consistency of high-voltage electricity collection data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820271A_ABST
    Figure CN118820271A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data acquisition, in particular to a data acquisition, storage and query system for power equipment production, which comprises an acquisition module, a storage module and a query module, the acquisition module is matched according to the actual number of high-voltage power stations, the storage module is used for storing data sent by the acquisition module, and the query module is used for querying the data sent by the storage module. The number of the storage modules is at least three, all the storage modules serve as data backups for each other, the query module is used for extracting data in the storage modules for data processing or data query, data collection of different devices can be achieved, meanwhile, one-place issuing and multi-terminal updating are achieved, the labor time is saved, and the efficiency is improved. Cost is reduced, efficiency is increased, and data confidentiality is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data acquisition, and specifically to a data acquisition, storage and query system for electric power equipment production. Background Art

[0002] With the rapid development of industrial Internet of Things technology, the diversification of the types, models and functions of national power equipment requires dedicated personnel to collect and enter data during the production of circuit equipment. However, most current power equipment is equipped with a stand-alone database to realize data collection and storage of the stand-alone equipment. There is no general solution for stand-alone database data collection on the market, such as Access and Sqlite. In addition, manual data aggregation and data entry are prone to data leakage and data aggregation errors. Summary of the invention

[0003] In view of the shortcomings of the prior art, the present invention aims to provide a data collection, storage and query system for power equipment production. To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a data acquisition, storage and query system for power equipment production, comprising an acquisition module, a storage module and a query module, wherein the acquisition module is set according to the actual number of high-voltage power stations, the storage module is used to store the data sent by the acquisition module, at least three storage modules are provided, and all storage modules are mutually backed up for data, and the query module is used to extract the data in the storage module for data processing or data query; The acquisition module includes a data acquisition module, an acquisition parameter configuration module and a PC terminal. The data acquisition module and the acquisition parameter configuration module are arranged in the PC terminal, and the PC terminal communicates with the power equipment data acquisition terminal. The data acquisition module includes an acquisition parameter information query interface unit, an acquisition unified interface unit, an acquisition software management unit, an acquisition software type management unit and a data acquisition software monitoring unit; The acquisition parameter configuration module includes a device ID information configuration unit, a database information configuration unit and an acquisition software type information configuration unit; The acquisition parameter information query interface unit and the acquisition unified interface unit communicate with the power equipment data acquisition terminal. The acquisition parameter information query interface unit receives the equipment information and communicates with the acquisition parameter configuration module to match the data. After receiving the matched data information, the acquisition unified interface unit sends the data information to the acquisition software type management unit. The acquisition software type management unit calls the matching acquisition software in the acquisition software management unit based on the received data information. The acquisition unified interface unit returns to the PC end through the called acquisition software for data acquisition, and stores the collected data in the local PC end database. The PC terminal also includes a random matching unit 1 and a data encryption unit. The random matching unit 1 is provided with link information of all storage modules. The random matching unit 1 randomly extracts link information of a storage module, and the PC terminal communicates with the storage module. The data collected by the PC terminal is encrypted by the data encryption unit and then transmitted to the linked storage module. The storage module includes an independently arranged storage server, a data decryption unit 1 arranged in the storage server, a data encryption storage unit, a data update synchronization unit, a digital certificate unit 1 and a storage database. The encryption algorithm of the data encryption storage unit is different from the encryption algorithm of the data encryption unit. The data decryption unit 1 is used to decrypt the data encrypted by the data encryption unit. The data encryption storage unit is used to encrypt the data decrypted by the data decryption unit 1 and store it in the storage database. The data update synchronization unit is used to monitor the data of the storage database. When the data encryption storage unit stores the encrypted data in the storage database, the data update synchronization unit is triggered to run. The data update synchronization unit communicates with the storage servers of all other remaining storage modules, and synchronizes the stored data in the storage database of this storage server to other storage servers, so as to keep the storage database data of all storage servers consistent. The digital certificate unit 1 stores the certificate information related to all query modules, which is used to verify the communication legalization link of the query module. The query module includes a query terminal, a digital certificate unit 2 set in the query terminal, a data decryption unit 2, and a random matching unit 2. The random matching unit 2 is provided with link information of all storage modules. The random matching unit 2 randomly extracts a storage module link information, and the query terminal communicates with the storage module. The digital certificate unit 2 stores the digital certificate of the query terminal. The digital certificate unit 1 is used to verify the digital certificate unit 2 and link the network communication between the query terminal and the storage server after verification. After the query terminal extracts the corresponding data from the storage database, the data decryption unit 2 is used to decrypt the encrypted data. The operation mode of the random matching unit 1 is: (1) Sort and number the link information of all storage modules and form an original array; (2) Using the shuffling algorithm, the original array is shuffled and randomly sorted to form a random array; (3) Extract the numbers at the corresponding positions in the random array according to the preset extraction sorting number; (4) Based on the extracted number corresponding to the corresponding link information, the storage module corresponding to the link information on the PC side is realized through the link information; (5) According to step (4), when the PC terminal is not communicating with the storage module for the first time, the random matching unit removes the number corresponding to the last link information from the original array, and then shuffles and randomly sorts the array through a shuffling algorithm to form a corresponding random array; (6) Then, after extracting the corresponding link information through steps (3) and (4), communication between the PC and the storage module is realized; The random matching unit 2 and the data matching unit 1 are processed in the same manner, and the extraction order of the random matching unit 2 is inconsistent with the extraction order of the random matching unit 1.

[0004] In some of the embodiments, the acquisition modules are numbered according to the corresponding high-voltage power stations, and each number is matched with the high-voltage electricity data acquisition equipment information corresponding to the high-voltage power station. Each time the data is transmitted from the PC to the storage module, it includes the high-voltage power station number, transmission time, corresponding high-voltage electricity data acquisition equipment information, and data collected by the acquisition equipment. The storage module receives the above information to establish a database index and performs index matching on the above information. The query module queries the storage module for the relevant data information required according to the index.

[0005] In some of the embodiments, the digital certificate unit includes a digital certificate parsing unit, a digital certificate verification unit and a digital certificate library. The digital certificate library contains digital certificate information related to all query modules. The digital certificate parsing unit is used to parse the digital certificate carried by the linked query terminal. The digital certificate verification unit is used to match the parsed information with the digital certificate library. After the match is verified correctly, the storage database in the storage module communicates with the corresponding query terminal.

[0006] In some embodiments, the acquisition parameter information query interface unit is specifically implemented as follows: Connect to the database: First, use the create_engine function in the SQLAlchemy library to establish a connection to the SQLite database; Get table information: Then, use the MetaData object to get metadata information in the database, including table structure, etc. Query parameters: Next, use the select method of the Table object to construct a query statement, specifying that the query is for the parameters table, and filter out rows where the device_id column is equal to the given parameter device_id; Execute query: Use the execute method of the connection object to execute the query statement and get the query results; Process query results: traverse the query results and add the parameter name and parameter value of each row to a dictionary; Close the connection: Finally, close the database connection and release resources; Return parameter dictionary: Returns a dictionary containing the queried parameters.

[0007] In some embodiments, the acquisition unified interface unit is specifically implemented as follows: (1) Accepts a parameter dictionary parameters, which contains parameter names and corresponding values; Traverse the parameter dictionary, call the call_external_api function for each parameter, and store the returned data in the collected_data dictionary; Returns the collected data dictionary collected_data; (2) Accept parameter name and value; Match the dictionary consisting of parameter names and values ​​to call the corresponding external API and return the corresponding data; (3) Accept a data dictionary data, which contains data collected from an external API; Call the call_third_party_api function, passing the collected data as parameters, and store the returned integration results in the integration_result dictionary; Returns the integration result dictionary integration_result; (4) Accept a data dictionary data, which contains the collected data; Returns a dictionary containing the success status, calls the corresponding third-party API, and returns the corresponding integration result.

[0008] In some embodiments, the acquisition software management unit is specifically implemented as follows: Import necessary modules: Use from flask import Flask, request, jsonify to import the Flask framework and related modules; Create a Flask application: Use app = Flask(__name__) to create a Flask application; Define routes and view functions: Use the @app.route() decorator to define multiple routes and specify the corresponding HTTP request methods; Install software: In the install_software() view function, extract the software name from the JSON data of the POST request and add it to the installed_software dictionary to indicate that the software has been installed; Configure software: In the configure_software() view function, extract the software name from the JSON data of the POST request and return a message of successful configuration; Start the software: In the start_software() view function, extract the software name from the JSON data of the POST request and return a successful startup message; Stop the software: In the stop_software() view function, extract the software name from the JSON data of the POST request and return a successful stop message; Update software: In the update_software() view function, extract the software name from the JSON data of the POST request and return a successful update message; Start the application: Use app.run(debug=True) to start the Flask application and enable debug mode.

[0009] In some embodiments, the acquisition software type management unit is specifically implemented as follows: Import necessary modules: Use from flask import Flask, request, jsonify to import the Flask framework and related modules; Create a Flask application: Use app = Flask(__name__) to create a Flask application; Define routes and view functions: Use the @app.route() decorator to define a route / match_software_type and specify the corresponding HTTP request method as POST; Matching software type: In the match_software_type() view function, extract the data type data_type from the JSON data of the POST request. If data_type is in the software_types dictionary, get the corresponding software type and return it. If data_type is not in the software_types dictionary, a message is returned indicating that no matching software type was found, and a status code of 404 is returned; Start the application: Use app.run(debug=True) to start the Flask application and enable debug mode.

[0010] In some embodiments, the data acquisition software monitoring unit is specifically implemented as follows: Import necessary modules: import the logging module for logging, import the time module for time operations, import the BackgroundScheduler class and related functional modules for background task scheduling; Configure logging: Use logging.basicConfig() to configure the logger, set the log level to INFO, and specify the log format; Define monitoring data collection function: define monitor_data_collection() function for monitoring data collection, which records monitoring information; Define exception handling function: define handle_exception(e) function to handle exceptions during task execution, and record exception information; Create a background task scheduler: Create a BackgroundScheduler instance scheduler for background task scheduling; Add a scheduled task: Use the scheduler.add_job() method to add a scheduled task to the scheduler to execute the monitor_data_collection() function every 60 seconds; Add an exception listener: Use the scheduler.add_listener() method to add an exception listener to the scheduler to monitor exceptions during task execution. When an exception occurs in a task, the handle_exception() function is called to handle it. Start the scheduler: Use scheduler.start() to start the background task scheduler and start executing scheduled tasks; Main loop and keyboard interrupt processing: Use while True to enter the main loop and keep the program running. Use time.sleep(2) to let the program execute the loop body every 2 seconds to avoid excessive consumption of CPU resources. Use the try-except block to catch keyboard interrupt exceptions. When a keyboard interrupt signal is received, call scheduler.shutdown() to stop the scheduler and log information to indicate that the scheduler has stopped.

[0011] In some of the embodiments, the encryption algorithm of the data encryption storage unit is an asymmetric encryption algorithm RSA, and the encryption algorithm of the data encryption unit is a Keccak hash algorithm.

[0012] In some of the embodiments, the digital certificate corresponding to the digital certificate unit 2 is generated by a management personnel through an encrypted digital certificate generator, and when the digital certificate is generated, the corresponding query terminal matching information is added, and then locked through an independent memory. At the same time, when the digital certificate is generated, the corresponding digital certificate verification information is generated and transmitted to the corresponding digital certificate library in all storage modules through an encrypted network for storage. When in use, the independent memory is inserted into a matching query terminal, and the digital certificate unit 2 on the query terminal extracts the digital certificate in the independent memory and pairs it with the query terminal. If the pairing is successful, the digital certificate is loaded. If the pairing is unsuccessful, the independent memory is disconnected from the query terminal.

[0013] Compared with the prior art, the invention has the following beneficial effects: data collection configuration information is placed on the PC end, the collection software is decoupled from the configuration information, the configuration information is collected and parsed, and the task is executed according to the collection rules; by separating the software business concerns, the complexity of software business division and the workload of software development are reduced; maintenance personnel only need to understand basic SQL statements to complete basic business changes without the participation of developers, which reduces labor costs and realizes automated data collection and aggregation; At the same time, through the setting of storage modules, data can be stored in different places, and multiple storage servers can be set up, which avoids data destruction and the confidentiality and security of data links, and ensures the security of high-voltage electricity collection data; The multi-layer encryption method in the storage module can avoid the consistency of the encrypted data on the PC side and the encrypted data in the storage module's database, ensuring data alienation and pairing, and preventing irrelevant personnel from stealing and decrypting the information intercepted during the PC-side encrypted data network transmission and the information in the storage module's database, thus ensuring data security; By setting the query module and setting a digital certificate in the query module, the communication security between the storage module and the query module is improved; By setting up the random matching unit, it is possible to avoid the same network matching in two adjacent communication connections, avoid the comparison of network monitoring information by irrelevant personnel, and ensure that different network matching information is used for each communication.

[0014] Details of one or more embodiments of the present application are presented in the following drawings and descriptions to make other features, purposes and advantages of the present application more concise and easy to understand. The present application is fully described and understood through the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a system principle block diagram of the present invention; Figure 2A communication diagram between the query module and the storage module of the present invention; Figure 3 A communication diagram between storage modules of the present invention; Figure 4 A communication diagram between the query module and the storage of the present invention; Figure 5 This is the data collection flow chart for the PC side. DETAILED DESCRIPTION

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

[0017] See also Figures 1 to 5 The present invention provides a technical solution: a data acquisition, storage and query system for power equipment production, comprising an acquisition module, a storage module and a query module, wherein the acquisition module is set according to the actual number of high-voltage power stations, the storage module is used to store the data sent by the acquisition module, at least three storage modules are provided, and all storage modules are mutually backed up for data, and the query module is used to extract the data in the storage module for data processing or data query; The acquisition module includes a data acquisition module, an acquisition parameter configuration module and a PC terminal. The data acquisition module and the acquisition parameter configuration module are arranged in the PC terminal, and the PC terminal communicates with the power equipment data acquisition terminal. The data acquisition module includes an acquisition parameter information query interface unit, an acquisition unified interface unit, an acquisition software management unit, an acquisition software type management unit and a data acquisition software monitoring unit; The acquisition parameter configuration module includes a device ID information configuration unit, a database information configuration unit and an acquisition software type information configuration unit; The acquisition parameter information query interface unit and the acquisition unified interface unit communicate with the power equipment data acquisition terminal. The acquisition parameter information query interface unit receives the equipment information and communicates with the acquisition parameter configuration module to match the data. After receiving the matched data information, the acquisition unified interface unit sends the data information to the acquisition software type management unit. The acquisition software type management unit calls the matching acquisition software in the acquisition software management unit based on the received data information. The acquisition unified interface unit returns to the PC end through the called acquisition software for data acquisition, and stores the collected data in the local PC end database. The PC terminal also includes a random matching unit 1 and a data encryption unit. The random matching unit 1 is provided with link information of all storage modules. The random matching unit 1 randomly extracts link information of a storage module, and the PC terminal communicates with the storage module. The data collected by the PC terminal is encrypted by the data encryption unit and then transmitted to the linked storage module. The storage module includes an independently arranged storage server, a data decryption unit 1 arranged in the storage server, a data encryption storage unit, a data update synchronization unit, a digital certificate unit 1 and a storage database. The encryption algorithm of the data encryption storage unit is different from the encryption algorithm of the data encryption unit. The data decryption unit 1 is used to decrypt the data encrypted by the data encryption unit. The data encryption storage unit is used to encrypt the data decrypted by the data decryption unit 1 and store it in the storage database. The data update synchronization unit is used to monitor the data of the storage database. When the data encryption storage unit stores the encrypted data in the storage database, the data update synchronization unit is triggered to run. The data update synchronization unit communicates with the storage servers of all other remaining storage modules, and synchronizes the stored data in the storage database of this storage server to other storage servers, so as to keep the storage database data of all storage servers consistent. The digital certificate unit 1 stores the certificate information related to all query modules, which is used to verify the communication legalization link of the query module. The query module includes a query terminal, a digital certificate unit 2 set in the query terminal, a data decryption unit 2, and a random matching unit 2. The random matching unit 2 is provided with link information of all storage modules. The random matching unit 2 randomly extracts a storage module link information, and the query terminal communicates with the storage module. The digital certificate unit 2 stores the digital certificate of the query terminal. The digital certificate unit 1 is used to verify the digital certificate unit 2 and link the network communication between the query terminal and the storage server after verification. After the query terminal extracts the corresponding data from the storage database, the data decryption unit 2 is used to decrypt the encrypted data. The operation mode of the random matching unit 1 is: (1) Sort and number the link information of all storage modules and form an original array; (2) Using the shuffling algorithm, the original array is shuffled and randomly sorted to form a random array; (3) Extract the numbers at the corresponding positions in the random array according to the preset extraction sorting number; (4) Based on the extracted number corresponding to the corresponding link information, the storage module corresponding to the link information on the PC side is realized through the link information; (5) According to step (4), when the PC terminal is not communicating with the storage module for the first time, the random matching unit removes the number corresponding to the last link information from the original array, and then shuffles and randomly sorts the array through a shuffling algorithm to form a corresponding random array; (6) Then, after extracting the corresponding link information through steps (3) and (4), communication between the PC and the storage module is realized; The random matching unit 2 is processed in the same manner as the data matching unit 1, and the extraction order of the random matching unit 2 is inconsistent with the extraction order of the random matching unit 1. For example, the extraction order of the random matching unit 1 is 1, and the extraction order of the random matching unit 2 is 2, that is, in the corresponding random array, the first number or the second number is extracted.

[0018] The acquisition modules are numbered according to the corresponding high-voltage power stations, and each number is matched with the high-voltage electricity data acquisition equipment information corresponding to the high-voltage power station. Each time the data is transmitted to the storage module from the PC, it includes the high-voltage power station number, transmission time, corresponding high-voltage electricity data acquisition equipment information, and data collected by the acquisition equipment. The storage module receives the above information to establish a database index and performs index matching on the above information. The query module queries the storage module for the relevant data information required according to the index.

[0019] The digital certificate unit 1 includes a digital certificate parsing unit, a digital certificate verification unit and a digital certificate library. The digital certificate library contains digital certificate information related to all query modules. The digital certificate parsing unit is used to parse the digital certificate carried by the linked query terminal. The digital certificate verification unit is used to match the parsed information with the digital certificate library. After the match is verified correctly, the storage database in the storage module communicates with the corresponding query terminal.

[0020] The encryption algorithm of the data encryption storage unit is the asymmetric encryption algorithm RSA, and the encryption algorithm of the data encryption unit is the Keccak hash algorithm.

[0021] The digital certificate corresponding to the digital certificate unit 2 is generated by the management personnel through the encrypted digital certificate generator, and when the digital certificate is generated, the corresponding query terminal matching information is added, and then locked through the independent memory. At the same time, when the digital certificate is generated, the corresponding digital certificate verification information is generated, and transmitted to the corresponding digital certificate library in all storage modules through the encrypted network for storage. When in use, the independent memory is inserted into the query terminal that matches it, and the digital certificate unit 2 on the query terminal extracts the digital certificate in the independent memory and pairs it with the query terminal. If the pairing is successful, the digital certificate is loaded, and if the pairing is unsuccessful, the independent memory is disconnected from the query terminal. Example

[0022] The acquisition parameter information query interface unit is specifically implemented as follows: Connect to the database: First, use the create_engine function in the SQLAlchemy library to establish a connection to the SQLite database; Get table information: Then, use the MetaData object to get metadata information in the database, including table structure, etc. Query parameters: Next, use the select method of the Table object to construct a query statement, specifying that the query is for the parameters table, and filter out rows where the device_id column is equal to the given parameter device_id; Execute query: Use the execute method of the connection object to execute the query statement and get the query results; Process query results: traverse the query results and add the parameter name and parameter value of each row to a dictionary; Close the connection: Finally, close the database connection and release resources; Return parameter dictionary: Returns a dictionary containing the queried parameters.

[0023] The specific process of the above method is as follows: def query_parameters(device_id): parameters = {} from sqlalchemy import create_engine, MetaData, Table, select engine = create_engine('sqlite: / / / parameters.db') conn = engine.connect() metadata = MetaData() parameters_table = Table('parameters', metadata, autoload=True,autoload_with=engine) query = select([parameters_table]).where(parameters_table.columns.device_id == device_id) result = conn.execute(query) for row in result: parameters[row['parameter_name']] = row['parameter_value'] conn.close() return parameters

[0024] The specific implementation of the unified acquisition interface unit is as follows: (1) Accepts a parameter dictionary parameters, which contains parameter names and corresponding values; Traverse the parameter dictionary, call the call_external_api function for each parameter, and store the returned data in the collected_data dictionary; Returns the collected data dictionary collected_data; (2) Accept parameter name and value; Match the dictionary consisting of parameter names and values ​​to call the corresponding external API and return the corresponding data; (3) Accept a data dictionary data, which contains data collected from an external API; Call the call_third_party_api function, passing the collected data as parameters, and store the returned integration results in the integration_result dictionary; Returns the integration result dictionary integration_result; (4) Accept a data dictionary data, which contains the collected data; Returns a dictionary containing the success status, calls the corresponding third-party API, and returns the corresponding integration result.

[0025] The specific process of the above method is as follows: def collect_data(parameters): collected_data = {} for parameter, value in parameters.items(): collected_data[parameter] = call_external_api(parameter,value) return collected_data def call_external_api(parameter, value): return {'value': value} def integrate_with_third_party(data): integration_result = {} integration_result = call_third_party_api(data) return integration_result def call_third_party_api(data): return {'status': 'success'}

[0026] The acquisition software management unit is specifically implemented as follows: Import necessary modules: Use from flask import Flask, request, jsonify to import the Flask framework and related modules; Create a Flask application: Use app = Flask(__name__) to create a Flask application; Define routes and view functions: Use the @app.route() decorator to define multiple routes and specify the corresponding HTTP request methods; Install software: In the install_software() view function, extract the software name from the JSON data of the POST request and add it to the installed_software dictionary to indicate that the software has been installed; Configure software: In the configure_software() view function, extract the software name from the JSON data of the POST request and return a message of successful configuration; Start the software: In the start_software() view function, extract the software name from the JSON data of the POST request and return a successful startup message; Stop the software: In the stop_software() view function, extract the software name from the JSON data of the POST request and return a successful stop message; Update software: In the update_software() view function, extract the software name from the JSON data of the POST request and return a successful update message; Start the application: Use app.run(debug=True) to start the Flask application and enable debug mode.

[0027] The specific process of the above method is as follows: from flask import Flask, request, jsonify app = Flask(__name__) installed_software = {} @app.route(' / install_software', methods=['POST']) def install_software(): software_name = request.json.get('name') installed_software[software_name] = True return jsonify({'message': f'{software_name} installedsuccessfully.'}) @app.route(' / configure_software', methods=['POST']) def configure_software(): software_name = request.json.get('name') return jsonify({'message': f'{software_name} configuredsuccessfully.'}) @app.route(' / start_software', methods=['POST']) def start_software(): software_name = request.json.get('name') return jsonify({'message': f'{software_name} startedsuccessfully.'}) @app.route(' / stop_software', methods=['POST']) def stop_software(): software_name = request.json.get('name') return jsonify({'message': f'{software_name} stoppedsuccessfully.'}) @app.route(' / update_software', methods=['POST']) def update_software(): software_name = request.json.get('name') return jsonify({'message': f'{software_name} updatedsuccessfully.'}) if __name__ == '__main__': app.run(debug=True)

[0028] The specific implementation of the acquisition software type management unit is as follows: Import necessary modules: Use from flask import Flask, request, jsonify to import the Flask framework and related modules; Create a Flask application: Use app = Flask(__name__) to create a Flask application; Define routes and view functions: Use the @app.route() decorator to define a route / match_software_type and specify the corresponding HTTP request method as POST; Matching software type: In the match_software_type() view function, extract the data type data_type from the JSON data of the POST request. If data_type is in the software_types dictionary, get the corresponding software type and return it. If data_type is not in the software_types dictionary, a message is returned indicating that no matching software type was found, and a status code of 404 is returned; Start the application: Use app.run(debug=True) to start the Flask application and enable debug mode.

[0029] The specific process of the above method is as follows: from flask import Flask, request, jsonify app = Flask(__name__) software_types = { 'type1': 'os1', 'type2': 'os2', 'type3': 'os1', } @app.route(' / match_software_type', methods=['POST']) def match_software_type(): data_info = request.json data_type = data_info.get('data_type') if data_type in software_types: software_type = software_types[data_type] return jsonify({'software_type': software_type}) else: return jsonify({'message': 'No matching software typefound.'}), 404 if __name__ == '__main__': app.run(debug=True)

[0030] The data acquisition software monitoring unit is specifically implemented as follows: Import necessary modules: import the logging module for logging, import the time module for time operations, import the BackgroundScheduler class and related functional modules for background task scheduling; Configure logging: Use logging.basicConfig() to configure the logger, set the log level to INFO, and specify the log format; Define monitoring data collection function: define monitor_data_collection() function for monitoring data collection, which records monitoring information; Define exception handling function: define handle_exception(e) function to handle exceptions during task execution, and record exception information; Create a background task scheduler: Create a BackgroundScheduler instance scheduler for background task scheduling; Add a scheduled task: Use the scheduler.add_job() method to add a scheduled task to the scheduler to execute the monitor_data_collection() function every 60 seconds; Add an exception listener: Use the scheduler.add_listener() method to add an exception listener to the scheduler to monitor exceptions during task execution. When an exception occurs in a task, the handle_exception() function is called to handle it. Start the scheduler: Use scheduler.start() to start the background task scheduler and start executing scheduled tasks; Main loop and keyboard interrupt processing: Use while True to enter the main loop and keep the program running. Use time.sleep(2) to let the program execute the loop body every 2 seconds to avoid excessive consumption of CPU resources. Use the try-except block to catch keyboard interrupt exceptions. When a keyboard interrupt signal is received, call scheduler.shutdown() to stop the scheduler and log information to indicate that the scheduler has stopped.

[0031] The specific process of the above method is as follows: import logging import time from apscheduler.schedulers.background import BackgroundScheduler logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') def monitor_data_collection(): logging.info("Monitoring data collection...") def handle_exception(e): logging.error(f"An error occurred: {e}") scheduler = BackgroundScheduler() scheduler.add_job(monitor_data_collection, 'interval', seconds=60) #Execute the monitoring function every 60 seconds scheduler.add_listener(handle_exception, 'job_error') # listen for exceptions during task execution scheduler.start() try: while True: time.sleep(2) except KeyboardInterrupt: scheduler.shutdown() logging.info("Scheduler stopped.") Example

[0032] Through the technical solution of this application, when used: (1) By configuring the PC end, the PC end is embedded with the management software of the corresponding high-voltage electric data acquisition device, and the PC end is connected to the corresponding high-voltage electric data acquisition device through the management software to perform data communication; (2) After the corresponding high-voltage electricity data acquisition device detects the corresponding data, the PC collects the data and aggregates the data of all high-voltage electricity data acquisition devices of the high-voltage power station corresponding to the PC according to a preset timestamp to form a data packet under the timestamp, and encrypts the data packet through the data encryption unit; (3) Based on the random matching unit 1, the link information of the storage module is randomly extracted, and the network connection with the corresponding storage server is established through the extracted link information, and the encrypted post-data packet is uploaded; (4) After receiving the data packet, the storage server decrypts the data encrypted by the data encryption unit through the data decryption unit 1; (5) The decrypted data packet is then re-encrypted by the data encryption storage unit and stored in a storage database, and the storage database generates an index corresponding to the data packet; (6) After the data encryption storage unit stores the encrypted data in the storage database, it triggers the data update synchronization unit to run, and communicates with the storage servers of all other storage modules through the data update synchronization unit, and synchronizes the stored data in the storage database of the storage server to other storage servers, so as to keep the storage database data of all storage servers consistent; (7) When data query is required, the corresponding digital certificate is loaded through the query terminal connected to the matching storage device with the digital certificate installed; (8) Then, the random matching unit 2 randomly extracts the link information of the storage module, and establishes a network connection with the corresponding storage server through the extracted link information. During the connection process, the storage server receives the digital certificate in the query terminal, and parses the digital certificate of the linked query terminal through the digital certificate parsing unit, and matches the parsed information with the digital certificate library through the digital certificate verification unit. After the matching and verification are correct, the storage database in the storage server communicates with the corresponding query terminal; (9) Then, the required data is searched through the index directory in the storage database, and the data is extracted to the query terminal; (10) The query terminal decrypts the extracted data through the data decryption unit 2 to obtain the final actual collected data.

[0033] In addition, in order to achieve distributed processing of storage servers, all storage servers are not placed in the same center, ensuring the security of the storage servers.

[0034] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

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

Claims

1. A data collection, storage and query system for power equipment production, characterized by: It includes a collection module, a storage module and a query module. The collection module is set according to the actual number of high-voltage power stations. The storage module is used to store the data sent by the collection module. There are at least three storage modules, and all storage modules back up each other's data. The query module is used to extract the data in the storage module for data processing or data query; The acquisition module includes a data acquisition module, an acquisition parameter configuration module and a PC terminal. The data acquisition module and the acquisition parameter configuration module are arranged in the PC terminal, and the PC terminal communicates with the power equipment data acquisition terminal. The data acquisition module includes an acquisition parameter information query interface unit, an acquisition unified interface unit, an acquisition software management unit, an acquisition software type management unit and a data acquisition software monitoring unit; The acquisition parameter configuration module includes a device ID information configuration unit, a database information configuration unit and an acquisition software type information configuration unit; The acquisition parameter information query interface unit and the acquisition unified interface unit communicate with the power equipment data acquisition terminal. The acquisition parameter information query interface unit receives the equipment information and communicates with the acquisition parameter configuration module to match the data. After receiving the matched data information, the acquisition unified interface unit sends the data information to the acquisition software type management unit. The acquisition software type management unit calls the matching acquisition software in the acquisition software management unit based on the received data information. The acquisition unified interface unit returns to the PC end through the called acquisition software for data acquisition, and stores the collected data in the local PC end database. The PC terminal also includes a random matching unit 1 and a data encryption unit. The random matching unit 1 is provided with link information of all storage modules. The random matching unit 1 randomly extracts link information of a storage module, and the PC terminal communicates with the storage module. The data collected by the PC terminal is encrypted by the data encryption unit and then transmitted to the linked storage module. The storage module includes an independently arranged storage server, a data decryption unit 1 arranged in the storage server, a data encryption storage unit, a data update synchronization unit, a digital certificate unit 1 and a storage database. The encryption algorithm of the data encryption storage unit is different from the encryption algorithm of the data encryption unit. The data decryption unit 1 is used to decrypt the data encrypted by the data encryption unit. The data encryption storage unit is used to encrypt the data decrypted by the data decryption unit 1 and store it in the storage database. The data update synchronization unit is used to monitor the data of the storage database. When the data encryption storage unit stores the encrypted data in the storage database, the data update synchronization unit is triggered to run. The data update synchronization unit communicates with the storage servers of all other remaining storage modules, and synchronizes the stored data in the storage database of this storage server to other storage servers, so as to keep the storage database data of all storage servers consistent. The digital certificate unit 1 stores the certificate information related to all query modules, which is used to verify the communication legalization link of the query module. The query module includes a query terminal, a digital certificate unit 2 set in the query terminal, a data decryption unit 2, and a random matching unit 2. The random matching unit 2 is provided with link information of all storage modules. The random matching unit 2 randomly extracts a storage module link information, and the query terminal communicates with the storage module. The digital certificate unit 2 stores the digital certificate of the query terminal. The digital certificate unit 1 is used to verify the digital certificate unit 2 and link the network communication between the query terminal and the storage server after verification. After the query terminal extracts the corresponding data from the storage database, the data decryption unit 2 is used to decrypt the encrypted data. The operation mode of the random matching unit 1 is: (1) Sort and number the link information of all storage modules and form an original array; (2) Using the shuffling algorithm, the original array is shuffled and randomly sorted to form a random array; (3) Extract the numbers at the corresponding positions in the random array according to the preset extraction sorting number; (4) Based on the extracted number corresponding to the corresponding link information, the PC end is implemented with the storage module corresponding to the link information through the link information; (5) According to step (4), when the PC terminal is not communicating with the storage module for the first time, the random matching unit removes the number corresponding to the last link information from the original array, and then shuffles and randomly sorts the array through a shuffling algorithm to form a corresponding random array; (6) Then, after extracting the corresponding link information through steps (3) and (4), communication between the PC and the storage module is realized; The random matching unit 2 and the data matching unit 1 are processed in the same manner, and the extraction order of the random matching unit 2 is inconsistent with the extraction order of the random matching unit 1.

2. A data acquisition, storage and query system for power equipment production according to claim 1, characterized in that: The acquisition modules are numbered according to the corresponding high-voltage power stations, and each number is matched with the high-voltage electricity data acquisition equipment information corresponding to the high-voltage power station. Each time the data is transmitted to the storage module from the PC, it includes the high-voltage power station number, transmission time, corresponding high-voltage electricity data acquisition equipment information, and data collected by the acquisition equipment. The storage module receives the above information to establish a database index and performs index matching on the above information. The query module queries the storage module for the relevant data information required according to the index.

3. The data acquisition, storage and query system for power equipment production according to claim 1 is characterized in that: The digital certificate unit 1 includes a digital certificate parsing unit, a digital certificate verification unit and a digital certificate library. The digital certificate library contains digital certificate information related to all query modules. The digital certificate parsing unit is used to parse the digital certificate carried by the linked query terminal. The digital certificate verification unit is used to match the parsed information with the digital certificate library. After the match is verified correctly, the storage database in the storage module communicates with the corresponding query terminal.

4. The data acquisition, storage and query system for power equipment production according to claim 1 is characterized in that: The acquisition parameter information query interface unit is specifically implemented as follows: Connect to the database: First, use the create_engine function in the SQLAlchemy library to establish a connection to the SQLite database; Get table information: Then, use the MetaData object to get metadata information in the database, including table structure, etc. Query parameters: Next, use the select method of the Table object to construct a query statement, specifying that the query is for the parameters table, and filter out rows where the device_id column is equal to the given parameter device_id; Execute query: Use the execute method of the connection object to execute the query statement and get the query results; Process query results: traverse the query results and add the parameter name and parameter value of each row to a dictionary; Close the connection: Finally, close the database connection and release resources; Return parameter dictionary: Returns a dictionary containing the queried parameters.

5. The data acquisition, storage and query system for power equipment production according to claim 1 is characterized in that: The specific implementation of the unified acquisition interface unit is as follows: (1) Accepts a parameter dictionary parameters, which contains parameter names and corresponding values; Traverse the parameter dictionary, call the call_external_api function for each parameter, and store the returned data in the collected_data dictionary; Returns the collected data dictionary collected_data; (2) Accept parameter name and value; Match the dictionary consisting of parameter names and values ​​to call the corresponding external API and return the corresponding data; (3) Accept a data dictionary data, which contains data collected from an external API; Call the call_third_party_api function, passing the collected data as parameters, and store the returned integration results in the integration_result dictionary; Return the integration result dictionary integration_result; (4) Accept a data dictionary data, which contains the collected data; Returns a dictionary containing the success status, calls the corresponding third-party API, and returns the corresponding integration result.

6. The data acquisition, storage and query system for power equipment production according to claim 1 is characterized in that: The acquisition software management unit is specifically implemented as follows: Import necessary modules: Use from flask import Flask, request, jsonify to import the Flask framework and related modules; Create a Flask application: Use app = Flask(__name__) to create a Flask application; Define routes and view functions: Use the @app.route() decorator to define multiple routes and specify the corresponding HTTP request methods; Install software: In the install_software() view function, extract the software name from the JSON data of the POST request and add it to the installed_software dictionary to indicate that the software has been installed; Configure software: In the configure_software() view function, extract the software name from the JSON data of the POST request and return a message of successful configuration; Start the software: In the start_software() view function, extract the software name from the JSON data of the POST request and return a successful startup message; Stop the software: In the stop_software() view function, extract the software name from the JSON data of the POST request and return a successful stop message; Update software: In the update_software() view function, extract the software name from the JSON data of the POST request and return a successful update message; Start the application: Use app.run(debug=True) to start the Flask application and enable debug mode.

7. The data acquisition, storage and query system for power equipment production according to claim 1 is characterized in that: The specific implementation of the acquisition software type management unit is as follows: Import necessary modules: Use from flask import Flask, request, jsonify to import the Flask framework and related modules; Create a Flask application: Use app = Flask(__name__) to create a Flask application; Define routes and view functions: Use the @app.route() decorator to define a route / match_software_type and specify the corresponding HTTP request method as POST; Matching software type: In the match_software_type() view function, extract the data type data_type from the JSON data of the POST request. If data_type is in the software_types dictionary, get the corresponding software type and return it. If data_type is not in the software_types dictionary, a message is returned indicating that no matching software type was found, and a status code of 404 is returned; Start the application: Use app.run(debug=True) to start the Flask application and enable debug mode.

8. The data acquisition, storage and query system for power equipment production according to claim 1 is characterized in that: The data acquisition software monitoring unit is specifically implemented as follows: Import necessary modules: import the logging module for logging, import the time module for time operations, import the BackgroundScheduler class and related functional modules for background task scheduling; Configure logging: Use logging.basicConfig() to configure the logger, set the log level to INFO, and specify the log format; Define monitoring data collection function: define monitor_data_collection() function for monitoring data collection, which records monitoring information; Define exception handling function: define handle_exception(e) function to handle exceptions during task execution, and record exception information; Create a background task scheduler: Create a BackgroundScheduler instance scheduler for background task scheduling; Add a scheduled task: Use the scheduler.add_job() method to add a scheduled task to the scheduler to execute the monitor_data_collection() function every 60 seconds; Add an exception listener: Use the scheduler.add_listener() method to add an exception listener to the scheduler to monitor exceptions during task execution. When an exception occurs in a task, the handle_exception() function is called to handle it. Start the scheduler: Use scheduler.start() to start the background task scheduler and start executing scheduled tasks; Main loop and keyboard interrupt processing: Use while True to enter the main loop and keep the program running. Use time.sleep(2) to let the program execute the loop body every 2 seconds to avoid excessive consumption of CPU resources. Use the try-except block to catch keyboard interrupt exceptions. When a keyboard interrupt signal is received, call scheduler.shutdown() to stop the scheduler and log information to indicate that the scheduler has stopped.

9. The data acquisition, storage and query system for power equipment production according to claim 1, characterized in that: The encryption algorithm of the data encryption storage unit is the asymmetric encryption algorithm RSA, and the encryption algorithm of the data encryption unit is the Keccak hash algorithm.

10. The data acquisition, storage and query system for electric power equipment production according to claim 3, characterized in that: The digital certificate corresponding to the digital certificate unit 2 is generated by the management personnel through an encrypted digital certificate generator, and when the digital certificate is generated, the corresponding query terminal matching information is added, and then locked through an independent memory. At the same time, when the digital certificate is generated, the corresponding digital certificate verification information is generated and transmitted to the corresponding digital certificate library in all storage modules through an encrypted network for storage. When in use, the independent memory is inserted into a matching query terminal, and the digital certificate unit 2 on the query terminal extracts the digital certificate in the independent memory and pairs it with the query terminal. If the pairing is successful, the digital certificate is loaded. If the pairing is unsuccessful, the independent memory is disconnected from the query terminal.

Citation Information

Patent Citations

  • Power big data transmission method and system based on rapid matching and integrity detection

    CN106506453A

  • Data management method and device of transformer substation and electronic equipment

    CN118051934A

  • Enterprise-level mass power data search engine dynamic modeling method and system

    CN118193525A