Method for connecting network camera to network video recorder and related equipment

By comparing the routing device identification and requesting new tickets when the network camera is connected to the network video recorder, the security risk after the device is transferred or stolen is solved, and the security of the network video system is improved.

CN118870079BActive Publication Date: 2024-11-29HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411354303.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-11-29
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

There are security risks in the connection between existing network video recorders and network cameras, especially after the equipment is transferred or stolen, the long-term or permanent operational permissions of NVR devices cause IPC devices to be accessed, resulting in security risks.

Method used

When the network camera accesses the network video recorder, it compares the currently accessed routing device identification with the ID carried by the pre-requested or pre-stored ticket. If it is inconsistent, the pre-requested or pre-stored ticket will be invalid and requested from the server. New tickets, reacquire the identity of the network video recorder and the identification of the routing device to establish a binding relationship and ensure the validity of the tickets.

Benefits of technology

When the network environment changes, pre-requested or pre-stored tickets are invalid, and new tickets are reacquired, avoiding the risk of NVR devices accessing IPC devices without authorization and improving the security of remote network video systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118870079B_ABST
    Figure CN118870079B_ABST
Patent Text Reader

Abstract

The invention relates to a method for accessing a network camera to a network video recorder and related equipment. In the present application, when a network camera accesses a network video recorder, the network camera or network video recorder first compares whether the identifier of the currently accessed routing device is consistent with the identifier of the routing device carried by the pre-requested or pre-stored ticket. If they are inconsistent, the pre-requested or pre-stored ticket is invalidated, and the ticket is requested from the server again. Then, the operation authority related to the network camera accessing the network video recorder is obtained or allocated based on the ticket. Through the present invention, the pre-requested or pre-stored ticket will become invalid when the network environment changes, thereby solving the problem of security risks caused by the long-term or permanent retention of the operation authority of the NVR that has been accessed in the IPC, and improving the security of the remote network video system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of network camera systems, in particular to a method for connecting a network camera to a network video recorder and related equipment. Background Art

[0002] The connection between existing network video recorders (NVR) and network cameras (IPCamera, IPC) is generally carried out within the intranet. However, with the development of the video camera industry, some users no longer lay out the expensive LAN wired topology, but choose to access the public network nearby and use the server to make P2P holes, so that the remote NVR can access the IPC device at the other end of the public network.

[0003] In the related technology, after the IPC is connected to the NVR across the public network, when the IPC device or the NVR device is transferred to other users or stolen, the operating permissions of the NVR that was once connected are retained in the IPC for a long time or permanently. The NVR can still access the previously connected IPC and perform preview streaming or other functional operations, which poses a security risk. Summary of the invention

[0004] The method for accessing a network camera to a network video recorder and related devices provided by the embodiments of the present invention at least solve the problem of security risks caused by long-term or permanent retention of the operating authority of the NVR that has been accessed in the IPC.

[0005] A method for connecting a network camera to a network video recorder, applied to the network camera, comprising:

[0006] The network camera obtains the identifier of the routing device to which the network camera is currently connected;

[0007] The network camera compares the identification of the currently connected routing device with the identification of the routing device carried by the ticket pre-requested by the network camera;

[0008] If the identification of the currently connected routing device is consistent with the identification of the routing device carried by the pre-requested ticket, the network camera uses the pre-requested ticket to obtain the identification of the network video recorder and the identification of the routing device connected to the network video recorder;

[0009] If the identifier of the currently connected routing device is inconsistent with the identifier of the routing device carried by the pre-requested ticket, the network camera invalidates the pre-requested ticket, requests a new ticket from the server based on the user identifier, the identifier of the network camera, and the identifier of the currently connected routing device, stores the new ticket, and uses the new ticket to obtain the identifier of the network video recorder and the identifier of the routing device connected to the network video recorder;

[0010] The network camera stores the identifier of the network video recorder and the identifier of the routing device to which the network video recorder is connected, and establishes a binding relationship with the network video recorder;

[0011] The network camera is connected to the network video recorder that is bound to the network camera.

[0012] In some embodiments, the network camera requests a new ticket from the server based on the user identification, the identification of the network camera, and the identification of the currently connected routing device, including:

[0013] The network camera sends a ticket request to the server, and the ticket request carries the user ID, the network camera ID, and the ID of the currently connected routing device;

[0014] The network camera obtains a new ticket from the server. The new ticket carries the user ID, the ID of the network camera, and the ID of the routing device to which the network camera is connected.

[0015] In some embodiments, the network camera uses the ticket to obtain the identification of the network video recorder and the identification of the routing device connected to the network video recorder, including:

[0016] The network camera obtains the new ticket ID from the server;

[0017] The network camera displays the identification of the new ticket, so that the network video recorder can request the server to establish a binding relationship with the network camera based on the user identification, the identification of the new ticket, the identification of the network video recorder, and the identification of the routing device to which the network video recorder is connected;

[0018] The network camera obtains the ticket, the ID of the network video recorder and the ID of the routing device to which the network video recorder is connected from the server;

