A method for sharing industrial cameras to a local area network

By binding network interface card devices to local area network (LAN) shared services, parsing and encapsulating industrial camera data packets, the problem of high-performance cameras being difficult to be compatible with standard protocols in LANs is solved. This achieves standardized device discovery and stable transmission, reduces system integration costs, and improves network connectivity.

CN123123546APending Publication Date: 2026-11-17深圳市度申科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611349864.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, high-performance industrial cameras, due to the stand-alone direct-connect architecture of the physical acquisition card, are difficult to be directly compatible with standard network vision protocols. This leads to difficulties in device discovery and enumeration, low-level parameter control, and stable lossless streaming media transmission in local area network topology environments, resulting in high system integration costs and poor network connectivity.

Method used

By binding the target network card device in the local area network sharing service, receiving and parsing the protocol stack broadcast request of the control host, generating standard device description packets, executing application programming interface calls, segmenting image data and encapsulating it into data packets conforming to network vision standard protocols, the hardware and network protocols are decoupled, and packet loss retransmission is performed.

Benefits of technology

It enables standardized device discovery and control of industrial cameras in a local area network, improves network enumeration success rate, ensures stable and lossless streaming media transmission, reduces system integration costs, and improves network connectivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123546A_ABST
    Figure CN123123546A_ABST
Patent Text Reader

Abstract

This invention relates to the field of machine vision network communication technology, and discloses a method for sharing industrial cameras to a local area network (LAN). The method includes responding to configuration commands to select a target acquisition card camera and bind it to the target network card device to complete the virtualization mapping environment initialization preparation; receiving device discovery requests to detect the device's operating status, constructing a discovery data packet based on the status, and unicasting it back to the control host to complete network enumeration; receiving control data packets, parsing standard control parameters, converting them into target application programming interface calls according to command mapping rules, executing the calls, obtaining status codes, and returning control response data packets; and acquiring raw image data when the video stream operation is successful, segmenting and encapsulating it to generate multiple video stream data packets, and sending them to the control host. This invention avoids network storms, achieves isolation and decoupling between the underlying hardware functions and the network control protocol layer, converts images into discrete streaming media sequences to avoid data truncation, and ensures stable LAN transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision network communication technology, specifically a method for sharing industrial cameras to a local area network. Background Technology

[0002] With the in-depth application of machine vision technology in the field of intelligent manufacturing, high-resolution and high-frame-rate industrial cameras have become the core data source of visual inspection systems. In order to meet the lossless real-time transmission of massive image data, these high-performance cameras usually rely on dedicated data interfaces and are directly connected to specific industrial control computers point-to-point through physical acquisition cards. This physical-level hardware-bonded architecture confines expensive camera resources to a single computing node, forming local data silos, which seriously restricts the flexibility of multi-host collaborative processing, distributed algorithm deployment, and remote equipment debugging in modern flexible production lines.

[0003] In conventional technical solutions, developers often use proprietary TCP / UDP communication software for coarse-grained data pass-through. Because this proprietary communication link is completely detached from standard industrial network communication protocol specifications such as gigabit Ethernet vision, it is difficult for commercially available machine vision algorithm platforms to enumerate these shared camera entities through standard device discovery requests, and it is also difficult to issue standard register read / write instructions to adjust low-level camera parameters such as exposure and gain in real time. System integration faces extremely high secondary development costs. At the same time, in complex LAN topology environments, the traditional device discovery and enumeration process relies excessively on network broadcast or multicast mechanisms. When there are a large number of terminals querying concurrently in the network segment, it is easy to cause channel congestion and broadcast storms, resulting in frequent device handshake failures and poor network connectivity stability. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method for sharing industrial cameras to a local area network (LAN). This method solves the problem that existing physical acquisition card cameras are limited by their stand-alone direct-connect architecture, making it difficult for them to directly support standard network vision protocols. Consequently, they struggle to achieve standardized device discovery and enumeration, low-level parameter control, and stable lossless streaming media transmission in LAN topology environments.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for sharing industrial cameras to a local area network, comprising the following: In response to the configuration command of the LAN sharing service, select the target acquisition card camera that needs to be mapped as a network camera, allocate and bind the target network card device for sending and receiving LAN data packets, and complete the initialization preparation of the virtualization mapping environment.

[0006] The system receives a device discovery request broadcast by the control host based on a preset network vision standard protocol stack and obtains the device operating status information of the locally connected acquisition card camera. This device operating status information includes at least the device packet transmission count, device packet reception count, device running time, and device heartbeat packet count. A standard device description header field is generated according to the protocol stack format requirements, and this header field is concatenated with the device operating status information to generate a discovery data packet, which is then unicasted back to the control host to complete the device network enumeration.

