Equipment access method and device, electronic device and storage medium
By obtaining device metadata and loading protocol parsing plug-ins, standard streaming media devices are mapped to the national standard registry, which solves the problem of device access to the national standard platform, realizes seamless access and unified management, reduces system integration complexity and development costs, and improves system stability and compatibility.
Patent Information
- Application Number
- CN202511114181.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-08-11
AI Technical Summary
Existing technologies cannot effectively connect devices that only support standard streaming media output to video surveillance management platforms that comply with national standard protocols, resulting in high development costs and poor adaptability and stability.
By obtaining the metadata notification package information of the target access device, determining the device protocol type, loading the protocol parsing plug-in to extract the device capability set, and mapping it to the national standard registry to achieve access, it supports seamless access and unified management of multi-protocol standardized streaming media devices to the national standard platform.
It achieves seamless access and unified management of multi-protocol standardized streaming media devices to the national standard platform, simplifies processes, reduces system integration complexity and development costs, and improves system stability and resource utilization.
Smart Images

Figure CN120602250A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic information communications, and in particular to a device access method, apparatus, electronic device, and storage medium. Background Art
[0002] With the development of the Internet of Things (IoT) and smart devices, a large number of standardized media streaming devices outside of traditional security fields (such as drones, handheld cameras, body cameras, inspection robots, smart glasses, and webcams) are widely used in security, emergency response, industrial inspection, smart city scenarios, and more. These devices generally use standard, internet-friendly streaming output protocols such as RTSP, HTTP-FLV, RTMP, and HLS.
[0003] Currently, mainstream professional video surveillance management platforms primarily adhere to national standards for device access, management, control, and media streaming. These platforms natively support national standard devices (such as IPCs and NVRs), but cannot directly access, manage, or utilize devices that only support standard Internet streaming protocols (such as RTSP / HTTP-FLV).
[0004] Furthermore, although many device manufacturers offer standard SDKs for integration and application, this approach incurs significant development costs and is often time-consuming, far from meeting actual business needs. Furthermore, this approach cannot guarantee the compatibility and stability of integration services when devices from multiple manufacturers coexist.
[0005] Therefore, it is necessary to provide a video acquisition device that only supports standard protocol output through technical means and uses standard protocols to connect to the video surveillance platform, and to achieve the management and functional application of this type of equipment to be basically consistent with traditional security equipment, so that users can perceive the same effect.
[0006] Currently, no effective solution has been proposed for how to connect devices that only support standard streaming media output to a platform that complies with national standard protocol requirements in related technologies. Summary of the Invention
[0007] The embodiments of the present application provide a device access method, apparatus, electronic device and storage medium to at least solve the problem in the related art of how to connect a device that only supports standard streaming media output to a platform that meets the requirements of national standard protocols.
[0008] In a first aspect, an embodiment of the present application provides a device access method.
[0009] In some embodiments, the method includes:
[0010] Obtain metadata notification package information corresponding to the target access device;
[0011] Determining a device protocol type of the target access device based on the metadata notification package information and preset feature library data;
[0012] Determining a protocol parsing plug-in according to the device protocol type, and loading the protocol parsing plug-in to extract a device capability set of the target access device;
[0013] The device capability set is mapped to a national standard registry to determine a national standard mapping result, and according to the national standard mapping result, the target access device is added to a national standard management platform.
[0014] In some embodiments, after mapping the device capability set to a national standard registry to determine a national standard mapping result, and adding the target access device to a national standard management platform according to the national standard mapping result, the method further includes:
[0015] Determine the virtual national standard unique identifier of the target access device according to the technical standards corresponding to the national standard management platform.
[0016] In some embodiments, after determining the virtual national standard unique identifier of the target access device according to the technical standard corresponding to the national standard management platform, the method further includes:
[0017] In the case where there are multiple target access devices, determining a target collaborative device among the multiple target access devices according to the virtual national standard unique identifier, and determining the target collaborative devices as a virtual collaborative device group;
[0018] A collaborative control instruction corresponding to the virtual collaborative device group is obtained, and a national standard alarm message body is determined according to the collaborative control instruction, a collaborative capability set and a collaborative control strategy of the virtual collaborative device group.
[0019] In some embodiments, determining the device protocol type of the target access device based on the metadata announcement package information and preset feature library data includes:
[0020] Determining an initial protocol type according to the metadata notification package information, and determining a format matching result according to the initial protocol type and the preset feature library data;
[0021] If the format matching result is mismatch, calculating a data entropy value of the data sequence corresponding to the target access device;
[0022] When the data entropy value is greater than a preset threshold, the data sequence is determined to be an encrypted stream, and the initial protocol type is determined to be the device protocol type of the target access device.
[0023] In some embodiments, determining a protocol parsing plug-in according to the device protocol type, and loading the protocol parsing plug-in to extract a device capability set of the target access device includes:
[0024] Querying a preset plug-in repository, and determining a plug-in in the preset plug-in repository that matches the device protocol type as a protocol parsing plug-in;
[0025] The protocol parsing plug-in is loaded into memory and a protocol parsing instance is created to extract the device capability set of the target access device.
[0026] In some embodiments, mapping the device capability set to a national standard registry to determine a national standard mapping result, and adding the target access device to a national standard management platform according to the national standard mapping result includes:
[0027] Obtaining a database field mapping table, and mapping the device capability set to a national standard registration table according to the database field mapping table to determine a national standard mapping result;
[0028] According to the national standard mapping result, the target access device is added to the national standard management platform.
[0029] In some embodiments, after adding the target access device to the national standard management platform according to the national standard mapping result, the method includes:
[0030] Acquire, according to the device protocol type, an original network abstraction layer unit of the data sequence corresponding to the target access device;
[0031] According to the original network abstraction layer unit, a media stream adapted to the national standard management platform is determined.
[0032] In a second aspect, an embodiment of the present application provides a device access apparatus.
[0033] In some embodiments, the device access apparatus includes a metadata information acquisition module, a device protocol type determination module, a device capability set extraction module, and a target device access module:
[0034] The metadata information acquisition module is used to obtain metadata notification package information corresponding to the target access device;
[0035] The device protocol type determination module is used to determine the device protocol type of the target access device based on the metadata notification package information and preset feature library data;
[0036] The device capability set extraction module is used to determine a protocol parsing plug-in according to the device protocol type, and load the protocol parsing plug-in to extract the device capability set of the target access device;
[0037] The target device access module is used to map the device capability set to the national standard registration table to determine the national standard mapping result, and add the target access device to the national standard management platform according to the national standard mapping result.
[0038] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the device access method as described in the first aspect above is implemented.
[0039] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the device access method as described in the first aspect above is implemented.
[0040] Compared with the related art, the device access method, device, electronic device and storage medium provided in the embodiments of the present application obtain the metadata notification package information corresponding to the target access device, determine the device protocol type of the target access device based on the metadata notification package information and the preset feature library data, and determine the protocol parsing plug-in based on the device protocol type, load the protocol parsing plug-in to extract the device capability set of the target access device, further, map the device capability set to the national standard registry to determine the national standard mapping result, and add the target access device to the national standard management platform based on the national standard mapping result, solving the problem in the related art of how to connect a device that only supports standard streaming media output to a platform that meets the requirements of the national standard protocol, and realizing seamless access and unified management of multi-protocol standardized streaming media devices to the national standard platform, simplifying the process, reducing the complexity and development cost of system integration, having good compatibility and scalability, and improving system stability and resource utilization.
[0041] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 1 is a hardware structure block diagram of a terminal according to a device access method according to an embodiment of the present application;
[0044] Figure 2 is a flow chart of a device access method according to an embodiment of the present application;
[0045] Figure 3is a flow chart of a device access method according to a preferred embodiment of the present application;
[0046] Figure 4 This is a structural block diagram of a device access apparatus according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means and should not be understood as the contents disclosed in the present application being insufficient.
[0048] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments unless there is a conflict.
[0049] Unless otherwise defined, technical or scientific terms used herein shall have the ordinary meaning as understood by persons of ordinary skill in the art to which this application belongs. The terms "a," "an," "an," "the," and similar expressions used herein do not denote limitations on quantity and may refer to either the singular or the plural. The terms "comprise," "include," "have," and any variations thereof, used herein, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or modules (units) is not limited to the listed steps or units but may also include steps or units not listed, or may include other steps or units inherent to the process, method, product, or apparatus. The terms "connected," "connected," "coupled," and similar expressions used herein are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. As used herein, "plurality" means greater than or equal to two. "And / or" describes an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" may mean: A exists alone; A and B exist simultaneously; or B exists alone. The terms "first", "second", "third" and the like involved in this application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0050] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 FIG is a block diagram of the hardware structure of a terminal of the device access method according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0051] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the device access method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0052] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the terminal's communications provider. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0053] This embodiment provides a device access method. Figure 2 is a flow chart of a device access method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0054] Step S201: Obtain metadata notification package information corresponding to the target access device.
[0055] In this embodiment, the gateway acquires metadata notification packets corresponding to the target access device. These packets contain specific information such as the device ID, protocol information, and codec capabilities. This process utilizes a differential update algorithm. If the camera resolution changes, only the difference in the resolution change field is transmitted, reducing data transmission.
[0056] Step S202: Determine the device protocol type of the target access device according to the metadata announcement package information and the preset feature library data.
[0057] Specifically, this embodiment of the present application builds a five-tuple filtering engine that monitors the source IP / port, destination IP / port, and protocol type in real time based on metadata notification packet information. It also establishes a pre-set signature library containing transmission characteristics (pre-set signature library data) for protocols such as RTSP, RTMP, ONVIF, and private SDKs. The five-tuple filtering engine is a protocol identification component that monitors the source / destination IP, port, and protocol type of network traffic, matches it against the built-in signature library, and accurately identifies the transmission characteristics of protocols such as RTSP and RTMP, providing a basis for protocol parsing. The pre-set signature library data also includes a standard format for verifying device protocol types. Furthermore, this embodiment of the present application establishes a traffic model and uses it to verify that the traffic interaction sequence complies with protocol specifications (for example, whether HTTPS completes the TLS handshake before transmitting HTTP data). It also performs format verification on message header fields (for example, whether the "CSeq" sequence number in the RTSP message is continuous). This is then compared with the standard format in the pre-set signature library to determine a format match. Based on this format match, the device protocol type of the target access device is further determined.
[0058] Step S203: Determine a protocol parsing plug-in according to the device protocol type, and load the protocol parsing plug-in to extract the device capability set of the target access device.
[0059] After determining the device protocol type, the protocol parser plugin for parsing the corresponding protocol is further determined based on the device protocol type. The protocol parser plugin is dynamically loaded into memory via a memory-mapped loader, creating a protocol parser instance to extract the device's capabilities. Specifically, for different device protocol types, the corresponding parsing instances can be as follows: For text protocols, such as RTSP, the "RTSP / 1.0 200 OK" response line is parsed and the "Session" field is extracted to verify the connection legitimacy; HTTP-FLV detects the ".flv" identifier in the URL path and parses the FLV file header (3-byte signature 0x464C56) and 9-byte metadata tag; for binary protocols, such as private SDKs, dynamic debugging captures the vendor API call sequence (e.g., OpenDevice→StartRealPlay→CloseDevice) to generate a 256-bit CRC-checked instruction fingerprint; and for drone image transmission, the MAVLink protocol start byte (0xFE) and message length field (1-255 bytes) are parsed to trigger the drone control protocol conversion module for accurate parsing.
[0060] Step S204 : Map the device capability set to the national standard registration table to determine the national standard mapping result, and add the target access device to the national standard management platform according to the national standard mapping result.
[0061] Furthermore, the device capability set is mapped to the national standard registration table to determine the national standard mapping result. The device capability set may include information such as codec capabilities (such as H.264 encoding and 1080P resolution) and control instruction sets (such as pan / tilt control). In this way, the present embodiment establishes a seamless access channel from standardized streaming media devices to the national standard platform, allowing the target access device to be added to the national standard management platform based on the national standard mapping result.
[0062] In addition, the system of the embodiment of the present application has a built-in OUI database to store the MAC address prefixes of each manufacturer. Before determining the device protocol type of the target access device based on the metadata notification package information and the preset feature library data, the device manufacturer can be quickly located by matching the device MAC address prefix, thereby narrowing the protocol matching range, saving resources and improving efficiency.
[0063] Through the above steps, the embodiment of the present application obtains the metadata notification package information corresponding to the target access device, determines the device protocol type of the target access device based on the metadata notification package information and the preset feature library data, and determines the protocol parsing plug-in based on the device protocol type, loads the protocol parsing plug-in to extract the device capability set of the target access device, further, maps the device capability set to the national standard registry to determine the national standard mapping result, and adds the target access device to the national standard management platform based on the national standard mapping result, which solves the problem in the related technology of how to connect a device that only supports standard streaming media output to a platform that meets the requirements of the national standard protocol, and realizes the seamless access and unified management of multi-protocol standardized streaming media devices to the national standard platform, simplifies the process, reduces the complexity and development cost of system integration, has good compatibility and scalability, and improves system stability and resource utilization.
[0064] In some embodiments, step S204 includes:
[0065] Step S205: Determine the virtual national standard unique identifier of the target access device according to the technical standards corresponding to the national standard management platform.
[0066] This embodiment of the application adheres to the technical standards of the national standard management platform to determine a virtual national standard unique identifier for a target access device. Specifically, a 32-bit virtual national standard unique identifier generation algorithm is designed, consisting of a 6-bit administrative region code, a 3-bit industry code (e.g., 200 for other), a 6-bit device type code (e.g., 000001 for video equipment), and a 7-bit sequence number. A millisecond-level sequence number is generated based on the device access timestamp (e.g., the current time 1690000000123 corresponds to the sequence number 0000123). Manual prefix configuration is supported (e.g., adding a "DL-" prefix to the serial number of power industry equipment). This ensures standardized and unique allocation of device virtual IDs, adapting to national standard platform device management.
[0067] In some embodiments, step S205 includes:
[0068] Step S206 : in the case of including multiple target access devices, determining target collaborative devices among the multiple target access devices according to the virtual national standard unique identifier, and determining the target collaborative devices as a virtual collaborative device group.
[0069] When collaborative control of multiple devices is required, a virtual collaborative device group can be constructed. Based on the application scenario requirements and the unique virtual national standard identifier, the target collaborative devices requiring collaborative control are identified among multiple target access devices and then grouped into a virtual collaborative device group. The data structure within the virtual collaborative device group can include the group ID, the target collaborative device ID and role (e.g., main_camera, sensor), collaborative capability set, and collaborative control policy.
[0070] Step S207 : obtaining a collaborative control instruction corresponding to the virtual collaborative device group, and determining a national standard alarm message body according to the collaborative control instruction, the collaborative capability set and the collaborative control strategy of the virtual collaborative device group.
[0071] The national standard management platform sends collaborative control instructions corresponding to the virtual collaborative device group, obtains and parses the collaborative control instructions, and determines the national standard alarm message body based on the parsed collaborative control instructions, collaborative capability set, and collaborative control strategy. It can further feedback the national standard alarm message body and report it to the platform. Taking drones and fixed cameras as an example, after the national standard management platform sends PTZ collaborative control instructions to the group ID of the virtual collaborative device group, the gateway parses the collaborative control instructions as drone flight control (MAVLink protocol NAV_CONTROLLER_OUTPUT) and camera steering (RS485 serial port instructions). A control command queue is established, with drone instructions given a higher priority. After receiving the device response, the status report is combined into the national standard alarm message body feedback, realizing multi-device collaborative control and unified status reporting, adapting to the device linkage requirements in complex scenarios.
[0072] In some embodiments, step S202 includes:
[0073] Step S2021: Determine the initial protocol type based on the metadata announcement package information, and determine the format matching result based on the initial protocol type and the preset feature library data.
[0074] In this embodiment of the present application, the system constructs an access adaptation matrix at the physical layer to achieve protocol detection coverage for multiple types of devices, identifying the ports, transport layer protocols, and handshake characteristics of different protocols. For IP digital devices, the initial protocol type of the device can be identified by utilizing dual Gigabit Ethernet ports or wireless WiFi modules, combined with link layer MAC address resolution and port scanning (covering common ports such as 554, 1935, and 80). Proprietary protocol devices rely on dedicated SDK interfaces and memory-mapped registers to capture vendor ID handshake packets, thereby identifying the initial protocol type. The initial protocol type is then compared with the standard format in a preset feature library to determine a format match.
[0075] Step S2022: When the format matching result is mismatch, the data entropy value of the data sequence corresponding to the target access device is calculated.
[0076] If the format matching result is not matched, it indicates that the data sequence corresponding to the target access device may be encrypted, so the data entropy value of the data sequence corresponding to the target access device is calculated. The formula for calculating the data entropy value is: , X is the data sequence, is the i-th byte appearing in the data, Byte value Probability of occurrence.
[0077] Step S2023: When the data entropy value is greater than a preset threshold, the data sequence is determined to be an encrypted stream, and the initial protocol type is determined to be the device protocol type of the target access device.
[0078] When the data entropy value is greater than the preset threshold, the data sequence is judged to be an encrypted stream. For example, the preset threshold is 7.5. When the data entropy value is greater than 7.5, the data sequence is judged to be TLS / SSL encrypted. At this time, the national secret SM4 algorithm can be loaded in advance to ensure secure data transmission.
[0079] In addition, this embodiment supports dual encryption mode negotiation (Security Mode: SM4-AES-128), prioritizing the use of the national encryption algorithm SM4 with a fallback to AES-128. The signaling layer encrypts the SIP message body (XML / JSON data) in AES-CBC mode, while the media layer encrypts the first 16 bytes of the RTP payload (NAL unit header) in SM4-ECB mode, ensuring data security during transmission and meeting different security requirements.
[0080] In some embodiments, step S203 includes:
[0081] Step S2031: query the preset plug-in repository and determine the plug-in that matches the device protocol type in the preset plug-in repository as the protocol parsing plug-in.
[0082] The system of the embodiment of the present application adopts a microkernel architecture to design a plug-in management system. After the protocol detection engine identifies the device protocol type, it queries the preset plug-in warehouse. If a plug-in matching the device protocol type exists in the preset plug-in warehouse, the matching plug-in is determined as the protocol parsing plug-in.
[0083] Step S2032: Load the protocol parsing plug-in into the memory and create a protocol parsing instance to extract the device capability set of the target access device.
[0084] The protocol parser plugin is dynamically loaded into memory via a memory-mapped loader, creating a protocol parser instance, extracting the device's capabilities, and mapping them to the national standard registry. If the protocol parser plugin fails to load, it automatically switches to generic parsing mode, transparently transmitting the original data and filling the national standard signaling placeholders. It's worth noting that if no plugin matching the device's protocol type exists in the pre-set plugin repository, the default plugin is used for parsing.
[0085] Furthermore, this embodiment of the application defines a standardized plug-in interface, encompassing functions such as obtaining protocol names, detecting device capabilities (codecs, control commands, resolution, etc.), extracting raw media stream data, and mapping control commands to national standard SIP messages. Standard protocol plug-ins (such as RTSP / RTMP) use a state machine to drive parsing of protocol state transitions; industry protocol plug-ins (such as SIP-B / ONVIF) utilize an XSLT template engine to transform industry fields; and proprietary protocol plug-ins utilize a dynamic link library (DLL) proxy model to transform control functions.
[0086] Through the above steps, the embodiment of the present application adopts a plug-in management system with a microkernel architecture, supports hot loading of protocol plug-ins, generates temporary plug-ins through AI self-learning, and other functions to achieve adaptive analysis of various protocol devices.
[0087] In some embodiments, step S204 includes:
[0088] Step S2041: Obtain a database field mapping table, and map the device capability set to a national standard registration table according to the database field mapping table to determine a national standard mapping result;
[0089] Among them, the database field mapping table can be an SQLite field mapping table. An SQLite field mapping table is established to store the correspondence between source protocol fields and national standard fields and conversion functions, such as direct extraction of RTSP.Session mapped to SIP.Call-ID, byte conversion of HTTP-FLV.FLVTag.DataSize mapped to PS stream.PayloadLength, and prefix completion of SDK.DeviceID mapped to national standard DeviceID. According to the correspondence and conversion function in the database field mapping table, the device capability set is mapped to the national standard registry to determine the national standard mapping result, thereby achieving accurate conversion of different source protocol fields to national standard fields. Taking PTZ control commands as an example, after the platform sends a SIP command (XML body) containing Pan, Tilt, and Zoom parameters, the protocol mapping engine first determines the device type (RTSP dome camera / private SDK drone), then searches the control command mapping table. The RTSP device generates a "SETUP rtsp: / / device / stream RTSP / 1.0" message with a Range header field. The drone then calls the COMMAND_LONG command of the MAVLink protocol, adding a timestamp check and retry mechanism to ensure accurate cross-protocol execution of the control command.
[0090] Step S2042: Add the target access device to the national standard management platform according to the national standard mapping result.
[0091] After mapping the device capability set to the national standard registry and determining the national standard mapping result, the conversion from the source protocol field to the national standard field is realized, and then the target access device is added to the national standard management platform, completing the access of the multi-protocol standardized streaming media device to the national standard platform.
[0092] Through the above steps, the embodiment of the present application builds a seamless access channel from standardized streaming media devices to the national standard platform through protocol adaptation access, dynamic signaling mapping, media stream format conversion, and device virtualization management, thereby realizing unified management and efficient interconnection of multi-protocol heterogeneous devices.
[0093] In some embodiments, step S2042 includes:
[0094] Step S2043: Acquire the original network abstraction layer unit of the data sequence corresponding to the target access device according to the device protocol type.
[0095] Furthermore, after the target access device is connected to the national standard management platform, the embodiment of the present application builds a multi-protocol decapsulation process. After the original stream of the target access device is input, the data sequence corresponding to the target access device is obtained. According to the device protocol type, the RTP payload is extracted from the RTSP stream, the FLV tag is parsed from the RTMP stream, the TS slices are merged into the HLS stream, and the manufacturer data interface is parsed from the private SDK stream. The original network abstraction layer (NAL) unit is separated to realize multi-protocol decapsulation.
[0096] Step S2044: Determine the media stream adapted to the national standard management platform according to the original network abstraction layer unit.
[0097] In the embodiment of the present application, for different input encodings, H.264 High Profile is converted to Baseline Profile, VP8 / VP9 is soft-transcoded to H.264, and quality control is performed at the same time (quantization parameters are adjusted, encoding presets are selected), and a media stream adapted to the national standard platform is output. Furthermore, based on the original network abstraction layer unit, the PS stream is encapsulated in accordance with the national standard specification, and the video ES stream adds the start code 0x00000001 before the H.264 / H.265 original network abstraction layer unit; the audio ES stream segments the G.711a / PCM data into 1024 bytes and adds a PTS / DTS timestamp; the system layer generates a PS packet header every 50ms, which includes a PCR clock to ensure that the media stream complies with the national standard format and can be recognized by the national standard platform. In addition, when the media stream is interrupted, the B frame completion algorithm is triggered, and a virtual frame is generated using the previous key frame to ensure that the system can still operate stably in abnormal scenarios and improve overall robustness.
[0098] Through the above steps, the embodiment of the present application strictly follows the national standard to encapsulate the PS stream, adds corresponding identifiers and timestamps to the video and audio ES streams, generates a PS packet header containing a PCR clock, ensures that the media stream can be recognized by the national standard platform, and ensures the accurate and stable operation of the system.
[0099] In addition, the device access method in the embodiment of the present application also includes constructing a national standard signaling state machine. When the device is powered on, it enters the registration state, sends a REGISTER request, and enters the keep-alive state after receiving a 200OK response. MESSAGE messages are periodically sent to maintain the connection; it enters the directory reporting state after receiving a platform directory request, and enters the control state after confirming the NOTIFY message. Operations such as PTZ control and video playback can be performed; after three consecutive keep-alive failures, it enters the abnormal state, triggers reconnection through an exponential backoff algorithm, and returns to the registration state. This ensures stable and orderly signaling interaction and adapts to the national standard platform signaling process. In addition, when a signaling field is missing, the protocol default value (e.g., if the resolution is not specified, the default is 720P) is used for real-time processing.
[0100] The embodiments of the present application are described and illustrated below through preferred embodiments.
[0101] Figure 3 This is a flow chart of the device access method according to the preferred embodiment of the present application. This embodiment is applied in large-scale intelligent park scenarios where multiple protocol devices need to be connected to the national standard platform. The park contains multiple functional areas, such as office areas, production areas, storage areas, etc., and devices from different manufacturers that support multiple standardized protocols are deployed. It is necessary to access the national standard management platform for unified management and monitoring. Figure 3 As shown, the device access method includes the following steps:
[0102] Step S301: Obtain metadata notification package information corresponding to the target access device.
[0103] In the office area, a large number of network cameras from Company A were deployed. These cameras supported the RTSP protocol and were connected to the access gateway system via dual Gigabit Ethernet ports. These network cameras were the target access devices. The system used link-layer MAC address resolution to identify the cameras' MAC addresses as having a prefix of 00:0C:29. After matching the cameras with the built-in OUI database, the cameras were identified as Company A devices.
[0104] Furthermore, when a camera device is connected, the gateway sends a metadata notification packet containing the device ID, protocol information, codec capabilities, and more. The system then retrieves the metadata notification packet information corresponding to the target connected device. This transmission process uses a differential update algorithm. If the camera resolution changes, only the difference in the resolution change field is transmitted, reducing data transmission volume.
[0105] Step S302: Determine the device protocol type of the target access device according to the metadata announcement package information and the preset feature library data.
[0106] Through port scanning, it was found that the target access device used port 554 for RTSP streaming. The five-tuple filtering engine further confirmed that its protocol type was RTSP based on the preset feature library data.
[0107] Step S303: Determine a protocol parsing plug-in according to the device protocol type, and load the protocol parsing plug-in to extract the device capability set of the target access device.
[0108] The protocol detection engine queries the preset plug-in repository and finds the corresponding RTSP plug-in, namely the protocol parsing plug-in. It loads the plug-in through the memory mapping loader and creates a protocol parsing instance to extract the device's codec capabilities (such as H.264 encoding and 1080P resolution), control instruction set (pan-tilt control, etc.), and other device capability set information.
[0109] Step S304: Map the device capability set to the national standard registration table to determine the national standard mapping result, and add the target access device to the national standard management platform according to the national standard mapping result.
[0110] The device capability set is mapped to the national standard registry to determine the national standard mapping result. Based on the national standard mapping result, the camera device is added to the national standard management platform. Additionally, some cameras are connected via wireless WiFi modules, while others utilize Ethernet connections. For wirelessly connected devices, the system identifies the device through WiFi signal scanning and MAC address resolution. The MAC address prefix 00:16:53 indicates a device from Company B. For wired devices, the manufacturer is similarly determined through link-layer MAC address resolution. These industrial cameras support the ONVIF protocol, and the five-tuple filtering engine identifies the device protocol type based on ONVIF protocol transmission characteristics (specific ports, handshake characteristics, etc.). After the ONVIF plug-in within the system is loaded through memory mapping, it analyzes the device capability set, such as supported image formats and frame rates, and maps the relevant information to the national standard registry.
[0111] In the signaling interaction between the device and the platform, the national standard signaling state machine process is followed. After power-on, a REGISTER request is sent to enter the registration state. After receiving a 200OK response, the device enters the keep-alive state. MESSAGE messages are periodically sent to maintain the connection to ensure stable signaling interaction.
[0112] The system converts and adapts media streams and data processing for different device types. The multi-protocol decapsulation process processes the RTSP and ONVIF streams separately, extracting the RTP payload and separating the NAL units. If the encoding format is H.264 High Profile, it converts to Baseline Profile, adjusts the quantization parameter to 28 (which can be optimized based on actual conditions), and selects the "fast" encoding preset to output a media stream compatible with national standard platforms.
[0113] The PS stream is encapsulated strictly in accordance with the national standard. The video ES stream is added with the start code 0x00000001. The audio ES stream (if any) is fragmented into 1024 bytes and the PTS / DTS timestamp is added. The system layer generates a PS packet header containing the PCR clock every 50ms.
[0114] Step S305: Determine the virtual national standard unique identifier of the target access device according to the technical standards corresponding to the national standard management platform.
[0115] Following the technical standards of the national standard management platform, a 32-bit virtual national standard unique identifier is generated for all devices within the park. For example, assuming the park's administrative district code is 330101 and its industry code is 200 (Other), for a camera in Company A's office area (video device, device type code 000001), the millisecond-level serial number 0000123 is generated based on the access timestamp 1690000000123. This camera's virtual national standard unique identifier is 3301012000000010000123, enabling standardized device management on the national standard platform.
[0116] Step S306: In the case where multiple target access devices are included, target collaborative devices among the multiple target access devices are determined according to the virtual national standard unique identifier, and the target collaborative devices are determined as a virtual collaborative device group.
[0117] To meet the collaborative needs of diverse devices within the campus, virtual collaborative device groups are constructed. For example, an industrial camera from Company B in the production area and several nearby cameras from Company A form a virtual collaborative device group. The group ID is set to "group001," the role of the industrial camera is "monitor_camera," and the collaborative capability sets and collaborative control strategies for each camera are clearly defined.
[0118] Step S307 : Acquire the collaborative control instruction corresponding to the virtual collaborative device group, and determine the national standard alarm message body according to the collaborative control instruction, the collaborative capability set and the collaborative control strategy of the virtual collaborative device group.
[0119] When the platform sends collaborative control commands to a group ID, the gateway parses the commands and sends ONVIF control commands to the industrial cameras based on the collaborative control strategy. It then establishes a control command queue and executes them. Upon receiving a response from the device, it consolidates the status report into a national standard alarm message and sends it back to the platform, enabling collaborative control and unified status reporting for multiple devices.
[0120] In terms of exception handling, if a device's plug-in fails to load, such as when a new device using a new private protocol is newly connected to the campus and its plug-in fails to load, the system automatically switches to universal parsing mode, transparently transmits the original data and fills in the national standard signaling placeholder to ensure that the device can still interact with the platform to a certain extent. When the signaling field is missing, such as when a camera does not receive the specified resolution information in the signaling interaction, the system uses the protocol default value of 720P for real-time processing, thereby ensuring the basic function of the device. If the media stream is interrupted, such as when a camera in the office area has a brief network failure that causes the media stream to be interrupted, the B-frame completion algorithm is triggered, and a virtual frame is generated using the previous key frame to maintain the continuity of video surveillance.
[0121] The device access method provided in the embodiment of the present application utilizes technologies such as protocol adaptation access, dynamic signaling mapping, media stream format conversion, and device virtualization management to break through protocol barriers, achieve unified access and management of multi-source streaming media devices, and reduce system integration complexity and development costs.
[0122] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0123] In addition, an embodiment of the present application also provides an access gateway system for converting standardized media streaming devices to national standard protocols. The system achieves comprehensive compatibility and analysis of different protocol devices by constructing an access adaptation matrix, adopting a plug-in management system, building a multi-protocol decapsulation process, and supporting dual encryption mode negotiation, thereby ensuring secure data transmission. At the same time, with the help of a virtual device group structure and an exception handling mechanism, the stability of the system is guaranteed and the compatibility of the system is improved.
[0124] This system detects and identifies device protocols by constructing an access adaptation matrix and a five-tuple filtering engine, uses a plug-in management system to implement hot loading of protocol plug-ins and mapping of device capability sets, relies on the national standard signaling state machine to ensure the signaling interaction process, combines multi-protocol decapsulation and format conversion technology to adapt to the national standard media stream specification, uses a virtual national standard ID generation algorithm and virtual device group technology to implement device virtualization management and collaborative control, and integrates differential updates, dual encryption mode, exception handling and other mechanisms to achieve seamless access and unified management of multi-protocol standardized streaming media devices to the national standard platform.
[0125] Based on a transparent protocol conversion mechanism, the system does not require major changes to the front-end equipment and back-end platform. System integration can be completed with minimal configuration, which greatly simplifies the process and effectively reduces the complexity of system integration and development costs. In addition, the system supports multiple mainstream standardized streaming media input protocols such as RTSP, HTTP-FLV, RTMP, HLS, etc., has good compatibility and scalability, and can flexibly expand new protocols to adapt to different front-end devices.
[0126] Through flexible device mapping and virtualization technology, the system allows one physical gateway to virtually access multiple national standard devices, achieving efficient resource utilization. Combined with optimized virtual access algorithms and resource allocation strategies, it avoids resource competition when multiple devices are connected, further improving system resource utilization and scalability, and ensuring stable operation of the gateway in complex environments.
[0127] This embodiment also provides a device access device, which is used to implement the above-mentioned embodiments and preferred implementations. Details that have already been described will not be repeated. As used below, the terms "module," "unit," "subunit," etc. may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0128] Figure 4 is a structural block diagram of a device access apparatus according to an embodiment of the present application, such as Figure 4 As shown, the apparatus includes a metadata information acquisition module 10, a device protocol type determination module 20, a device capability set extraction module 30, and a target device access module 40:
[0129] The metadata information acquisition module 10 is used to obtain metadata notification package information corresponding to the target access device;
[0130] The device protocol type determination module 20 is used to determine the device protocol type of the target access device based on the metadata notification package information and the preset feature library data;
[0131] The device capability set extraction module 30 is used to determine the protocol parsing plug-in according to the device protocol type, and load the protocol parsing plug-in to extract the device capability set of the target access device;
[0132] The target device access module 40 is used to map the device capability set to the national standard registration table to determine the national standard mapping result, and add the target access device to the national standard management platform according to the national standard mapping result.
[0133] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0134] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0135] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0136] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0137] Obtain metadata notification package information corresponding to the target access device;
[0138] Determine the device protocol type of the target access device based on the metadata notification package information and the preset feature library data;
[0139] Determine the protocol parsing plug-in based on the device protocol type, and load the protocol parsing plug-in to extract the device capability set of the target access device;
[0140] Map the device capability set to the national standard registry to determine the national standard mapping result, and add the target access device to the national standard management platform based on the national standard mapping result.
[0141] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be repeated here.
[0142] In addition, in conjunction with the device access method in the above embodiments, the present application embodiment may provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the device access methods in the above embodiments is implemented.
[0143] Those skilled in the art should understand that the various technical features of the above-described embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0145] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A device access method, characterized in that: The following steps are involved: Obtain metadata notification package information corresponding to the target access device; Determining a device protocol type of the target access device based on the metadata notification package information and preset feature library data; Determining a protocol parsing plug-in according to the device protocol type, and loading the protocol parsing plug-in to extract a device capability set of the target access device; The device capability set is mapped to a national standard registry to determine a national standard mapping result, and according to the national standard mapping result, the target access device is added to a national standard management platform.
2. The device access method according to claim 1, wherein: After mapping the device capability set to a national standard registry to determine a national standard mapping result, and adding the target access device to a national standard management platform according to the national standard mapping result, the method further includes: Determine the virtual national standard unique identifier of the target access device according to the technical standards corresponding to the national standard management platform.
3. The device access method according to claim 2, characterized in that: After determining the virtual national standard unique identifier of the target access device according to the technical standard corresponding to the national standard management platform, the method further includes: In the case where there are multiple target access devices, determining a target collaborative device among the multiple target access devices according to the virtual national standard unique identifier, and determining the target collaborative devices as a virtual collaborative device group; A collaborative control instruction corresponding to the virtual collaborative device group is obtained, and a national standard alarm message body is determined according to the collaborative control instruction, a collaborative capability set and a collaborative control strategy of the virtual collaborative device group.
4. The device access method according to any one of claims 1 to 3, characterized in that: The determining, based on the metadata notification package information and the preset feature library data, the device protocol type of the target access device includes: Determining an initial protocol type according to the metadata notification package information, and determining a format matching result according to the initial protocol type and the preset feature library data; If the format matching result is mismatch, calculating a data entropy value of the data sequence corresponding to the target access device; When the data entropy value is greater than a preset threshold, the data sequence is determined to be an encrypted stream, and the initial protocol type is determined to be the device protocol type of the target access device.
5. The device access method according to claim 4, characterized in that: The step of determining a protocol parsing plug-in according to the device protocol type, and loading the protocol parsing plug-in to extract a device capability set of the target access device includes: Querying a preset plug-in repository, and determining a plug-in in the preset plug-in repository that matches the device protocol type as a protocol parsing plug-in; The protocol parsing plug-in is loaded into memory and a protocol parsing instance is created to extract the device capability set of the target access device.
6. The device access method according to claim 5, characterized in that: Mapping the device capability set to a national standard registry to determine a national standard mapping result, and adding the target access device to a national standard management platform according to the national standard mapping result includes: Obtaining a database field mapping table, and mapping the device capability set to a national standard registration table according to the database field mapping table to determine a national standard mapping result; According to the national standard mapping result, the target access device is added to the national standard management platform.
7. The device access method according to claim 6, characterized in that: After adding the target access device to the national standard management platform according to the national standard mapping result, the method further includes: Acquire, according to the device protocol type, an original network abstraction layer unit of the data sequence corresponding to the target access device; According to the original network abstraction layer unit, a media stream adapted to the national standard management platform is determined.
8. A device access device, characterized in that: It includes metadata information acquisition module, device protocol type determination module, device capability set extraction module and target device access module: The metadata information acquisition module is used to obtain metadata notification package information corresponding to the target access device; The device protocol type determination module is used to determine the device protocol type of the target access device based on the metadata notification package information and preset feature library data; The device capability set extraction module is used to determine a protocol parsing plug-in according to the device protocol type, and load the protocol parsing plug-in to extract the device capability set of the target access device; The target device access module is used to map the device capability set to the national standard registration table to determine the national standard mapping result, and add the target access device to the national standard management platform according to the national standard mapping result.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the device access method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the device access method according to any one of claims 1 to 7 when running.
Citation Information
Patent Citations
Solution for no plug-in of national standard stream
CN115865872A
Multi-feature fusion CC encrypted traffic recognition algorithm
CN118656737A
Internet of things sensing equipment access management system and method
CN118748679A
Video multi-protocol fusion method and device, electronic equipment and storage medium
CN118827825A
Data access method and system of intelligent Internet of Things gateway
CN119420712A
Cited By
Video monitoring platform-oriented mass sensor access method, device and system
CN120825363A
Equipment management method and device, business server and storage medium
CN121691490A