Device information collection method, system, device and medium based on plug-in package

Through the plug-in package-based method, the problems of poor cross-device compatibility and difficulty in unified management in the existing technology are solved, and efficient data interaction and unified management are achieved.

CN119766895APending Publication Date: 2025-04-04SUZHOU HANMA INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411904270.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-04

Smart Images

  • Figure CN119766895A_ABST
    Figure CN119766895A_ABST
Patent Text Reader

Abstract

The present application relates to a device information collection method, system, device and medium based on a plug-in package, the method comprising obtaining a device communication protocol of a connected device, performing a structured analysis of the device communication protocol and a preset platform support protocol through a plug-in package, and determining the protocol adaptation requirements; obtaining a platform data format, converting the platform data format into a data request according to the protocol adaptation requirements, and sending the data request to the connected device; the connected device parses the data request, extracts a payload from the data request, processes the message in the data request according to the payload, and generates corresponding response data; receives the response data returned by the connected device, and parses the response data to generate corresponding platform parsed data. The present application has the effect of improving the efficiency of information collection between the IoT platform and the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data collection of Internet of Things devices, and in particular to a device information collection method, system, device and medium based on a plug-in package. Background Art

[0002] At present, the data collection method between the IoT platform and the device usually relies on the developer's self-built client or the SDK provided by the integrated device manufacturer. Although this method can meet the basic needs of data collection, due to the different communication protocols and data formats of different device manufacturers, developers need to develop adaptation logic for each device separately or rely on the SDK provided by the manufacturer. Different devices need to develop adaptation logic separately, resulting in poor cross-device compatibility, increased development and maintenance workload, and highly customized structure and process of collected data, resulting in a lack of standardization, which is not conducive to unified management and expansion.

[0003] The above-mentioned existing technical solutions have the following defects: the data collection method between the IoT platform and the devices is highly dependent on the customized design of the devices, and it is difficult to achieve efficient compatibility and unified management across devices, so there is room for improvement. Summary of the invention

[0004] In order to improve the efficiency of information collection between an Internet of Things platform and devices, the present application provides a device information collection method, system, device and medium based on a plug-in package.

[0005] The above-mentioned invention objective of the present application is achieved through the following technical solutions: A method for collecting information of an Internet of Things device based on a plug-in package, the method comprising: Obtain the device communication protocol of the connected device, perform structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, and determine the protocol adaptation requirements; Acquire a platform data format, convert the platform data format into a data request according to the protocol adaptation requirement, and send the data request to the connection device; The connecting device parses the data request, extracts a payload from the data request, processes the message in the data request according to the payload, and generates corresponding response data; Receive response data returned by the connection device, and parse the response data to generate corresponding platform parsed data.

[0006] By adopting the above technical solution, by obtaining the device communication protocol of the connected device, and performing structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, the protocol adaptation requirements can be determined, and the automatic adaptation between the device communication protocol and the platform support protocol can be realized, reducing the workload of developers to manually analyze the protocol, thereby improving the adaptation efficiency and reducing the adaptation complexity; by obtaining the platform data format, converting the platform data format into a data request according to the protocol adaptation requirements and sending it to the connected device, it can be ensured that the data request meets the format requirements of the device communication protocol, thereby ensuring that the data can be correctly identified and processed by the target device; by parsing the data request through the connected device, extracting the payload from the data request, processing the message in the data request according to the payload, and generating the corresponding response data, it can be ensured that the device completes the data processing task according to the platform requirements, thereby realizing efficient data interaction; by receiving the response data returned by the connected device, parsing the response data, and generating the corresponding platform parsed data, the data returned by the device can be converted into a format that meets the platform specifications, thereby realizing the platform's unified management and further processing of the device data.

[0007] In one example, the present application may be further configured as follows: the plug-in package is used to perform a structured analysis on the device communication protocol and the preset platform support protocol to determine the protocol adaptation requirements, specifically including: Sequentially parsing the structures of the device communication protocol and the platform support protocol, extracting device protocol features of the device communication protocol and platform protocol features of the platform support protocol; By using the field matching algorithm of the plug-in package, the device protocol features and the platform protocol features are compared one by one to obtain protocol difference information; The protocol adaptation requirement is generated according to the protocol difference information.