[0007] The system receives control data packets sent by the control host based on a preset network vision standard protocol stack. These packets are then disassembled to extract the command code, target register address, and data value to be processed as standard control parameters. According to a preset instruction mapping rule, these parameters are converted into target function calls and execution parameters for a dedicated software development kit (SDK) for the camera acquisition card. This allows for the execution of target application programming interface (API) calls, including camera opening / closing, adjusting camera exposure parameters, or camera firmware upgrades. Upon execution, the status code is determined, and it is encapsulated with the command code to construct a control response data packet, which is then returned to the control host.

[0008] When the target application interface call to enable video streaming is successful, the total amount of raw image data output by the single-frame capture card camera and the preset maximum payload length of a single video stream data packet are obtained. The target number of segments is calculated based on the total amount of data and the maximum payload length, specifically following the payload allocation model: ; In the formula, This represents the target number of segments, and it is expressed as a positive integer. The total amount of raw image data representing a single frame, in bytes, is consistent with the size of the data block actually returned from the underlying hardware memory after each camera triggers a capture. This represents the maximum payload length of a single video stream data packet, in bytes. This value is calculated by reading the maximum transmission unit (MTU) value of the network interface card (NIC) in the current local area network environment and subtracting the standard network protocol header length. This represents the logic of rounding up.

[0009] Based on the target number of segments, the original single-frame image data is sequentially divided into multiple consecutive data blocks. A transmission header containing the current frame identifier and the current data packet sequence number is generated for each consecutive data block. The transmission header and the corresponding consecutive data block are merged to generate a video stream data packet, which is then sent to the control host through a designated network port in ascending order of the data packet sequence number.

[0010] Simultaneously, a fixed-capacity circular buffer is allocated in local memory. The transmitted single-frame raw image data and its corresponding current frame identifier are stored in the circular buffer for preservation. When the capacity limit is reached, the buffer is cyclically overwritten in chronological order. Upon receiving a packet loss retransmission request packet sent by the control host when a sequence number is detected as missing, the missing frame identifier and missing data packet sequence number are extracted. A matching target frame identifier is then searched in the circular buffer. If found, the starting memory address of the original image data in the circular buffer is accessed based on the target frame identifier. Combined with the offset corresponding to the missing data packet sequence number, the missing data block is re-extracted, a retransmitted video stream data packet is constructed, and returned to the control host to achieve frame retransmission.

[0011] This invention provides a method for sharing industrial cameras to a local area network. It has the following beneficial effects: 1. This invention receives device discovery requests broadcast by the protocol stack and detects the device's operating status. It combines the status information to generate a discovery data packet and sends it back to the control host via unicast to complete network enumeration. This avoids network storms caused by non-standard multicast responses in the Ethernet visual protocol and improves the success rate of LAN node search and handshake.

[0012] 2. This invention extracts standard parameters by parsing control packets, converts them into application programming interface calls according to instruction mapping rules, executes the calls to obtain status codes, encapsulates response data packets, and returns them to the control host. This achieves isolation and decoupling between the underlying hardware functions and the network control protocol layer, enabling local physical acquisition devices to be directly compatible with standard network vision master control terminals.

[0013] 3. This invention acquires raw image data, segments and encapsulates it to generate multiple video stream data packets conforming to network vision standard protocols, and sends them to the control host. This converts the physically continuous video memory image matrix into a discrete streaming media sequence that matches the boundary of the maximum transmission unit, thus avoiding data truncation caused by the underlying network card and resulting in transmission failure. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the network architecture for sharing industrial cameras to a local area network system according to the present invention; Figure 2 This is a flowchart illustrating the overall process of sharing industrial cameras to a local area network according to the present invention. Figure 3 This is a schematic diagram illustrating the principle of control command parsing and mapping interaction in this invention; Figure 4 This is a schematic diagram illustrating the process of slicing, encapsulating, and sending video stream data according to the present invention. Figure 5 This is a schematic diagram illustrating the principle of the packet loss retransmission mechanism of the present invention; Figure 6This is a schematic diagram of the virtualization system device for sharing industrial cameras to a local area network according to the present invention. Detailed Implementation

[0015] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] Please see the appendix Figure 1 To be continued Figure 6 This invention provides a method for sharing an industrial camera to a local area network. The method involves running a local area network sharing program on a server-side computing device that is physically connected to the camera, thereby decoupling the underlying physical hardware from the upper-layer network communication protocol stack. This allows a camera that does not have network communication capabilities to appear as a standard network camera entity in the local area network.

