A device access method and apparatus, an electronic device, and a storage medium
By acquiring device metadata and loading a protocol parsing plugin, seamless access from standard streaming media devices to the national standard platform was achieved, solving the problem of difficult device access and improving system stability and resource utilization.
Patent Information
- Application Number
- CN202511114181.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-12-23
- 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 packet information of the target access device, the device protocol type is determined, the protocol parsing plugin is loaded to extract the device capability set, and it is mapped to the national standard registry to achieve access. It adopts virtual national standard unique identifier and collaborative device group management to support seamless access of multi-protocol standardized streaming media devices.
It enables 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 CN120602250B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of electronic information communication, and in particular, to a device access method and device, an electronic device, and a storage medium. BACKGROUND
[0002] With the development of the Internet of Things and smart devices, a large number of standardized media stream devices in non-traditional security fields (such as unmanned aerial vehicles, handheld video cameras, law enforcement recorders, inspection robots, smart glasses, network cameras, etc.) are widely used in security, emergency, industrial inspection, smart cities, and other scenarios. These devices generally use standard, Internet-friendly streaming media output protocols, such as RTSP, HTTP-FLV, RTMP, HLS, etc.
[0003] However, the mainstream professional video monitoring management platform currently mainly follows national standards for device access, management, control, and media stream transmission. These platforms natively support national standard devices (such as IPCs and NVRs), but cannot directly access, manage, and apply to devices that only support standard Internet streaming media protocols (RTSP / HTTP-FLV, etc.).
[0004] In addition, although many device manufacturers provide standard SDKs for interfacing and application, the development cost required for interfacing in this way is extremely high, and the timeliness of the interface cannot meet actual business needs. At the same time, the adaptability and stability of the interfacing service cannot be guaranteed when multiple manufacturers' devices coexist.
[0005] Therefore, it is necessary to provide a method for accessing a video monitoring platform using a standard protocol through technical means for a video capture device that only supports standard protocol output, and to achieve management and functional application of this type of device that is basically consistent with traditional security devices, so that users have no perceptible difference.
[0006] Currently, there is no effective solution to how to access a device that only supports standard streaming media output to a platform that meets the requirements of national standard protocols. SUMMARY
[0007] Embodiments of the present application provide a device access method, device, electronic device, and storage medium to at least solve the problem of how to access a device that only supports standard streaming media output to a platform that meets the requirements of national standard protocols in related technologies.
[0008] In a first aspect, embodiments of the present application provide a device access method.
[0009] In some embodiments, the method includes:
[0010] Obtaining metadata announcement package information corresponding to a target access device.
[0011] determine a device protocol type of the target access device according to the metadata announcement packet information and preset feature library data;
[0012] determine a protocol analysis plug-in according to the device protocol type, and load the protocol analysis plug-in to extract a device capability set of the target access device;
[0013] map the device capability set to a national standard registry to determine a national standard mapping result, and add the target access device to a national standard management platform according to the national standard mapping result.
[0014] In some embodiments, the method further comprises, after the mapping the device capability set to the national standard registry to determine the national standard mapping result, and adding the target access device to the national standard management platform according to the national standard mapping result:
[0015] determine a virtual national standard unique identifier of the target access device according to a technical standard corresponding to the national standard management platform.
[0016] In some embodiments, the method further comprises, after the determining the virtual national standard unique identifier of the target access device according to the technical standard corresponding to the national standard management platform:
[0017] In a case where a plurality of target access devices are included, determine a target cooperative device in the plurality of target access devices according to the virtual national standard unique identifier, and determine the target cooperative device as a virtual cooperative device group.
[0018] obtain a cooperative control instruction corresponding to the virtual cooperative device group, and determine a national standard alarm message body according to the cooperative control instruction, a cooperative capability set of the virtual cooperative device group, and a cooperative control strategy.
[0019] In some embodiments, the determining the device protocol type of the target access device according to the metadata announcement packet information and the preset feature library data comprises:
[0020] determine an initial protocol type according to the metadata announcement packet information, and determine a format matching result according to the initial protocol type and the preset feature library data;
[0021] in a case where the format matching result is not matched, calculate a data entropy value of a data sequence corresponding to the target access device;
[0022] in a case where the data entropy value is greater than a preset threshold value, determine that the data sequence is an encrypted stream, and determine the initial protocol type as the device protocol type of the target access device.
[0023] In some embodiments, the determining a protocol parsing plug-in according to the device protocol type and loading the protocol parsing plug-in to extract the device capability set of the target access device comprises:
[0024] querying a preset plug-in warehouse, determining a plug-in matching the device protocol type in the preset plug-in warehouse as the protocol parsing plug-in;
[0025] loading the protocol parsing plug-in to a memory and creating a protocol parsing instance to extract the device capability set of the target access device.
[0026] In some embodiments, the 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 comprises:
[0027] obtaining a database field mapping table, mapping the device capability set to the national standard registry according to the database field mapping table to determine a national standard mapping result;
[0028] adding the target access device to the national standard management platform according to the national standard mapping result.
[0029] In some embodiments, after the adding the target access device to the national standard management platform according to the national standard mapping result comprises:
[0030] obtaining an original network abstraction layer unit of a data sequence corresponding to the target access device according to the device protocol type;
[0031] determining a media stream adapted to the national standard management platform according to the original network abstraction layer unit.
[0032] In a second aspect, the embodiments of the present application provide a device access apparatus.
[0033] In some embodiments, the device access apparatus comprises a metadata information obtaining module, a device protocol type determining module, a device capability set extracting module and a target device access module:
[0034] The metadata information obtaining module is configured to obtain metadata advertisement packet information corresponding to a target access device.
[0035] The device protocol type determining module is configured to determine a device protocol type of the target access device according to the metadata advertisement packet information and preset feature library data.
[0036] The device capability set extracting module is configured to determine a protocol parsing plug-in according to the device protocol type and load the protocol parsing plug-in to extract a device capability set of the target access device.
[0037] The target device access module is configured to map the device capability set to a national standard registry to determine a national standard mapping result, and add the target access device to a national standard management platform according to the national standard mapping result.
[0038] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the device access method according to the first aspect when executing the computer program.
[0039] In a fourth aspect, a storage medium is provided, which stores a computer program executable by a processor to implement the device access method according to the first aspect.
[0040] Compared with the related art, the device access method, the device, the electronic device, and the storage medium provided by the embodiments of the present application solve the problem of how to access a device that only supports standard streaming media output to a platform that meets the requirements of national standard protocols, realize seamless access and unified management of multi-protocol standardized streaming media devices to a national standard platform, simplify the process, reduce system integration complexity and development cost, have good compatibility and expansibility, and improve system stability and resource utilization.
[0041] Details of one or more embodiments of the present application are presented in the following drawings and description to make other features, objects, and advantages of the present application more apparent. BRIEF DESCRIPTION OF DRAWINGS
[0042] The accompanying drawings illustrated herein are used to provide further understanding of the present application, constitute a part of the present application, and illustrate the illustrative embodiments of the present application and their description are used to explain the present application, and do not constitute improper limitation on the present application. In the drawings:
[0043] Figure 1 is a hardware structure block diagram of a terminal according to the device access method of the embodiments of the present application;
[0044] Figure 2 is a flowchart of the device access method according to the embodiments 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 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 objects, technical solutions and advantages of the present application clearer, the present application is described and explained below in connection with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of protection of the present application. In addition, it can be understood that, although the efforts made in this development process can be complex and lengthy, some design, manufacture or production changes made on the basis of the technical content disclosed in the present application are only routine technical means for those of ordinary skill in the art related to the content disclosed in the present application, and should not be understood as insufficient disclosure of the content disclosed in the present application.
[0048] In the present application, the phrase "embodiments" means that the specific features, structures or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The appearance of this phrase at various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. Those of ordinary skill in the art explicitly and implicitly understand that the embodiments described in the present application can be combined with other embodiments without conflict.
[0049] Unless otherwise defined, technical terms and scientific terms used in the present application shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. Unless otherwise defined, the terms "one" and "a" or "an" used in the present application shall not be construed as being limited to a single element, but instead are used to represent one or more elements. The terms "including," "comprising," "having," and variations thereof in the present application are meant to encompass the elements listed thereafter and variations thereof, unless otherwise specified. For example, a process, method, system, product, or apparatus that comprises a list of steps or modules (units) is not limited to those steps or modules which are recited, but can also include additional steps or modules that are not expressly listed or can also include additional steps or modules that are inherent to such process, method, product, or apparatus. The terms "connected," "coupled," and variations thereof in the present application are not limited to direct connections, but can also include indirect connections or intermediate components that facilitate the connection between other components. The term "plurality" in the present application means two or more. The term "and / or" in the present application describes an associated relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. The terms "first," "second," "third," and the like in the present application are merely used to distinguish similar objects, and do not represent a specific order of the objects.
[0050] The method embodiments provided by the present embodiment can be executed in a terminal, a computer, or a similar computing device. Taking a terminal as an example, Figure 1 is a hardware structure diagram of a terminal of the device access method of the embodiments of the present application. As shown in Figure 1 , the terminal can include one or more (only one is shown in Figure 1 ) processor 102 (the processor 102 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above terminal can also include a transmission device 106 for communication function and an input and output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, and does not limit the structure of the above terminal. For example, the terminal can include more or fewer components than those shown in Figure 1 , or have a different configuration from that shown in Figure 1 .
[0051] The memory 104 can be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the device access method in the embodiments of the present application. The processor 102 can execute various functional applications and data processing, i.e., implement the above method, by running the computer programs stored in the memory 104. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to the terminal through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0052] The transmission device 106 is configured to receive or send data via a network. The specific examples of the above network can include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0053] The embodiments of the present application provide a device access method, Figure 2 The device access method according to the embodiments of the present application is shown in FIG. 2, which includes the following steps: Figure 2
[0054] In step S201, metadata announcement packet information corresponding to a target access device is acquired.
[0055] In the embodiments of the present application, the metadata announcement packet information corresponding to the target access device sent by the gateway is acquired, wherein the metadata announcement packet information includes device ID, protocol information, and specific information such as codec capability. In addition, the process adopts a differential update algorithm. If the resolution of the camera changes, only the difference of the resolution change field is transmitted, so as to reduce the data transmission amount.
[0056] In step S202, a device protocol type of the target access device is determined according to the metadata announcement packet information and preset feature library data.
[0057] Specifically, the embodiment of the present application builds a five-tuple filtering engine, monitors source IP / port, destination IP / port, and protocol type based on metadata announcement packet information, and establishes a preset feature library containing transmission characteristics (preset feature library data) of RTSP, RTMP, ONVIF, and private SDK. The five-tuple filtering engine is a protocol identification component that matches the built-in feature library by monitoring the source / destination IP, port, and protocol type of network traffic, accurately identifies the transmission characteristics of RTSP, RTMP, and other protocols, and provides a basis for protocol analysis. Among them, the preset feature library data also contains a standard format for verifying the protocol type of the device. In addition, the embodiment of the present application establishes a traffic model and uses the traffic model to verify whether the traffic interaction sequence conforms to the protocol specification (such as whether HTTPS completes TLS handshake before transmitting HTTP data), and performs format checking and parsing of the message header field (such as whether the "CSeq" sequence number in the RTSP message is continuous), and compares it with the standard format in the preset feature library to determine the format matching result, and further determines the device protocol type of the target access device according to the format matching result.
[0058] Step S203, according to the device protocol type, determine the protocol analysis plug-in, and load the protocol analysis plug-in to extract the device capability set of the target access device.
[0059] After determining the device protocol type, further determine the protocol analysis plug-in for analyzing the corresponding protocol based on the device protocol type, dynamically load the protocol analysis plug-in to the memory through the memory mapping loader, create a protocol analysis instance, and extract the device capability set. Specifically, for different device protocol types, the corresponding analysis instance can be as follows: for text protocols, such as RTSP analysis "RTSP / 1.0 200 OK" response line, extract the "Session" field to verify the legality of the connection; HTTP-FLV detects URL path ".flv" identifier, analyzes the FLV file header (3-byte signature 0x464C56) and 9-byte metadata tag; for binary protocols, such as private SDK, generate 256-bit CRC check instruction fingerprint by dynamically debugging to capture vendor API call sequence (such as OpenDevice→StartRealPlay→CloseDevice); for drone image transmission, analyze MAVLink protocol start byte (0xFE) and message length field (1-255 bytes), trigger the drone control protocol conversion module to achieve accurate analysis.
[0060] Step S204, 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 according to the national standard mapping result.
[0061] Further, the device capability set is mapped to the national standard registry to determine a national standard mapping result, wherein the device capability set can include codec capability (such as H.264 encoding, 1080P resolution), control instruction set (gimbal control, etc.), and the like. In this way, the embodiment of the present application constructs a seamless access channel from the standardized streaming media device to the national standard platform, so that the target access device can be added to the national standard management platform according to the national standard mapping result.
[0062] In addition, the system of the embodiment of the present application is built-in with an OUI database to store MAC address prefixes of various manufacturers. Before determining the device protocol type of the target access device according to the metadata announcement package information and the preset feature library data, the device manufacturer can be quickly located by matching the device MAC address prefix, so as to narrow the protocol matching range, save resources, and improve efficiency.
[0063] Through the above steps, the metadata announcement package information corresponding to the target access device is obtained, the device protocol type of the target access device is determined according to the metadata announcement package information and the preset feature library data, the protocol analysis plug-in is determined according to the device protocol type, the protocol analysis plug-in is loaded to extract the device capability set of the target access device, further, the device capability set is mapped to the national standard registry to determine the national standard mapping result, and the target access device is added to the national standard management platform according to the national standard mapping result. The problem of how to access the device supporting only standard streaming media output to the platform meeting the national standard protocol requirement in the related art is solved, seamless access and unified management of the multi-protocol standardized streaming media device to the national standard platform are achieved, the process is simplified, the system integration complexity and development cost are reduced, good compatibility and expansibility are possessed, and the system stability and resource utilization rate are improved.
[0064] In some embodiments, step S204 is followed by:
[0065] Step S205: determining a virtual national standard unique identifier of the target access device according to a technical standard corresponding to the national standard management platform.
[0066] The embodiment of the present application determines the virtual national standard unique identifier of the target access device according to the technical standard corresponding to the national standard management platform. Specifically, a 32-bit virtual national standard unique identifier generation algorithm is designed, which is composed of administrative division code (6 bits), industry code (3 bits, for example, 200 for other), device type code (6 bits, for example, 000001 for video device), and serial number (7 bits). The millisecond-level serial number is generated according to the device access timestamp (for example, the current time 1690000000123 corresponds to the serial number 0000123), manual prefix configuration (for example, the serial number of the power industry device adds the "DL-" prefix) is supported, so as to realize the specification and unique allocation of the device virtual ID, and adapt to the device management of the national standard platform.
[0067] In some embodiments, step S205 is followed by:
[0068] Step S206, in the case of multiple target access devices, determining a target collaborative device in the multiple target access devices according to the virtual national standard unique identifier, and determining the target collaborative device as a virtual collaborative device group.
[0069] When multiple device collaborative control needs to be implemented, a virtual collaborative device group can be constructed. Based on application scenario requirements, a target collaborative device in multiple target access devices that needs to be collaboratively controlled is determined according to the virtual national standard unique identifier, and the target collaborative device is determined as a virtual collaborative device group. The data structure in the virtual collaborative device group can include group ID, target collaborative device ID and role (such as main camera, sensor, etc.), collaborative capability set, and collaborative control strategy.
[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 of the virtual collaborative device group, and the collaborative control strategy.
[0071] The national standard management platform sends a collaborative control instruction corresponding to the virtual collaborative device group, obtains the collaborative control instruction and parses it, determines a national standard alarm message body according to the parsed collaborative control instruction, the collaborative capability set, and the collaborative control strategy, and can further feed back the national standard alarm message body and report it to the platform. Taking a drone and a fixed camera as an example, after the national standard management platform sends a PTZ collaborative control instruction to the group ID of the virtual collaborative device group, the gateway parses the collaborative control instruction into a drone flight control (MAVLink protocol NAV_CONTROLLER_OUTPUT) and a camera steering (RS485 serial port instruction), then a control instruction queue is established, the priority of the drone instruction is set to be higher, and after receiving the device response, the state report is combined into a national standard alarm message body feedback, realizing multiple device collaborative control and unified state reporting, and adapting to complex scene device linkage requirements.
[0072] In some embodiments, step S202 includes:
[0073] Step S2021, determining an initial protocol type according to the metadata announcement package information, and determining a format matching result according to the initial protocol type and a preset feature library data.
[0074] In the embodiment of the present application, the system constructs an access adaptation matrix at the physical layer to realize protocol detection coverage for multiple types of devices, identify 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 using a dual-gigabit network port or a wireless WiFi module, combining link layer MAC address resolution and port scanning (covering common ports such as 554, 1935, 80, etc.). Private protocol devices rely on special SDK interfaces and memory mapping registers to capture vendor ID handshake packets, thereby identifying the initial protocol type. The initial protocol type is compared with the standard format in the preset feature library to determine the format matching result.
[0075] In step S2022, if the format matching result is not matched, 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, and therefore 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, is the byte value and the probability of occurrence.
[0077] In step S2023, if 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, it is determined that the data sequence is an encrypted stream. For example, the preset threshold is 7.5, and when the data entropy value is greater than 7.5, it is determined that the data sequence is a TLS / SSL encryption. At this time, the SM4 algorithm can be loaded in advance to ensure the security of data transmission.
[0079] In addition, the embodiment of the present application supports dual encryption mode negotiation (SecurityMode: SM4-AES-128), which preferentially uses the SM4 algorithm and falls back to AES-128. The signaling layer uses the AES-CBC mode to encrypt the SIP message body (XML / JSON data), and the media layer uses the SM4-ECB mode to encrypt the first 16 bytes (NAL unit header) of the RTP load, thereby ensuring the security of data in the transmission process and meeting different security requirement scenarios.
[0080] In some embodiments, step S203 includes:
[0081] In step S2031, the preset plug-in warehouse is queried, and the plug-in in the preset plug-in warehouse that matches the device protocol type is determined as the protocol analysis plug-in.
[0082] The system of the embodiment of the application adopts a microkernel architecture to design a plug-in management system. After the protocol detection engine identifies the device protocol type, the preset plug-in warehouse is queried. If there is a plug-in matching the device protocol type in the preset plug-in warehouse, the matching plug-in is determined as a protocol analysis plug-in.
[0083] In step S2032, the protocol analysis plug-in is loaded into the memory and a protocol analysis instance is created to extract the device capability set of the target access device.
[0084] The protocol analysis plug-in is dynamically loaded into the memory by the memory mapping loader, a protocol analysis instance is created, the device capability set is extracted and mapped to the national standard registry. If the protocol analysis plug-in fails to be loaded, the general analysis mode is automatically switched to, the original data is transparently transmitted and the national standard signaling placeholder is filled. It is worth mentioning that if there is no plug-in matching the device protocol type in the preset plug-in warehouse, the default plug-in is used for analysis.
[0085] In addition, the embodiment of the application also defines a standardized plug-in interface, which covers functions such as obtaining a protocol name, detecting a device capability set (codec, control instruction, resolution, etc.), extracting original media stream data, and mapping a control instruction to a national standard SIP message. Standard protocol plug-ins (such as RTSP / RTMP) drive protocol state migration through a state machine; industry protocol plug-ins (such as SIP-B / ONVIF) convert industry fields by using an XSLT template engine; and private protocol plug-ins convert control functions by using a dynamic link library (DLL) proxy mode.
[0086] Through the above steps, the embodiment of the application adopts a plug-in management system of a microkernel architecture, supports hot loading of protocol plug-ins, generates temporary plug-ins through AI self-learning, and realizes adaptive analysis of various protocol devices.
[0087] In some embodiments, step S204 includes:
[0088] In step S2041, a database field mapping table is obtained, and the device capability set is mapped to the national standard registry according to the database field mapping table to determine a national standard mapping result.
[0089] The database field mapping table can be a SQLite field mapping table. The SQLite field mapping table is established and used to store the correspondence and conversion functions between the source protocol fields and the national standard fields. For example, RTSP.Session is directly extracted and mapped to SIP.Call-ID, HTTP-FLV.FLVTag.DataSize bytes are converted and mapped to PS stream.PayloadLength, SDK.DeviceID is prefixed and mapped to the national standard DeviceID. According to the correspondence and conversion functions in the database field mapping table, the device capability set is mapped to the national standard registry to determine the national standard mapping result, so as to realize accurate conversion of different source protocol fields to national standard fields. Taking a PTZ control instruction as an example, after the platform issues a SIP instruction (XML body) containing Pan, Tilt and Zoom parameters, the protocol mapping engine first determines the device type (RTSP ball machine / private SDK unmanned aerial vehicle), and then searches the control instruction mapping table. The RTSP device generates a "SETUP rtsp: / / device / stream RTSP / 1.0" message and carries a Range header field. The unmanned aerial vehicle calls the COMMAND_LONG instruction of the MAVLink protocol, adds a timestamp checksum and a retry mechanism, and guarantees accurate execution of the control instruction across protocols.
[0090] In step S2042, the target access device is added to the national standard management platform according to the national standard mapping result.
[0091] After the device capability set is mapped to the national standard registry to determine the national standard mapping result, the conversion of 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, and the access of the multi-protocol standardized stream media device to the national standard platform is completed.
[0092] Through the above steps, the embodiments of the present application construct a seamless access channel from the standardized stream media device to the national standard platform through protocol adaptation access, signaling dynamic mapping, media stream format conversion and device virtualization management, and realize unified management and efficient interconnection of multi-protocol heterogeneous devices.
[0093] In some embodiments, step S2042 includes the following steps:
[0094] In step S2043, according to the device protocol type, the original network abstract layer unit of the data sequence corresponding to the target access device is obtained.
[0095] Further, after the target access device accesses the national standard management platform, the embodiment of the application builds a multi-protocol unpacking process. After the original stream of the target access device is input, the data sequence corresponding to the target access device is obtained, and according to the device protocol type, the RTP load of the RTSP stream is extracted, the FLV tag of the RTMP stream is parsed, the TS slice of the HLS stream is merged, and the vendor data interface of the private SDK stream is parsed, all of which separate the original network abstraction layer (NAL) unit, and realize multi-protocol unpacking.
[0096] In step S2044, the media stream suitable for the national standard management platform is determined according to the original network abstraction layer unit.
[0097] In the embodiment of the application, for different input encodings, H.264 HighProfile is converted to BaselineProfile, and VP8 / VP9 soft transcoding is converted to H.264, while quality control (adjusting the quantization parameter and selecting the encoding preset) is performed, and the media stream suitable for the national standard platform is output. Further, based on the original network abstraction layer unit, the PS stream is packaged in accordance with the national standard specification, the video ES stream is added with a start code 0x00000001 in front of the H.264 / H.265 original network abstraction layer unit, the G.711a / PCM data is fragmented according to 1024 bytes, and the PTS / DTS timestamp is added; the system layer generates a PS packet header every 50 ms, which contains a PCR clock, so as to ensure that the media stream conforms to the national standard format and can be recognized by the national standard platform. In addition, when the media stream is interrupted, a B-frame completion algorithm is triggered to generate a virtual frame by using the previous key frame, so as to ensure that the system can still operate stably under abnormal scenarios and improve the overall robustness.
[0098] Through the above steps, the embodiment of the application strictly packages the PS stream in accordance with the national standard specification, adds the corresponding identifier and timestamp to the video and audio ES streams, generates a PS packet header containing a PCR clock, and ensures that the media stream can be recognized by the national standard platform, so as to ensure that the system operates accurately and stably.
[0099] In addition, the device access method in the embodiment of the application further includes building a national standard signaling state machine, powering on the device to enter a registration state, sending a REGISTER request, entering a keep-alive state after receiving a 200OK response, and periodically sending a MESSAGE message to maintain the connection; entering a directory reporting state after receiving a platform directory request, entering a control state after a NOTIFY message is confirmed, and performing PTZ control, video playback and other operations; entering an abnormal state after three consecutive keep-alive failures, triggering a reconnection through an exponential backoff algorithm, and recovering to the registration state, so as to ensure that the signaling interaction is stable and orderly, and to adapt to the national standard platform signaling process. In addition, when the signaling field is missing, the protocol default value (such as defaulting to 720P if the resolution is not specified) is used for real-time processing.
[0100] The embodiment of the application will be described and explained below through preferred embodiments.
[0101] Figure 3 is a flowchart of a device access method according to a preferred embodiment of the present application. This embodiment is applied in a large intelligent park scenario where devices from different manufacturers supporting multiple standardized protocols need to be accessed to a national standard platform for unified management and monitoring. As shown in Figure 3 the device access method comprises the following steps:
[0102] Step S301, obtaining metadata announcement package information corresponding to the target access device.
[0103] In the office area, a large number of network cameras of company A are deployed, supporting RTSP protocol, and are accessed to the access gateway system through dual gigabit network ports. These network cameras are the target access devices. The system identifies the MAC address prefix of the camera as 00:0C:29 through link layer MAC address resolution, and determines it as a device of company A after matching the built-in OUI database.
[0104] Further, when the camera device is accessed, the gateway sends a metadata announcement package containing device ID, protocol information, and codec capability, etc. The system obtains the metadata announcement package information corresponding to the target access device. The transmission process uses a differential update algorithm. If the resolution of the camera changes, only the difference value of the resolution change field is transmitted, reducing the amount of data transmission.
[0105] Step S302, determining 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 is found that the target access device uses port 554 for RTSP streaming. The five-tuple filtering engine further confirms that its protocol type is RTSP based on the preset feature library data.
[0107] Step S303, determining the protocol parsing plug-in according to the device protocol type, and loading 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 warehouse to find the corresponding RTSP plug-in, i.e. the protocol parsing plug-in, loads the plug-in through the memory mapping loader and creates a protocol parsing instance, and extracts the device capability set information such as the codec capability (such as H.264 encoding, 1080P resolution), control instruction set (pan-tilt control, etc.) of the device.
[0109] Step S304, mapping the device capability set to the national standard registry to determine the national standard mapping result, and adding 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, and the camera device is added to the national standard management platform according to the national standard mapping result. In addition, if part of the cameras are accessed through a wireless WiFi module, and part are connected through Ethernet. For the devices accessed wirelessly, the system identifies the devices through WiFi signal scanning and MAC address resolution. The MAC address prefix 00:16:53 indicates a B company device. The wired connection devices are also determined by link layer MAC address resolution. These industrial cameras support the ONVIF protocol, and the five-tuple filtering engine identifies the device protocol type according to the transmission characteristics (specific port, handshake characteristics, etc.) of the ONVIF protocol. The ONVIF plug-in in the system is loaded through memory mapping, and the device capability set is parsed, such as supported image format, frame rate, etc., and the relevant information is mapped 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, the REGISTER request is sent to enter the registration state, and after receiving the 200 OK response, the keep-alive state is entered. The MESSAGE message is sent periodically to maintain the connection, and the signaling interaction is stable.
[0112] For media stream or data processing of different types of devices, the system performs corresponding conversion and adaptation operations. The multi-protocol unpacking process processes RTSP stream and ONVIF stream respectively, extracts the RTP payload and separates the NAL unit. If the encoding format is H.264 High Profile, it is converted to Baseline Profile, the quantization parameter is adjusted to 28 (which can be optimized according to actual conditions), and the "fast" encoding preset is selected. The media stream adapted to the national standard platform is output.
[0113] The PS stream is strictly packaged according to the national standard specification. The video ES stream adds the start code 0x00000001, the audio ES stream (if any) is fragmented in 1024 bytes and adds the PTS / DTS timestamp, and the system layer generates a PS packet header containing the PCR clock every 50ms.
[0114] Step S305, according to the technical standard corresponding to the national standard management platform, determine the virtual national standard unique identifier of the target access device.
[0115] According to the technical standard corresponding to the national standard management platform, a 32-bit virtual national standard unique identifier is generated for all devices in the park. For example, assuming that the administrative division code of the park is 330101, the industry code is 200 (other), and for the A company camera (video device, device type code 000001) in the office area, the millisecond sequence number is 0000123 generated according to the access timestamp 1690000000123, the virtual national standard unique identifier of the camera is 3301012000000010000123, and the standardized management of the device on the national standard platform is realized.
[0116] In step S306, in the case of a plurality of target access devices, a target cooperative device is determined from the plurality of target access devices according to the virtual national standard unique identifier, and the target cooperative device is determined as a virtual cooperative device group.
[0117] In order to meet the cooperative work requirements of different devices in the park, a virtual cooperative device group is constructed. For example, a B company industrial camera in the production area and several A company cameras nearby form a virtual cooperative device group. The group ID is set to "group001", and the role of the industrial camera is "monitor_camera", which clearly defines the respective cooperative capability set and cooperative control strategy.
[0118] In step S307, the cooperative control instruction corresponding to the virtual cooperative device group is obtained, and the national standard alarm message body is determined according to the cooperative control instruction, the cooperative capability set and the cooperative control strategy of the virtual cooperative device group.
[0119] When the platform sends a cooperative control instruction to the group ID, the gateway analyzes the instruction and sends an ONVIF control instruction to the industrial camera according to the cooperative control strategy, establishes a control instruction queue and executes it. After receiving the device response, the state report is combined into a national standard alarm message body and fed back to the platform, realizing the cooperative control of multiple devices and the unified reporting of the state.
[0120] In terms of exception handling, if the plug-in of a device fails to load, such as a new device using a new private protocol being newly connected to the park, when the plug-in fails to load, the system automatically switches to a general analysis mode, transmits the original data and fills in the national standard signaling placeholder, ensuring that the device can still interact with the platform to a certain extent. When the signaling field is missing, such as a camera not receiving the specified resolution information in the signaling interaction, the system uses the protocol default value 720P for real-time processing, thereby ensuring the basic function of the device. If the media stream is interrupted, such as a temporary network failure of a camera in the office area causing the media stream to be interrupted, the B-frame completion algorithm is triggered to generate a virtual frame using the previous key frame, thereby maintaining the continuity of video monitoring.
[0121] The device access method provided by the embodiments of the present application breaks protocol barriers, realizes unified access and management of multi-source stream media devices, and reduces system integration complexity and development cost by using protocol adaptation access, signaling dynamic mapping, media stream format conversion, and device virtualization management.
[0122] It should be noted that the steps shown in the above flow or the flowchart of 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 here.
[0123] In addition, the embodiments of the present application also provide an access gateway system for converting a standardized media stream device into a national standard protocol, which realizes comprehensive compatibility and analysis of different protocol devices, guarantees safe data transmission, and improves system stability and compatibility by means of a virtual device group structure and an exception handling mechanism.
[0124] The system detects and identifies device protocols by constructing an access adaptation matrix and a five-tuple filtering engine, realizes protocol plug-in hot loading and device capability set mapping by using a plug-in management system, guarantees signaling interaction processes by relying on a national standard signaling state machine, adapts national standard media stream specifications by combining multi-protocol unpacking and format conversion technologies, realizes device virtualization management and collaborative control by using a virtual national standard ID generation algorithm and a virtual device group technology, and realizes seamless access and unified management of multi-protocol standardized stream media devices to a national standard platform by integrating differential update, double encryption mode, and exception handling mechanisms.
[0125] Based on the transparent protocol conversion mechanism, the system does not need to make substantial changes to the front-end devices and the back-end platform, and can complete system integration only by minimal configuration, greatly simplifying the process and effectively reducing system integration complexity and development cost; in addition, the system supports multiple mainstream standardized stream media input protocols such as RTSP, HTTP-FLV, RTMP, and HLS, has good compatibility and expandability, and can flexibly extend new protocol adaptation to different front-end devices.
[0126] The system realizes efficient use of resources by device flexible mapping and virtualization technology, and a physical gateway can virtually access multiple national standard devices, avoids resource competition when multiple devices are accessed, further improves system resource utilization and scalability, and guarantees stable operation of the gateway in a complex environment.
[0127] The embodiments further provide a device access apparatus for implementing the above-mentioned embodiments and preferred embodiments, which have been described above and will not be repeated. As used below, the terms "module", "unit", "sub-unit" and the like can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in 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 the embodiments of the present application, as shown in the figure, the apparatus comprises 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: Figure 4
[0129] The metadata information acquisition module 10 is configured to acquire metadata announcement packet information corresponding to a target access device;
[0130] The device protocol type determination module 20 is configured to determine a device protocol type of the target access device according to the metadata announcement packet information and preset feature library data;
[0131] The device capability set extraction module 30 is configured to determine a protocol analysis plug-in according to the device protocol type, and load the protocol analysis plug-in to extract a device capability set of the target access device;
[0132] The target device access module 40 is configured to map the device capability set to a national standard registry to determine a national standard mapping result, and add the target access device to a national standard management platform according to the national standard mapping result.
[0133] It should be noted that each of the above modules can be a functional module or a program module, which can be implemented by software or hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combination.
[0134] The embodiments further provide an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0135] Optionally, the above electronic device can further comprise 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 the embodiments, the processor can be configured to perform the following steps through the computer program:
[0137] Obtain metadata announcement packet information corresponding to the target access device;
[0138] Determine a device protocol type of the target access device according to the metadata announcement packet information and preset feature library data;
[0139] According to the device protocol type, determine a protocol analysis plug-in, and load the protocol analysis plug-in to extract a device capability set of the target access device;
[0140] Map the device capability set to a national standard registry to determine a national standard mapping result, and add the target access device to a national standard management platform according to the national standard mapping result.
[0141] It should be noted that the specific examples in the embodiments can refer to the examples described in the above embodiments and optional implementation manners, and the embodiments will not be described here.
[0142] In addition, in combination with the device access method in the above embodiments, the application embodiments can provide a storage medium for implementation. The storage medium has a computer program stored thereon; the computer program is executed by a processor to implement any one of the device access methods in the above embodiments.
[0143] Those skilled in the art should understand that the technical features of the above-described embodiments can be combined in any manner, and in order to make the description concise, all possible combinations of the technical features in the above-described embodiments are not described, however, as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0145] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A device access method, characterized in that, Includes the following steps: The differential update algorithm is used to obtain the metadata announcement packet information corresponding to the target access device; The device protocol type of the target access device is determined based on the metadata notification packet information and the preset feature library data; Based on the device protocol type, determine the protocol parsing plugin and load the protocol parsing plugin to extract the device capability set of the target access device. If the protocol parsing plugin fails to load, the system automatically switches to the general parsing mode, transmits the original data, and fills in the national standard signaling placeholder. The device capability set, including encoding / decoding capabilities and control instruction sets, is mapped to the national standard registry to determine the national standard mapping result, and the target access device is added to the national standard management platform according to the national standard mapping result; Based on the technical standards corresponding to the national standard management platform, determine the virtual national standard unique identifier of the target access device; In the case of multiple target access devices, the target collaborative device among the multiple target access devices is determined according to the virtual national standard unique identifier, and the target collaborative device is identified as a virtual collaborative device group; The system obtains the collaborative control command corresponding to the virtual collaborative device group. Based on the collaborative control command, the collaborative capability set of the virtual collaborative device group, and the collaborative control strategy, the national standard management platform sends the collaborative control command to the group ID of the virtual collaborative device group. The gateway parses the collaborative control command and sends control commands to multiple target collaborative devices according to the collaborative control strategy. A control command queue is established and executed. After receiving the response from the target collaborative device, the status report is merged into a national standard alarm message body.
2. The device access method according to claim 1, characterized in that, The step of determining the device protocol type of the target access device based on the metadata notification packet information and the preset feature database data includes: The initial protocol type is determined based on the metadata notification packet information, and the format matching result is determined based on the initial protocol type and the preset feature library data; If the format matching result is a mismatch, calculate the data entropy value of the data sequence corresponding to the target access device; If 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.
3. The device access method according to claim 2, characterized in that, The step of determining the protocol parsing plugin based on the device protocol type and loading the protocol parsing plugin to extract the device capability set of the target access device includes: Query the preset plugin repository and identify the plugins in the preset plugin repository that match the device protocol type as protocol parsing plugins; The protocol parsing plugin is loaded into memory and a protocol parsing instance is created to extract the device capability set of the target access device.
4. The device access method according to claim 3, characterized in that, The step of mapping the device capability set to the national standard registry to determine the national standard mapping result, and adding the target access device to the national standard management platform according to the national standard mapping result, includes: Obtain the database field mapping table, and map the device capability set to the national standard registry based on the database field mapping table to determine the national standard mapping result; Based on the national standard mapping results, the target access device is added to the national standard management platform.
5. The device access method according to claim 4, characterized in that, After adding the target access device to the national standard management platform according to the national standard mapping result, the following steps are included: Based on the device protocol type, obtain the original network abstraction layer unit of the data sequence corresponding to the target access device; Based on the original network abstraction layer unit, determine the media stream adapted to the national standard management platform.
6. A device access apparatus for implementing the device access method as described in any one of claims 1 to 5, characterized in that, This includes a metadata information acquisition module, a device protocol type determination module, a device capability set extraction module, and a target device access module. The metadata information acquisition module is used to acquire metadata notification packet 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 packet information and the preset feature library data. The device capability set extraction module is used to determine the protocol parsing plugin according to the device protocol type, and load the protocol parsing plugin 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 registry 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.
7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the device access method according to any one of claims 1 to 5.
8. 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 5 when it is run.
Citation Information
Patent Citations
Multi-feature fusion CC encrypted traffic recognition algorithm
CN118656737A
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
Multi-device cooperative control method and system based on virtual-real fusion of intelligent Internet of Things and element universe
CN120103769A