[0008] By adopting the above technical solution, by successively parsing the structures of the device communication protocol and the platform support protocol, extracting the device protocol features and the platform protocol features, it is possible to obtain key fields and structural information from the protocol description, thereby providing basic data for subsequent field comparison and adaptation; by using the field matching algorithm of the plug-in package, the device protocol features and the platform protocol features are compared one by one to obtain the protocol difference information, which can identify the field differences between the protocols and generate clear adaptation requirements, thereby solving the communication compatibility problems between different protocols; by generating protocol adaptation requirements based on the protocol difference information, it is possible to establish specific mapping and conversion rules for the communication between the platform and the device, thereby achieving efficient and standardized data interaction.

[0009] In one example, the present application may be further configured as follows: generating the protocol adaptation requirement according to the protocol difference information specifically includes: Extracting a specific difference type from the protocol difference information, and performing corresponding difference matching according to the specific difference type to obtain a difference matching result; The difference matching results are combined to obtain the protocol adaptation rules of the device protocol features and the platform protocol features, thereby forming the protocol adaptation requirements.

[0010] By adopting the above technical solution, by extracting specific difference types from the protocol difference information and performing corresponding difference matching according to the specific difference types, the difference matching results are obtained, which can accurately identify and classify the differences between the protocols, thereby providing a basis for the subsequent generation of adaptation rules; by combining the difference matching results, the protocol adaptation rules of the device protocol characteristics and the platform protocol characteristics are obtained, and the protocol adaptation requirements are formed. Complex difference points can be integrated into adaptation rules, thereby providing complete support for subsequent automated adaptation.

[0011] In one example, the present application may be further configured as follows: converting the platform data format into a data request according to the protocol adaptation requirement specifically includes: According to the field mapping relationship in the protocol adaptation requirement, the fields of the platform data format are renamed as the field names of the device communication protocol, and the field types corresponding to the field names are formatted; Device identification information is added to the renamed and formatted data, and then packaged into the data request.

[0012] By adopting the above technical solution, by renaming the fields of the platform data format to the field names of the device communication protocol according to the field mapping relationship in the protocol adaptation requirements, and formatting the field types corresponding to the field names, it is possible to ensure that the platform data format complies with the field naming and type requirements of the device communication protocol, thereby improving the readability and compatibility of data requests; by adding device identification information to the renamed and formatted data and then packaging it into a data request, the data can be uniquely bound to the target device, thereby ensuring that the data request can be correctly routed to the specified device and correctly parsed.

[0013] In one example, the present application may be further configured as follows: extracting a payload from the data request, and processing a message in the data request according to the payload, specifically including: Obtaining a device parsing rule of the device communication protocol, and decoding the data request according to the device parsing rule to extract a payload field; The payload field is classified and processed, and according to the classification result, a processing operation corresponding to the payload field is performed.

[0014] By adopting the above technical solution, by obtaining the device parsing rules of the device communication protocol, decoding the data request according to the device parsing rules, and extracting the payload field, it is possible to accurately extract core information from the data request, thereby eliminating redundant data and improving the device processing efficiency; by classifying the payload field and performing the processing operation of the corresponding payload field according to the classification result, it is possible to trigger the relevant operations of the device according to the actual needs of the data request, thereby improving the accuracy and efficiency of the device response.

[0015] In one example, the present application may be further configured as follows: parsing the response data to generate corresponding platform parsing data specifically includes: Obtaining a platform parsing rule of the platform support protocol, decoding the response data step by step according to the platform parsing rule, and extracting field content in the response data; The extracted field content is adapted according to the protocol adaptation requirements, and the adapted field content is integrity checked. After the check passes, the platform parsed data is obtained.