[0017] Sharing industrial cameras to a local area network can include the following steps: In response to the configuration command for the LAN sharing service, select the target acquisition card camera that needs to be mapped as a network camera; Allocate and bind target network interface cards (NICs) for sending and receiving LAN data packets in the LAN sharing service to complete the initialization preparation of the virtualization mapping environment; The system receives a device discovery request broadcast by the control host based on a preset network vision standard protocol stack, detects the device operating status of the locally connected capture card camera, constructs a discovery data packet conforming to the preset network vision standard protocol stack based on the device operating status, and unicasts it back to the control host to complete the device network enumeration for the capture card camera. The system receives control data packets sent by the control host based on the preset network vision standard protocol stack, parses the control data packets to obtain standard control parameters, and converts the standard control parameters into target application interface calls for the acquisition card camera according to preset instruction mapping rules. The target application programming interface is called to control the acquisition card camera, the execution status code is obtained, and a control response data packet is returned to the control host based on the execution status code; When the target application interface call is to enable video streaming and the operation is executed successfully, the raw image data output by the camera of the acquisition card is obtained, the raw image data is segmented and packaged into blocks to generate multiple video stream data packets that conform to the preset network vision standard protocol stack, and then sent to the control host.

[0018] Before executing the main process described above, the program first performs a multi-instance initialization operation. The system enumerates multiple capture card cameras connected to the current hardware bus by reading the underlying driver interface of the physical cameras. For each capture card camera that needs to be shared, the system creates an independent virtual network interface card for each capture card camera by calling the operating system's network namespace mechanism and assigns an independent virtual LAN Internet Protocol address, thereby achieving network layer isolation of physical hardware resources. The system loads the corresponding standard industrial vision camera description file for each mapping session. This file is a camera general interface extensible markup language (EXPLAIN) format file conforming to the European Machine Vision Association (EMA) standard. The system constructs a virtual device register mapping table in memory and allocates a logical address space starting at virtual address 0x0000 as a bootstrap register mapping area to simulate the boot register area specified by the Gigabit Ethernet vision protocol standard. The system maps the physical memory address pointer containing the EXPLAIN format file and the total file length to a specific logical address segment within this bootstrap register mapping area, so that the control host can read and parse the description file using standard memory read commands, thereby obtaining specific control node parameters such as gain and exposure time supported by the physical camera.

[0019] After the enumeration is completed, the control host issues various parameter adjustment or control commands. These commands are all encapsulated in standard control data packets. After the system receives the control data packet, it extracts the command features and uses a pre-built routing mapping mechanism to address the corresponding physical machine control function to execute hardware operations. After the operation is completed, it obtains the physical execution status of the underlying hardware and converts the physical execution status back into a standard network response message and sends it back to the control host, completing the closed-loop interaction of the control plane.

[0020] When the parsed instruction is a video stream start instruction, the system opens the data plane transmission channel and continuously captures raw image data from the underlying buffer of the physical camera. Due to the limitation of the maximum transmission unit in local area network transmission, the system performs precise mathematical segmentation on the single frame of raw image data.

[0021] In practice, the total amount of data in a single frame of the original image data depends on the camera's physical resolution and the actual pixel format configuration. Its specific size is obtained through the following data total calculation model: ; In the formula, The total amount of data in a single frame representing the original image data is expressed in bytes. This value is consistent with the actual data block size read from the underlying hardware memory after each camera triggers a capture. The image width in pixels represents the current configuration of the target acquisition card's camera, which is obtained by querying the horizontal resolution register of the camera sensor. The image height pixel value representing the current configuration of the target acquisition card camera is obtained by querying the vertical resolution register of the camera sensor; This represents the average number of bytes actually occupied by each pixel in the current pixel format. This value is directly obtained from the lookup table of the machine vision common pixel format specification standard. For example, the value is 1 for the standard 8-bit monochrome format and 3 for the 24-bit red-green-blue color format. For complex pixel formats where the underlying hardware has non-integer bits or requires bit concatenation and packing, the actual number of bytes occupied by a single row is calculated independently according to the single-row pixel data alignment and packing rules specified by the underlying protocol, and then multiplied by the image height pixel value for equivalent derivation.

[0022] After obtaining the total amount of data in a single frame, the system calculates the number of blocks based on the maximum effective payload length of a single video stream data packet, specifically following the payload allocation model: ; In the formula, Represents the target number of segments, which is the total number of video stream data packets that need to be generated from splitting one frame of an image; it is expressed as a positive integer. This represents the maximum payload length of a single video stream data packet, in bytes. This value is calculated by reading the maximum transmission unit (MTU) value of the network interface card (NIC) in the current local area network environment and subtracting the standard network protocol header length. This represents the rounding up operation logic, ensuring that any remaining image data at the end that is less than the maximum payload length can be encapsulated into a separate data packet.

