Camera management and control method and system, platform server and intermediate agent module

By setting up an intermediate proxy module at the edge of the camera and using the authentication mechanism of the platform server, videos are streamed to the streaming media server on the public network, solving the problems of low security, high privacy risks and high platform storage costs in remote access of intranet cameras, and achieving security, efficiency and cost optimization.

CN119835521APending Publication Date: 2025-04-15SHENZHEN DAS INTELLITECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411860059.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The prior art has defects in the remote access and control of intranet cameras, which are low security, high privacy risks and high platform storage costs.

Method used

By setting up an intermediate proxy module at the edge of the camera, and using the platform server's instruction delivery and management of the intermediate proxy module, video streaming to the streaming media server on the public network, users can directly view the video stream of the target camera through the streaming media server. The platform server has an authentication mechanism to ensure that only authorized users can view the video stream.

Benefits of technology

Remote access to intranet cameras is realized, security and efficiency are improved, and storage costs and privacy leakage risks are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835521A_ABST
    Figure CN119835521A_ABST
Patent Text Reader

Abstract

The invention discloses a camera management and control method and system, a platform server and an intermediate agent module. The camera management and control method comprises the following steps: receiving a viewing request of a target camera input by a user from a first client; sending a viewing instruction of the target camera to a corresponding intermediate agent module according to the viewing request; receiving a stream address from the intermediate agent module, and sending the stream address to the first client; receiving a verification request from the streaming media server, and verifying the user token in the verification request; and when the verification is passed, first verification result information is sent to the first client, so that the first client is allowed to perform pull stream playing on a video stream corresponding to the stream address in the streaming media server. By implementing the technical scheme of the invention, the potential network attack risk and the user privacy leakage risk are reduced, the security is improved, and the storage cost is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Things, and in particular to a camera management and control method, system, platform server, and intermediate proxy module. Background Art

[0002] In current IoT applications, remote access and control of intranet cameras is an important and challenging task. For cameras that do not have national standard capabilities or do not meet national standards, if you want to view the camera's video stream, the following two methods are usually used: 1. The user end directly establishes a TCP connection with the camera; 2. The camera uploads the real-time video to the platform, and the user indirectly views the camera's video by viewing the platform's video. However, for method 1, since the camera's IP address needs to be exposed to the public network, the camera is vulnerable to unauthorized access and has security vulnerabilities. Moreover, direct access to the intranet camera through the public network, without encryption or identity authentication, poses a risk of user privacy being violated; for method 2, since the camera is required to upload real-time video to the public network platform 24 hours a day, the platform will incur high storage costs. In summary, the existing video stream viewing methods have the disadvantages of low security, high privacy risks, and high platform storage costs. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a camera management and control method, system, platform server, and intermediate proxy module in view of the technical defects of low security, high privacy risk, and high platform storage cost in the prior art.

[0004] The technical solution adopted by the present invention to solve the technical problem is: construct a camera control method, which is applied to a platform server, including:

[0005] receiving a viewing request of a target camera input by a user from a first client;

[0006] According to the viewing request, sending a viewing instruction of the target camera to the corresponding intermediate proxy module;

[0007] Receiving a stream address from the intermediate proxy module and sending the stream address to the first client, wherein the intermediate proxy module determines the corresponding stream address after receiving the viewing instruction, pulls the video stream from the target camera, and pushes the video stream to a corresponding position of the streaming media server according to the stream address;

[0008] Receiving a verification request from a streaming media server, and verifying a user token in the verification request, wherein after receiving the streaming address, the first client sends a stream pull request to the streaming media server according to the streaming address and the user token, and the streaming media server sends a verification request to the platform server according to the user token in the received stream pull request;

[0009] When the verification is passed, first verification result information is sent to the first client to allow the first client to pull and play the video stream corresponding to the stream address in the streaming media server;

[0010] When the verification fails, second verification result information is sent to the first client to prohibit the first client from pulling and playing the video stream corresponding to the stream address in the streaming media server.

[0011] Optionally, it also includes:

[0012] Receiving a control request of a target camera input by a user from a first client;

[0013] According to the control request, a control instruction of the target camera is sent to the corresponding intermediate proxy module;

[0014] Receive status return information from the intermediate agent module and send the status return information to the first client, wherein the intermediate agent module performs corresponding control operations on the target camera after receiving the control instruction and receives status return information from the target camera.