[0016] By adopting the above technical solution, by obtaining the platform parsing rules of the platform supported protocol, gradually decoding the response data according to the platform parsing rules, and extracting the field content in the response data, the data returned by the device can be accurately parsed into a field format recognizable by the platform, thereby ensuring the accuracy and consistency of data parsing; by adapting the extracted field content according to the protocol adaptation requirements, and performing integrity verification on the adapted field content, the platform parsed data is obtained after the verification passes, which can ensure that the data returned by the device complies with the field format and data constraints of the platform, thereby improving the platform's management capabilities for device data and the reliability of the data.

[0017] The second object of the invention is achieved by the following technical solutions: A plug-in package-based IoT device information collection system, the plug-in package-based device information collection system comprising: A protocol adaptation requirement generation module is used to obtain the device communication protocol of the connected device, perform a structured analysis on the device communication protocol and the preset platform support protocol through a plug-in package, and determine the protocol adaptation requirement; A data request generation module, used to obtain a platform data format, convert the platform data format into a data request according to the protocol adaptation requirement, and send the data request to the connection device; A data parsing and processing module, used for the connection device to parse the data request, extract the effective load from the data request, process the message in the data request according to the effective load, and generate corresponding response data; The response data parsing module is used to receive the response data returned by the connection device, parse the response data, and generate corresponding platform parsing data.

[0018] By adopting the above technical solution, by obtaining the device communication protocol of the connected device, and performing structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, the protocol adaptation requirements can be determined, and the automatic adaptation between the device communication protocol and the platform support protocol can be realized, reducing the workload of developers to manually analyze the protocol, thereby improving the adaptation efficiency and reducing the adaptation complexity; by obtaining the platform data format, converting the platform data format into a data request according to the protocol adaptation requirements and sending it to the connected device, it can be ensured that the data request meets the format requirements of the device communication protocol, thereby ensuring that the data can be correctly identified and processed by the target device; by parsing the data request through the connected device, extracting the payload from the data request, processing the message in the data request according to the payload, and generating the corresponding response data, it can be ensured that the device completes the data processing task according to the platform requirements, thereby realizing efficient data interaction; by receiving the response data returned by the connected device, parsing the response data, and generating the corresponding platform parsed data, the data returned by the device can be converted into a format that meets the platform specifications, thereby realizing the platform's unified management and further processing of the device data.

[0019] The third objective of the present application is achieved through the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the device information collection method based on the plug-in package are implemented.

[0020] The fourth objective of the present application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device information collection method based on the plug-in package are implemented.

[0021] In summary, this application includes the following beneficial technical effects: 1. By obtaining the device communication protocol of the connected device and performing structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, the protocol adaptation requirements can be determined, and the automatic adaptation between the device communication protocol and the platform support protocol can be realized, reducing the workload of developers to manually analyze the protocol, thereby improving the adaptation efficiency and reducing the adaptation complexity; by obtaining the platform data format, converting the platform data format into a data request according to the protocol adaptation requirements and sending it to the connected device, it can ensure that the data request meets the format requirements of the device communication protocol, thereby ensuring that the data can be correctly identified and processed by the target device; by parsing the data request through the connected device, extracting the payload from the data request, processing the message in the data request according to the payload, and generating the corresponding response data, it can ensure that the device completes the data processing task according to the platform requirements, thereby realizing efficient data interaction; by receiving the response data returned by the connected device, parsing the response data, and generating the corresponding platform parsed data, the data returned by the device can be converted into a format that meets the platform specifications, thereby realizing the unified management and further processing of the device data by the platform; 2. By successively parsing the structures of the device communication protocol and the platform support protocol, extracting the device protocol features and the platform protocol features, it is possible to obtain key fields and structural information from the protocol description, thereby providing basic data for subsequent field comparison and adaptation; by using the field matching algorithm of the plug-in package, the device protocol features and the platform protocol features are compared one by one to obtain the protocol difference information, which can identify the field differences between the protocols and generate clear adaptation requirements, thereby solving the communication compatibility problem between different protocols; by generating protocol adaptation requirements based on the protocol difference information, it is possible to establish specific mapping and conversion rules for the communication between the platform and the device, thereby achieving efficient and standardized data interaction; 3. By extracting specific difference types from the protocol difference information and performing corresponding difference matching according to the specific difference types, the difference matching results can be obtained, which can accurately identify and classify the differences between the protocols, thereby providing a basis for the subsequent generation of adaptation rules; by combining the difference matching results, the protocol adaptation rules of the device protocol characteristics and platform protocol characteristics are obtained, and the protocol adaptation requirements are formed. Complex difference points can be integrated into adaptation rules, thereby providing complete support for subsequent automated adaptation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flow chart of a device information collection method based on a plug-in package in an embodiment of the present application; Figure 2 It is a flowchart for implementing step S10 in the device information collection method based on the plug-in package in one embodiment of the present application; Figure 3It is a flowchart for implementing step S13 in the device information collection method based on the plug-in package in one embodiment of the present application; Figure 4 It is a flowchart for implementing step S20 in the device information collection method based on the plug-in package in one embodiment of the present application; Figure 5 It is a flowchart for implementing step S30 in the device information collection method based on the plug-in package in one embodiment of the present application; Figure 6 It is a flowchart for implementing step S40 in the device information collection method based on the plug-in package in one embodiment of the present application; Figure 7 This is a principle block diagram of a device information collection system based on a plug-in package in an embodiment of the present application; Figure 8 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The present application is further described in detail below in conjunction with the accompanying drawings.