[0023] Through the above segmentation logic, the system converts the continuous physical image memory stream into a set of discrete data blocks suitable for high-speed transmission over a local area network. Then, according to the specifications of the standard streaming media protocol, timestamps and sorting marks are injected one by one. Finally, the data is pushed to the control host at high frequency and concurrently through the designated network port. This achieves complete virtualization and network sharing of physical cameras without changing the existing industrial vision software ecosystem.

[0024] In this invention, when the program is in a local area network (LAN) listening state, the bound target network interface card (NIC) receives a device discovery request broadcast by the control host based on a preset network vision standard protocol stack. After parsing the network request packet, the system calls the underlying hardware driver interface to send a probe command to the physically connected target acquisition card camera. This probe command triggers the acquisition card camera to perform a self-check, thereby enabling the system to obtain the device operating status information of the acquisition card camera as the aforementioned device operating status.

[0025] In practice, the aforementioned device operating status information includes multi-dimensional hardware and network interaction parameters, including at least the device packet transmission count, device packet reception count, device runtime, and device heartbeat count. The system obtains the device packet transmission count by reading the transmit buffer queue at the network card driver level and the device packet reception count by reading the receive buffer queue. The system calls the operating system's kernel clock tick to obtain the difference between the device's initial power-on and the current time, using this as the device runtime. Simultaneously, the system maintains a periodically accumulating timer variable in the background, refreshing its value based on the number of keep-alive communication commands issued, which serves as the device heartbeat count.

[0026] To accurately characterize the aforementioned hardware and communication states, the system constructs a device state vector in memory, the specific mathematical expression of which is as follows: ; In the formula, A vector representing a set of equipment operating status information; This represents the packet count of the device, which is read in real time through the counter of the underlying operating system; The packet count represents the number of packets received by the device, which is obtained by monitoring the receiving channel of the underlying network interface; The device's operating time is calculated by subtracting the base timestamp of the camera's initialization from the current system timestamp. The heartbeat count of the device is determined by the number of times the background keep-alive thread is executed in a loop. All parameters are temporarily stored in a specific memory address range in binary form.

[0027] After initialization, the system enters a listening state. Regarding the device discovery enumeration and keep-alive mechanism, this invention strictly adheres to a passive response model. When the control host sends a standard device discovery request command packet to the target port 3956 of the local area network, the bound virtual network interface intercepts the request packet. The system parses the request packet and, after obtaining the device state vector set of the physical cameras at the underlying level, generates a standard device description header field according to the Gigabit Ethernet visual protocol specification. The system extracts the pre-configured virtual manufacturer identifier, device model, and system-assigned virtual media access control address and fills them into the protocol header. Subsequently, the system concatenates and integrates the standard device description header field with the device state vector set to generate a response-type discovery data packet. Its data packet construction model is as follows: ; In the formula, The discovery data packet represents the completed construction; This represents the standard device description header field generated according to the protocol specification; This represents a network byte order conversion function, responsible for converting numerical status parameters of different lengths into binary byte streams conforming to big-endian or little-endian network byte order; symbol This represents the concatenation operation of continuous data sequences in the memory buffer space. After concatenation and integration are complete, the system calls the underlying network sending function to unicast the discovered data packet back to the source port of the control host, completing the device network enumeration response for the camera on the acquisition card.

[0028] During the device keep-alive phase after network enumeration is established, the system listens for heartbeat commands periodically written to the control channel privilege register by the control host. The system maintains a watchdog timer in the background. If no valid heartbeat write command is received from the control host within the preset timeout period, the system determines that the network connection is broken and actively releases hardware control. At the same time, the system performs incremental statistics on the valid heartbeat operations written by the control host and records them as the heartbeat packet count in the memory status.

[0029] In this invention, the system listens to the dedicated control port of the network interface to obtain network data packets sent by the host. These control data packets conform to the Gigabit Ethernet visual control protocol in the preset network visual standard protocol stack. The program calls specific protocol decomposition logic to decompose the control data packets, reads fixed-range data segments according to the byte offset specified in the protocol, and then extracts the command code, target register address, and data value to be processed. These three fields are then combined and entered into the system's instruction conversion queue as the standard control parameters.