[0019] The network camera verifies whether the identifier of the routing device to which the network camera is connected, which is carried in the obtained ticket, is consistent with the identifier of the currently connected routing device;

[0020] If the identification of the routing device to which the network camera is connected carried by the obtained ticket is consistent with the identification of the currently connected routing device, the network camera stores the identification of the network video recorder and the identification of the routing device to which the network video recorder is connected, establishes a binding relationship with the network video recorder, and sends the first binding result to the network video recorder;

[0021] If the identification of the routing device to which the network camera is connected, which is carried in the obtained ticket, is inconsistent with the identification of the currently connected routing device, the network camera sends the second binding result to the network video recorder.

[0022] A method for connecting a network camera to a network video recorder, applied to the network video recorder, comprising:

[0023] The network video recorder obtains the identifier of the routing device to which the network video recorder is currently connected;

[0024] The network video recorder compares the identification of the currently connected routing device with the identification of the routing device pre-stored in the network video recorder;

[0025] If the identifier of the currently connected routing device is consistent with the identifier of the pre-stored routing device, the network video recorder requests a token required for establishing a link from the server based on the pre-stored ticket, and establishes a link based on the token, the pre-stored ticket carrying the user identifier, the identifier of the network camera and the identifier of the routing device to which the network camera is connected, and the link is used for the network camera to access the network video recorder;

[0026] If the identifier of the currently connected routing device is inconsistent with the identifier of the pre-stored routing device, the network video recorder stores the identifier of the currently connected routing device of the network video recorder and determines that the pre-stored ticket is invalid.

[0027] In some of these embodiments, the method further comprises:

[0028] The network video recorder receives input information from the user, the input information includes a ticket identifier and a user identifier, the ticket carries the user identifier, the network camera identifier and the identifier of the routing device to which the network camera is connected;

[0029] The network video recorder sends a binding request to the server, the binding request carries the user ID, the ticket ID, the network video recorder ID, and the ID of the routing device to which the network video recorder is connected;

[0030] The network video recorder obtains the binding result from the server, and stores the ticket when the binding result indicates that the binding relationship is successfully established and the binding result includes the ticket.

[0031] In some of the embodiments, the network video recorder establishing a link based on a token includes:

[0032] The network video recorder obtains the identification of the network camera carried by the pre-stored ticket;

[0033] Based on the token and the identification of the network camera, the network video recorder requests the server to establish a link for the network camera to access the network video recorder.

[0034] A method for connecting a network camera to a network video recorder, applied to a server, comprising:

[0035] The server receives a binding request from a network video recorder, the binding request carrying a user ID, a ticket ID, a network video recorder ID, and an ID of a routing device to which the network video recorder is connected; the server queries the corresponding ticket based on the ticket ID carried in the binding request; the server sends the ticket, the network video recorder ID, and the routing device ID to which the network video recorder is connected to the network camera, so that the network camera verifies the ticket based on the ID of the routing device currently connected to the network camera, and establishes a binding relationship with the network video recorder based on the ID of the network video recorder and the ID of the routing device to which the network video recorder is connected if the verification passes; the server forwards the binding result returned by the network camera to the network video recorder;

[0036] The server receives a token request from the network video recorder, the token request carrying a ticket; the server generates a token and sends the token to the network video recorder;

[0037] The server receives a link establishment request from the network video recorder, which carries a token and an identifier of the network camera. If the token verification passes, the server sends the link establishment request to the network camera, so that the network camera responds to the link establishment request and accesses the network video recorder.

[0038] In some of the embodiments, after the server queries the corresponding ticket based on the identifier of the ticket carried in the binding request, the method further includes:

[0039] The server verifies the binding request based on the user ID carried in the binding request and the user ID carried in the queried ticket; if the binding request passes the verification, the server sends the ticket, the ID of the network video recorder, and the ID of the routing device to which the network video recorder is connected to the network camera.

[0040] In some of these embodiments, the method further comprises:

[0041] The server receives a ticket request from the network camera, which carries the user ID, the network camera ID, and the ID of the routing device to which the network camera is connected; the server generates and stores a ticket and the ticket ID, which carries the user ID, the network camera ID, and the ID of the routing device to which the network camera is connected; the server sends the ticket and the ticket ID to the network camera.

[0042] In some of these embodiments, the method further comprises:

[0043] When the server receives the ticket from the network camera and / or the network video recorder, the server also verifies the expiration time and signature of the received ticket.

[0044] A network camera system includes a network camera, a network video recorder and a server.

[0045] A non-transitory machine-readable medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the above method.

[0046] The invention provides a method for accessing a network camera to a network video recorder and related devices. When a network camera accesses a network video recorder, the network camera or network video recorder first compares whether the identifier of the currently accessed routing device is consistent with the identifier of the routing device carried by the pre-requested or pre-stored ticket. If they are inconsistent, the pre-requested or pre-stored ticket is invalidated, and the ticket is requested from the server again. Then, the operation authority related to the network camera accessing the network video recorder is obtained or allocated based on the ticket. In the above manner, the pre-requested or pre-stored ticket will become invalid when the network environment changes, thereby solving the problem of security risks caused by long-term or permanent retention of the operation authority of the NVR that has been accessed in the IPC, and improving the security of the remote network video system. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other embodiments can be obtained based on these drawings without creative work.