[0024] In one embodiment, if Figure 1 As shown, the present application discloses a device information collection method based on a plug-in package, which specifically includes the following steps: S10: Obtain the device communication protocol of the connected device, perform structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, and determine the protocol adaptation requirements.

[0025] Specifically, a network broadcast signal is sent through the device scanning module or a predefined device discovery mechanism is adopted to obtain the communication protocol description file of the target device, extract the field information, protocol identifier and transmission data format of the device communication protocol, and parse the communication protocol of the target device layer by layer through parsing rules, breaking it down into field name, field type, field order and structural features of the protocol. At the same time, the field description and structural features of the protocol supported by the preset platform are extracted, and the field features of the two are compared and analyzed through the field matching algorithm to identify differences in field name, data type and field arrangement, and generate corresponding protocol difference information, and finally form protocol adaptation requirements based on the protocol difference information.

[0026] S20: Obtain the platform data format, convert the platform data format into a data request according to the protocol adaptation requirements, and send the data request to the connected device.

[0027] Specifically, the data format file provided by the platform is parsed to extract the field name, data type and field arrangement order. According to the field mapping relationship in the protocol adaptation requirements, the field name in the platform data format is replaced with the field name in the device communication protocol. Incompatible data types are formatted and converted according to the mapping rules. For example, the string type field supported by the platform is converted into the numeric type field required by the device communication protocol. After the formatting is completed, the unique identification information of the target device is added, including the physical address of the device, the communication protocol version number and the device type. All data is structured and encapsulated in accordance with the requirements of the device communication protocol. Finally, a data request that complies with the target device communication protocol specification is generated, and the data request is sent to the target device through the network interface.

[0028] S30: The connecting device parses the data request, extracts the effective load from the data request, processes the message in the data request according to the effective load, and generates corresponding response data.

[0029] Specifically, the parsing rules of the device communication protocol are used to decode the data request step by step after it is received, the field contents are parsed in sequence according to the protocol structure, the payload field is extracted, irrelevant fields and redundant information are stripped out, the core data for processing is retained, and classification processing is performed according to the contents of the payload field. For example, when the payload field contains a control instruction, the execution module inside the device is triggered to complete the corresponding action; when the payload field contains a data query instruction, the relevant data is retrieved from the device memory; when the payload field contains a status query request, the real-time monitoring module of the device is called to collect the current operating status of the device, and the processing result is encoded into a response data format that conforms to the device communication protocol.

[0030] S40: receiving response data returned by the connected device, parsing the response data, and generating corresponding platform parsed data.