[0030] Subsequently, the system executes preset instruction mapping rules based on the pre-stored register routing table, converting network layer register read / write requests into target application interface calls. This register routing table is represented in system memory as a data structure with the virtual register's starting address as the hash key and the device control interface function pointer as the value. The specific mapping rules are as follows: when the extracted command code is 0x0080 (standard register read command), the system addresses the corresponding status acquisition function in the routing table based on the target register address, calls the underlying driver to read the camera's physical parameters, and encapsulates them into a return payload; when the extracted command code is 0x0082 (standard register write command), and the target register address is 0x00010000 (acquisition start register), the system precisely maps this instruction to the image acquisition start function in the underlying driver interface for the physical camera. This conversion process follows the following rule model: ; In the formula, This represents the command code parsed and extracted from the control data packet; Represents the address of the target register; This represents the data value to be processed for that register space; This represents a route lookup function predefined in the system memory; This represents the target application interface call generated after the conversion. During the table lookup process, if the extracted target register address is not found in the register routing table, the system triggers an exception handling branch, skips the physical hardware call, and directly returns the standard error status code 0x8007, indicating an illegal address, to the control host.

[0031] After the system executes the target application interface call, it captures the hexadecimal interrupt signal returned by the underlying driver interface of the physical camera. The system queries the status constant mapping table to perform protocol layer conversion on the interrupt signal: if the underlying layer returns 0x00, indicating successful hardware execution, the system generates the Gigabit Ethernet visual protocol standard success status code 0x0000 as the execution status code; if the underlying layer returns 0x06, indicating that the hardware device is busy, the system generates the standard device busy status code 0x8006 as the execution status code. The system encapsulates this execution status code into a control response data packet and returns it to the control host.

[0032] After the determination is completed, the system begins assembling the data packet to be transmitted back to the network layer. The execution status code and the command code are encapsulated in a header of a preset format, and a response data packet based on the Gigabit Ethernet visual control protocol is constructed as the control response data packet. The specific response packet construction process is implemented according to the following data splicing model: ; In the formula, The generated control response data packet is located in the system's transmit buffer; This represents the execution status code obtained from the underlying hardware. The protocol layer response code generated by the system based on the original command code is used to match asynchronous requests from the control host. The structured encapsulation function representing the header of the Gigabit Ethernet visual control protocol is responsible for writing the status code and response code into the specified byte bits; This represents the payload data retrieved from and supplemented by the hardware for read register instructions, and is assigned a null value for write register instructions; symbol This represents the memory assembly and combination operation of the network packet header and data payload.

[0033] After the assembly operation is completed, the system calls the underlying network sending interface to return the control response data packet to the control host, so as to inform the control host of the operation result of the acquisition card camera, thus completing the interactive closed loop between a single standard network control command and a non-standard underlying physical operation.

[0034] In this invention, the system's underlying video stream acquisition interface intercepts the raw image data output by the camera on the capture card. For each frame of image data arriving at the system memory, the program reads the attribute information of the memory block for that frame to obtain the total amount of raw image data for a single frame; simultaneously, the program calls the configuration reading interface of the system network protocol stack to obtain the maximum effective payload length of a single video stream data packet preset in the current local area network environment.

[0035] After obtaining the basic parameters, the system transfers the original image data to the slice calculation logic unit. The calculation logic unit calculates the target number of slice blocks based on the total amount of data and the maximum effective payload length; the system then performs data cutting in a specially allocated slice buffer pool, sequentially cutting the original image data of the single frame into multiple consecutive data blocks corresponding to the target number of slice blocks.

[0036] The specific memory segmentation, addressing, and truncation length are executed based on the following data block extraction model: ; ; In the formula, This variable represents the current slice number, and its value ranges from 1 to the target number of slice blocks mentioned above. Representing the The starting read offset of each of the consecutive data blocks in the memory block of the entire frame of the original image data; This represents the maximum payload length of the preset single video stream data packet; The total amount of data representing the original image data of a single frame acquired; Representing the The actual length of bytes that need to be truncated from a continuous data block; This represents a mathematical operation to extract the minimum value. The system calls the underlying memory copy function, passing in the calculated starting offset and truncation length value in sequence, to sequentially separate and extract all continuous data blocks.

[0037] After the extraction operation is completed, the system enters the protocol encapsulation stage. The video stream data packet conforms to the Gigabit Ethernet visual stream transmission protocol in the preset network visual standard protocol stack. The program allocates a specific space in the protocol message construction area and generates a transmission header containing the current frame identifier and the current data packet sequence number for each consecutive data block. The system then calls the data assembly routine to merge the transmission header with the corresponding consecutive data block to generate the final video stream data packet.