[0048] Figure 1 The process of the method of connecting the network camera to the network video recorder of this embodiment is as follows Figure 1 .

[0049] Figure 2 The process of the method of connecting the network camera to the network video recorder of this embodiment is as follows Figure 2 .

[0050] Figure 3 The process of the method of connecting the network camera to the network video recorder of this embodiment is as follows Figure 3 .

[0051] Figure 4 Schematic diagram of the structure of the network camera system of this embodiment.

[0052] Figure 5 This is a flow chart of the server verifying the binding request in this embodiment.

[0053] Figure 6 This is a flowchart of the server verifying Ticket in this embodiment.

[0054] Figure 7 This is a flowchart of the IPC Ticket verification of this embodiment. DETAILED DESCRIPTION

[0055] The embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0056] Ticket, also known as a bill, is a credential used in the communication process between the client and the server. It is a temporary, time-limited authentication method used to prove that the user has passed the verification process. The server will authenticate the user based on the ticket and decide whether to authorize the request based on the verification result.

[0057] The expiration time of a ticket can be long or short, for example, the expiration time may be set to 30 days. After the ticket reaches the expiration time, it can no longer pass the server verification, and the client needs to request a new ticket from the server again. However, within the expiration time of the ticket, the client can always pass the server's ticket verification and obtain the corresponding operation permissions.

[0058] In a network camera system, if the IPC and NVR in the network camera system have obtained valid tickets, within the expiration time of the tickets, whether the IPC or NVR is transferred or stolen, the NVR can still obtain the operation authority of the IPC based on the previously obtained ticket of the corresponding IPC, which poses a security risk. To solve the above problem, this embodiment provides a method for a network camera to access a network video recorder. The method is applied to a network camera system composed of a network camera, a network video recorder and a server. The method for accessing a network camera to a network video recorder will be described and illustrated from three aspects: the network camera, the network video recorder and the server.

[0059] Network Camera

[0060] Figure 1 The process of the method of connecting the network camera to the network video recorder of this embodiment is as follows Figure 1 , Figure 1 The process performed by the network camera in the process of accessing the network video recorder is shown, including the following steps:

[0061] Step S101: The network camera obtains the identifier of the routing device to which the network camera is currently connected.

[0062] In step S101, the identifier of the routing device currently accessed by the network camera may be, for example, the physical address (Media Access Control Address, MAC) of the routing device, or other information about the unique network location that can be obtained through network information. For example, it may also be a combination of a MAC address and a local area network IP address. For a local area network that uses a fixed public network IP address as a unified public network entrance, the public network IP address, or a combination of the public network IP address and the MAC address may also be used as the identifier of the above-mentioned routing device.

[0063] Step S102: The network camera compares the identifier of the currently connected routing device with the identifier of the routing device carried in the ticket pre-requested by the network camera.

[0064] In this embodiment, the ticket requested by the network camera carries at least the identification of the routing device. By comparing the identification of the currently connected routing device with the identification of the routing device carried by the previously requested ticket, it is possible to determine whether the current network environment has changed.

[0065] Step S103, if the identifier of the currently connected routing device is consistent with the identifier of the routing device carried by the pre-requested ticket, the network camera uses the pre-requested ticket to obtain the identifier of the network video recorder and the identifier of the routing device connected to the network video recorder.

[0066] If the identification of the currently connected routing device is consistent with the identification of the routing device carried by the pre-requested ticket, it indicates that the network environment has not changed, that is, the possibility of the network camera being transferred or stolen is very low. At this time, the pre-requested ticket will continue to be valid before the expiration time arrives.

[0067] Step S104, if the identifier of the currently connected routing device is inconsistent with the identifier of the routing device carried by the pre-requested ticket, the network camera invalidates the pre-requested ticket, requests a new ticket from the server based on the user identifier, the identifier of the network camera, and the identifier of the currently connected routing device, stores the new ticket, and uses the new ticket to obtain the identifier of the network video recorder and the identifier of the routing device to which the network video recorder is connected.

[0068] In this embodiment, the identifier of the network camera may be, for example, the serial number (IPC_sn) of the network camera, which is usually unique. The identifier of the network video recorder may be, for example, the serial number (NVR_sn) of the network video recorder, which is usually also unique.

[0069] If the ID of the currently connected routing device is inconsistent with the ID of the routing device carried by the pre-requested ticket, it indicates that the network environment has changed, and the network camera may have been transferred or stolen. In this case, even if the expiration time of the pre-requested ticket has not yet arrived, the network camera will immediately invalidate the pre-requested ticket and request a new ticket from the server again.

[0070] Step S105: The network camera stores the identifier of the network video recorder and the identifier of the routing device to which the network video recorder is connected, and establishes a binding relationship with the network video recorder.

[0071] Step S106: the network camera is connected to a network video recorder that has established a binding relationship with the network camera.

