Data transmission method and device of network camera, instruction issuing method and device, electronic equipment and medium
By establishing encrypted communication connections and authentication between network cameras, and adjusting encoding parameters and transmission strategies, the security and efficiency issues in data transmission between multiple network cameras are resolved, achieving efficient and secure data transmission while reducing system costs and complexity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, data transmission between multiple network cameras suffers from problems such as cumbersome configuration, low transmission security, wasted bandwidth resources, and mismatch between data transmission and receiving end resources, which affect the overall performance of the monitoring system.
By establishing encrypted communication connections between network cameras, performing authentication, and adjusting encoding parameters and transmission strategies according to configuration information and resource status, autonomous interaction is achieved, and time-sharing or concurrent transmission strategies are used to resolve data conflicts.
It improves the efficiency and security of data transmission between multiple network cameras, reduces system cost and complexity, prevents data interception or tampering, improves resource utilization, avoids bandwidth waste and storage overflow, and ensures the integrity and reliability of data transmission.
Smart Images

Figure CN121815005A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a data transmission method, command issuance method, device, electronic device, and storage medium for a network camera. Background Technology
[0002] With the rapid development of video surveillance technology, network cameras (IPCs) have been widely used in various fields such as urban security, park monitoring, intelligent transportation, and home security. In practical applications, a single monitoring scenario often requires the deployment of multiple network cameras to achieve comprehensive coverage and form a multi-device collaborative monitoring network. In such networks, data exchange is frequently required between the network cameras. For example, front-end acquisition cameras transmit video data to the central storage camera, high-definition cameras transmit raw video streams to edge computing cameras for real-time analysis, and multiple distributed cameras transmit segmented monitoring data to the aggregation camera to complete panoramic stitching.
[0003] The stability, security, and resource adaptability of data transmission are core requirements for collaborative monitoring of multiple network cameras. Current technologies often suffer from cumbersome configuration, low transmission security, wasted bandwidth resources, and mismatch between data transmission and receiving end resources, severely impacting the overall performance of the monitoring system. Therefore, current data transmission solutions for multiple network cameras are inefficient and lack security. Summary of the Invention
[0004] This application provides a data transmission method, command issuance method, device, electronic device, and storage medium for network cameras, which can improve the efficiency and security of data transmission between multiple network cameras.
[0005] In a first aspect, embodiments of this application provide a data transmission method for a network camera, applied to a first network camera, comprising: Obtain configuration information for multiple second network cameras; According to the configuration information, an encrypted communication connection is established with each of the second network cameras; Receive video transmission instructions sent by each of the second network cameras, the video transmission instructions including bitrate requirements, resolution parameters and transmission time information; Adjust its own encoding parameters according to the video transmission instructions, generate an adapted video data stream, and transmit the video data stream to the corresponding second network camera.
[0006] Optionally, in some embodiments of this application, establishing encrypted communication connections with each of the second network cameras according to the configuration information includes: The network address, communication port, and authentication key of the second network camera are obtained from the configuration information. Initiate a connection request based on the network address and communication port; The link request is authenticated based on the authentication key; After successful authentication, an encrypted communication connection based on a transport layer security protocol is established.
[0007] Optionally, in some embodiments of this application, receiving video transmission instructions sent by each of the second network cameras includes: Listen to the local port corresponding to the established encrypted communication connection; Obtain the instruction data packets sent by each second network camera, and parse them to obtain the bit rate requirement, resolution parameters, transmission time period information and data transmission priority in the video transmission instruction; The instruction data packet is encapsulated in a preset format and contains the identification information of the second network camera.
[0008] Optionally, in some embodiments of this application, the step of adjusting its own encoding parameters according to the video transmission instruction, generating an adapted video data stream, and transmitting the video data stream to the corresponding second network camera includes: Adjust the encoding parameters of your own video encoding chip according to the bitrate requirements and resolution parameters; According to the transmission time period information and data transmission priority, the collected raw video data is encoded to generate an adapted video data stream; The video data stream is transmitted to each of the second network cameras in a time-sharing or concurrent manner through the corresponding encrypted communication connection.
[0009] Secondly, this application provides a method for issuing instructions to a network camera, applied to a second network camera, comprising: Receive a connection request sent by a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; The first network camera is authenticated; When the first network camera passes verification, an encrypted communication connection is established; Based on local storage information and current bandwidth resources, a video transmission instruction is generated and sent to the first network camera. The video transmission instruction is used to instruct the first network camera to adjust encoding parameters and transmit an adapted video data stream.
[0010] Optionally, in some embodiments of this application, generating a video transmission instruction based on local storage information and current bandwidth resources and sending it to the first network camera includes: Retrieve local storage information; Obtain network bandwidth utilization and concurrent connection count from the current bandwidth resources; Based on the local storage information, network bandwidth utilization, and number of concurrent connections, the transmission parameter information is determined, and the transmission parameter information is encapsulated into video transmission instructions; Based on the established encrypted communication connection's service port, the video transmission command is sent to the local port of the network camera.
[0011] Thirdly, embodiments of this application provide a data transmission device for a network camera, applied to a first network camera, comprising: The acquisition module is used to acquire configuration information from multiple second network cameras; The first establishment module is used to establish encrypted communication connections with each of the second network cameras according to the configuration information; The first receiving module is used to receive video transmission instructions sent by each of the second network cameras. The video transmission instructions include bitrate requirements, resolution parameters, and transmission time information. The generation module is used to adjust its own encoding parameters according to the video transmission instructions, generate an adapted video data stream, and transmit the video data stream to the corresponding second network camera.
[0012] Fourthly, embodiments of this application provide a command issuing device for a network camera, applied to a second network camera, comprising: The second receiving module is used to receive a connection request sent by the first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; The verification module is used to authenticate the first network camera; The second establishment module is used to establish an encrypted communication connection when the first network camera passes the verification. The sending module is used to generate a video transmission instruction based on local storage information and current bandwidth resources and send it to the first network camera. The video transmission instruction is used to instruct the first network camera to adjust the encoding parameters and transmit an adapted video data stream.
[0013] Accordingly, this application also provides an electronic device, including a memory, a processor, and a processor program stored in the memory and executable on the processor, wherein the processor executes the program as described in any of the methods above.
[0014] This application also provides a storage medium storing a processor program that, when executed by a processor, implements any of the methods described above.
[0015] This application provides a data transmission method for a network camera, a command issuance method for a network camera, an apparatus, an electronic device, and a storage medium. The data transmission method for a network camera, applied to a first network camera, includes: acquiring configuration information of multiple second network cameras; establishing encrypted communication connections with each of the second network cameras according to the configuration information; receiving video transmission commands sent by each of the second network cameras, the video transmission commands including bitrate requirements, resolution parameters, and transmission time period information; adjusting its own encoding parameters according to the video transmission commands to generate an adapted video data stream, and transmitting the video data stream to the corresponding second network camera. The command issuance method for a network camera, applied to a second network camera, includes: receiving a connection request sent by a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; authenticating the first network camera; establishing an encrypted communication connection when the first network camera passes authentication; generating a video transmission command based on local storage information and current bandwidth resources and sending it to the first network camera, the video transmission command instructing the first network camera to adjust its encoding parameters and transmit an adapted video data stream. In the data transmission scheme between network cameras provided in this application embodiment, direct autonomous interaction between the first network camera and multiple second network cameras is achieved without relying on additional central scheduling equipment, reducing system cost and complexity. Secondly, through encrypted communication and authentication mechanisms, the security of data during device interaction is ensured, preventing data interception, tampering, and malicious device access. At the same time, the first network camera can adjust encoding parameters and transmission strategies according to the resource status of the second network cameras, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, through time-sharing or concurrent transmission strategies, the conflict problem of multiple senders transmitting data to the same receiver is resolved, ensuring the integrity and reliability of data transmission. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the data transmission method of a network camera provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the instruction sending method for a network camera provided in an embodiment of this application; Figure 3 This is a schematic diagram of the data transmission device for a network camera provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of the instruction issuing device for the network camera provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0019] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.
[0020] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0021] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.
[0022] The following describes in detail the embodiments involved in this application. It should be noted that the order of description of the embodiments in this application is not intended to limit the priority of the embodiments.
[0023] This application provides a data transmission method, apparatus, storage medium, and smart terminal for a network camera. Specifically, the data transmission method of the network camera in this application can be executed by a smart terminal or a server, wherein the smart terminal can be a terminal. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other smart terminal. The terminal may also include a client, which can be a media playback client or a data transmission client for the real-time network camera, etc.
[0024] This application provides a data transmission method for a network camera, which can be executed by an electronic device or a server. This application example illustrates the data transmission method of a network camera executed by an electronic device. The electronic device includes a touch screen and a processor. The touch screen is used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. When the user operates the GUI through the touch screen, the GUI can control the local content of the electronic device in response to the received operation commands, or it can control the content on the server side in response to the received operation commands.
[0025] In the data transmission scheme between network cameras provided in this application embodiment, direct autonomous interaction between the first network camera and multiple second network cameras is achieved without relying on additional central scheduling equipment, reducing system cost and complexity. Secondly, through encrypted communication and authentication mechanisms, the security of data during device interaction is ensured, preventing data interception, tampering, and malicious device access. At the same time, the first network camera can adjust encoding parameters and transmission strategies according to the resource status of the second network cameras, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, through time-sharing or concurrent transmission strategies, the conflict problem of multiple senders transmitting data to the same receiver is resolved, ensuring the integrity and reliability of data transmission.
[0026] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0027] A data transmission method for a network camera, applied to a first network camera, includes: acquiring configuration information of multiple second network cameras; establishing encrypted communication connections with each of the second network cameras according to the configuration information; receiving video transmission instructions sent by each of the second network cameras, the video transmission instructions including bitrate requirements, resolution parameters, and transmission time period information; adjusting its own encoding parameters according to the video transmission instructions to generate an adapted video data stream, and transmitting the video data stream to the corresponding second network camera.
[0028] Please see Figure 1 , Figure 1 This application provides a schematic flowchart of a data transmission method for a network camera. The specific flow of this data transmission method is as follows: Step S1: Obtain the configuration information of multiple second network cameras.
[0029] For example, in this embodiment, the first network camera obtains the configuration information of the five second network cameras using a combination of local area network broadcast and preset configuration files: After the first network camera is started, it sends a configuration information query broadcast packet to the campus LAN (network segment 192.168.1.0 / 24) through the Ethernet interface. The target IP of the broadcast packet is 255.255.255.255, the target port is 8080, and the data body of the broadcast packet includes the device identifier of the first network camera (serial number: IPC-2024001) and the query request ("Request to obtain configuration information of the second network camera"). After receiving the broadcast packet, the five second network cameras (device IDs IPC-2024002 to IPC-2024006) extract the device ID of the first network camera, query the local authorized device list, and confirm that IPC-2024001 is an authorized device. Therefore, they send their configuration information back to the first network camera, specifically: IPC-2024002, network address 192.168.1.102, communication port 8080, authentication key Key-2024002, device model DS-2CD3T46WD-I5, maximum storage capacity 2TB, maximum supported bandwidth 100Mbps; IPC-2024003, network address 192.168.1.103, communication port 8080, authentication key Key-2024003, device model DS-2CD3T46WD-I5, maximum storage capacity 2TB, maximum supported bandwidth 100Mbps. Supports bandwidth up to 100Mbps; IPC-2024004, network address 192.168.1.104, communication port 8080, authentication key Key-2024004, device model DS-2CD3T46WD-I5, maximum storage capacity 2TB, maximum supported bandwidth 100Mbps; IPC-2024005, network address 192.168.1.105, communication port 8080, authentication key Key-2024005, device model DS-2CD3T46WD-I5, maximum storage capacity 2TB, maximum supported bandwidth 100Mbps; IPC-2024006, network address 192.168.1.106, communication port 8080, authentication key Key-2024006, device model DS-2CD3T46WD-I5, maximum storage capacity 2TB, maximum supported bandwidth 100Mbps; After receiving feedback information from five second network cameras, the first network camera reads a locally preset XML configuration file, compares the feedback information with the information in the configuration file, and stores the configuration information of each second network camera to the local solid-state drive after confirming that the information is consistent.
[0030] Step S2: Establish encrypted communication connections with each of the second network cameras according to the configuration information.
[0031] Further, in step S2, establishing encrypted communication connections with each of the second network cameras according to the configuration information includes: Step S21: Extract the network address, communication port, and authentication key of the second network camera from the configuration information; Step S22: Initiate a connection request based on the network address and communication port; Step S23: Authenticate the connection request based on the authentication key; Step S24: After successful authentication, establish an encrypted communication connection based on Transport Layer Security (TLS).
[0032] The first network camera extracts the core parameters of the five second network cameras one by one from the stored configuration information: IPC-2024002 (192.168.1.102, 8080, Key-2024002), IPC-2024003 (192.168.1.103, 8080, Key-2024003), IPC-2024004 (192.168.1.104, 8080, Key-2024004), IPC-2024005 (192.168.1.105, 8080, Key-2024005), and IPC-2024006 (192.168.1.106, 8080, Key-2024006), and stores them according to their device identifiers.
[0033] Next, the first network camera, based on the TCP protocol, constructs connection request packets to the IP addresses and communication ports of the five second network cameras. Taking IPC-2024002 as an example, the packet header includes the source IP (192.168.1.101), source port (randomly generated 51234), destination IP (192.168.1.102), and destination port (8080). The data body carries the device identifier of the first network camera (IPC-2024001) and the supported encryption protocol type (TLS1.3). The first camera then sends this packet to IPC-2024002. The connection request sending logic for the other four devices is the same.
[0034] Furthermore, for each of the second network cameras, the first network camera performs a SHA-256 hash operation on its own device identifier (IPC-2024001) and the corresponding authentication key (such as Key-2024002) to generate authentication information (such as Hash(IPC-2024001+Key-2024002)=8F7A...), and includes it in the connection request. Taking IPC-2024002 as an example, after receiving the request, it extracts the device identifier and authentication information, performs the same hash operation on Key-2024001 (the first network camera's authentication key) stored locally, and if the comparison result matches, the authentication is confirmed to be successful; the authentication process for the other four devices is the same, and all devices pass authentication.
[0035] After all five second network cameras passed authentication, they negotiated the TLS 1.3 protocol with the first network camera, ultimately determining unified encryption parameters: AES-256 encryption algorithm, ECDHE key exchange algorithm, and HMAC-SHA256 message authentication algorithm. Following the negotiation, both parties generated session keys based on the ECDHE algorithm (each device corresponds to a unique session key, e.g., IPC-2024002 corresponds to session key SK1, IPC-2024003 corresponds to SK2, etc.), establishing independent encrypted communication connections. The first network camera assigned a unique local listening port to each connection: 50001 (corresponding to IPC-2024002), 50002 (corresponding to IPC-2024003), 50003 (corresponding to IPC-2024004), 50004 (corresponding to IPC-2024005), and 50005 (corresponding to IPC-2024006), for subsequent command and data transmission. Step S3: Receive video transmission instructions sent by each of the second network cameras, wherein the video transmission instructions include bitrate requirements, resolution parameters and transmission time period information; Further, in step S3, receiving the video transmission instructions sent by each of the second network cameras includes: Step S31: Listen to the local port corresponding to the established encrypted communication connection; The first network camera assigns a unique local listening port to each encrypted communication connection established with the second network camera, and continuously listens for data packets sent by the second network camera through this port; Step S32: Obtain the instruction data packets sent by each second network camera, and parse them to obtain the bit rate requirement, resolution parameters, transmission time period information and data transmission priority in the video transmission instruction; Specifically, the instruction data packet is encapsulated in a preset binary format. The header of the data packet contains the unique identifier of the second network camera, the instruction type (video transmission instruction), data length, and other information, while the body of the data packet contains encrypted transmission parameters. After receiving the instruction data packet, the first network camera first decrypts the body of the data packet using the session key, and then parses it according to the preset format to obtain the transmission parameters. The bitrate requirements include a maximum bitrate threshold and a minimum bitrate threshold, for example, a maximum bitrate threshold of 4 Mbps and a minimum bitrate threshold of 1 Mbps. The adjusted encoding bitrate of the first network camera must be within this range. The resolution parameters include a list of selectable resolutions (such as 1080P, 720P, 4K) or a fixed resolution value. The transmission time period information is the time interval during which the second network camera is allowed to receive data, for example, 8:00-20:00 daily. Outside this time period, the first network camera will suspend data transmission to the second network camera. The data transmission priority is divided into three levels: high, medium, and low. High priority corresponds to emergency monitoring scenarios (such as video data during security alarms), medium priority corresponds to regular monitoring scenarios, and low priority corresponds to non-critical area monitoring scenarios. The instruction data packet is encapsulated in a preset format and contains the unique identification information of the second network camera (such as the device serial number) so that the first network camera can distinguish instructions sent by different second network cameras.
[0036] Step S4: Adjust its own encoding parameters according to the video transmission instructions, generate an adapted video data stream, and transmit the video data stream to the corresponding second network camera.
[0037] Further, in step S4, adjusting its own encoding parameters according to the video transmission instruction, generating an adapted video data stream, and transmitting the video data stream to the corresponding second network camera includes: Step S41: Adjust the encoding parameters of the video encoding chip according to the bitrate requirement and resolution parameters. Specifically, the video encoding chip of the first network camera supports multiple encoding protocols such as H.264, H.265, and AV1. The first network camera determines the supported encoding protocol based on the device model of the second network camera (obtained from the configuration information), and then adjusts the encoding parameters such as quantization parameters (QP), frame rate, and I-frame interval of the encoding chip in combination with the bitrate requirement and resolution parameters. For example, if the video transmission command requires a resolution of 1080P and a bitrate of 2-3Mbps, the first network camera sets the encoding resolution to 1920×1080, the frame rate to 25fps, and the I-frame interval to 50 frames. By adjusting the quantization parameters, the encoding bitrate is stabilized within the 2-3Mbps range. Step S42: Encode the acquired raw video data according to the transmission time period information and data transmission priority to generate a suitable video data stream. Specifically, the image sensor of the first network camera acquires raw video data (RAW format) in real time, performs preprocessing (such as noise reduction, white balance adjustment, and exposure adjustment), and then encodes it according to the adjusted encoding parameters to generate a video data stream that meets the requirements (such as an H.265 encoded TS stream). Regarding the transmission time period information, if the current time is within the transmission time period, encoding is performed directly. If the current time exceeds the transmission time period, the preprocessed raw video data is temporarily stored in a local cache and encoded after entering the transmission time period. Regarding data transmission priority, high-priority data adopts a "priority encoding, priority transmission" strategy, allocating more computing resources during the encoding process to ensure that the encoding delay is ≤50ms. Medium-priority data adopts a "conventional encoding" strategy, with the encoding delay controlled between 50-100ms. Low-priority data adopts a "delayed encoding" strategy, which can be encoded when the system computing resources are idle. Step S43: Transmit the video data stream to each of the second network cameras in a time-sharing or concurrent manner through the corresponding encrypted communication connection. Specifically, the first network camera selects a time-sharing or concurrent transmission strategy based on the number of second network cameras, the priority of each video data stream, and its own network transmission capability: When the number of second network cameras is small (e.g., ≤3) and the priority of each data stream is high, a concurrent transmission strategy is adopted, transmitting data to multiple second network cameras simultaneously through different encrypted communication connections; when the number of second network cameras is large (e.g., >3) or some data streams have low priority, a time-sharing transmission strategy is adopted, sorting data according to data transmission priority, with high-priority data transmitted first, and data of the same priority transmitted sequentially in a preset order (e.g., ascending order of second network camera identifiers), with each transmission period lasting 1-5 minutes, and the process is repeated cyclically; during transmission, the first network camera monitors the network transmission status in real time (e.g., transmission rate, packet loss rate), and if the packet loss rate is >5%, it automatically reduces the encoding bitrate to ensure the stability of data transmission. This application provides a data transmission method for a network camera, applied to a first network camera. The method involves acquiring configuration information from multiple second network cameras; establishing encrypted communication connections with each of the second network cameras based on the configuration information; receiving video transmission instructions from each of the second network cameras, the video transmission instructions including bitrate requirements, resolution parameters, and transmission time period information; and finally, adjusting its own encoding parameters according to the video transmission instructions to generate an adapted video data stream, and transmitting the video data stream to the corresponding second network camera. In the data transmission scheme provided by this application, encrypted communication and authentication mechanisms ensure data security during device interaction, preventing data interception, tampering, and malicious device access. Simultaneously, the first network camera can adjust encoding parameters and transmission strategies according to the resource status of the second network cameras, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, time-sharing or concurrent transmission strategies resolve conflicts caused by multiple senders transmitting data to the same receiver, ensuring the integrity and reliability of data transmission.
[0038] A method for issuing instructions to a network camera, applied to a second network camera, includes: receiving a connection request sent by a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; authenticating the first network camera; establishing an encrypted communication connection when the first network camera passes authentication; generating a video transmission instruction based on local storage information and current bandwidth resources and sending it to the first network camera, the video transmission instruction instructing the first network camera to adjust encoding parameters and transmit an adapted video data stream.
[0039] Please see Figure 2 , Figure 2 This application provides a flowchart illustrating the command issuance method for a network camera. The specific flow of this command issuance method for the network camera is as follows: Step T1: Receive the connection request from the first network camera.
[0040] Let's take five second network cameras as an example. All five second network cameras listen for connection requests through a preset communication port (8080). Taking IPC-2024002 as an example, after receiving a TCP connection request packet from the first network camera, it first verifies the integrity of the packet (that it has not been tampered with) through checksum verification. Then, it decrypts the data body using the session key and extracts the device identifier (IPC-2024001) and capability parameters of the first network camera: supported encoding protocols (H.264 / H.265 / AV1), maximum encoding bitrate of 8Mbps, supported resolutions (720P / 1080P / 4K), and a maximum concurrent transmission channel count of 4. The receiving process of IPC-2024006 is the same as that of IPC-2024002, and the same capability parameters are extracted.
[0041] Step T2: Authenticate the first network camera.
[0042] Taking IPC-2024002 as an example, the authentication process is as follows: Step T21: Extract verification information. Extract the device identifier (IPC-2024001) and authentication information (8F7A...) of the first network camera from the decrypted connection request.
[0043] Step T22: Query the authorized list. IPC-2024002 queries the locally stored list of authorized devices. This list contains the device identifiers and corresponding authentication keys that are allowed to access the device, including the mapping relationship of "IPC-2024001-Key-2024001".
[0044] Step T23: Verification Calculation. IPC-2024002 obtains Key-2024001, uses the same SHA-256 hash algorithm as the first network camera, and performs a calculation on "IPC-2024001+Key-2024001" to generate the verification result (8F7A...).
[0045] Step T24: Result Judgment. Compare the generated verification result with the authentication information in the connection request. If they match, the first network camera's authentication is confirmed to be successful. If the device identifier is not in the authorized list (e.g., an illegal device spoofing a request), a connection rejection response is returned, and the illegal request is recorded (log content: "2024-XX-XX XX:XX, Illegal device IP: XXX.XXX.XXX.XXX, request rejected"). The authentication process of IPC-2024006 is consistent with that of IPC-2024002, and the final verification is successful.
[0046] Step T3: Establish an encrypted communication connection.
[0047] After both IPC-2024002 and IPC-2024006 are authenticated, they negotiate the TLS 1.3 protocol with the first network camera. The negotiated encryption parameters (AES-256 / ECDHE / HMAC-SHA256) are consistent with those of the first network camera. After the negotiation is completed, they generate their respective session keys based on the ECDHE algorithm (SK1 for IPC-2024002 and SK5 for IPC-2024006), establish an independent encrypted communication connection with the first network camera, and record the connection information: connection time (2024-XX-XX 08:00:00) and session key validity period (24 hours, automatically renegotiation upon expiration).
[0048] Step T4: Generate and send video transmission instructions.
[0049] Specifically as follows: (1) Generation and transmission of instructions for IPC-2024002 (East entrance / exit, high priority).
[0050] Step T41: Obtain local storage information. The IPC-2024002 reads the status of the local storage medium (2TB solid-state drive) through the storage management module: 600GB of used capacity, 1400GB of remaining storage space, and a storage data retention policy of 30 days.
[0051] Step T42: Obtain bandwidth resource information. Monitor the network interface status through the network management module: total bandwidth 100Mbps, currently used bandwidth 30Mbps, network bandwidth utilization rate 30% (30 / 100×100%), current concurrent connection count 2 (in addition to the connection with the first network camera, there is also 1 connection with the NVR in the park center).
[0052] Step T43: Determine the transmission parameters.
[0053] The maximum allowed bitrate is calculated using the formula: (Remaining storage space × 8) / (Retention days × 24 × 3600). Substituting the data, (1400 × 1024 × 1024 × 8) / (30 × 24 × 3600) ≈ 44.5 Mbps. Considering the bandwidth utilization rate (30% ≤ 50%), the upper limit of the bitrate is set to 40% of the total bandwidth (40 Mbps). The final bitrate requirement is the range between the smaller of the two values (40 Mbps) and the minimum bitrate threshold (1 Mbps), i.e., 1-3 Mbps (considering the normal bitrate range and video quality requirements of the first network camera, 1-3 Mbps is chosen instead of 40 Mbps to avoid resource waste). The display device connected to IPC-2024002 supports 4K resolution and has sufficient remaining storage space (1400GB > 500GB). Combined with the fact that the first network camera supports 1080P resolution, the resolution parameter is determined to be 1080P. The east entrance / exit is an important monitoring area in the park, and the current concurrent connection count is 2 ≤ 3 (low workload), so the transmission period is determined to be all day. The east entrance / exit is a critical security area, requiring real-time acquisition and aggregation of video data, thus the data transmission priority is set as high.
[0054] Step T44: Command Encapsulation and Transmission. The above parameters (1-3Mbps, 1080P, all-day, high priority) are encapsulated into a binary format video transmission command: command header (command type 0x01, data length 32 bytes, device identifier IPC-2024002) and command body (encrypted transmission parameters). Through the established encrypted communication connection, the command is sent to the local listening port 50001 of the first network camera, and a command confirmation response is received from the first network camera (response content: "Command received successfully, parameters adapted").
[0055] (2) IPC-2024006 (Central Square, Medium Priority) instruction generation and transmission.
[0056] Step T41: Obtain local storage information. The storage medium of IPC-2024006 is a 2TB solid-state drive, with 800GB of used capacity, 1200GB of remaining storage space, and a 30-day data retention policy.
[0057] Step T42: Obtain bandwidth resource information. Total bandwidth: 100Mbps, currently used bandwidth: 40Mbps, network bandwidth utilization: 40%, current concurrent connections: 4 (medium workload).
[0058] Step T43: Determine the transmission parameters.
[0059] Specifically, the maximum allowed bitrate = (1200×1024×1024×8) / (30×24×3600) ≈ 37.7Mbps; bandwidth utilization ≤ 50%, bitrate cap set at 40% of total bandwidth (40Mbps); considering the central square is a regular monitoring area, the bitrate requirement is determined to be 1-2Mbps (balancing image quality and resources); 1200GB of remaining storage space is sufficient, but central square monitoring does not require ultra-high image quality, based on the resolution supported by the first network camera, 720P is selected; the current concurrent connection count is 4 (medium load), and during the day (8:00-20:00), other monitoring data needs to be processed first, so the transmission period is set to 20:00-8:00 the next day. Since the central square is a regular monitoring area, the data transmission priority is determined to be medium.
[0060] Step T44: Command Encapsulation and Transmission. Encapsulate the parameters (1-2Mbps, 720P, 20:00-8:00 the next day, medium priority) into a binary command, and send it to the local listening port 50005 of the first network camera via an encrypted connection. Receive and confirm successful command reception.
[0061] This application provides a method for issuing instructions to a network camera, applied to a second network camera. The method involves receiving a connection request from a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; authenticating the first network camera; establishing an encrypted communication connection when the first network camera passes authentication; generating a video transmission instruction based on local storage information and current bandwidth resources and sending it to the first network camera. This video transmission instruction instructs the first network camera to adjust encoding parameters and transmit an adapted video data stream. In the data transmission scheme provided by this application, encrypted communication and authentication mechanisms ensure data security during device interaction, preventing data interception, tampering, and malicious device access. Simultaneously, the first network camera can adjust encoding parameters and transmission strategies according to the resource status of the second network camera, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, time-sharing or concurrent transmission strategies resolve conflicts caused by multiple senders transmitting data to the same receiver, ensuring the integrity and reliability of data transmission.
[0062] To facilitate better implementation of the data transmission method of the network camera in the embodiments of this application, the embodiments of this application also provide a data transmission device for the network camera, wherein the meanings of the terms are the same as those in the data transmission system of the network camera described above, and specific implementation details can be found in the description of the system embodiments.
[0063] Please see Figure 3 , Figure 3This is a schematic diagram of the data transmission device for a network camera provided in an embodiment of this application. Specifically, the data transmission device may include an acquisition module 201, a first establishment module 202, a first receiving module 203, and a generation module 204, as follows: The acquisition module 201 is used to acquire configuration information of multiple second network cameras; The first establishment module 202 is used to establish encrypted communication connections with each of the second network cameras according to the configuration information; The first receiving module 203 is used to receive video transmission instructions sent by each of the second network cameras. The video transmission instructions include bit rate requirements, resolution parameters and transmission time information. The generation module 204 is used to adjust its own encoding parameters according to the video transmission instructions, generate an adapted video data stream, and transmit the video data stream to the corresponding second network camera.
[0064] This application provides a data transmission device for a network camera, applied to a first network camera. An acquisition module 201 acquires configuration information from multiple second network cameras. A first establishment module 202 establishes encrypted communication connections with each of the second network cameras based on the configuration information. Next, a first receiving module 203 receives video transmission instructions sent by each of the second network cameras, the video transmission instructions including bitrate requirements, resolution parameters, and transmission time period information. Finally, a generation module 204 adjusts its own encoding parameters according to the video transmission instructions, generates an adapted video data stream, and transmits the video data stream to the corresponding second network camera. In the data transmission scheme for the network camera provided in this application, encrypted communication and authentication mechanisms ensure data security during device interaction, preventing data interception, tampering, and malicious device access. Simultaneously, the first network camera can adjust encoding parameters and transmission strategies according to the resource status of the second network cameras, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, through time-sharing or concurrent transmission strategies, the conflict problem of multiple senders transmitting data to the same receiver is resolved, ensuring the integrity and reliability of data transmission.
[0065] To facilitate better implementation of the data transmission method of the network camera in the embodiments of this application, the embodiments of this application also provide a data transmission device for the network camera, wherein the meanings of the terms are the same as those in the data transmission system of the network camera described above, and specific implementation details can be found in the description of the system embodiments.
[0066] Please see Figure 3 , Figure 3This is a schematic diagram of the data transmission device for a network camera provided in an embodiment of this application. Specifically, the data transmission device may include a second receiving module 301, a verification module 302, a second establishing module 303, and a sending module 304, as follows: The second receiving module 301 is used to receive a connection request sent by the first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; Verification module 302 is used to authenticate the first network camera; The second establishment module 303 is used to establish an encrypted communication connection when the first network camera passes the verification. The sending module 304 is used to generate a video transmission instruction based on local storage information and current bandwidth resources and send it to the first network camera. The video transmission instruction is used to instruct the first network camera to adjust the encoding parameters and transmit an adapted video data stream.
[0067] This application provides a command issuing device for a network camera, applied to a second network camera. A second receiving module 301 receives a connection request sent by a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera. An authentication module 302 authenticates the first network camera. A second establishing module 303 establishes an encrypted communication connection when the first network camera passes authentication. A sending module 304 generates a video transmission command based on local storage information and current bandwidth resources and sends it to the first network camera. The video transmission command instructs the first network camera to adjust encoding parameters and transmit an adapted video data stream. In the data transmission scheme of the network camera provided in this application, encrypted communication and authentication mechanisms ensure data security during device interaction, preventing data interception, tampering, and malicious device access. Simultaneously, the first network camera can adjust encoding parameters and transmission strategies according to the resource status of the second network camera, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, through time-sharing or concurrent transmission strategies, the conflict problem of multiple sending ends transmitting data to the same receiving end is resolved, ensuring the integrity and reliability of data transmission.
[0068] Furthermore, embodiments of this application also provide an electronic device, such as... Figure 5 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically: The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more processor-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will understand that... Figure 5The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: Processor 301 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in memory 302, and by calling data stored in memory 302, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Optionally, processor 301 may include one or more processing cores; preferably, processor 301 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles data transmission from the wireless network camera. It is understood that the modem processor may not be integrated into processor 301.
[0069] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data transmission methods of the network camera by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0070] The electronic device also includes a power supply 303 that supplies power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 303 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0071] The electronic device may also include an input unit 304, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0072] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in the embodiments of this application, the processing 301 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 302 according to the following instructions, and the processing 301 runs the applications stored in the memory 302 to realize various functions, as follows: The system acquires configuration information of multiple second network cameras; establishes encrypted communication connections with each second network camera based on the configuration information; receives video transmission instructions sent by each second network camera, the video transmission instructions including bitrate requirements, resolution parameters, and transmission time period information; adjusts its own encoding parameters according to the video transmission instructions, generates an adapted video data stream, and transmits the video data stream to the corresponding second network camera.
[0073] The system receives a connection request from a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; authenticates the first network camera; when the first network camera passes authentication, establishes an encrypted communication connection; generates a video transmission instruction based on local storage information and current bandwidth resources and sends it to the first network camera, the video transmission instruction being used to instruct the first network camera to adjust encoding parameters and transmit an adapted video data stream.
[0074] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0075] This application embodiment ensures data security during device interaction through encrypted communication and authentication mechanisms, preventing data interception, tampering, and malicious device access. Simultaneously, the first network camera can adjust encoding parameters and transmission strategies based on the resource status of the second network camera, improving resource utilization and avoiding bandwidth waste and storage overflow. Furthermore, by employing time-sharing or concurrent transmission strategies, it resolves conflicts arising from multiple senders transmitting data to the same receiver, ensuring the integrity and reliability of data transmission.
[0076] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a processor-readable storage medium and loaded and executed by a processor.
[0077] Therefore, embodiments of this application provide a storage medium storing multiple instructions that can be loaded by a processor to execute steps in any of the data transmission methods for network cameras provided in embodiments of this application. For example, the instructions can execute the following steps: The system acquires configuration information of multiple second network cameras; establishes encrypted communication connections with each second network camera based on the configuration information; receives video transmission instructions sent by each second network camera, the video transmission instructions including bitrate requirements, resolution parameters, and transmission time period information; adjusts its own encoding parameters according to the video transmission instructions, generates an adapted video data stream, and transmits the video data stream to the corresponding second network camera.
[0078] The system receives a connection request from a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; authenticates the first network camera; when the first network camera passes authentication, establishes an encrypted communication connection; generates a video transmission instruction based on local storage information and current bandwidth resources and sends it to the first network camera, the video transmission instruction being used to instruct the first network camera to adjust encoding parameters and transmit an adapted video data stream.
[0079] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0080] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0081] Since the instructions stored in the storage medium can execute the steps in any of the data transmission methods of the network camera provided in the embodiments of this application, the beneficial effects that any of the data transmission methods of the network camera provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0082] The data transmission method, apparatus, electronic device, and storage medium of a network camera provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A data transmission method for a network camera, characterized in that, Applied to the first network camera, including: Obtain configuration information for multiple second network cameras; According to the configuration information, an encrypted communication connection is established with each of the second network cameras; Receive video transmission instructions sent by each of the second network cameras, the video transmission instructions including bitrate requirements, resolution parameters and transmission time information; Adjust its own encoding parameters according to the video transmission instructions, generate an adapted video data stream, and transmit the video data stream to the corresponding second network camera.
2. The data transmission method according to claim 1, characterized in that, The step of establishing encrypted communication connections with each of the second network cameras according to the configuration information includes: The network address, communication port, and authentication key of the second network camera are obtained from the configuration information. Initiate a connection request based on the network address and communication port; The link request is authenticated based on the authentication key; After successful authentication, an encrypted communication connection based on a transport layer security protocol is established.
3. The data transmission method according to claim 2, characterized in that, The receiving of video transmission instructions sent by each of the second network cameras includes: Listen to the local port corresponding to the established encrypted communication connection; Obtain the instruction data packets sent by each second network camera, and parse them to obtain the bit rate requirement, resolution parameters, transmission time period information and data transmission priority in the video transmission instruction; The instruction data packet is encapsulated in a preset format and contains the identification information of the second network camera.
4. The data transmission method according to claim 3, characterized in that, The step of adjusting its own encoding parameters according to the video transmission instruction, generating an adapted video data stream, and transmitting the video data stream to the corresponding second network camera includes: Adjust the encoding parameters of your own video encoding chip according to the bitrate requirements and resolution parameters; According to the transmission time period information and data transmission priority, the collected raw video data is encoded to generate an adapted video data stream; The video data stream is transmitted to each of the second network cameras in a time-sharing or concurrent manner through the corresponding encrypted communication connection.
5. A method for issuing commands to a network camera, characterized in that, Applications to second network cameras include: Receive a connection request sent by a first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; The first network camera is authenticated; When the first network camera passes verification, an encrypted communication connection is established; Based on local storage information and current bandwidth resources, a video transmission instruction is generated and sent to the first network camera. The video transmission instruction is used to instruct the first network camera to adjust encoding parameters and transmit an adapted video data stream.
6. The instruction issuance method according to claim 5, characterized in that, The step of generating a video transmission command and sending it to the first network camera based on local storage information and current bandwidth resources includes: Retrieve local storage information; Obtain network bandwidth utilization and concurrent connection count from the current bandwidth resources; Based on the local storage information, network bandwidth utilization, and number of concurrent connections, the transmission parameter information is determined, and the transmission parameter information is encapsulated into video transmission instructions; Based on the established encrypted communication connection's service port, the video transmission command is sent to the local port of the network camera.
7. A data transmission device for a network camera, characterized in that, Applied to the first network camera, including: The acquisition module is used to acquire configuration information from multiple second network cameras; The first establishment module is used to establish encrypted communication connections with each of the second network cameras according to the configuration information; The first receiving module is used to receive video transmission instructions sent by each of the second network cameras. The video transmission instructions include bitrate requirements, resolution parameters, and transmission time information. The generation module is used to adjust its own encoding parameters according to the video transmission instructions, generate an adapted video data stream, and transmit the video data stream to the corresponding second network camera.
8. A command issuing device for a network camera, characterized in that, Applications to second network cameras include: The second receiving module is used to receive a connection request sent by the first network camera, the connection request carrying the device identifier and capability parameters of the first network camera; The verification module is used to authenticate the first network camera; The second establishment module is used to establish an encrypted communication connection when the first network camera passes the verification. The sending module is used to generate a video transmission instruction based on local storage information and current bandwidth resources and send it to the first network camera. The video transmission instruction is used to instruct the first network camera to adjust the encoding parameters and transmit an adapted video data stream.
9. An electronic device, characterized in that, include: A memory, a processor, and a processor program stored in the memory and executable on the processor, wherein the processor executes the program as a data transmission method of a network camera as claimed in any one of claims 1 to 4, and / or a command issuing method of a network camera as claimed in any one of claims 1 to 4.
10. A storage medium, characterized in that, A computer processing program that stores the steps of a data transmission method for a network camera as described in any one of claims 1 to 4, and / or a command issuing method for a network camera as described in any one of claims 1 to 4, which can be loaded by a processor and executed.