[0031] Specifically, the received response data file is parsed, gradually decoded according to the parsing rules of the platform-supported protocol, the field content in the response data is extracted, the field content is compared with the field mapping relationship in the protocol adaptation requirements, the field names are converted according to the adaptation rules, the field names in the device communication protocol are mapped to the field names of the platform-supported protocol, and at the same time, the field values ​​of the response data are formatted and converted according to the field type conversion rules. For example, the numeric data returned by the device is converted into string data supported by the platform, and the processed field content is checked for integrity, including data length check, field type check, and field value range check. After the check passes, the parsed fields are reorganized according to the field order of the platform-supported protocol, and finally parsed data that meets the platform parsing requirements is generated for subsequent data storage or business processing.

[0032] In one embodiment, if Figure 2 As shown, in step S10, the device communication protocol and the preset platform support protocol are structurally analyzed through the plug-in package to determine the protocol adaptation requirements, which specifically include: S11: parsing the structures of the device communication protocol and the platform support protocol in sequence, extracting the device protocol features of the device communication protocol and the platform protocol features of the platform support protocol.

[0033] Specifically, the description file of the device communication protocol is hierarchically parsed, the protocol identifier, field name, field type and field arrangement rules are extracted from the file header, the fields of the nested structure are recursively parsed, the nesting hierarchy and dependencies are recorded, and a complete set of device protocol features is formed. At the same time, a similar parsing is performed on the platform support protocol to extract field features and structural rules, and the field constraints of the platform protocol are recorded, such as data type restrictions, length requirements and field sorting rules. The extracted device protocol features and platform protocol features are stored separately for subsequent comparison.

[0034] S12: By using the field matching algorithm of the plug-in package, the device protocol features and the platform protocol features are compared one by one to obtain protocol difference information.

[0035] Specifically, a field matching algorithm is used to select a corresponding set of fields from the device protocol features and the platform protocol features for comparison, and the fields are matched according to the field name priority rule. If the field names are inconsistent, fuzzy matching is further performed based on the field types. For example, if the device protocol contains an integer type field and the platform protocol contains a string type field, the fuzzy matching algorithm is used to determine the semantic consistency of the two, identify the potential association between the fields, record the differences in field names, field types, and field arrangement order, and store the difference information as protocol difference information.

[0036] S13: Generate protocol adaptation requirements based on the protocol difference information.

[0037] Specifically, field name differences and field type differences are extracted from the protocol difference information, mapping rules are defined according to the difference types, device protocol fields are mapped to platform protocol fields, and incompatible field types are converted according to preset rules. For example, floating-point fields in the device protocol are converted to integer fields in the platform protocol, and decimal truncation rules are supplemented. The field mapping relationship, type conversion rules, and field arrangement rules are combined into adaptation rules to form a complete protocol adaptation requirement.

[0038] In one embodiment, if Figure 3 As shown, in step S13, the protocol adaptation requirements are generated according to the protocol difference information, which specifically includes: S131: extracting a specific difference type from the protocol difference information, and performing corresponding difference matching according to the specific difference type to obtain a difference matching result.

[0039] Specifically, the protocol difference information is parsed to identify differences in three dimensions: field name, field type, and field arrangement. For field name differences, the field semantic matching algorithm is used to try to automatically establish a mapping relationship. If the semantic matching fails, the field is marked as unmatched. For field type differences, the preset type conversion table is used to generate adaptation rules. For example, when converting an integer type field to a floating point field, a decimal completion operation is added. For field arrangement differences, the field order is redefined according to the field priority rules, and all matching results are integrated into difference matching results.

[0040] S132: Combining the difference matching results to obtain protocol adaptation rules for device protocol features and platform protocol features, and forming protocol adaptation requirements.

[0041] Specifically, the field mapping rules, type conversion rules and field arrangement rules in the difference matching results are merged according to priority, and the field mapping priority is set to the highest priority to ensure the consistency of the field name; secondly, the type conversion rules are sorted, and the general conversion rules are given priority to avoid data loss; finally, the field arrangement rules are adjusted, and the high-priority fields are placed at the front of the result set to form a complete set of protocol adaptation rules, which is defined as the protocol adaptation requirement.