[0072] Through the above steps, when the network environment changes and causes the identification of the routing device to which the network camera is connected to change, the network camera will invalidate the ticket it has requested and obtain a new ticket from the server again. This not only ensures that subsequent business can continue, but also avoids the problem that the NVR using the pre-requested ticket can still obtain the operation authority of the network camera, thereby improving security.

[0073] In some of the embodiments, when the network camera currently does not have a valid ticket, the network camera can directly request a new ticket from the server based on the user ID, the network camera ID, and the ID of the currently connected routing device, store the new ticket, and use the new ticket to obtain the ID of the network video recorder and the ID of the routing device to which the network video recorder is connected, without executing the above-mentioned steps S101 to S104.

[0074] Since the ticket requested by the network camera from the server carries the identifier of the routing device to which the network camera is connected, the network camera will also pass the identifier of the currently connected routing device to the server when requesting the ticket. For example, in some embodiments, the network camera requests a new ticket from the server based on the user identifier, the network camera identifier, and the identifier of the currently connected routing device, including: the network camera sends a ticket request to the server, the ticket request carries the user identifier, the network camera identifier, and the identifier of the currently connected routing device; the network camera obtains a new ticket from the server, the new ticket carries the user identifier, the network camera identifier, and the identifier of the routing device to which the network camera is connected. The user identifier can be an identifier assigned to the user by the system, such as the user's login account or the unique identification code corresponding to the user's login account; it can also be a unique string entered by the user. The "unique" means that there is no other user in the current system using the same identification code or string. The user identifier is mainly used for the server to verify the ticket.

[0075] In this embodiment, the process of binding the network camera to the network video recorder adopts manual intervention to avoid the security risks caused by automatic binding. In some embodiments, step S105 includes the following steps:

[0076] Step S105-1, the network camera obtains the identifier of a new ticket from the server.

[0077] In this embodiment, the ticket uses the JWT (JSON Web Token) format. JWT is a compact, self-contained way to securely transmit information between parties as a JSON object. This information can be verified and trusted because JWT can be signed with a secret key (using the HMAC algorithm) or with a public / private key pair (using RSA or ECDSA). JWT consists of three parts: Header, Payload, and Signature. These three parts are connected together by a dot (.).

[0078] The format of a JWT is usually: <header> . <payload> . <signature>.

[0079] The Header contains metadata about the JWT, usually information about which algorithm was used for signing. It is a JSON object, usually encoded as a Base64Url. The Payload contains the actual information to be declared. It is also data in JSON format and encoded as a Base64Url. The payload can contain any number of declarations. In this embodiment, the Payload contains declarations about the user ID, the ID of the network camera, and the ID of the routing device to which the network camera is connected. In addition, it can also contain declarations related to the ID of the ticket and the expiration time of the ticket. Signature is used to verify the integrity of the JWT and confirm that the sender is indeed who it claims to be.

[0080] A typical JWT format ticket after Base64Url encoding is as follows: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXJpYWxudW0iOiIxMjM0NTY3ODkwIiwibWFjIjoiYWI6MTI6MzQ6NTY6Nzg6OTAiLCJjdXN0b20gaWQiOiJ0ZXN0MTIzIn0.Iz16TlhyQ JRd9PJzeIwJDyTHq6BFMehPhTl9c-J1VCk, the bill string contains many characters. During the manual intervention process, if the user needs to manually input the bill in the form of the above string, it will cause input difficulties. For this reason, in this embodiment, the server uniquely maps a bill identifier (called a short code) to each bill string (called a long code). The bill identifier can be customized in length, for example, the short code can be a seven-digit or eight-digit string, thereby facilitating user input.

[0081] Step S105-2, the network camera displays the new ticket ID, so that the network video recorder can request the server to establish a binding relationship with the network camera based on the user ID, the new ticket ID, the network video recorder ID and the ID of the routing device connected to the network video recorder.

[0082] The ID of the new ticket displayed by the network camera can be a string or a QR code. The user can enter the ticket ID manually or scan the QR code on the network video recorder, and manually enter the user ID. The user ID needs to be consistent with the user ID used when requesting the ticket, otherwise it will fail to pass the server verification.

[0083] Step S105-3, the network camera obtains the ticket, the identifier of the network video recorder, and the identifier of the routing device to which the network video recorder is connected from the server.

[0084] Step S105-4: The network camera verifies whether the identifier of the routing device to which the network camera is connected, which is carried on the obtained ticket, is consistent with the identifier of the currently connected routing device.

[0085] Step S105-5, if the identification of the routing device connected to the network camera carried by the obtained ticket is consistent with the identification of the currently connected routing device, the network camera stores the identification of the network video recorder and the identification of the routing device connected to the network video recorder, establishes a binding relationship with the network video recorder, and sends a first binding result to the network video recorder. The first binding result indicates that the binding relationship is successfully established, which carries the information of the ticket.

[0086] Step 105-6: If the ID of the routing device to which the network camera is connected carried in the obtained ticket is inconsistent with the ID of the currently connected routing device, the network camera sends a second binding result to the network video recorder. The second binding result indicates that the binding relationship fails to be established and carries the reason for the failure.