[0015] The present invention also constructs a camera control method, which is applied to an intermediate proxy module, comprising:

[0016] Receiving a viewing instruction of a target camera from a platform server, wherein the platform server sends the viewing instruction of the target camera to a corresponding intermediate proxy module after receiving a viewing request of the target camera input by a user from the first client;

[0017] According to the viewing instruction, a corresponding stream address is determined, and a video stream is pulled from the target camera, and the video stream is pushed to a corresponding position of a streaming media server according to the stream address;

[0018] The stream address is sent to the platform server so that the platform server sends the stream address to the first client, and after receiving the stream address, the first client sends a stream pull request to the streaming media server according to the stream address and the user token; the streaming media server sends a verification request to the platform server according to the user token in the received stream pull request; the platform server verifies the user token in the verification request, and when the verification passes, sends first verification result information to the first client to allow the first client to play the video stream corresponding to the stream address in the streaming media server, and when the verification fails, sends second verification result information to the first client to prohibit the first client from playing the video stream corresponding to the stream address in the streaming media server.

[0019] Optionally, it also includes:

[0020] Receiving a control instruction of a target camera from a platform server, wherein the platform server sends the control instruction of the target camera to a corresponding intermediate proxy module after receiving a control request of the target camera input by a user from the first client;

[0021] According to the control instruction, a corresponding control operation is performed on the target camera, and status return information is received from the target camera;

[0022] The status return information is sent to the platform server, so that the platform server sends the status return information to the first client.

[0023] Optionally, determining the corresponding stream address includes:

[0024] Step S221, determining whether there is a second client that is currently viewing the stream from the target camera, if so, executing step S222; if not, executing step S223;

[0025] Step S222, obtaining the stream address corresponding to the target camera;

[0026] Step S223, generating a stream address according to a preset rule, and recording the relationship between the target camera and the stream address.

[0027] Optionally, it also includes:

[0028] If it is determined that no viewing instruction from the target camera is received within a preset time period, then the video stream pulling from the target camera is stopped, and the stream address corresponding to the target camera is deleted.

[0029] Optionally, generating a flow address according to a preset rule includes:

[0030] Generate a stream address according to the identification information and current time information of the target camera.

[0031] The present invention also constructs a platform server, including a first processor and a first memory storing a first computer program, wherein the first processor implements the steps of the above-mentioned camera control method when executing the first computer program.

[0032] The present invention also constructs an intermediate agent module, including a second processor and a second memory storing a second computer program, and the second processor implements the steps of the above-mentioned camera control method when executing the second computer program.

[0033] The present invention also constructs a camera control system, including:

[0034] Client side;

[0035] Camera;

[0036] Streaming media server;

[0037] The platform server mentioned above;

[0038] The intermediate proxy module described above.

[0039] Through the technical solution of the present invention, by setting an intermediate proxy module at the edge of the camera, and through the instruction transmission of the platform server and the management of the intermediate proxy module, the video stream is transmitted to the streaming media server of the public network, so that the user can directly view the video stream of the target camera through the streaming media server. In addition, the platform server has an authentication mechanism to ensure that only authorized users can view the video stream. Therefore, this technical solution not only realizes the remote access of the intranet camera and achieves the purpose of viewing the intranet video on the external network, but also has the following beneficial effects compared with the prior art:

[0040] 1. Since there is no need to expose the IP address of the camera to the public network, nor is there a need for the platform server to store the video stream, the camera can be securely connected based on the communication capability of the platform server, which can ensure the security of the entire link and reduce the potential risk of network attacks, thereby improving security;

[0041] 2. Since the platform server has an authentication mechanism, it can ensure that only authorized users can view the camera's video stream, thereby reducing the risk of user privacy leakage and further improving security;

[0042] 3. Since the intermediate proxy module uses an on-demand method to push the stream, compared with the traditional method (the camera needs to push the stream to the platform server in real time), it not only reduces the storage cost, but also makes the video stream transmission more flexible and controllable, improving the security and efficiency of the system;

[0043] 4. Since users view video streams through streaming media servers, it is less invasive and can be deployed independently of platform servers, which is more flexible and reduces dependence on the platform, thus reducing the burden on the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0045] Figure 1 is a flow chart of a first embodiment of a camera control method of the present invention;

[0046] Figure 2 is a flow chart of Embodiment 2 of the camera control method of the present invention;