[0042] In one embodiment, if Figure 4 As shown, in step S20, the platform data format is converted into a data request according to the protocol adaptation requirements, specifically including: S21: According to the field mapping relationship in the protocol adaptation requirement, the fields in the platform data format are renamed to the field names of the device communication protocol, and the field types corresponding to the field names are formatted.

[0043] Specifically, parse the platform data format, match the field name with the field mapping relationship in the protocol adaptation requirements, rename the platform fields, replace the field names of the platform protocol with the field names defined in the device communication protocol, and mark the parts with mismatched field names as abnormal fields; format the field data according to the field type conversion rules in the adaptation requirements, for example, convert the date type fields defined in the platform protocol into the timestamp format defined in the device protocol, and add decimal places restrictions to numeric fields to ensure that the field data meets the requirements of the device communication protocol.

[0044] S22: Add device identification information to the renamed and formatted data, and then package them into a data request.

[0045] Specifically, the unique identification information of the device, including the physical address of the device, the protocol version number and the device type, is inserted into the processed data, all data fields are rearranged according to the field order of the device communication protocol, and the arranged data set is packaged into a data request format supported by the target device through the encapsulation module. The protocol header information is added to identify the data request type, and finally a complete data request is formed.

[0046] In one embodiment, if Figure 5 As shown, in step S30, the effective load is extracted from the data request, and the message in the data request is processed according to the effective load, specifically including: S31: Obtain the device parsing rule of the device communication protocol, and decode the data request according to the device parsing rule to extract the payload field.

[0047] Specifically, the device parsing rules of the device communication protocol are parsed, field separators, field order, and field length limits are extracted from the rules, the received data request is gradually parsed according to the parsing rules, the payload fields are identified and extracted, irrelevant fields are removed, and the data type of the field value is checked. For example, it is verified whether the numeric field meets the range requirements in the device parsing rules to ensure that the extracted payload field is accurate.

[0048] S32: Classify the payload field and execute the processing operation corresponding to the payload field according to the classification result.

[0049] Specifically, according to the content and data type of the payload field, the fields are divided into three categories: control instructions, data query requests, and status query requests; if the field is a control instruction, the execution module inside the device is triggered to complete the corresponding control operation; if the field is a data query request, the specified data is extracted from the device's memory or database; if the field is a status query request, the device real-time status monitoring module is called to obtain the current device operating status, and the execution result is re-encoded and stored to generate response data.

[0050] In one embodiment, if Figure 6 As shown, in step S40, the response data is parsed to generate corresponding platform parsing data, which specifically includes: S41: Obtain the platform parsing rules of the platform support protocol, gradually decode the response data according to the platform parsing rules, and extract the field content in the response data.

[0051] Specifically, the parsing platform supports the parsing rules defined in the protocol, obtains the field name, field type and field arrangement order from the rules, parses the response data field step by step according to the rules, extracts the field name and value in turn, and performs data type verification at the same time to ensure that the field content meets the requirements of the platform protocol. For example, when parsing a time field, the format of the timestamp is verified, and when parsing a numeric field, it is checked whether it exceeds the maximum range defined in the protocol, and finally a field content set is formed.

[0052] S42: The extracted field content is adapted according to the protocol adaptation requirements, and the adapted field content is integrity checked. After the check passes, the platform parsed data is obtained.

[0053] Specifically, according to the field mapping rules in the protocol adaptation requirements, the device protocol field name in the field content is mapped to the platform support protocol field name, and the field value is formatted and converted according to the field type conversion rules. For example, the integer field in the device protocol is converted to a string field in the platform protocol, and the converted field content is checked for integrity, including whether the field value length complies with the protocol definition, whether the field value type matches the platform protocol, and whether the field value range is within the allowable range. After the check passes, the field content is rearranged in the field order of the platform support protocol to form complete platform parsed data, which is ultimately used for subsequent business processing and storage.