[0087] Network Video Recorder

[0088] Figure 2 The process of the method of connecting the network camera to the network video recorder of this embodiment is as follows Figure 2 , Figure 2 The process performed by the network video recorder in the process of establishing a link with the network camera is shown, including the following steps:

[0089] Step S201: The network video recorder obtains an identifier of a routing device to which the network video recorder is currently connected.

[0090] Step S202: the network video recorder compares the identifier of the currently connected routing device with the identifier of the routing device pre-stored in the network video recorder.

[0091] Step S203, if the identifier of the currently connected routing device is consistent with the identifier of the pre-stored routing device, the network video recorder requests the server for a token required to establish a link based on the pre-stored ticket, and establishes a link based on the token. The pre-stored ticket carries the user identifier, the identifier of the network camera and the identifier of the routing device to which the network camera is connected. The link is used for the network camera to access the network video recorder.

[0092] The above token is also called a token string or Token, which refers to a credential issued by the system to verify the identity of the user, usually containing some encrypted information, such as the user's identity, permissions, etc. Token is usually used in a cross-domain environment, and its function is equivalent to that of a ticket, but the token has higher security in a distributed system or a cross-domain environment.

[0093] Step S204: If the identifier of the currently connected routing device is inconsistent with the identifier of the pre-stored routing device, the network video recorder stores the identifier of the currently connected routing device and determines that the pre-stored ticket is invalid.

[0094] In this embodiment, the network video recorder also uses the identifier of the currently connected routing device and the identifier of the routing device pre-stored in the network video recorder to determine whether the network environment of the network video recorder has changed. If it has changed, the network video recorder will also invalidate the pre-stored tickets, thereby improving the security of the network camera accessing the network video recorder.

[0095] It should be noted that Figure 1 and Figure 2 In the method for connecting a network camera to a network video recorder shown in the figure, the validity check of the ticket is performed at both ends of the network camera and the network video recorder. If the check fails at either end, the network camera cannot use the invalid ticket to connect to the network video recorder. Therefore, in actual scenarios, it is possible to choose to only check the validity of the ticket at one end, which does not mean that the validity check of the ticket must be performed at both ends. For example, in the network camera system of some embodiments, the network camera performs the following Figure 1 The process shown in the figure is not based on the network video recorder. Figure 2 The process shown in the figure is used to verify the validity of the ticket. In other embodiments of the network camera system, the network camera does not rely on Figure 1 The process shown in the figure verifies the validity of the ticket, and the network video recorder performs the following Figure 2 The process shown.

[0096] In some embodiments, after the network camera displays the ticket logo, the network video recorder requests the binding relationship from the network camera via the server in the following manner:

[0097] Step 1: The network video recorder receives input information from the user. The input information includes a ticket ID and a user ID. The ticket carries the user ID, the network camera ID, and the ID of the routing device to which the network camera is connected.

[0098] Step 2: The network video recorder sends a binding request to the server. The binding request carries the user ID, the ticket ID, the network video recorder ID, and the ID of the routing device to which the network video recorder is connected.

[0099] Step 3: The network video recorder obtains the binding result from the server, and stores the ticket if the binding result indicates that the binding relationship is successfully established and the binding result includes the ticket.

[0100] In some of the embodiments, in step S203, the network video recorder establishes a link based on the token, including the following steps: the network video recorder obtains the identification of the network camera carried by the pre-stored ticket; the network video recorder requests the server to establish a link for the network camera to access the network video recorder based on the token and the identification of the network camera.

[0101] The network video recorder can initiate the process of obtaining a token and establishing a link in response to the binding result of successful binding. Each token corresponds to a link establishment process, and a new token is required to reestablish the link. Each time the network video recorder requests a new token from the server, it needs to use a valid ticket.

[0102] server

[0103] Figure 3 The process of the method of connecting the network camera to the network video recorder of this embodiment is as follows Figure 3 , Figure 3 The process executed by the server when the network camera is connected to the network video recorder is shown, including the following steps:

[0104] Step S301: The server receives a binding request from a network video recorder, where the binding request carries a user ID, a ticket ID, an ID of the network video recorder, and an ID of a routing device to which the network video recorder is connected.

[0105] Step S302: The server queries the corresponding ticket based on the ticket identifier carried in the binding request.

[0106] In step S303, the server sends the ticket, the identifier of the network video recorder, and the identifier of the routing device to which the network video recorder is connected to the network camera, so that the network camera can verify the ticket based on the identifier of the routing device to which the network camera is currently connected, and establish a binding relationship with the network video recorder based on the identifier of the network video recorder and the identifier of the routing device to which the network video recorder is connected if the verification passes.

[0107] Step S304: the server forwards the binding result returned by the network camera to the network video recorder.

[0108] Step S305: The server receives a token request from the network video recorder, where the token request carries a ticket.

[0109] Step S306: The server generates a token and sends the token to the network video recorder.

[0110] Step S307: The server receives a link establishment request from the network video recorder, where the link establishment request carries a token and an identifier of the network camera.