[0047] Figure 3 It is a structural diagram of embodiment 1 of the camera control system of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Figure 1 It is a flow chart of Example 1 of the camera control method of the present invention. The control method of this embodiment is applied to the platform server of the camera control system. The control system also includes a streaming media server, a client, a camera and an intermediate proxy module.

[0050] like Figure 1 As shown, the control method of this embodiment includes:

[0051] Step S101, receiving a viewing request of a target camera input by a user from a first client;

[0052] In this step, it is first explained that the first client is, for example, a user's mobile phone, PAD, computer or other terminal device with a specific APP installed. When a user wants to view the video stream of a target camera, he can input a viewing request through his first client, and the viewing request includes the identification information of the target camera to be viewed, such as device ID, device number, etc. After receiving the user's viewing request, the first client sends it to the platform server.

[0053] Step S102, sending a viewing instruction of the target camera to a corresponding intermediate proxy module according to the viewing request;

[0054] In this step, it is first explained that the intermediate proxy module can be set at the edge of the corresponding camera, for example, built into the camera or externally connected to the camera, and when externally connected to the camera, one intermediate proxy module can be connected to multiple cameras at the same time. After the intermediate proxy module is deployed, the correspondence between the intermediate proxy module and the camera can be stored in the platform server. In actual applications, when the platform server receives a viewing request, it can find the intermediate proxy module corresponding to the target camera from the stored correspondence according to the identifier of the target camera in the viewing request, and then send a viewing instruction of the target camera to the intermediate proxy module.

[0055] Step S103, receiving a stream address from the intermediate proxy module, and sending the stream address to the first client, wherein the intermediate proxy module determines the corresponding stream address after receiving the viewing instruction, pulls the video stream from the target camera, and pushes the video stream to the corresponding position of the streaming media server according to the stream address;

[0056] In this step, when the intermediate proxy module receives the viewing instruction, it first determines the corresponding stream address, then pulls the video stream from the target camera, and pushes it to the corresponding position of the streaming media server, and also sends the stream address to the platform server. After receiving the stream address, the platform server sends it to the first client. In addition, when pulling the stream, the intermediate proxy module can push the stream address to the streaming media server through a video decoding suite tool, such as FFmpeg tool, to generate video stream addresses such as HLS, RTMP, and FLV.

[0057] Step S104, receiving a verification request from a streaming media server, and verifying a user token in the verification request, wherein after receiving the streaming address, the first client sends a stream pull request to the streaming media server according to the streaming address and the user token, and the streaming media server sends a verification request to the platform server according to the user token in the received stream pull request;

[0058] In this step, after the first client receives the stream address, it appends the user token to the stream address as a URL parameter to initiate a stream pull request to the streaming media server. After the streaming media server detects the stream pull request from the first client, it sends the user token of the stream pull request to the platform server. The platform server verifies the legitimacy of the user token. For example, the corresponding relationship between the corresponding camera and the corresponding user token can be pre-stored in the platform server. When verifying, the platform server can determine whether the user token is legal through the corresponding relationship.

[0059] Step S105, when the verification is passed, sending first verification result information to the first client to allow the first client to play the video stream corresponding to the stream address in the streaming media server;

[0060] In this step, the platform server sends the first verification result information (verification passed) to the first client only when the verification is passed. When the first client receives the first verification result information, it can play the video stream corresponding to the stream address in the streaming media server.

[0061] Step S106: When the verification fails, second verification result information is sent to the first client to prohibit the first client from pulling and playing the video stream corresponding to the stream address in the streaming media server.

[0062] In this step, when the platform server fails the verification, it indicates that the user of the first client is an unauthorized user. At this time, the second verification result information (verification failed) is sent to the first client. In addition, when the first client receives the second verification result information, it can output a prompt message, for example, outputting an HttpStatus403 status code.

[0063] In the technical solution of this embodiment, an intermediate proxy module is set at the edge of the camera, and the video stream is transmitted to the streaming media server of the public network through the instruction transmission of the platform server and the management of the intermediate proxy module. In this way, the user can directly view the video stream of the target camera through the streaming media server. In addition, the platform server has an authentication mechanism to ensure that only authorized users can view the video stream. Therefore, this technical solution not only realizes the remote access of the intranet camera and achieves the purpose of viewing the intranet video from the external network, but also has the following beneficial effects compared with the prior art:

[0064] 1. Since there is no need to expose the IP address of the camera to the public network, nor is there a need for the platform server to store the video stream, the camera can be securely connected based on the communication capability of the platform server, which can ensure the security of the entire link and reduce the potential risk of network attacks, thereby improving security;

[0065] 2. Since the platform server has an authentication mechanism, it can ensure that only authorized users can view the camera's video stream, thereby reducing the risk of user privacy leakage and further improving security;

[0066] 3. Since the intermediate proxy module uses an on-demand method to push the stream, compared with the traditional method (the camera needs to push the stream to the platform server in real time), it not only reduces the storage cost, but also makes the video stream transmission more flexible and controllable, improving the security and efficiency of the system;

[0067] 4. Since users view video streams through streaming media servers, it is less invasive and can be deployed independently of platform servers, which is more flexible and reduces dependence on the platform, thus reducing the burden on the system.

[0068] Furthermore, in an optional embodiment, the camera control method of the present invention further includes:

[0069] Step S107, receiving a control request of a target camera input by a user from the first client;

[0070] Step S108, sending a control instruction of the target camera to a corresponding intermediate proxy module according to the control request;

[0071] Step S109, receiving status return information from the intermediate proxy module, and sending the status return information to the first client, wherein the intermediate proxy module performs corresponding control operations on the target camera after receiving the control instruction, and receives status return information from the target camera.

[0072] In this embodiment, when the target camera needs to be controlled, for example, the pan / tilt is controlled, the intermediate proxy module operates the target camera indirectly after receiving the control instruction from the platform server. This control method does not need to expose the IP address of the camera to the public network, so it reduces the potential risk of network attacks and improves security. Moreover, the requirements for the camera are lower and more flexible. In some large projects, the compatibility is stronger for cameras that do not meet the national standards or old cameras.

[0073] Further, in an optional embodiment, the user can not only view the current video stream of the target camera, but also view the video stream of the target camera in the historical period. Specifically, a memory for storing videos of a specific period (e.g., the last week, the last month) is built-in or externally connected to the target camera, such as an SD card. When the user inputs a viewing request through its client, the time period to be viewed can be specified at the same time, for example, viewing the video stream from 9:00-10:00 yesterday. When the intermediate proxy module receives the viewing instruction, the corresponding video stream is pulled from the memory of the target camera according to the specified time period, and pushed to the streaming media server. In this way, the user can view the video stream of the target camera in the specified time period through the streaming media server.

[0074] The present invention also constructs a platform server, which includes a first processor and a first memory storing a first computer program. The first processor implements the steps of the camera control method described above when executing the first computer program.

[0075] Figure 2 : is a flow chart of Embodiment 2 of the camera control method of the present invention. The control method of this embodiment is applied to the intermediate proxy module and includes:

[0076] Step S201, receiving a viewing instruction of a target camera from a platform server, wherein the platform server sends the viewing instruction of the target camera to a corresponding intermediate proxy module after receiving a viewing request of the target camera input by a user from a first client;

[0077] Step S202, according to the viewing instruction, determining a corresponding stream address, pulling a video stream from the target camera, and pushing the video stream to a corresponding position of a streaming media server according to the stream address;

[0078] Step S203, sending the stream address to the platform server, so that the platform server sends the stream address to the first client, and after receiving the stream address, the first client sends a stream pull request to the streaming media server according to the stream address and the user token; the streaming media server sends a verification request to the platform server according to the user token in the received stream pull request; the platform server verifies the user token in the verification request, and when the verification passes, sends first verification result information to the first client to allow the first client to play the video stream corresponding to the stream address in the streaming media server, and when the verification fails, sends second verification result information to the first client to prohibit the first client from playing the video stream corresponding to the stream address in the streaming media server.

[0079] In the technical solution of this embodiment, an intermediate proxy module is set at the edge of the camera, and the video stream is transmitted to the streaming media server of the public network through the instruction transmission of the platform server and the management of the intermediate proxy module. In this way, the user can directly view the video stream of the target camera through the streaming media server. In addition, the platform server has an authentication mechanism to ensure that only authorized users can view the video stream. Therefore, this technical solution not only realizes the remote access of the intranet camera and achieves the purpose of viewing the intranet video from the external network, but also has the following beneficial effects compared with the prior art:

[0080] 1. Since there is no need to expose the IP address of the camera to the public network, nor is there a need for the platform server to store the video stream, the camera can be securely connected based on the communication capability of the platform server, which can ensure the security of the entire link and reduce the potential risk of network attacks, thereby improving security;

[0081] 2. Since the platform server has an authentication mechanism, it can ensure that only authorized users can view the camera's video stream, thereby reducing the risk of user privacy leakage and further improving security;

[0082] 3. Since the intermediate proxy module uses an on-demand method to push the stream, compared with the traditional method (the camera needs to push the stream to the platform server in real time), it not only reduces the storage cost, but also makes the video stream transmission more flexible and controllable, improving the security and efficiency of the system;

[0083] 4. Since users view video streams through streaming media servers, it is less invasive and can be deployed independently of platform servers, which is more flexible and reduces dependence on the platform, thus reducing the burden on the system.

[0084] Furthermore, in an optional embodiment, the camera control method of the present invention further includes:

[0085] Step S204, receiving a control instruction of the target camera from the platform server, wherein the platform server sends the control instruction of the target camera to the corresponding intermediate proxy module after receiving the control request of the target camera input by the user from the first client;

[0086] Step S205, performing corresponding control operations on the target camera according to the control instruction, and receiving status return information from the target camera;

[0087] Step S206: Send the status return information to the platform server, so that the platform server sends the status return information to the first client.

[0088] In this embodiment, when the target camera needs to be controlled, for example, the pan / tilt is controlled, the intermediate proxy module operates the target camera indirectly after receiving the control instruction from the platform server. This control method does not need to expose the IP address of the camera to the public network, so it reduces the potential risk of network attacks and improves security. Moreover, the requirements for the camera are lower and more flexible. In some large projects, the compatibility is stronger for cameras that do not meet the national standards or old cameras.

[0089] Further, in an optional embodiment, in step S202, determining the corresponding stream address includes:

[0090] Step S2021, determining whether there is a second client that is currently viewing the stream from the target camera, if so, executing step S222; if not, executing step S223;

[0091] Step S2022, obtaining the stream address corresponding to the target camera;

[0092] Step S2023, generating a stream address according to a preset rule, and recording the relationship between the target camera and the stream address.

[0093] In this embodiment, after receiving the viewing instruction from the platform server, the intermediate proxy module first checks whether there are other clients (second clients) in the memory that are pulling the stream for viewing the target camera. If there is a second client that is pulling the stream for viewing, the corresponding stream address is directly returned. After receiving the stream address returned by the intermediate proxy module, the platform server uses the stream address as a response to the viewing request of the first client. If there is no second client that is pulling the stream for viewing, a random stream address is generated for the target camera. For example, the generation rule of the stream address is: stream / MD5 ({camera identification}{current millisecond timestamp}), that is, the camera identification is appended with the current millisecond timestamp, and then the MD5 operation is performed on this string. The new string generated is the current latest unique stream address, where the camera identification (unique identification code) can be a device ID, device number, or MAC address. At the same time, the relationship between this camera and the stream address is also recorded in the memory. Through the technical solution of this embodiment, for the same camera, if any other client is pulling the stream, no repeated streaming will be performed. The stream address of this camera in the memory will be directly returned to the platform server to achieve video stream sharing and avoid waste of resources caused by repeated streaming.

[0094] Furthermore, in an optional embodiment, the camera control method of the present invention further includes:

[0095] If it is determined that no viewing instruction is received from the target camera within the preset time period, then the video stream is stopped from being pulled from the target camera, and the stream address corresponding to the target camera is deleted.

[0096] In this embodiment, if no client pulls the stream to view the target camera within a preset period of time (for example, 1 minute), the pulling and pushing of the stream are stopped, and the stream address corresponding to the target camera recorded in the memory is deleted, so as to ensure the security of the stream address.

[0097] The present invention also constructs an intermediate agent module, which includes a second processor and a second memory storing a second computer program. The second processor implements the steps of the camera control method described above when executing the second computer program.

[0098] Figure 3 It is a structural diagram of the first embodiment of the camera control system of the present invention. The control system of this embodiment includes a client, a camera, a streaming media server, a platform server, and an intermediate proxy module. Among them, the platform server and the intermediate proxy module transmit messages through the MQTT (Message Queuing Telemetry Transport) protocol, so the platform server includes an IoT server, an MQTT server (MQTT Broker) and an authentication module. It should be understood that in actual applications, the number of clients and cameras can be multiple, the number of intermediate proxy modules can also be multiple, and the intermediate proxy module can be built in the camera or externally connected to the camera.