[0054] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0055] In one embodiment, a device information collection system based on a plug-in package is provided, and the device information collection system based on a plug-in package corresponds one-to-one to the device information collection method based on a plug-in package in the above embodiment. Figure 7 As shown, the device information collection system based on the plug-in package includes a protocol adaptation requirement generation module, a data request generation module, a data analysis and processing module, and a response data analysis module. The detailed description of each functional module is as follows: The protocol adaptation requirement generation module is used to obtain the device communication protocol of the connected device, perform structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, and determine the protocol adaptation requirement; A data request generation module is used to obtain the platform data format, convert the platform data format into a data request according to the protocol adaptation requirements, and send the data request to the connected device; The data parsing and processing module is used to parse the data request of the connected device, extract the effective load from the data request, process the message in the data request according to the effective load, and generate the corresponding response data; The response data parsing module is used to receive the response data returned by the connected device, parse the response data, and generate corresponding platform parsing data.

[0056] Optionally, the protocol adaptation requirement generation module specifically includes: The protocol feature extraction submodule is used to parse the structures of the device communication protocol and the platform support protocol in turn, and extract the device protocol features of the device communication protocol and the platform protocol features of the platform support protocol; The protocol field matching submodule is used to compare the device protocol features and platform protocol features one by one through the field matching algorithm of the plug-in package to obtain protocol difference information; The protocol adaptation rule generation submodule is used to generate protocol adaptation requirements based on protocol difference information.

[0057] Optionally, the protocol adaptation rule generation submodule specifically includes: The difference type matching unit is used to extract the specific difference type from the protocol difference information, and perform corresponding difference matching according to the specific difference type to obtain a difference matching result; The difference result combination unit is used to combine the difference matching results to obtain the protocol adaptation rules of the device protocol characteristics and the platform protocol characteristics to form the protocol adaptation requirements.

[0058] Optionally, the data request generation module specifically includes: The field mapping submodule is used to rename the fields in the platform data format to the field names of the device communication protocol according to the field mapping relationship in the protocol adaptation requirements, and to format the field types corresponding to the field names; The data encapsulation submodule is used to add device identification information to the renamed and formatted data, and then package them into a data request.

[0059] Optionally, the data parsing and processing module specifically includes: The payload extraction submodule is used to obtain the device parsing rules of the device communication protocol, and decode the data request according to the device parsing rules to extract the payload field; The field classification and processing submodule is used to classify and process the effective load fields, and perform processing operations on the corresponding effective load fields based on the classification results.

[0060] Optionally, the response data parsing module specifically includes: The field decoding submodule is used to obtain the platform parsing rules of the platform support protocol, gradually decode the response data according to the platform parsing rules, and extract the field content in the response data; The field verification and adaptation submodule is used to adapt the extracted field content according to the protocol adaptation requirements, and to perform integrity verification on the adapted field content. After the verification passes, the platform parsed data is obtained.

[0061] For the specific definition of the device information collection system based on the plug-in package, please refer to the definition of the device information collection method based on the plug-in package above, which will not be repeated here. Each module in the above-mentioned device information collection system based on the plug-in package can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0062] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a device information collection method based on a plug-in package is implemented.

[0063] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Obtain the device communication protocol of the connected device, perform structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, and determine the protocol adaptation requirements; Obtain the platform data format, convert the platform data format into a data request according to the protocol adaptation requirements, and send the data request to the connected device; The connecting device parses the data request, extracts the payload from the data request, processes the message in the data request according to the payload, and generates corresponding response data; Receive the response data returned by the connected device, parse the response data, and generate corresponding platform parsed data.

[0064] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Obtain the device communication protocol of the connected device, perform structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, and determine the protocol adaptation requirements; Obtain the platform data format, convert the platform data format into a data request according to the protocol adaptation requirements, and send the data request to the connected device; The connecting device parses the data request, extracts the payload from the data request, processes the message in the data request according to the payload, and generates corresponding response data; Receive the response data returned by the connected device, parse the response data, and generate corresponding platform parsed data.

[0065] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0066] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