[0111] Step S308: If the token verification is passed, the server sends a link establishment request to the network camera, so that the network camera accesses the network video recorder in response to the link establishment request.

[0112] In some embodiments, the server is also used to accept a ticket request from the network camera to generate a ticket. The process of the server generating a ticket includes the following steps:

[0113] Step 1: The server receives a ticket request from a network camera, where the ticket request carries a user ID, an ID of the network camera, and an ID of a routing device to which the network camera is connected.

[0114] Step 2: The server generates and stores a ticket and a ticket identifier, wherein the ticket carries a user identifier, an identifier of the network camera, and an identifier of a routing device to which the network camera is connected; the server sends the ticket and the ticket identifier to the network camera.

[0115] In some embodiments, after step S302, the server further verifies the binding request, including the following steps:

[0116] Step 1: The server verifies the binding request based on the user identifier carried in the binding request and the user identifier carried in the queried ticket.

[0117] Step 2: If the binding request verification is passed, the server sends the ticket, the identifier of the network video recorder, and the identifier of the routing device to which the network video recorder is connected to the network camera.

[0118] Step 3: If the binding request verification fails, the server returns a notification of binding failure to the network video recorder.

[0119] In other embodiments, when the server receives a ticket from a network camera and / or a network video recorder, the server also verifies the expiration time and signature of the received ticket to ensure the validity, integrity and authenticity of the ticket. For example, when the server receives a ticket, it first decrypts the expiration time of the ticket from the ticket and compares it with the current system time. If the expiration time of the ticket is before the current system time, it indicates that the ticket is valid, otherwise the ticket is invalid. Then, according to the signature field in the JWT format of the ticket, the server uses the salt value stored by the server and the specified signature algorithm to re-sign the header, payload and key of the ticket, and compares them with the signature field in the JWT format of the received ticket. If they are consistent, it indicates that the ticket is complete and authentic, otherwise it indicates that the ticket has been tampered with.

[0120] The salt value used in the process of verifying the ticket on the server is only stored on the server and will not be transmitted to the network camera or network video recorder. Therefore, it is more difficult to tamper with the ticket and improves the tamper-proof performance of the generated ticket.

[0121] The security of network cameras accessing network video recorders is further improved through multiple verifications of binding requests, ticket requests and tickets adopted by the server.

[0122] This embodiment also provides a network camera system. Figure 4 Schematic diagram of the network camera system of this embodiment. Figure 4 As shown, the system includes: a network camera 10, a network video recorder 20 and a server 30. The network camera 10 and the network video recorder 20 are connected via a link, and the link is used to transmit video code streams; the control signaling between the network camera 10 and the network video recorder 20 is transmitted via the server 30. The network camera 10 is used to perform the following Figure 1 As shown in the process, the network video recorder 20 is used to perform the following steps: Figure 2 The process shown in FIG. 1 is a process in which the server 30 is used to execute Figure 3 The process shown.

[0123] This embodiment also provides a non-transitory machine-readable medium storing computer instructions, where the computer instructions are used to enable a computer to execute the process executed by the above-mentioned network camera, network video recorder or server.

[0124] The following uses an example to illustrate the method of connecting the network camera of the above embodiment to a network video recorder.

[0125] This example involves a server, IPC, and NVR. The server provides binding relationship services to help establish transparent links, token and ticket mapping relationships, and ticket lifecycle maintenance. IPC is used to obtain tickets, record tickets, and authenticate binding. NVR is used to initiate binding and apply for a chain building token through the binding relationship to complete access.

[0126] The method of connecting a network camera to a network video recorder in this example includes the following steps:

[0127] Step 1, after logging in to the local webpage of IPC, send a Ticket request to the device access service (DAS) of the server. The Ticket request carries CustomID (i.e. user ID), IPC serial number, MAC address of the router where IPC is located and random number (used to prevent replay attacks), and applies for the Ticket of the NVR to be bound. The DAS service generates a Ticket and maps it to generate an operation short code (ShortCode). This ShortCode is uniquely corresponding to the ticket. In this example, the ShortCode is a 9-digit string containing uppercase letters and numbers, and its validity period is set to 3 days. The DAS service returns this Ticket and ShortCode to the IPC, and the IPC displays the obtained ShortCode.

[0128] Step 2: Manually fill in the CustomID and the ShortCode displayed by the above IPC on the NVR, and carry the MAC address of the router where the NVR is located and the NVR serial number, and send a binding request to the DAS. After the DAS verifies the binding request, it sends a Ticket and carries the NVR serial number and MAC address to the IPC, which is verified again by the IPC itself. If the verification is passed, the IPC saves the NVR serial number and the MAC address of the router where the NVR is located, and the binding is completed; otherwise, an error code is returned. Among them, the binding result returned to the NVR after the verification carries the Ticket information; the NVR also synchronously saves this Ticket and the MAC address of the router where it is located.

[0129] Step 3: NVR carries the Ticket and requests the DAS for the Token to operate the IPC. The DAS will verify the Ticket. Each time the NVR applies to the server's RelayServer (the service in the server responsible for establishing the link) to establish a link, it needs to obtain the Token again.