[0099] The camera control system of the present invention can be applied to security systems, smart home systems, etc., providing users with a safer and more convenient way to remotely control intranet cameras.

[0100] Combine the following Figure 3 Describe the process of viewing or controlling cameras through the intermediate proxy module in the security system:

[0101] First of all, it should be noted that in the security system, an intermediate proxy module can be independently set around the camera, and the intermediate proxy module can be connected to multiple cameras at the same time.

[0102] In step S10, the manager (user) initiates a viewing request or a control request of the target camera through the security APP installed in his client (first client).

[0103] In step S11, after receiving the corresponding request, the IoT server sends the corresponding instruction through the MQTT protocol to trigger the intermediate proxy module to subscribe to this message.

[0104] In step S12, the intermediate proxy module pulls the RTSP real-time video stream from the specified target camera or performs corresponding PTZ control operations according to the instruction.

[0105] In step S13, after the RTSP video stream is pulled, the streaming media is pushed using RTMP. Specifically, if there is no client pulling the stream for the target camera being viewed, a random stream address is generated for this camera. The stream address generation rule is, for example: stream / MD5 ({device unique identification code}{current millisecond timestamp}), and the first half of the route can be freely changed. Moreover, the relationship between this camera and the stream address is recorded in the memory. If no client pulls the stream within a preset period of time, the push is stopped, and the stream address of this camera in the memory is deleted to ensure the security of the stream address. If any client is pulling the stream from the target camera, the stream will not be pushed again, and the stream address of this camera in the memory will be directly obtained to achieve shared video streams and avoid waste of resources caused by repeated pushes.

[0106] In step S14, after the streaming is successful or the target camera is successfully controlled, the intermediate proxy module reports the real-time streaming address or control success status information generated by the MQTT protocol to the IoT server.

[0107] In step S15, the IoT server receives and processes the data, and returns the latest stream address of the target camera to the user APP as a response.

[0108] In step S16, the client adds the user Token credentials of the current APP as a URL parameter through this address, generates a complete request link, and initiates a pull request to the streaming media server.

[0109] In step S17, after the streaming media server detects the client's streaming request, it obtains the user token credential information in the URL parameter and sends the requested user token to the authentication module of the platform server to verify the legitimacy of the token. If the verification fails, a 403 message is responded; if the verification passes, streaming is allowed.

[0110] Combine the following Figure 3 Describe the process of viewing or controlling a camera through an intermediate proxy module in a smart home system:

[0111] First of all, it should be noted that in the smart home system, the intermediate proxy module can be built into the camera, that is, the camera has the ability to communicate with the platform server through MQTT when it leaves the factory.

[0112] In step S10, a family member (user) initiates a request to view or control the camera device through the smart home APP installed on his client (first client).

[0113] In step S11, after receiving the corresponding request, the IoT server sends the corresponding instruction through the MQTT protocol to trigger the intermediate proxy module to subscribe to this message.

[0114] In step S12, the intermediate proxy module pulls the RTSP real-time video stream from the specified target camera or performs corresponding PTZ control operations according to the instruction.

[0115] In step S13, after the RTSP video stream is pulled, the streaming media is pushed using RTMP. Specifically, if there is no client pulling the stream for the target camera being viewed, a random stream address is generated for this camera. The stream address generation rule is, for example: stream / MD5 ({device unique identification code}{current millisecond timestamp}), and the first half of the route can be freely changed. Moreover, the relationship between this camera and the stream address is recorded in the memory. If no client pulls the stream within a preset period of time, the push is stopped, and the stream address of this camera in the memory is deleted to ensure the security of the stream address. If any client is pulling the stream from the target camera, the stream will not be pushed again, and the stream address of this camera in the memory will be directly obtained to achieve shared video streams and avoid waste of resources caused by repeated pushes.

[0116] In step S14, after the streaming is successful or the target camera is successfully controlled, the intermediate proxy module reports the real-time streaming address or control success status information generated by the MQTT protocol to the IoT server.

[0117] In step S15, the IoT server receives and processes the data, and returns the latest stream address of the target camera to the user APP as a response.

[0118] In step S16, the client uses this address to add the user token credentials of the current APP as a URL parameter to initiate a streaming request to the streaming media server.

