A pan / tilt control method, device, system and computer readable storage medium
By converting the PTZ control request into the target PTZ control request of the corresponding protocol, the problem that PTZ equipment with different protocols requires different platform control is solved, consistent PTZ control options are realized, and development and maintenance costs are reduced.
Patent Information
- Application Number
- CN202211707142.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-12-27
AI Technical Summary
Gloss-table devices with different protocols need different platforms to control, resulting in streaming server developers need to develop different platforms, increasing development and maintenance costs.
By converting the PTZ control request into the target PTZ control request of the corresponding protocol according to the device protocol type in the PTZ control request, and redefining the calling interface and parameters, the communication methods and calling differences between PTZ protocols can be internally shielded. .
It provides consistent PTZ control options, avoids the problem of developing different platforms due to different PTZ protocols, and saves developers the energy to develop and maintain platforms.
Smart Images

Figure CN116032922B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of monitoring, and in particular to a pan / tilt control method, device, system and computer-readable storage medium. Background Art
[0002] There are many protocols used by PTZ devices to access streaming media servers, and the interaction methods of PTZ devices with different protocols are also different. For example, the currently more mainstream ONVIF protocol and GB28181 protocol, of which ONVIF protocol is an international standard, supported by most PTZs, and GB28181 protocol is a domestic standard, supported by mainstream domestic PTZs. When the PTZ uses the ONVIF protocol to access the streaming media server, the streaming media server needs to actively connect to the PTZ, communicate with the PTZ through the SOAP protocol, and send SOAP messages to achieve PTZ control. When the PTZ uses the GB28181 protocol to access the streaming media server, it will actively report to the streaming media server and register. The two communicate through the SIP protocol, and the streaming media server sends SIP signaling to the PTZ to achieve PTZ control. Since PTZ devices with different protocols require different platforms to control, streaming media server developers need to develop different platforms to support PTZ devices with different protocols, which increases development and maintenance costs. Summary of the invention
[0003] The purpose of the present invention is to provide a pan-tilt control method, device, system and computer-readable storage medium. The method converts the pan-tilt control request into a target pan-tilt control request of the corresponding protocol according to the device protocol type in the pan-tilt control request, redefines the calling interface and parameters, realizes internal shielding of the communication mode and calling differences between pan-tilt protocols, and provides consistent pan-tilt control options externally, avoiding the problem in the prior art that different platforms need to be developed to support pan-tilts of different protocols due to different pan-tilt protocols.
[0004] To achieve the above object, the present invention provides a pan / tilt control method, comprising:
[0005] Receive the PTZ control request sent by the client;
[0006] Converting the pan / tilt control request into a target pan / tilt control request of a corresponding protocol according to the device protocol in the pan / tilt control request;
[0007] The target pan-tilt control request is sent to the corresponding pan-tilt via the device address, so that the corresponding pan-tilt performs an operation according to the target pan-tilt control request.
[0008] Optionally, the receiving a pan / tilt control request sent by a client includes:
[0009] The client parses the request parameters input by the user and uses the parsed result as the pan / tilt control request; wherein the request parameters include device ID, device protocol, device action, moving direction, focal length adjustment, zoom speed and moving speed;
[0010] The server receives the pan / tilt control request sent by the client.
[0011] Optionally, the receiving a pan / tilt control request sent by a client includes:
[0012] Receive the pan / tilt control request sent by the client, where the device protocol is the ONVIF protocol.
[0013] Accordingly, converting the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to the device protocol in the pan-tilt control request includes:
[0014] The pan-tilt control request is converted into the target pan-tilt control request of the SOAP protocol according to the device protocol in the pan-tilt control request.
[0015] Optionally, the receiving a pan / tilt control request sent by a client includes:
[0016] Receive the pan / tilt control request sent by the client, where the device protocol is the GB28181 protocol.
[0017] Accordingly, converting the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to the device protocol in the pan-tilt control request includes:
[0018] The pan / tilt control request is converted into the target pan / tilt control request of the SIP protocol according to the device protocol in the pan / tilt control request.
[0019] To achieve the above object, the present invention further provides a pan / tilt control device, comprising:
[0020] The receiving module is used to receive the PTZ control request sent by the client;
[0021] A conversion module, used for converting the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to the device protocol in the pan-tilt control request;
[0022] The execution module is used to send the target pan-tilt control request to the corresponding pan-tilt via the device address, so that the corresponding pan-tilt performs an operation according to the target pan-tilt control request.
[0023] To achieve the above object, the present invention further provides a pan / tilt control system, comprising:
[0024] Client, used to send PTZ control requests to the server;
[0025] The server is used to receive a pan / tilt control request; convert the pan / tilt control request into a target pan / tilt control request of a corresponding protocol according to a device protocol in the pan / tilt control request; and send the target pan / tilt control request to a corresponding pan / tilt via a device address;
[0026] The PTZ is used to receive a target PTZ control request and perform an operation according to the target PTZ control request.
[0027] Optionally, the client includes:
[0028] The parsing unit is used to parse the request parameters input by the user and use the parsed results as the pan / tilt control request; wherein the request parameters include device ID, device protocol, device action, moving direction, focal length adjustment, zoom speed and moving speed.
[0029] Optionally, the server includes:
[0030] A first receiving unit, configured to receive the PTZ control request sent by the client, wherein the device protocol is the ONVIF protocol;
[0031] The first conversion unit converts the pan-tilt control request into the target pan-tilt control request of the SOAP protocol according to the device protocol in the pan-tilt control request.
[0032] Optionally, the server includes:
[0033] A second receiving unit is used to receive the PTZ control request sent by the client, where the device protocol is the GB28181 protocol;
[0034] The second conversion unit is used to convert the pan-tilt control request into the target pan-tilt control request of the SIP protocol according to the device protocol in the pan-tilt control request.
[0035] To achieve the above objectives, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above-mentioned pan-tilt control methods are implemented.
[0036] The present invention provides a pan-tilt control method, which comprises: receiving a pan-tilt control request sent by a client; converting the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to a device protocol in the pan-tilt control request; and sending the target pan-tilt control request to a corresponding pan-tilt via a device address, so that the corresponding pan-tilt performs an operation according to the target pan-tilt control request.
[0037] It can be seen that the method of the present invention converts the pan-tilt control request into a target pan-tilt control request of the corresponding protocol according to the device protocol type in the pan-tilt control request, redefines the calling interface and parameters, and realizes internal shielding of the communication methods and calling differences between pan-tilt protocols, and provides consistent pan-tilt control options externally. It avoids the problem in the prior art that different platforms need to be developed to support pan-tilts of different protocols due to different pan-tilt protocols, and can save developers' energy in developing and maintaining the platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0039] Figure 1 A flow chart of a pan / tilt control method provided by an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of a pan / tilt control method provided by an embodiment of the present invention;
[0041] Figure 3 A specific embodiment diagram of a pan / tilt control method provided by an embodiment of the present invention;
[0042] Figure 4 A structural block diagram of a pan / tilt control system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] 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.
[0044] The following combination Figure 1 , Figure 1 A flowchart of a pan / tilt control method provided by an embodiment of the present invention, the method may include:
[0045] S101: receiving a PTZ control request sent by a client.
[0046] The execution subject of this embodiment can be a streaming media server. Furthermore, this embodiment does not limit the specific type of server. It can be classified by chassis structure, such as desktop server, rack server, cabinet server and blade server; it can also be classified by purpose, such as general-purpose server and special-purpose server; it can also be classified by processor architecture, such as CISC (Complex Instruction Set Computer) server, RISC (Reduced Instruction Set Computing) server and VLIW (Very Long Instruction Word) server; it can also be classified by application level, such as entry-level server, workgroup-level server, department-level server and enterprise-level server.
[0047] This embodiment does not limit the specific connection method between the client and the streaming media server, which can be connected by wire or wirelessly. Furthermore, this embodiment does not limit the number of connected clients. This embodiment does not limit the generation method of the pan-tilt control request. Generally, the user can input the request parameters corresponding to the pan-tilt through the client, and the client analyzes the request parameters to obtain the pan-tilt control request, and the client sends the pan-tilt control request to the streaming media server. This embodiment does not limit the specific content of the request parameters, which can generally be commonly used and general, such as device ID (Identity Document), device protocol, device action, moving direction, focal length adjustment, zoom speed and moving speed. This embodiment does not limit the specific content of the request parameters. For example, the movement direction of the device can be set to other movement directions besides up, down, left and right. After the user inputs the command according to the above request parameters, the client parses the request parameters. This embodiment does not limit the parsed content of the request parameters. Among them, since ONVIF (OpenNetwork Video Interface Forum) protocol and GB28181 protocol are two more commonly used pan-tilt protocols, in this embodiment, the device protocol can be parsed into ONVIF, GB28181 and other types, the device action can be parsed into move and stop, the movement direction can be parsed into up, down, left and right, the focal length adjustment can be parsed into zoom in and out, the zoom speed can be parsed into an integer between 1 and 10, and the movement speed can be parsed into an integer between 1 and 10.
[0048] Furthermore, if the client determines that the parsed device protocol type is not a supported protocol preset by the client, the client will issue a protocol incompatibility notification and will not send a control request. For example, if the conversion service in the streaming media server includes the ONVIF protocol and the GB28181 protocol, then for other protocol types other than these two protocols, the client will issue a protocol incompatibility notification. However, the method of this embodiment does not only support these two protocols. If the streaming media server is equipped with conversion services for other types of protocols, then the client can also parse the request parameters of other protocol types, and generate a pan-tilt control request and send it to the streaming media server.
[0049] S102: Convert the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to the device protocol in the pan-tilt control request.
[0050] In this embodiment, since the ONVIF protocol is an international universal standard, most pan-tilt heads support it, and the GB28181 protocol is a domestic standard, and domestic mainstream pan-tilt head devices also support it, the streaming media server in this embodiment can be a streaming media server with ONVIF protocol and GB28181 protocol conversion services. When the pan-tilt head uses the ONVIF protocol to access the streaming media server, the streaming media server needs to actively connect to the pan-tilt head, communicate with the pan-tilt head through the SOAP protocol, and send SOAP (Simple Object Access Protocol) messages to achieve pan-tilt head control. When the pan-tilt head uses the GB28181 protocol to access the streaming media server, it will actively report to and register with the streaming media server. The two communicate through the SIP (Session Initiation Protocol) protocol. The streaming media server sends SIP signaling to the pan-tilt head to achieve pan-tilt head control. The specific process can be as follows. Figure 2 shown.
[0051] In this embodiment, the streaming media server makes a judgment based on the device protocol type in the pan-tilt control request sent by the client. If it is judged to be the ONVIF protocol, the streaming media server can access the database based on the device ID in the pan-tilt control request to query the specific information of the device. The device information may include the device IP (Internet Protocol) address, device user name, and device password. The streaming media server then interacts with the pan-tilt through the SOAP protocol based on the request parameters and device information, and finally generates a target pan-tilt control request that supports SOAP protocol messages. If it is judged to be the GB28181 protocol, the streaming media server generates an 8-byte PTZ instruction based on the device action, moving direction, focal length adjustment, zoom speed, and moving speed in the pan-tilt control request sent by the client, and generates the generated instruction, the device ID in the pan-tilt control request, and a self-incrementing SN (Sum Number) as the target pan-tilt control request of the SIP protocol.
[0052] Further, this embodiment does not limit the specific steps for the streaming media server to convert the PTZ control request into the target PTZ control request. Generally, when converting the target PTZ control request of the SOAP protocol, the streaming media server can send a SOAP message that calls the Get Capabilities interface in the ONVIF protocol to the PTZ according to the device IP address, and obtain the service address of the PTZ media module and the PTZ (Pan Tilt Zoom, full range movement and lens zoom and zoom control) module. Then, according to the obtained media module service address, as well as the device user name and device password information, a SOAP protocol message that calls the GetProfiles interface in the ONVIF protocol is sent to the PTZ to obtain the Profile Token of the PTZ. The streaming media server judges the device action in the PTZ control request. If it is judged that the device action in the PTZ control request is to stop, the Stop interface in the ONVIF protocol can be used to assign the Profile Token attribute value in the interface to the value of the Profile token of the PTZ, and set the PTZ attribute values in the interface to false, and finally generate the target PTZ control request converted into a SOAP message.
[0053] In this embodiment, when it is determined that the device action in the pan-tilt control is moving, the Continuous Move interface in the ONVIF protocol can be used, and the Profile Token attribute value in the interface is assigned to the attribute value of the Profile token in the pan-tilt. The streaming media server processes the moving direction, focal length adjustment, zoom speed and moving speed in the pan-tilt control request. When the moving direction in the pan-tilt control request is up, the moving speed of the pan-tilt control request is multiplied by 0.1 and the result is assigned to the y attribute under the Pan Tilt (horizontal and vertical movement) attribute in the interface; when the moving direction in the pan-tilt control request is down, the moving speed is multiplied by -0.1 and the result is assigned to the y attribute under the Pan Tilt attribute in the interface; when the moving direction in the pan-tilt control request is left, the moving speed is multiplied by -0.1 and the result is assigned to the x attribute under the PanTilt attribute in the interface; when the moving direction in the pan-tilt control request is right, the moving speed is multiplied by 0.1 and the result is assigned to the Pan Tilt attribute in the interface. The x attribute under the Tilt attribute; when the focus is adjusted to zoom in in the gimbal control request, the zoom speed is multiplied by 0.1 and assigned to the x attribute under the Zoom attribute in the interface; when the focus is adjusted to zoom out in the gimbal control request, the zoom speed is multiplied by 0.1 and assigned to the x attribute under the Zoom attribute in the interface, and finally the target gimbal control request of the SOAP message is generated.
[0054] Further, in this embodiment, when converting the target PTZ control request of the SIP protocol, if the device action in the PTZ control request is stop, the PTZ instruction can be directly assigned as: A50F01017D000033. If the device action in the PTZ control request is move, the moving speed and zoom speed are first processed, and the moving speed in the PTZ control request can be converted into a byte of two hexadecimal digits. When the moving direction is left or right, the moving speed can be set in the 5th byte of the PTZ instruction; when the moving direction is up or down, the moving speed can be set in the 6th byte of the PTZ instruction; when the focal length is adjusted to zoom in or out, the zoom speed can be set to the high 4 bits of the 7th byte of the PTZ instruction, and the low 4 bits are set to 0H. Then the moving direction is processed. When the moving direction is right, the fourth byte of the PTZ instruction can be set to 01H; when the moving direction is left, the fourth byte of the PTZ instruction can be set to 02H; when the moving direction is down, the fourth byte of the PTZ instruction can be set to 04H; when the moving direction is up, the fourth byte of the PTZ instruction can be set to 08H; when the focus is adjusted to zoom in, the fourth byte of the PTZ instruction can be set to 10H; when the focus is adjusted to zoom out, the fourth byte of the PTZ instruction can be set to 20H. Finally, the 8th byte of the PTZ instruction is set to the lower 8 bits of the arithmetic sum of the first 7 bytes. The first three bytes default to A5H, 0FH and 01H, and the remaining bytes not mentioned default to 00H. The above steps generate the corresponding PTZ instruction according to the PTZ control request. The streaming media server then generates the final SIP protocol target PTZ control request with the PTZ control instruction, the device ID in the PTZ control request, and a self-incrementing SN.
[0055] S103: Sending the target PTZ control request to the corresponding PTZ through the device address, so that the corresponding PTZ performs an operation according to the target PTZ control request.
[0056] In this embodiment, the IP address of the connected PTZ device is stored in the database of the streaming media server, and the corresponding device IP address is found through the device ID in the PTZ control protocol. The target control request that is finally converted is sent to the corresponding PTZ through the device IP address. After receiving the target PTZ control request, the corresponding PTZ performs the corresponding operation according to the command in the request. Furthermore, this embodiment does not limit the number of PTZs connected to the streaming media server, nor does it limit the connection method with the PTZ. It can be a wired network connection or a wireless network connection. The transmission speed of the wired network connection is faster and more stable, and the wireless network connection eliminates the problem of wiring. The specific connection method can be selected according to the actual usage scenario.
[0057] This embodiment converts the pan-tilt control request into a target pan-tilt control request of the corresponding protocol according to the device protocol type in the pan-tilt control request, redefines the calling interface and parameters, and shields the communication methods and calling differences between pan-tilt protocols internally, while providing consistent pan-tilt control options externally. This avoids the problem in the prior art of needing to develop different platforms to support pan-tilts of different protocols due to different pan-tilt protocols, and can save developers' energy in developing and maintaining the platform.
[0058] The following combination Figure 3 , Figure 3 A specific embodiment diagram of a pan-tilt control method provided by an embodiment of the present invention, wherein the execution subject may be a streaming media server, and the pan-tilt device may be a pan-tilt device supporting the ONVIF protocol and a pan-tilt device supporting the GB28181 protocol. The specific embodiment may include:
[0059] 1. The streaming media server receives the PTZ control request sent by the client
[0060] 2. Determine the protocol type of the PTZ according to the device protocol in the PTZ control request
[0061] 3. If it is determined to be the ONVIF protocol, query the device information of the PTZ according to the device ID in the PTZ control request and go to 4.
[0062] 4. Obtain the PTZ Profile Token and PTZ module service address based on the device information, and go to 5 or 6.
[0063] 5. If the device action in the PTZ control request is moving, assign the PTZ Profile Token to the Continuous Move interface Profile Token, and then set the PTZ attribute value of the interface according to the PTZ control request to generate the target PTZ control request of the SOAP protocol, and go to 9.
[0064] 6. If the device action in the PTZ control request is stop, assign the PTZ Profile Token to the Stop interface Profile Token, and then set the PTZ attribute value of the interface according to the PTZ control request to generate the target PTZ control request of the SOAP protocol, and go to 9.
[0065] 7. If it is determined to be the GB28181 protocol, generate an 8-byte PTZ command based on the PTZ control request and go to 8.
[0066] 8. Generate a target PTZ control request of the SIP protocol using the PTZ command, the device ID in the PTZ control request and a self-incrementing SN, and go to 9.
[0067] 9. Send the target PTZ control request to the corresponding PTZ through the device address so that the corresponding PTZ performs the operation.
[0068] The following is an introduction to the pan-tilt control device, system and computer-readable storage medium provided in the embodiments of the present invention. The pan-tilt control device, system and computer-readable storage medium described below can be referenced to the pan-tilt control method described above.
[0069] The present invention provides a pan / tilt control device, which may include:
[0070] The receiving module 10 is used to receive the PTZ control request sent by the client;
[0071] A conversion module 20, configured to convert the pan / tilt control request into a target pan / tilt control request of a corresponding protocol according to a device protocol in the pan / tilt control request;
[0072] The execution module 30 is used to send the target pan-tilt control request to the corresponding pan-tilt via the device address, so that the corresponding pan-tilt performs an operation according to the target pan-tilt control request.
[0073] The following combination Figure 4 , Figure 4 A structural block diagram of a pan / tilt control system provided by an embodiment of the present invention, the system may include:
[0074] The client 100 is used to send a PTZ control request to the server;
[0075] The server 200 is used to receive a pan / tilt control request; convert the pan / tilt control request into a target pan / tilt control request of a corresponding protocol according to a device protocol in the pan / tilt control request; and send the target pan / tilt control request to a corresponding pan / tilt via a device address;
[0076] The PTZ 300 is configured to receive a target PTZ control request and perform an operation according to the target PTZ control request.
[0077] Based on the above embodiments, the present invention converts the pan-tilt control request into a target pan-tilt control request of the corresponding protocol according to the device protocol type in the pan-tilt control request, redefines the calling interface and parameters, and realizes internal shielding of the communication methods and calling differences between pan-tilt protocols, and provides consistent pan-tilt control options externally. It avoids the problem in the prior art that different platforms need to be developed to support pan-tilts of different protocols due to different pan-tilt protocols, and can save developers' energy in developing and maintaining the platform.
[0078] Based on the above embodiments, the client 100 may include:
[0079] The parsing unit is used to parse the request parameters input by the user and use the parsed results as the pan / tilt control request; wherein the request parameters include device ID, device protocol, device action, moving direction, focal length adjustment, zoom speed and moving speed.
[0080] Based on the above embodiments, the server 200 may include:
[0081] A first receiving unit, configured to receive the PTZ control request sent by the client, wherein the device protocol is the ONVIF protocol;
[0082] The first conversion unit converts the pan-tilt control request into the target pan-tilt control request of the SOAP protocol according to the device protocol in the pan-tilt control request.
[0083] Based on the above embodiments, the server 200 includes:
[0084] A second receiving unit is used to receive the PTZ control request sent by the client, where the device protocol is the GB28181 protocol;
[0085] The second conversion unit is used to convert the pan-tilt control request into the target pan-tilt control request of the SIP protocol according to the device protocol in the pan-tilt control request.
[0086] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by an execution terminal or a processor, the pan-tilt control method provided in the embodiment of the present invention can be implemented; the storage medium may include: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0087] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0088] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0089] The above is a detailed introduction to a pan-tilt control method, device, system and computer-readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A pan / tilt control method, characterized in that: include: Receive the PTZ control request sent by the client; Converting the pan / tilt control request into a target pan / tilt control request of a corresponding protocol according to the device protocol in the pan / tilt control request; Sending the target PTZ control request to the corresponding PTZ through the device address, so that the corresponding PTZ performs an operation according to the target PTZ control request; The receiving of the PTZ control request sent by the client includes: The client parses the request parameters input by the user and uses the parsed results as the pan / tilt control request; the request parameters include the device ID, the device protocol, the device action, the moving direction, the focal length adjustment, the zoom speed and the moving speed; the device action is parsed as moving and stopping, the moving direction is parsed as up, down, left and right, the focal length adjustment is parsed as zooming in and out, the zoom speed is parsed as an integer between 1 and 10, and the moving speed is parsed as an integer between 1 and 10; the server receives the pan / tilt control request sent by the client; and if the client determines that the parsed device protocol type is not a supported protocol preset by the client, the client will notify the protocol incompatibility and will not send the control request; Wherein, the receiving of the pan-tilt control request sent by the client includes: receiving the pan-tilt control request sent by the client, wherein the device protocol is the ONVIF protocol; correspondingly, converting the pan-tilt control request into a target pan-tilt control request of the corresponding protocol according to the device protocol in the pan-tilt control request includes: accessing a database to query the device information of the device according to the device ID in the pan-tilt control request, wherein the device information includes the device IP address, the device user name, and the device password; interacting with the pan-tilt through the SOAP protocol according to the request parameters and the device information, and generating a target pan-tilt control request that supports SOAP protocol messages; Or, the receiving of the pan-tilt control request sent by the client includes: receiving the pan-tilt control request sent by the client, wherein the device protocol is the GB28181 protocol; correspondingly, converting the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to the device protocol in the pan-tilt control request includes: generating an 8-byte PTZ omnidirectional movement and lens magnification and zoom control instruction according to the device action, moving direction, focal length adjustment, zoom speed and moving speed in the pan-tilt control request sent by the client, and generating the generated instruction, the device ID in the pan-tilt control request and a self-incrementing SN total count as a target pan-tilt control request of the SIP protocol; Among them, when converting the target PTZ control request of the SOAP protocol, according to the device IP address, a SOAP message calling the Get Capabilities interface in the ONVIF protocol is sent to the PTZ to obtain the service addresses of the PTZ media module and the PTZ module; according to the obtained media module service address, as well as the device username and device password information, a SOAP protocol message calling the Get Profiles interface in the ONVIF protocol is sent to the PTZ to obtain the Profile Token of the PTZ; the device action in the PTZ control request is judged, and if the device action in the PTZ control request is judged to be stop, the Stop interface in the ONVIF protocol is used, and the ProfileToken attribute value in the interface is assigned to the value of the Profile token of the PTZ, and the PTZ attribute values in the interface are all set to false, and finally the target PTZ control request converted to a SOAP message is generated; when it is judged that the device action in the PTZ control is moving, the Continuous Move interface in the ONVIF protocol is used, and the Profile Token attribute value in the interface is assigned to the Profile Token in the PTZ. The attribute value of token; process the moving direction, focal length adjustment, zoom speed and moving speed in the gimbal control request. When the moving direction in the gimbal control request is up, multiply the moving speed of the gimbal control request by 0.1 and assign the result to the y attribute under the Pan Tilt horizontal and vertical moving attributes in the interface; when the moving direction in the gimbal control request is down, multiply the moving speed by -0.1 and assign the result to the y attribute under the Pan Tilt attribute in the interface; when the moving direction in the gimbal control request is left, multiply the moving speed by -0.1 and assign the result to the x attribute under the Pan Tilt attribute in the interface; when the moving direction in the gimbal control request is right, multiply the moving speed by 0.1 and assign the result to the x attribute under the Pan Tilt attribute in the interface; finally generate the target gimbal control request of the SOAP message.
2. A pan / tilt control device, characterized in that: include: The receiving module is used to receive the PTZ control request sent by the client; A conversion module, used for converting the pan-tilt control request into a target pan-tilt control request of a corresponding protocol according to the device protocol in the pan-tilt control request; An execution module, used for sending the target pan-tilt control request to the corresponding pan-tilt via a device address, so that the corresponding pan-tilt performs an operation according to the target pan-tilt control request; The receiving module is used for: the client parses the request parameters input by the user and uses the parsed results as the pan-tilt control request; the request parameters include the device ID, the device protocol, the device action, the moving direction, the focal length adjustment, the zoom speed and the moving speed; the device action is parsed as moving and stopping, the moving direction is parsed as up, down, left and right, the focal length adjustment is parsed as zooming in and out, the zoom speed is parsed as an integer between 1 and 10, and the moving speed is parsed as an integer between 1 and 10; the server receives the pan-tilt control request sent by the client; and if the client determines that the parsed device protocol type is not a supported protocol preset by the client, the client will notify the protocol incompatibility and will not send the control request; The receiving module is used to: receive the PTZ control request sent by the client, the device protocol of which is the ONVIF protocol; correspondingly, the conversion module is used to: access the database according to the device ID in the PTZ control request to query the device information of the device, the device information includes the device IP address, device user name, and device password; interact with the PTZ through the SOAP protocol according to the request parameters and the device information, and generate a target PTZ control request that supports SOAP protocol messages; Or, the receiving module is used to: receive the pan-tilt control request sent by the client whose device protocol is the GB28181 protocol; correspondingly, the conversion module is used to generate an 8-byte PTZ omnidirectional movement and lens zoom control instruction according to the device action, moving direction, focal length adjustment, zoom speed and moving speed in the pan-tilt control request sent by the client, and generate the generated instruction, the device ID in the pan-tilt control request and a self-incrementing SN total count as a target pan-tilt control request of the SIP protocol; Among them, when converting the target PTZ control request of the SOAP protocol, according to the device IP address, a SOAP message calling the Get Capabilities interface in the ONVIF protocol is sent to the PTZ to obtain the service addresses of the PTZ media module and the PTZ module; according to the obtained media module service address, as well as the device username and device password information, a SOAP protocol message calling the Get Profiles interface in the ONVIF protocol is sent to the PTZ to obtain the Profile Token of the PTZ; the device action in the PTZ control request is judged, and if the device action in the PTZ control request is judged to be stop, the Stop interface in the ONVIF protocol is used, and the ProfileToken attribute value in the interface is assigned to the value of the Profile token of the PTZ, and the PTZ attribute values in the interface are all set to false, and finally the target PTZ control request converted to a SOAP message is generated; when it is judged that the device action in the PTZ control is moving, the Continuous Move interface in the ONVIF protocol is used, and the Profile Token attribute value in the interface is assigned to the Profile Token in the PTZ. The attribute value of token; process the moving direction, focal length adjustment, zoom speed and moving speed in the gimbal control request. When the moving direction in the gimbal control request is up, multiply the moving speed of the gimbal control request by 0.1 and assign the result to the y attribute under the Pan Tilt horizontal and vertical moving attributes in the interface; when the moving direction in the gimbal control request is down, multiply the moving speed by -0.1 and assign the result to the y attribute under the Pan Tilt attribute in the interface; when the moving direction in the gimbal control request is left, multiply the moving speed by -0.1 and assign the result to the x attribute under the Pan Tilt attribute in the interface; when the moving direction in the gimbal control request is right, multiply the moving speed by 0.1 and assign the result to the x attribute under the Pan Tilt attribute in the interface; finally generate the target gimbal control request of the SOAP message.
3. A pan / tilt control system, characterized in that: include: Client, used to send PTZ control requests to the server; Server, used to receive PTZ control requests; Converting the pan / tilt control request into a target pan / tilt control request of a corresponding protocol according to the device protocol in the pan / tilt control request; and sending the target pan / tilt control request to the corresponding pan / tilt via the device address; The PTZ is used to receive a target PTZ control request and perform an operation according to the target PTZ control request; Wherein, the client comprises: A parsing unit, used to parse the request parameters input by the user, and use the parsed results as the pan / tilt control request; wherein the request parameters include device ID, device protocol, device action, moving direction, focal length adjustment, zoom speed and moving speed; the device action is parsed as moving and stopping, the moving direction is parsed as up, down, left and right, the focal length adjustment is parsed as zooming in and out, the zoom speed is parsed as an integer between 1 and 10, and the moving speed is parsed as an integer between 1 and 10; and if the client determines that the parsed device protocol type is not a supported protocol preset by the client, the client will notify the protocol incompatibility and will not send the control request; Wherein, the server comprises: A first receiving unit is used to receive the PTZ control request sent by the client, wherein the device protocol is the ONVIF protocol; a first conversion unit is used to access a database according to the device ID in the PTZ control request to query the device information of the device, wherein the device information includes the device IP address, the device user name, and the device password; and interact with the PTZ through the SOAP protocol according to the request parameters and the device information to generate a target PTZ control request that supports SOAP protocol messages; Or, the server comprises: A second receiving unit is used to receive the PTZ control request sent by the client, where the device protocol is the GB28181 protocol; The second conversion unit is used to generate an 8-byte PTZ full-range movement and lens zoom control instruction according to the device action, moving direction, focal length adjustment, zoom speed and moving speed in the PTZ control request sent by the client, and generate the generated instruction, the device ID in the PTZ control request and a self-incrementing SN total count as a target PTZ control request of the SIP protocol; Among them, when converting the target PTZ control request of the SOAP protocol, according to the device IP address, a SOAP message calling the Get Capabilities interface in the ONVIF protocol is sent to the PTZ to obtain the service addresses of the PTZ media module and the PTZ module; according to the obtained media module service address, as well as the device username and device password information, a SOAP protocol message calling the Get Profiles interface in the ONVIF protocol is sent to the PTZ to obtain the Profile Token of the PTZ; the device action in the PTZ control request is judged, and if the device action in the PTZ control request is judged to be stop, the Stop interface in the ONVIF protocol is used, and the ProfileToken attribute value in the interface is assigned to the value of the Profile token of the PTZ, and the PTZ attribute values in the interface are all set to false, and finally the target PTZ control request converted to a SOAP message is generated; when it is judged that the device action in the PTZ control is moving, the Continuous Move interface in the ONVIF protocol is used, and the Profile Token attribute value in the interface is assigned to the Profile Token in the PTZ. The attribute value of token; process the moving direction, focal length adjustment, zoom speed and moving speed in the gimbal control request. When the moving direction in the gimbal control request is up, multiply the moving speed of the gimbal control request by 0.1 and assign the result to the y attribute under the Pan Tilt horizontal and vertical moving attributes in the interface; when the moving direction in the gimbal control request is down, multiply the moving speed by -0.1 and assign the result to the y attribute under the Pan Tilt attribute in the interface; when the moving direction in the gimbal control request is left, multiply the moving speed by -0.1 and assign the result to the x attribute under the Pan Tilt attribute in the interface; when the moving direction in the gimbal control request is right, multiply the moving speed by 0.1 and assign the result to the x attribute under the Pan Tilt attribute in the interface; finally generate the target gimbal control request of the SOAP message.
4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the pan / tilt control method as claimed in claim 1 are implemented.