[0130] Step 4: NVR carries the Ticket and requests the DAS for the RelayServer address, public key, and public key version information.

[0131] Step 5: NVR sends a request to RelayServer to establish a link, carrying the Token and the IPC_sn to be linked.

[0132] Step 6: RelayServer verifies the Token and sends a link establishment request to IPC through DAS, requesting to establish a Relay / P2P link.

[0133] Step 7: After the NVR and IPC exchange / P2P hole punching information via the Relay link, they start punching holes and establish a P2P link.

[0134] When the IPC device is transferred, the MAC address of the router where the IPC is located changes. When the IPC detects that the MAC address of the same-level router is different from the previously detected and stored MAC, it will disconnect from the NVR and re-initiate the Ticket application.

[0135] Figure 5 : is a flow chart of the server verifying the binding request of this embodiment, such as Figure 5 As shown, in step 2 of the above example, when the server verifies the binding request, the NVR sends the short code and the user ID to the server. After receiving the short code, the server queries the mapped Ticket, decrypts the Head and Payload fields, and obtains the CustomID and ShortCode in the Payload. The obtained CustomID and ShortCode are compared with the CustomID and ShortCode entered by the user from the NVR to verify whether they are consistent.

[0136] Figure 6 This is a flowchart of the server verifying Ticket in this embodiment, such as Figure 6 As shown, whenever the server receives a Ticket sent by IPC and / or NVR, the server regenerates the signature of the Ticket according to the salt value stored on the server, and compares it with the signature of the received Ticket. If they are consistent, the verification passes.

[0137] In step 2 of the above example, after the server verifies the Ticket, it decrypts the IPC serial number to be bound from the Payload field of the Ticket, and then sends the Ticket (which also carries the NVR serial number and the MAC address of the router where the NVR is located) to the IPC for verification. Figure 7 This is a flowchart of the IPC verification ticket of this embodiment, such as Figure 7 As shown, after receiving the Ticket, the IPC reverses the header and payload parts, obtains the MAC address and serial number, and compares it with its own serial number and the MAC address of the router. If the verification passes, the binding is successful.

[0138] Through the above-mentioned embodiments provided by the present application, the binding relationship between the IPC and the NVR is strongly associated with the current network environment. If the network environment changes, the binding relationship is removed; when the server verifies the integrity of the Ticket, the salt value generated by the Ticket only exists on the server and cannot be obtained by other users, thereby ensuring security. The server, IPC, and NVR can all verify the Ticket, achieving double security guarantees; the IPC and NVR themselves will also associate the current network environment with the Ticket. If there is inconsistency, the Ticket is deemed invalid, and the next interactive token application requires a new Ticket. The above-mentioned embodiments ensure the security of the network camera's remote access to the network video recorder, and effectively prevent the security risks of the equipment being resold or physically stolen.

[0139] It should be noted that the term "including" and its variations used in the embodiments of the present invention are open inclusions, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0140] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0141] The various steps described in the method implementation methods provided by the embodiments of the present invention can be performed in different orders and / or in parallel. In addition, the method implementation methods may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.

[0142] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments are referenced to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment.

[0143] The above-described embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of protection. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the attached claims.< / signature> < / payload> < / header>

Claims

1. A method for connecting a network camera to a network video recorder, applied to a network camera, Features include: The network camera obtains an identifier of a routing device to which the network camera is currently connected; The network camera compares the identifier of the currently connected routing device with the identifier of the routing device carried by the ticket pre-requested by the network camera; If the identifier of the currently connected routing device is consistent with the identifier of the routing device carried by the pre-requested ticket, the network camera uses the pre-requested ticket to obtain the identifier of the network video recorder and the identifier of the routing device connected to the network video recorder; If the identifier of the currently connected routing device is inconsistent with the identifier of the routing device carried by the pre-requested ticket, the network camera invalidates the pre-requested ticket, requests a new ticket from the server based on the user identifier, the identifier of the network camera, and the identifier of the currently connected routing device, stores the new ticket, and uses the new ticket to obtain the identifier of the network video recorder and the identifier of the routing device connected to the network video recorder; The network camera stores the identifier of the network video recorder and the identifier of the routing device to which the network video recorder is connected, and establishes a binding relationship with the network video recorder; The network camera is connected to a network video recorder that establishes a binding relationship with the network camera.

2. The method according to claim 1, It is characterized in that The network camera requests a new ticket from the server based on the user identifier, the identifier of the network camera, and the identifier of the currently connected routing device, including: The network camera sends a ticket request to the server, wherein the ticket request carries the user identifier, the identifier of the network camera, and the identifier of the currently connected routing device; The network camera obtains the new ticket from the server, and the new ticket carries the user ID, the ID of the network camera, and the ID of the routing device to which the network camera is connected.