[0119] In step S17, after the streaming media server detects the client's streaming request, it sends the requested user Token to the authentication module of the platform server to verify the legitimacy of the Token. If the verification fails, it responds with a 403 message; if the verification passes, streaming is allowed.

[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the claims of the present invention.

Claims

1. A camera control method, applied to a platform server, characterized in that: include: receiving a viewing request of a target camera input by a user from a first client; According to the viewing request, sending a viewing instruction of the target camera to the corresponding intermediate proxy module; Receiving a stream address from the intermediate proxy module and sending the stream address to the first client, wherein the intermediate proxy module determines the corresponding stream address after receiving the viewing instruction, pulls the video stream from the target camera, and pushes the video stream to a corresponding position of the streaming media server according to the stream address; Receiving a verification request from a streaming media server, and verifying a user token in the verification request, wherein after receiving the streaming address, the first client sends a stream pull request to the streaming media server according to the streaming address and the user token, and the streaming media server sends a verification request to the platform server according to the user token in the received stream pull request; When the verification is passed, first verification result information is sent to the first client to allow the first client to pull and play the video stream corresponding to the stream address in the streaming media server; When the verification fails, second verification result information is sent to the first client to prohibit the first client from pulling and playing the video stream corresponding to the stream address in the streaming media server.

2. The camera control method according to claim 1, characterized in that: Also includes: Receiving a control request of a target camera input by a user from a first client; According to the control request, a control instruction of the target camera is sent to the corresponding intermediate proxy module; Receive status return information from the intermediate agent module and send the status return information to the first client, wherein the intermediate agent module performs corresponding control operations on the target camera after receiving the control instruction and receives status return information from the target camera.

3. A camera control method, applied to an intermediate proxy module, characterized in that: include: Receiving a viewing instruction of a target camera from a platform server, wherein the platform server sends the viewing instruction of the target camera to a corresponding intermediate proxy module after receiving a viewing request of the target camera input by a user from the first client; According to the viewing instruction, a corresponding stream address is determined, and a video stream is pulled from the target camera, and the video stream is pushed to a corresponding position of a streaming media server according to the stream address; The stream address is sent to the platform server so that the platform server sends the stream address to the first client, and after receiving the stream address, the first client sends a stream pull request to the streaming media server according to the stream address and the user token; the streaming media server sends a verification request to the platform server according to the user token in the received stream pull request; the platform server verifies the user token in the verification request, and when the verification passes, sends first verification result information to the first client to allow the first client to play the video stream corresponding to the stream address in the streaming media server, and when the verification fails, sends second verification result information to the first client to prohibit the first client from playing the video stream corresponding to the stream address in the streaming media server.

4. The camera control method according to claim 3, characterized in that: Also includes: Receiving a control instruction of a target camera from a platform server, wherein the platform server sends the control instruction of the target camera to a corresponding intermediate proxy module after receiving a control request of the target camera input by a user from the first client; According to the control instruction, a corresponding control operation is performed on the target camera, and status return information is received from the target camera; The status return information is sent to the platform server, so that the platform server sends the status return information to the first client.

5. The camera control method according to claim 3, characterized in that: Determining the corresponding stream address includes: Step S221, determining whether there is a second client that is currently viewing the stream from the target camera, if so, executing step S222; if not, executing step S223; Step S222, obtaining the stream address corresponding to the target camera; Step S223, generating a stream address according to a preset rule, and recording the relationship between the target camera and the stream address.

6. The camera control method according to claim 5, characterized in that: Also includes: If it is determined that no viewing instruction from the target camera is received within a preset time period, then the video stream pulling from the target camera is stopped, and the stream address corresponding to the target camera is deleted.

7. The camera control method according to claim 5, characterized in that: The generating of the flow address according to the preset rule includes: Generate a stream address according to the identification information and current time information of the target camera.

8. A platform server, comprising a first processor and a first memory storing a first computer program, characterized in that: The first processor implements the steps of the camera control method described in claim 1 or 2 when executing the first computer program.

9. An intermediate proxy module, comprising a second processor and a second memory storing a second computer program, characterized in that: When executing the second computer program, the second processor implements the steps of the camera control method described in any one of claims 3-7.

10. A camera control system, characterized in that: include: Client side; Camera; Streaming media server; The platform server as claimed in claim 8; The intermediate proxy module as described in claim 9.