[0038] The above header generation and merging operations follow the following protocol assembly model: ; In the formula, Represents the first generated by the encapsulation The video stream data packets; The identifier representing the current frame is incremented at the hardware level as each frame of physical image data is generated. This represents the current data packet sequence number, and this value is related to the current slice sequence number. Keep the values ​​consistent; This represents the computational function that generates structured message headers according to the Gigabit Ethernet Visual Streaming Protocol specification. The first one obtained based on the aforementioned extraction model A continuous data block; symbol This represents the low-level assembly operation that combines the protocol header stream and the image payload stream in memory space within the transmission buffer queue.

[0039] After the system completes the encapsulation of video stream data packets, it constructs a network transmission queue based on the User Datagram Protocol (UDP). The system reads the flow control channel establishment instruction issued by the control host before starting the video stream and extracts the dynamic streaming media receiving port number specified by the control host. The system calls the underlying UDP socket to encapsulate the video stream data packets into user data packets and continuously sends all video stream data packets corresponding to the same current frame identifier to the dynamic streaming media receiving port of the control host in ascending order of the current data packet sequence number. During the transmission process, the system controls the byte throughput of each network submission based on the aforementioned maximum payload length to avoid data truncation by the underlying network card driver and ensure that the control host completely reassembles the image data matrix based on the received sequence numbers.

[0040] In this invention, during the program initialization phase, the operating system's memory allocation routine is invoked to create a fixed-capacity circular buffer in local memory. The system dynamically calculates the preset number of frames to be retained by detecting the total available physical memory of the host device and allocates dedicated buffer pool space within a safe threshold. This circular buffer consists of contiguous physical memory blocks combined with a status index table containing write pointers. During normal video data push, the system synchronously stores copies of sent data slices in the circular buffer and moves the write pointer forward, while simultaneously establishing a precise mapping relationship between frame identifiers, data packet sequence numbers, and local memory offset addresses in the status index table. As image frame data is continuously stored, once the physical capacity limit of the circular buffer is reached, the system automatically resets the write pointer to the addressing start position of the buffer and performs cyclic overwriting processing according to the first-in-first-out time flow order to maintain a normal data resident operation mechanism.

[0041] After establishing the video stream transmission link, the system initiates parallel abnormal event monitoring. When the control host detects a discontinuous jump in the sequence number of data packets while receiving the video stream, it determines that network packet loss has occurred and issues a data packet retransmission request according to the standard network flow control protocol. The system captures this data packet retransmission request and extracts the missing frame identifier and the missing data packet sequence number from the instruction payload. The system first performs a traversal comparison in the status index table. If the query result indicates that the missing data segment still exists within the current valid coverage period, the system directly accesses the starting memory address of the frame in the circular buffer based on the target frame identifier. To accurately locate and extract the missing data segment and avoid the risk of memory out-of-bounds read crashes caused by insufficient tail packet slice length, this precise addressing action follows the following memory offset and dynamic safe interception model: ; ; ; ; In the formula, This represents the sequence number of the missing data packet extracted from the retransmission request packet; This represents the maximum payload length of a single video stream data packet determined in the preceding steps; This represents the calculated memory read offset for the missing data block; This represents the total number of original bytes of the target frame data recorded in the status index table; This represents the starting memory address located by the query; Represents the absolute address of the target slice data within the circular buffer; This represents the safe cut-off length, dynamically calculated to prevent exceeding the limit. This represents a digital logic operation that takes the minimum value of two parameters. This represents the underlying memory copy and extraction functions of the operating system. This represents the missing data block that was ultimately extracted and obtained without loss.

[0042] After acquiring the missing data block, the program calls the protocol header assembly routine to generate a dedicated transport header marked with a retransmission attribute for the data packet type. This protocol header is then concatenated with the acquired missing data block to generate the corresponding retransmitted video stream data packet. Finally, the system calls the underlying User Datagram Transport Protocol (UDP) sending socket to resend the retransmitted video stream data packet to the control host, achieving accurate backhaul of the missing slice and enabling the control host to seamlessly reassemble the initial image display matrix.

[0043] In this embodiment, the present invention provides a virtualization system device for sharing industrial cameras to a local area network. This device resides in the underlying computer system as a collection of software modules, executing the protocol mapping and data transmission methods described in the foregoing embodiments. The system device includes a multi-device initialization module, a device discovery and enumeration module, a control command conversion module, a video stream data slicing module, a ring buffer management module, and a packet loss retransmission control module. The multi-device initialization module performs hardware bus addressing operations, allocates concurrent network ports, and loads network camera description files. The device discovery and enumeration module detects the operating parameter information of the camera on the acquisition card and constructs discovery packets to unicast responses to the device enumeration requests from the control host. The control command conversion module intercepts control packets sent from the network link and completes control mapping calls between standard network commands and the underlying physical driver interface based on the register routing table. The video stream data slicing module extracts underlying image data and performs data block fragmentation and streaming media protocol header encapsulation based on the network's maximum transmission unit boundary. The ring buffer management module maintains a fixed-capacity ring queue in memory and cyclically retains copies of recently sent slice data according to the first-in-first-out principle. The packet loss retransmission control module listens for abnormal retransmission requests from the network, accurately addresses and extracts missing data blocks from the ring buffer management module, and performs secondary retransmission.