[0067] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A device information collection method based on a plug-in package, characterized in that: The device information collection method based on the plug-in package includes: Obtain the device communication protocol of the connected device, perform structured analysis on the device communication protocol and the preset platform support protocol through the plug-in package, and determine the protocol adaptation requirements; Acquire a platform data format, convert the platform data format into a data request according to the protocol adaptation requirement, and send the data request to the connection device; The connecting device parses the data request, extracts a payload from the data request, processes the message in the data request according to the payload, and generates corresponding response data; Receive response data returned by the connection device, and parse the response data to generate corresponding platform parsed data.

2. The device information collection method based on the plug-in package according to claim 1 is characterized in that: The plug-in package is used to perform a structured analysis on the device communication protocol and the preset platform support protocol to determine the protocol adaptation requirements, specifically including: Sequentially parsing the structures of the device communication protocol and the platform support protocol, extracting device protocol features of the device communication protocol and platform protocol features of the platform support protocol; By using the field matching algorithm of the plug-in package, the device protocol features and the platform protocol features are compared one by one to obtain protocol difference information; The protocol adaptation requirement is generated according to the protocol difference information.

3. The device information collection method based on the plug-in package according to claim 2 is characterized in that: Generating the protocol adaptation requirement according to the protocol difference information specifically includes: Extracting a specific difference type from the protocol difference information, and performing corresponding difference matching according to the specific difference type to obtain a difference matching result; The difference matching results are combined to obtain the protocol adaptation rules of the device protocol features and the platform protocol features, thereby forming the protocol adaptation requirements.

4. The device information collection method based on the plug-in package according to claim 1 is characterized in that: The converting the platform data format into a data request according to the protocol adaptation requirement specifically includes: According to the field mapping relationship in the protocol adaptation requirement, the fields of the platform data format are renamed as the field names of the device communication protocol, and the field types corresponding to the field names are formatted; Device identification information is added to the renamed and formatted data, and then packaged into the data request.

5. The device information collection method based on the plug-in package according to claim 1 is characterized in that: The extracting a payload from the data request and processing a message in the data request according to the payload specifically includes: Obtaining a device parsing rule of the device communication protocol, and decoding the data request according to the device parsing rule to extract a payload field; The payload field is classified and processed, and according to the classification result, a processing operation corresponding to the payload field is performed.

6. The device information collection method based on the plug-in package according to claim 1 is characterized in that: The parsing of the response data to generate corresponding platform parsing data specifically includes: Obtaining a platform parsing rule of the platform support protocol, decoding the response data step by step according to the platform parsing rule, and extracting field content in the response data; The extracted field content is adapted according to the protocol adaptation requirements, and the adapted field content is integrity checked. After the check passes, the platform parsed data is obtained.

7. A device information collection system based on a plug-in package, characterized in that: The device information collection system based on the plug-in package includes: A protocol adaptation requirement generation module is used to obtain the device communication protocol of the connected device, perform a structured analysis on the device communication protocol and the preset platform support protocol through a plug-in package, and determine the protocol adaptation requirement; A data request generation module, used to obtain a platform data format, convert the platform data format into a data request according to the protocol adaptation requirement, and send the data request to the connection device; A data parsing and processing module, used for the connection device to parse the data request, extract the effective load from the data request, process the message in the data request according to the effective load, and generate corresponding response data; The response data parsing module is used to receive the response data returned by the connection device, parse the response data, and generate corresponding platform parsing data.

8. The device information collection system based on the plug-in package according to claim 7 is characterized in that: The protocol adaptation requirement generation module specifically includes: A protocol feature extraction submodule, used to parse the structures of the device communication protocol and the platform support protocol in sequence, and extract the device protocol features of the device communication protocol and the platform protocol features of the platform support protocol; The protocol field matching submodule is used to compare the device protocol features with the platform protocol features one by one through the field matching algorithm of the plug-in package to obtain protocol difference information; The protocol adaptation rule generation submodule is used to generate the protocol adaptation requirement according to the protocol difference information.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the device information collection method based on the plug-in package are implemented as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the device information collection method based on the plug-in package as claimed in any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Protocol conversion method and device in EMS and storage medium

    CN120956813A

  • Method, device and storage medium for protocol conversion in EMS

    CN120956813B