3. The method according to claim 2, It is characterized in that The network camera uses the ticket to obtain the identification of the network video recorder and the identification of the routing device connected to the network video recorder, including: The network camera obtains the identifier of the new ticket from the server; The network camera displays the identification of the new ticket, so that the network video recorder can request the server to establish a binding relationship with the network camera based on the user identification, the identification of the new ticket, the identification of the network video recorder, and the identification of the routing device connected to the network video recorder; The network camera obtains the ticket, the identification of the network video recorder and the identification of the routing device to which the network video recorder is connected from the server; The network camera verifies whether the identification of the routing device to which the network camera is connected, which is carried on the obtained ticket, is consistent with the identification of the currently connected routing device; If the identification of the routing device to which the network camera carried on the obtained ticket is connected is consistent with the identification of the currently connected routing device, the network camera stores the identification of the network video recorder and the identification of the routing device to which the network video recorder is connected, establishes a binding relationship with the network video recorder, and sends a first binding result to the network video recorder; If the identification of the routing device to which the network camera is connected, which is carried in the acquired ticket, is inconsistent with the identification of the currently connected routing device, the network camera sends the second binding result to the network video recorder.

4. A method for connecting a network camera to a network video recorder, applied to a network video recorder, Features include: The network video recorder obtains an identifier of a routing device to which the network video recorder is currently connected; The network video recorder compares the identifier of the currently connected routing device with the identifier of the routing device pre-stored in the network video recorder; If the identifier of the currently connected routing device is consistent with the identifier of the pre-stored routing device, the network video recorder requests a token required for establishing a link from a server based on a pre-stored ticket, and establishes a link based on the token, wherein the pre-stored ticket carries a user identifier, an identifier of a network camera, and an identifier of a routing device connected to the network camera, and the link is used for the network camera to access the network video recorder; If the identifier of the currently connected routing device is inconsistent with the pre-stored identifier of the routing device, the network video recorder stores the identifier of the currently connected routing device of the network video recorder and determines that the pre-stored ticket is invalid.

5. The method according to claim 4, It is characterized in that The method further comprises: The network video recorder receives input information from a user, the input information includes a ticket identifier and a user identifier, the ticket carries the user identifier, the network camera identifier, and the identifier of a routing device to which the network camera is connected; The network video recorder sends a binding request to the server, wherein the binding request carries the user identifier, the ticket identifier, the network video recorder identifier, and the routing device identifier to which the network video recorder is connected; The network video recorder obtains the binding result from the server, and stores the ticket when the binding result indicates that the binding relationship is successfully established and the binding result includes the ticket.

6. The method according to claim 4, It is characterized in that The network video recorder establishes a link based on the token, including: The network video recorder obtains the identification of the network camera carried by the pre-stored ticket; The network video recorder requests the server to establish a link for the network camera to access the network video recorder based on the token and the identification of the network camera.

7. A method for connecting a network camera to a network video recorder, applied to a server, Features include: The server receives a binding request from a network video recorder, the binding request carrying a user identifier, a ticket identifier, an identifier of the network video recorder, and an identifier of a routing device to which the network video recorder is connected; the server queries a corresponding ticket based on the ticket identifier carried in the binding request; The server sends the ticket, the identifier of the network video recorder, and the identifier of the routing device to which the network video recorder is connected to the network camera, so that the network camera verifies the ticket based on the identifier of the routing device currently connected to the network camera, and establishes a binding relationship with the network video recorder based on the identifier of the network video recorder and the identifier of the routing device to which the network video recorder is connected if the verification passes; The server forwards the binding result returned by the network camera to the network video recorder; The server receives a token request from the network video recorder, wherein the token request carries the ticket; the server generates a token and sends the token to the network video recorder; The server receives a link establishment request from the network video recorder, wherein the link establishment request carries the token and the identifier of the network camera; If the token verification passes, the server sends the link establishment request to the network camera, so that the network camera accesses the network video recorder in response to the link establishment request.

8. The method according to claim 7, It is characterized in that After the server queries the corresponding ticket based on the ticket identifier carried in the binding request, the method further includes: The server verifies the binding request based on the user identifier carried in the binding request and the user identifier carried in the queried ticket; if the binding request passes the verification, the server sends the ticket, the identifier of the network video recorder, and the identifier of the routing device to which the network video recorder is connected to the network camera.

9. The method according to claim 7, It is characterized in that The method further comprises: The server receives a ticket request from a network camera, wherein the ticket request carries a user ID, an ID of the network camera, and an ID of a routing device to which the network camera is connected; the server generates and stores a ticket and the ID of the ticket, wherein the ticket carries the user ID, the ID of the network camera, and an ID of the routing device to which the network camera is connected; and the server sends the ticket and the ID of the ticket to the network camera.

10. The method according to claim 7, It is characterized in that The method further comprises: When the server receives the ticket from the network camera or the network video recorder, the server also verifies the expiration time and signature of the received ticket.

11. A network camera system, include: A network camera, a network video recorder and a server, characterized in that the network camera is used to execute the method as described in any one of claims 1 to 3, the network video recorder is used to execute the method as described in any one of claims 4 to 6, and the server is used to execute the method as described in any one of claims 7 to 10.

12. A non-transitory machine-readable medium storing computer instructions, It is characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Device, method and system for synchronizing express information to video monitoring

    CN110177245A

  • Streaming media for portable devices

    US20110231903A1