[0044] In this invention, an electronic device is provided to carry the aforementioned software control logic. This electronic device includes a processor, a storage medium, and a network interface component. The processor, storage medium, and network interface component establish an electrical signal communication connection via the data bus inside the system motherboard. The storage medium stores the machine instruction code sequence for the aforementioned protocol conversion and data slicing steps; the processor reads the machine instruction code sequence from the storage medium, allocates kernel register resources to compute the aforementioned data conversion models; the network interface component maintains the physical network connectivity between the electronic device and the local area network control host, receives enumeration and instruction data frames from the control host, and simultaneously outputs network protocol messages carrying camera status data and image slice sequences.

[0045] Concurrent network communication for high-frame-rate industrial images consumes significant external bus bandwidth and internal processing resources. To avoid system performance bottlenecks caused by frequent kernel-mode and user-mode context switching during protocol message assembly, the electronic device hosting the system incorporates direct memory access control logic based on a zero-copy mechanism within the processor. Specifically, for the process of acquiring raw image stream data from the underlying camera hardware's video memory and transmitting and encapsulating it to the network interface components, the underlying device system software follows the following zero-copy resource mapping mechanism: ; In the formula, This represents a handle to a shared memory region successfully established by the operating system. This represents the physical video memory reference address allocated to the acquisition card hardware in the kernel driver layer; This represents the virtual user-mode address space allocated by the system to the network communication stack for sending and receiving data packets. Represents the physical size of the pre-allocated circular data buffer; This represents the page table direct mapping functions provided by the underlying operating system or hardware bus controller. By directly mounting the hardware-level contiguous memory page table of the image to the memory address space of the virtual network transmission queue, the system eliminates the redundant secondary memory fetching and memory copying overhead of traditional application layers, thereby significantly reducing the instruction cycle during video stream slicing and packaging, and ensuring that a single electronic computing device can stably support the concurrent mapping of large-capacity video streams from multiple industrial cameras.

[0046] This invention provides a non-volatile computer-readable storage medium. The storage medium contains an array of storage cells that store binary executable code instructing a computer entity to run the aforementioned camera LAN sharing method. After the computer entity is powered on and reads the code from the storage medium, it instantiates the aforementioned camouflage detection service thread, control instruction routing mechanism, and image slicing engine based on maximum transmission unit calculation in the operating system's memory space. This storage medium possesses the physical characteristic of maintaining its internal data format independently of an external power supply network. The computing platform system loading this storage medium has the protocol forwarding capability to map a local physical acquisition card to a standard LAN virtual camera, achieving device function decoupling and node communication proxying within the same network topology environment.

Claims

1. A method for sharing industrial cameras to a local area network, characterized in that, Includes the following steps: S1: Receive the device discovery request broadcast by the control host based on the preset network vision standard protocol stack, detect the device operating status of the locally connected capture card camera, construct a discovery data packet conforming to the preset network vision standard protocol stack based on the device operating status, and unicast it back to the control host to complete the device network enumeration for the capture card camera. S2: Receive the control data packet sent by the control host based on the preset network vision standard protocol stack, parse the control data packet to obtain standard control parameters, and convert the standard control parameters into a target application interface call for the acquisition card camera according to the preset instruction mapping rules; S3: Execute the target application interface call to control the acquisition card camera, obtain the execution status code, and return a control response data packet to the control host based on the execution status code; S4: When the target application interface call is to enable video streaming and the operation is executed successfully, the raw image data output by the camera of the acquisition card is obtained, the raw image data is segmented and packaged into blocks to generate multiple video stream data packets that conform to the preset network vision standard protocol stack, and then sent to the control host.

2. The method for sharing industrial cameras to a local area network according to claim 1, characterized in that, The step of constructing a discovery data packet conforming to the preset network visual standard protocol stack based on the device's operating status and returning it to the control host via unicast includes: The device operating status information of the acquisition card camera is obtained as the device operating status, and the device operating status information includes at least the device packet sending count, the device packet receiving count, the device running time, and the device heartbeat packet count; Generate standard device description header fields according to the format requirements of the preset network visual standard protocol stack; The standard device description header field is concatenated with the device operating status information to generate the discovery data packet, and the discovery data packet is unicasted back to the control host through the specified network card.

