Data processing method and device, optical storage and direct flexible device, system and storage medium
By pre-setting protocol plugins in the optical-storage-direct-flexible system and dynamically selecting target plugins for data parsing and storage, the programming requirements of the optical-storage-direct-flexible system when multiple protocol devices are connected are solved, achieving plug-and-play functionality and efficient data interaction.
Patent Information
- Application Number
- CN202511363479.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-23
AI Technical Summary
Existing optical-storage-direct-connect-flexible systems require rewriting the GDC program when multiple protocol devices are connected, resulting in a large workload for development and maintenance, low communication efficiency, and system response delays.
By pre-setting multiple protocol plugins, the target protocol plugin is dynamically selected based on the device information for data parsing and format conversion, and the data is stored using the target gateway, achieving plug-and-play functionality.
It reduces system expansion costs, improves data interaction efficiency, reduces communication pressure, and supports efficient access and data management for devices from multiple vendors and using multiple protocols.
Smart Images

Figure CN120881173B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of optical storage direct flexible system, and particularly relate to a data processing method and device, an optical storage direct flexible equipment, a system and a storage medium. BACKGROUND
[0002] With the rapid development of new energy, photovoltaic power generation, energy storage regulation, direct current power distribution and flexible regulation gradually integrate, forming an optical storage direct flexible system, a comprehensive energy management technology. With the continuous expansion of the system scale, the types and quantities of access equipment increase dramatically, and the communication protocols and versions used by different equipment differ greatly, causing complexity in data management and interconnection of the system.
[0003] In the prior art, data acquisition of the optical storage direct flexible system usually relies on a general digital controller gateway (Gateway Data Controller, GDC). When a new device is connected, if the device uses a new communication protocol, the GDC must be reprogrammed to support protocol recognition and data acquisition. At the same time, at the data receiving end (such as application programs, web pages, touch screens, etc.), the corresponding data analysis logic needs to be written according to different communication protocols. This not only increases the development and maintenance workload, but also significantly increases the complexity of data analysis in the scenario of multiple protocols in parallel, which easily causes low communication efficiency and system response delay.
[0004] Therefore, the existing optical storage direct flexible system still has the following technical problems in the process of multi-protocol device access and data interaction: when a new communication protocol device is connected, the GDC program must be re-written to adapt to the protocol, which is complex and inefficient. Therefore, how to improve the data interaction efficiency of the optical storage direct flexible system has become a problem to be solved. SUMMARY
[0005] In view of this, in order to solve the above or part of the technical problems, embodiments of the present application provide a data processing method and device, an optical storage direct flexible equipment, a system and a storage medium.
[0006] In a first aspect, the embodiments of the present application provide a data processing method, comprising:
[0007] When a target device is detected to access the system, device information of the target device is acquired, and a plurality of protocol plug-ins for processing different protocols are pre-set in the system;
[0008] According to the device information, a target protocol plug-in corresponding to the target device is determined, so as to analyze target data sent by the target device into target format data through the target protocol plug-in;
[0009] sending the target format data to a target gateway of the system, so as to store the target format data through the target gateway;
[0010] The target protocol plug-in corresponding to the target device is determined according to the device information, and the method comprises the following steps:
[0011] It is judged whether the device protocol type and the device protocol version in the device information match the plug-in protocol type and the plug-in protocol version of each protocol plug-in;
[0012] If the judgment result is matching, it is determined that the matching protocol plug-in is the target protocol plug-in;
[0013] If the judgment result is not matching, a target protocol plug-in matching the protocol type and the device protocol version is imported into the system.
[0014] In one possible implementation, before the target device accesses the system, the method further comprises:
[0015] Protocol plug-ins of a plurality of protocols are imported into the system, and the plug-in protocol type and the plug-in protocol version corresponding to each protocol plug-in are obtained for storage;
[0016] The device information of the target device is obtained, and the method comprises the following steps:
[0017] The device protocol type and the device protocol version of the device are obtained as the device information.
[0018] In one possible implementation, the target protocol plug-in matching the protocol type and the device protocol version is imported into the system, and the method comprises the following steps:
[0019] It is judged whether the cloud end has a target protocol plug-in matching the protocol type and the device protocol version;
[0020] If the judgment result is yes, the target protocol plug-in is obtained from the cloud end and imported into the system;
[0021] If the judgment result is no, a target model is called, an analysis template is generated according to the protocol type and the protocol version, and the analysis template is used as the target protocol plug-in.
[0022] In one possible implementation, the target format data is stored through the target gateway, and the method comprises the following steps:
[0023] A corresponding storage location is set for each protocol plug-in in the target gateway;
[0024] The target format data and the device identifier of the target device are received through the target gateway;
[0025] determine a target storage location corresponding to the target protocol plug-in, and store the device identity and the target format data in the target storage location.
[0026] In one possible implementation, the method further includes:
[0027] receiving a data query request for first data, the data query request including a first device identity of a device sending the first data and a first data identity of the first data;
[0028] determining a first storage location where the first data is located according to the first device identity, and obtaining the first data from the first storage location according to the first data identity.
[0029] In a second aspect, an embodiment of the present application provides an optical storage and direct access system for implementing the method in the first aspect, and the system includes:
[0030] a control module, a target gateway, and a plurality of plug-in modules, each of the plug-in modules loading a different protocol plug-in;
[0031] The control module is configured to determine a target protocol plug-in according to device information sent by a device, and a target plug-in module corresponding to the target protocol plug-in.
[0032] The target plug-in module is configured to parse data sent by the device into target format data.
[0033] The target gateway is configured to receive and store the target format data.
[0034] The target gateway is further configured to query data according to a data query request when the data query request is received.
[0035] The control module is specifically configured to determine whether a device protocol type and a device protocol version in the device information match a plug-in protocol type and a plug-in protocol version of each protocol plug-in.
[0036] If the determination result is a match, the matched protocol plug-in is determined to be the target protocol plug-in.
[0037] If the determination result is a mismatch, a target protocol plug-in matching the protocol type and the device protocol version is imported for the system.
[0038] In a third aspect, an embodiment of the present application provides a data processing apparatus, including:
[0039] The acquisition module is used to acquire device information of the target device when the target device is detected to be connected to the system. The system is pre-configured with multiple protocol plugins that process different protocols.
[0040] The determination module is used to determine the target protocol plugin corresponding to the target device based on the device information, so as to parse the target data sent by the target device into target format data through the target protocol plugin;
[0041] A sending module is used to send the target format data to the target gateway of the system, so that the target format data can be stored through the target gateway;
[0042] The determining module is specifically used to determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin;
[0043] If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin;
[0044] If the determination result is a mismatch, then import a target protocol plugin that matches the protocol type and the device protocol version for the system.
[0045] Fourthly, embodiments of the present invention provide an optical storage direct current flexible device, characterized in that it includes: a processor and a memory, wherein the processor is used to execute a data processing program stored in the memory to implement the data processing method described in any one of the first aspects above.
[0046] Fifthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the data processing method described in any one of the first aspects.
[0047] The data processing scheme provided in this invention involves obtaining device information of a target device when it is detected that the device is accessing the system. Multiple protocol plugins for processing different protocols are pre-configured in the system. Based on the device information, a target protocol plugin corresponding to the target device is determined, and the target protocol plugin parses the target data sent by the target device into target format data. The target format data is then sent to the target gateway of the system for storage. Therefore, a suitable plugin can be dynamically selected based on the device information accessing the system to complete data parsing and conversion into target format data for storage. This eliminates the need for re-encoding, ensuring compatibility with new protocol devices, reducing system expansion costs, improving interaction efficiency, and reducing communication pressure. Attached Figure Description
[0048] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of the present invention;
[0049] Figure 2 A flowchart illustrating another data processing method provided in an embodiment of the present invention;
[0050] Figure 3 This is a schematic diagram of the structure of a direct-drive flexible optical storage system provided in an embodiment of the present invention;
[0051] Figure 4 A flowchart illustrating another data processing method provided in an embodiment of the present invention;
[0052] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present invention;
[0053] Figure 6 This is a schematic diagram of the structure of a photovoltaic storage direct current flexible device provided in an embodiment of the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0055] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0056] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method specifically includes:
[0057] S11. When the target device is detected to be connected to the system, the device information of the target device is obtained. Multiple protocol plugins for processing different protocols are pre-set in the system.
[0058] The data processing method provided in this invention is applied to photovoltaic-storage-DC-flexible systems (e.g., a photovoltaic-storage-DC-flexible system). In such systems, multiple devices may be simultaneously connected to the site, including photovoltaic inverters, energy storage battery management systems, DC power distribution devices, and flexible control controllers. These devices employ different communication protocols (e.g., Modbus, CAN, MQTT, TCP / IP, etc.). Upon connection of a new device, the system in this embodiment automatically matches the appropriate protocol plugin based on the device information, parses the data, uniformly converts the format, and then stores it in the gateway. This allows for the connection of devices with different protocols without reprogramming the gateway, and the receiving end (e.g., an APP, webpage, or touchscreen monitoring interface) directly reads data in a unified format from the gateway without needing to consider underlying protocol differences, achieving plug-and-play access and efficient data interaction for devices from multiple vendors and using multiple protocols.
[0059] In this embodiment, within the photovoltaic-storage-DC-flexible system, the target equipment refers to various power or energy-related terminal devices connected to the system (e.g., photovoltaic inverters, energy storage battery management systems, DC power distribution devices, flexible control controllers, smart power terminals, etc.). These devices are often provided by different manufacturers and use different communication protocols. The methods for connecting these devices to the system can include: wired connection: connecting to the system's acquisition terminal (e.g., a GDC gateway) via RS485, CAN bus, Ethernet port, etc.; wireless connection: establishing a connection with the GDC gateway via wireless communication modules such as WiFi, 4G / 5G, etc.
[0060] Specifically, when a target device connects to the optical-storage-direct-connection-flexible system, the system first triggers an access detection mechanism via GDC. The detection method can be network layer handshake, heartbeat reporting, or bus identification. Subsequently, the system automatically reads the target device's equipment information, which includes, but is not limited to: device model, manufacturer identifier, communication protocol type, and version number. This information is used to provide a basis for subsequent protocol plugin selection.
[0061] In the optical-storage-direct-drive-flexible system, various protocol plugins (e.g., CAN, Modbus, TCP, MQTT, etc.) are pre-configured to handle the communication protocols of different devices. Each plugin contains logic for recognizing and parsing protocol message structures and is deployed in a plug-in format for easy dynamic loading and unloading. The plugins are responsible for receiving and parsing data packets uploaded by the target device. This ensures that the system can be extended to adapt to new devices through plugins without modifying the core GDC program.
[0062] S12. Determine the target protocol plugin corresponding to the target device based on the device information, so as to parse the target data sent by the target device into target format data through the target protocol plugin.
[0063] In this embodiment, the system matches the acquired device information with known protocol identifiers in the protocol plugin library. Matching methods can include key field comparison (such as protocol type ID), version number mapping table lookup, or dynamic judgment via a rule engine. This determines the target protocol plugin that matches the target device, and the system automatically calls that target protocol plugin as the parsing engine. This enables automatic matching of devices and plugins, improving access efficiency.
[0064] Furthermore, during operation, the target device sends raw data packets to the system as target data. The system parses this target data using the loaded target protocol plugin, extracting standardized parameter information (e.g., voltage, current, power, operating status, etc.). The parsed data is then uniformly converted into target format data (e.g., JSON data format: (Key: Value) such as voltage: 252.2V, current: 12A, power: 5000W). This eliminates the differences between different protocols, forming a unified data representation method.
[0065] In one possible implementation, it is determined whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin; if the determination result is a match, the matching protocol plugin is determined as the target protocol plugin; if the determination result is a mismatch, the target protocol plugin that matches the protocol type and device protocol version is imported into the system.
[0066] S13. Send the target format data to the system's target gateway so that the target format data can be stored through the target gateway.
[0067] In this embodiment, the system sends the parsed target format data to the target gateway of the optical-storage-direct-flexible system (e.g., the data storage module of the GDC). The target gateway is responsible for local storage and indexing management of the target format data based on device information, and provides a unified data query interface for upper-layer applications (APP, web page, touch screen). Therefore, the receiving end only needs to call the data according to the unified format, without needing to concern itself with the underlying protocol, simplifying the logic and improving interaction efficiency.
[0068] The data processing method provided in this invention involves obtaining device information of a target device when it is detected that the device is accessing the system. Multiple protocol plugins for processing different protocols are pre-configured in the system. Based on the device information, a target protocol plugin corresponding to the target device is determined, and the target protocol plugin parses the target data sent by the target device into target format data. The target format data is then sent to the target gateway of the system for storage. Therefore, a suitable plugin can be dynamically selected based on the device information accessing the system to complete data parsing and conversion into target format data for storage. This eliminates the need for re-encoding, ensuring compatibility with new protocol devices, reducing system expansion costs, improving interaction efficiency, and reducing communication pressure.
[0069] Figure 2 This is a flowchart illustrating another data processing method provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method specifically includes:
[0070] S21. Import protocol plugins for multiple protocols into the system, and obtain the plugin protocol type and plugin protocol version corresponding to each protocol plugin for storage; when a target device is detected to be connected to the system, obtain the device protocol type and device protocol version of the device as device information.
[0071] In this embodiment, during system initialization or operation, multiple different protocol plugins are imported. Upon import of each plugin, the system automatically acquires and records its corresponding protocol type (e.g., Modbus), indicating the types of communication protocols the plugin can parse, and its protocol version (e.g., Modbus RTU V1.1), indicating the version of the current type of communication protocol the plugin can parse. This protocol type and version information is stored in the GDC's plugin management module, forming a protocol plugin library. When a new device is connected, the system can directly search the plugin library for a matching protocol plugin based on the device's protocol information.
[0072] Furthermore, when a target device is detected accessing the system, the system triggers a device access detection process. This involves at least reading the target device's identifier (such as device ID, vendor ID, model number, etc.) to uniquely identify the device; and the device protocol type (e.g., Modbus protocol) and protocol version (e.g., RTU V1.1) used by the target device. This information is uniformly encapsulated as device information for subsequent protocol plugin matching. This ensures the system can distinguish between different devices and accurately locate the corresponding protocol plugin.
[0073] S22. Determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin. If the result is a match, determine the matching protocol plugin as the target protocol plugin. If the result is a mismatch, import the target protocol plugin that matches the protocol type and device protocol version into the system. The target data sent by the target device will then be parsed into target format data using the target protocol plugin.
[0074] In this embodiment, after the system obtains the device information, it will search in the plugin library: if a plugin that matches both the protocol type and the protocol version is found, the plugin will be directly loaded as the target protocol plugin for data parsing; if only the protocol type is matched but the version is different, it can be adapted through a version compatibility strategy or a plugin upgrade mechanism; if no matching plugin is found, the system can prompt the administrator to import a new protocol plugin.
[0075] Specifically, when determining a match, the system iterates through all imported protocol plugins, checking one by one: whether the plugin's protocol type matches the device's protocol type; and whether the plugin's protocol version matches the device's protocol version. If both type and version match, the plugin is identified as the target protocol plugin. If the system determines that no existing plugin matches the device information, it triggers the plugin management module to import a target protocol plugin that matches the device's protocol type and version. After importing, the plugin library is immediately updated, and a new matching confirmation is performed. Once the target protocol plugin is identified, the system calls the target protocol plugin to parse the target data uploaded by the target device. The plugin extracts valid data according to protocol rules and converts it into target format data (e.g., JSON). The target format data is then stored in the target gateway's (GDC) data storage module and provides a unified data interface. Thus, through a dual-field matching mechanism of protocol type and version, the most suitable protocol plugin can be accurately determined, enabling plug-and-play multi-protocol device access capabilities and improving the compatibility and scalability of the optical-storage-direct-flex system.
[0076] In one possible implementation, the step of importing a target protocol plugin that matches the protocol type and device protocol version into the system includes: determining whether a target protocol plugin that matches the protocol type and device protocol version exists in the cloud; if the determination result is yes, then obtaining the target protocol plugin from the cloud and importing it into the system; if the determination result is no, then calling the target model and generating a parsing template based on the protocol type and protocol version as the target protocol plugin.
[0077] In this embodiment, when the system finds that there is no plugin in the local plugin library that matches the device protocol type and version, it first sends a request to the cloud plugin repository to determine whether a corresponding target protocol plugin exists in the cloud. If a target protocol plugin that matches the device protocol type and version exists in the cloud, the plugin is downloaded to the local machine and imported into the system's plugin library. The system immediately calls the plugin to parse and format the data of the target device. If no matching plugin exists in the cloud plugin repository, the system calls the target model built into the system or deployed in the cloud. This model automatically generates a protocol parsing template based on the input device protocol type and version. The generated parsing template is encapsulated to form a new target protocol plugin and imported into the system. The data sent by the target device is parsed using the imported or generated target protocol plugin. The parsed data is uniformly converted into target format data such as JSON and stored in the data storage module of the target gateway. Therefore, it can quickly pull the latest protocol plugins from the cloud, ensuring that devices from different manufacturers and versions can be used plug and play. When there are no matching plugins in the cloud, the system can automatically generate parsing templates with the help of models to achieve rapid adaptation to new protocols. It no longer relies on manual writing and deployment of new plugins, greatly shortening the response time for new device access and achieving full-scenario coverage of multi-protocol devices.
[0078] S23. Send the target format data to the system's target gateway, and set the corresponding storage location for each protocol plugin in the target gateway; receive the target format data and the device identifier of the target device through the target gateway; determine the target storage location corresponding to the target protocol plugin, and store the device identifier and target format data in the target storage location accordingly.
[0079] In this embodiment, after the target protocol plugin completes the parsing and format conversion of the target data, the system sends the generated target format data along with the device identifier to the system's target gateway. In the target gateway, a corresponding storage location is pre-allocated or dynamically created for each protocol plugin; each storage location is equivalent to a logical partition or data index area, used to store the data parsed by that protocol plugin. After receiving the data packet of the target format data, the target gateway determines its corresponding target storage location based on the target protocol plugin identifier or protocol type information carried in the data packet; the system binds the device identifier of the target device with its target format data to the corresponding storage, forming a storage record.
[0080] The bound device identifier and target format data are written to the corresponding target storage location. In this way, the gateway can efficiently manage data according to the index path of "protocol plugin → storage location → device identifier". This ensures that data parsed by different protocol plugins is stored in independent storage locations, avoiding data mixing and guaranteeing the clarity of data management. Through dual indexing of device identifier and protocol plugin, upper-layer applications can quickly locate and obtain data from the target device. When a new protocol plugin is introduced, only the corresponding storage location needs to be created in the gateway; no modification to existing logic is required. The receiving end only needs to query data according to a unified storage structure, without having to handle underlying protocol differences, thus improving access efficiency.
[0081] S24. Receive a data query request for the first data, the data query request including: a first device identifier of the device that sent the first data and a first data identifier of the first data; determine the first storage location of the first data according to the first device identifier, and retrieve the first data from the first storage location according to the first data identifier.
[0082] In this embodiment, the system target gateway receives a data query request from an upper-layer application (such as an APP, webpage, touchscreen, etc.). The query request contains two key fields: a first device identifier, used to uniquely identify the device to which the requested data belongs; and a first data identifier, used to identify the specific data item sent by the device (e.g., voltage, current, power, temperature). Based on the first device identifier, the system retrieves the index table in the target gateway; determines the first storage location corresponding to the device, i.e., the logical storage area or database partition where the device data resides. Within the determined first storage location, the system further uses the first data identifier to locate the corresponding data entry; and extracts the first data entry from the storage location. The obtained first data is returned to the initiator of the query request, allowing the upper-layer application to directly display or use the data. Thus, by first determining the storage location using the device identifier and then locating the specific data using the data identifier, full database traversal is avoided, significantly improving query efficiency. Upper-layer applications can perform precise queries for different devices and different data items, supporting multi-dimensional data access. Upper-layer applications do not need to concern themselves with protocol parsing and data storage details; they only need to rely on the device identifier and data identifier to complete the query.
[0083] Figure 3 This is a schematic diagram of the structure of a direct-drive flexible optical storage system provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the system specifically includes:
[0084] The system comprises a control module, a target gateway (GDC), and multiple plug-in modules, each loading a different protocol plug-in. The control module determines the target protocol plug-in and its corresponding target plug-in module based on device information sent by the device. The target plug-in module parses the data sent by the device into the target format. The target gateway receives and stores the target format data and also retrieves data based on the received query request. The plug-in modules may also include a serial communication interface, a CAN communication interface, a TCP communication network port, and a display screen for connecting to different devices, communicating with the GDC via TCP, and displaying content.
[0085] In this embodiment, each plug-in module contains protocol plug-ins for different communication protocols. The plug-in module can connect to devices with different communication protocols, including but not limited to: CAN, Modbus, TCP, MQtt, etc. The devices can include but not limited to: photovoltaic subsystem, energy storage subsystem, DC meters 1-n, electrical loads 1-n, etc. The control module determines the target protocol plug-in and target plug-in module based on the device information sent by the connected device, and controls the device to connect to the target plug-in module that matches its communication protocol. Each plug-in module parses the target data sent by the device according to the protocol plug-in, converts it into target format data, and sends it to the GDC for storage. The terminal device can access the GDC through the data receiving end and directly read the required data.
[0086] The control module is specifically used to determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin; if the determination result is a match, the matching protocol plugin is determined as the target protocol plugin; if the determination result is a mismatch, the target protocol plugin that matches the protocol type and device protocol version is imported into the system.
[0087] The optical-storage-flexible system provided in this embodiment can be as follows: Figure 3 The system shown can perform, for example Figures 1-2 All steps of the data processing method in the middle, thereby achieving Figures 1-2 For details on the technical effects of the data processing method shown, please refer to [link / reference]. Figures 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0088] As an example, such as Figure 4The diagram illustrates a flowchart of another data processing method provided by an embodiment of the present invention. The method includes: loading protocol plugins such as MQTT, Mobus, TCP, and CAN into each plugin module and setting a parsing script for each protocol; when a newly added target device in the optical-storage-direct-drive-flexible system is detected, acquiring the device information frame reported by the target device; determining the device protocol type and version used by the newly connected target device; selecting a target protocol plugin matching the device protocol type and version to parse the device data and obtain JSON format data; if no protocol plugin matching the device protocol type and version exists, customizing a matching protocol plugin and loading it into the plugin module. The GDC receives the JSON format data and queries the data frame from the data display terminal, saving the required data locally. When the data display terminal queries, the GDC sends a protocol data frame of a unified format to the data receiving and display terminal.
[0089] In this embodiment, the GDC has an environment for running script programs. When a new device connects to the optical storage direct current flexible system, it automatically sends a device information frame. This frame contains at least one of the following: device identifier (device type, device model, device characteristic value (a unique identifier representing the device, such as the device's MAC address)), device protocol type, and device protocol version. Commonly used protocol plugins are imported into the plugin module, with the latest version being the current one. The new device connects to the communication interface corresponding to the plugin module. When the plugin module parses the received device frame, it displays the device type, model, protocol type, and protocol version, confirming whether the protocol type and version match. If they do not match, a protocol plugin of the same version matching the protocol type is imported externally. If the protocol version matches, clicking the confirmation button on the plugin module's display screen runs the protocol parsing script within the plugin, converting the received binary stream data into JSON format data. The plugin module and GDC transmit JSON data via HTTP, and a database table is created for each device to store the received JSON data, with the database tables distinguished by the device identifier. The terminal device sends a data query frame (device identifier + data name) to the GDC, and the GDC directly sends the required JSON data to the corresponding terminal based on the content of the query frame.
[0090] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present invention, as shown below. Figure 5 As shown, the device specifically includes:
[0091] The acquisition module 51 is used to acquire the device information of the target device when the target device is detected to be connected to the system. The system is pre-configured with multiple protocol plugins that process different protocols.
[0092] The determination module 52 is used to determine the target protocol plugin corresponding to the target device based on the device information, so as to parse the target data sent by the target device into target format data through the target protocol plugin;
[0093] The sending module 53 is used to send the target format data to the target gateway of the system so that the target format data can be stored through the target gateway.
[0094] In one possible implementation, the acquisition module is further configured to import protocol plugins for multiple protocols into the system, and acquire the plugin protocol type and plugin protocol version corresponding to each protocol plugin for storage.
[0095] Obtain the device protocol type and device protocol version of the device as the device information.
[0096] In one possible implementation, the determining module is specifically used to determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin;
[0097] If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin;
[0098] If the determination result is a mismatch, then import a target protocol plugin that matches the protocol type and the device protocol version for the system.
[0099] In one possible implementation, the determining module is further configured to determine whether a target protocol plugin matching the protocol type and the device protocol version exists in the cloud;
[0100] If the determination result is yes, then the target protocol plugin is retrieved from the cloud and imported into the system;
[0101] If the judgment result is negative, the target model is invoked, and a parsing template is generated based on the protocol type and the protocol version, which serves as the target protocol plugin.
[0102] In one possible implementation, the storage module 54 is used to set a corresponding storage location for each of the protocol plug-ins in the target gateway;
[0103] The target gateway receives the target format data and the device identifier of the target device.
[0104] Determine the target storage location corresponding to the target protocol plugin, and store the device identifier and the target format data in the target storage location.
[0105] In one possible implementation, receiving module 55 is configured to receive a data query request for first data, the data query request including: a first device identifier of the device that sent the first data and a first data identifier of the first data;
[0106] The first storage location of the first data is determined based on the first device identifier, and the first data is retrieved from the first storage location based on the first data identifier.
[0107] The data processing device provided in this embodiment may be as follows: Figure 5 The apparatus shown can perform, for example Figures 1-2 All steps of the data processing method in the middle, thereby achieving Figures 1-2 For details on the technical effects of the data processing method shown, please refer to [link / reference]. Figures 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0108] Figure 6 This is a schematic diagram of the structure of a photovoltaic-storage-direct-drive-flexible device provided in an embodiment of the present invention. Figure 6 The illustrated optical-storage-direct-connect flexible device 600 includes at least one processor 601, a memory 602, at least one network interface 604, and other user interfaces 603. The various components in the optical-storage-direct-connect flexible device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to implement communication between these components. In addition to a data bus, the bus system 605 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 6 The general designated all buses as Bus System 605.
[0109] The user interface 603 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0110] It is understood that the memory 602 in this embodiment of the invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0111] In some implementations, memory 602 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 6021 and application program 6022.
[0112] The operating system 6021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 6022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 6022.
[0113] In this embodiment of the invention, by calling the program or instructions stored in memory 602, specifically the program or instructions stored in application program 6022, processor 601 executes the method steps provided in each method embodiment, including, for example:
[0114] When a target device is detected to be connected to the system, the device information of the target device is obtained. The system has multiple protocol plugins that process different protocols pre-set.
[0115] Based on the device information, the target protocol plugin corresponding to the target device is determined, so that the target data sent by the target device can be parsed into target format data through the target protocol plugin;
[0116] The target format data is sent to the target gateway of the system for storage by the target gateway;
[0117] The step of determining the target protocol plugin corresponding to the target device based on the device information includes:
[0118] Determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin;
[0119] If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin;
[0120] If the determination result is a mismatch, then import a target protocol plugin that matches the protocol type and the device protocol version for the system.
[0121] In one possible implementation, multiple protocol plugins are imported for the system, and the plugin protocol type and plugin protocol version corresponding to each protocol plugin are obtained for storage.
[0122] The step of obtaining the device information of the target device includes:
[0123] Obtain the device protocol type and device protocol version of the device as the device information.
[0124] In one possible implementation, it is determined whether a target protocol plugin matching the protocol type and the device protocol version exists in the cloud;
[0125] If the determination result is yes, then the target protocol plugin is retrieved from the cloud and imported into the system;
[0126] If the judgment result is negative, the target model is invoked, and a parsing template is generated based on the protocol type and the protocol version, which serves as the target protocol plugin.
[0127] In one possible implementation, a corresponding storage location is set in the target gateway for each of the protocol plugins;
[0128] The target gateway receives the target format data and the device identifier of the target device.
[0129] Determine the target storage location corresponding to the target protocol plugin, and store the device identifier and the target format data in the target storage location.
[0130] In one possible implementation, a data query request for first data is received, the data query request including: a first device identifier of the device that sent the first data and a first data identifier of the first data;
[0131] The first storage location of the first data is determined based on the first device identifier, and the first data is retrieved from the first storage location based on the first data identifier.
[0132] The methods disclosed in the above embodiments of the present invention can be applied to processor 601, or implemented by processor 601. Processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 601 or by instructions in the form of software. The processor 601 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 602. Processor 601 reads the information in memory 602 and, in conjunction with its hardware, completes the steps of the above method.
[0133] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0134] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0135] The optical storage direct-drive flexible device provided in this embodiment can be as follows: Figure 6 The device shown can perform, for example Figures 1-2 All steps of the data processing method in the middle, thereby achieving Figures 1-2 For details on the technical effects of the data processing method shown, please refer to [link / reference]. Figures 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0136] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.
[0137] When one or more programs in the storage medium can be executed by one or more processors to implement the data processing method described above that is executed on the device side.
[0138] The processor is used to execute a data processing program stored in the memory to implement the following steps of a data processing method executed on the device side:
[0139] When a target device is detected to be connected to the system, the device information of the target device is obtained. The system has multiple protocol plugins that process different protocols pre-set.
[0140] Based on the device information, the target protocol plugin corresponding to the target device is determined, so that the target data sent by the target device can be parsed into target format data through the target protocol plugin;
[0141] The target format data is sent to the target gateway of the system for storage by the target gateway;
[0142] The step of determining the target protocol plugin corresponding to the target device based on the device information includes:
[0143] Determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin;
[0144] If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin;
[0145] If the determination result is a mismatch, then import a target protocol plugin that matches the protocol type and the device protocol version for the system.
[0146] In one possible implementation, multiple protocol plugins are imported for the system, and the plugin protocol type and plugin protocol version corresponding to each protocol plugin are obtained for storage.
[0147] The step of obtaining the device information of the target device includes:
[0148] Obtain the device protocol type and device protocol version of the device as the device information.
[0149] In one possible implementation, it is determined whether a target protocol plugin matching the protocol type and the device protocol version exists in the cloud;
[0150] If the determination result is yes, then the target protocol plugin is retrieved from the cloud and imported into the system;
[0151] If the judgment result is negative, the target model is invoked, and a parsing template is generated based on the protocol type and the protocol version, which serves as the target protocol plugin.
[0152] In one possible implementation, a corresponding storage location is set in the target gateway for each of the protocol plugins;
[0153] The target gateway receives the target format data and the device identifier of the target device.
[0154] Determine the target storage location corresponding to the target protocol plugin, and store the device identifier and the target format data in the target storage location.
[0155] In one possible implementation, a data query request for first data is received, the data query request including: a first device identifier of the device that sent the first data and a first data identifier of the first data;
[0156] The first storage location of the first data is determined based on the first device identifier, and the first data is retrieved from the first storage location based on the first data identifier.
[0157] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0158] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0159] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data processing method, characterized in that, include: When a target device is detected to be connected to the system, the device information of the target device is obtained. The system is pre-configured with multiple protocol plug-ins that process different protocols. The system is an optical storage DC-flexible system. Based on the device information, the target protocol plugin corresponding to the target device is determined, so that the target data sent by the target device can be parsed into target format data through the target protocol plugin; The target format data is sent to the target gateway of the system for storage by the target gateway; The step of determining the target protocol plugin corresponding to the target device based on the device information includes: Determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin; If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin; If the judgment result is a mismatch, then the system imports a target protocol plugin that matches the protocol type and the device protocol version. If there is no matching plugin in the cloud plugin repository, then the system's built-in or cloud-deployed target model is called. The target model automatically generates a protocol parsing template based on the input device protocol type and protocol version. The generated protocol parsing template is encapsulated to form a new target protocol plugin and imported into the system. If a protocol type is matched but the protocol version is different, adaptation will be achieved through a protocol version compatibility strategy or a plugin upgrade mechanism.
2. The method according to claim 1, characterized in that, Before detecting that the target device has accessed the system, the method further includes: For the system, multiple protocol plugins are imported, and the plugin protocol type and plugin protocol version corresponding to each protocol plugin are obtained for storage. The step of obtaining the device information of the target device includes: Obtain the device protocol type and device protocol version of the device as the device information.
3. The method according to claim 1, characterized in that, The importation of a target protocol plugin that matches the protocol type and the device protocol version into the system includes: Determine whether a target protocol plugin matching the protocol type and the device protocol version exists in the cloud; If the determination result is yes, then the target protocol plugin is retrieved from the cloud and imported into the system; If the judgment result is negative, the target model is invoked, and a parsing template is generated based on the protocol type and the protocol version, which serves as the target protocol plugin.
4. The method according to claim 1, characterized in that, The storage of the target format data through the target gateway includes: In the target gateway, a corresponding storage location is set for each protocol plugin; The target gateway receives the target format data and the device identifier of the target device. Determine the target storage location corresponding to the target protocol plugin, and store the device identifier and the target format data in the target storage location.
5. The method according to claim 3, characterized in that, The method further includes: Receive a data query request for the first data, the data query request including: a first device identifier of the device that sent the first data and a first data identifier of the first data; The first storage location of the first data is determined based on the first device identifier, and the first data is retrieved from the first storage location based on the first data identifier.
6. A photovoltaic-storage-direct-drive-flexible system, characterized in that, The system for implementing the method of claim 1 includes: The system includes a control module, a target gateway, and multiple plugin modules, each of which loads a different protocol plugin. The control module is used to determine the target protocol plugin and the target plugin module corresponding to the target protocol plugin based on the device information sent by the device. The target plug-in module is used to parse the data sent by the device into target format data; The target gateway is used to receive and store the target format data; The control module is specifically used to determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin; If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin; If the judgment result is a mismatch, then the system imports a target protocol plugin that matches the protocol type and the device protocol version. If there is no matching plugin in the cloud plugin repository, then the system's built-in or cloud-deployed target model is called. The target model automatically generates a protocol parsing template based on the input device protocol type and protocol version. The generated protocol parsing template is encapsulated to form a new target protocol plugin and imported into the system. If a protocol type is matched but the protocol version is different, adaptation will be achieved through a protocol version compatibility strategy or a plugin upgrade mechanism.
7. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire the device information of the target device when the target device is detected to be connected to the system. The system is pre-configured with multiple protocol plug-ins that process different protocols. The system is an optical storage direct current flexible system. The determination module is used to determine the target protocol plugin corresponding to the target device based on the device information, so as to parse the target data sent by the target device into target format data through the target protocol plugin; A sending module is used to send the target format data to the target gateway of the system, so that the target format data can be stored through the target gateway; The determining module is specifically used to determine whether the device protocol type and device protocol version in the device information match the plugin protocol type and plugin protocol version of each protocol plugin; If the judgment result is a match, then the matched protocol plugin is determined to be the target protocol plugin; If the judgment result is a mismatch, then the system imports a target protocol plugin that matches the protocol type and the device protocol version. If there is no matching plugin in the cloud plugin repository, then the system's built-in or cloud-deployed target model is called. The target model automatically generates a protocol parsing template based on the input device protocol type and protocol version. The generated protocol parsing template is encapsulated to form a new target protocol plugin and imported into the system. If a protocol type is matched but the protocol version is different, adaptation will be achieved through a protocol version compatibility strategy or a plugin upgrade mechanism.
8. A photovoltaic storage direct current flexible device, characterized in that, include: A processor and a memory, the processor being configured to execute a data processing program stored in the memory to implement the data processing method according to any one of claims 1 to 5.
9. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the data processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data transmission method, protocol converter and monitoring system of energy storage equipment
CN119135781A
Gateway control method and device, gateway and storage medium
CN119449915A