3. The method for sharing industrial cameras to a local area network according to claim 1, characterized in that, The control data packet is a data packet conforming to the Gigabit Ethernet vision control protocol in the preset network vision standard protocol stack; correspondingly, parsing the control data packet to obtain standard control parameters, and converting the standard control parameters into a target application programming interface call for the acquisition card camera according to a preset instruction mapping rule, includes: The control data packet is disassembled, and the command code, target register address, and data value to be processed are extracted as the standard control parameters. According to the preset instruction mapping rules, the command code, the target register address, and the data value to be processed are converted into target function calls and execution parameters of a dedicated software development kit for the acquisition card camera, and determined as the target application programming interface call.

4. The method for sharing industrial cameras to a local area network according to claim 3, characterized in that, The step of returning a control response data packet to the control host based on the execution status code includes: Determine whether the execution status code indicates that the target application interface call was executed successfully; The execution status code and the command code are encapsulated into a header of a preset format, and a response data packet based on the Gigabit Ethernet visual control protocol is constructed as the control response data packet; The control response data packet is returned to the control host to inform the control host of the operation result for the acquisition card camera.

5. The method for sharing industrial cameras to a local area network according to claim 1, characterized in that, The video stream data packets are data packets conforming to the Gigabit Ethernet visual stream transmission protocol in the preset network visual standard protocol stack; correspondingly, the step of segmenting and encapsulating the original image data to generate multiple video stream data packets conforming to the preset network visual standard protocol stack and sending them to the control host includes: Obtain the total amount of data in the original image data of a single frame, and the maximum effective payload length of a preset single video stream data packet; calculate the target number of segments based on the total amount of data and the maximum effective payload length, and sequentially segment the original image data of the single frame into multiple consecutive data blocks corresponding to the target number of segments; A transmission header containing the current frame identifier and the current data packet sequence number is generated for each of the consecutive data blocks, and the transmission header is merged with the corresponding consecutive data block to generate the video stream data packet; According to the ascending order of the current data packet sequence number, all video stream data packets corresponding to the same current frame identifier are sent to the control host through the designated network port.

6. The method for sharing industrial cameras to a local area network according to claim 5, characterized in that, The method further includes: Allocate and construct a fixed-capacity circular buffer in local memory; The original image data of the sent single frame and its corresponding current frame identifier are stored in the circular buffer for retention until the circular buffer reaches its capacity limit, at which point it is cyclically overwritten in chronological order.

7. The method for sharing industrial cameras to a local area network according to claim 6, characterized in that, After storing the original image data of the transmitted single frame and its corresponding current frame identifier in the circular buffer for retention, the method further includes: The control host receives a packet loss retransmission request packet, wherein the packet loss retransmission request packet is sent by the control host when it detects that the current data packet sequence number of the received video stream data packet is missing, and the packet loss retransmission request packet carries a missing frame identifier and a missing data packet sequence number. Parse the packet loss retransmission request packet to extract the missing frame identifier and the missing data packet sequence number.

8. The method for sharing industrial cameras to a local area network according to claim 7, characterized in that, After parsing the packet loss retransmission request packet and extracting the missing frame identifier and the missing data packet sequence number, the method further includes: Check in the circular buffer whether there is a target frame identifier that matches the missing frame identifier; If the query result is found, the starting memory address of the corresponding original image data in the circular buffer is accessed according to the target frame identifier; Based on the starting memory address and the offset corresponding to the missing data packet sequence number, the corresponding missing data block is re-extracted, and the corresponding retransmitted video stream data packet is reconstructed. The retransmitted video stream data packet is then sent back to the control host to achieve frame retransmission.

9. The method for sharing industrial cameras to a local area network according to claim 1, characterized in that, Before receiving a device discovery request broadcast by the control host based on a preset network visual standard protocol stack, the method further includes: In response to the configuration command for the LAN sharing service, select the target acquisition card camera that needs to be mapped as a network camera; Allocate and bind target network interface cards (NICs) for sending and receiving LAN data packets in the LAN sharing service to complete the initialization preparation of the virtualization mapping environment.

10. The method for sharing industrial cameras to a local area network according to claim 1, characterized in that, The physical operations corresponding to the camera on the acquisition card called by the target application interface include at least one of the following: turning on the camera, turning off the camera, adjusting the camera exposure parameters, and performing a camera firmware upgrade.