Synchronous photographing method for power monitoring equipment
By calculating the average loopback time using heartbeat commands in the power video surveillance device and delaying sending the photo command, the problem of difficulty in time synchronization between dual camera equipment is solved, and high-precision binocular photography is achieved.
Patent Information
- Application Number
- CN202310764060.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-12-27
AI Technical Summary
In the field of power video surveillance, it is difficult to achieve accurate time synchronization between dual camera devices, resulting in difficulty in taking photos at the same time at the millisecond level.
The wired network connection is performed by two monitoring devices under the same local area network, and the timestamps are synchronized with the upper computer respectively, and the heartbeat command is used to calculate the average heartbeat loop time, delaying the sending of the photo command to ensure that the device takes photos simultaneously within a certain time error range.
The time error control of the two devices in about 10 milliseconds is achieved, ensuring high-precision binocular photography, and coordinating the dual cameras to take photos at the same time.
Smart Images

Figure CN119211699A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of power transmission line monitoring, and in particular to a synchronous photographing method for power monitoring equipment. Background Art
[0002] Currently in the field of power transmission line video surveillance, the equipment photo-taking schedule is issued by the host computer. Each device initiates photo-taking at the specified time point. There is no communication between devices, and each device takes photos independently without interfering with each other.
[0003] In the field of power video surveillance, it is sometimes necessary to use image algorithms to measure distance. One of the binocular distance measurement solutions is to use dual cameras to take pictures at the same time. Generally, dual cameras are based on the same device. If they are based on two devices, the two devices need to take pictures synchronously.
[0004] However, because each device communicates with the host computer separately and the hardware performance of each device is different, it is difficult to achieve accurate time synchronization even with a time synchronization mechanism. If you want two devices to take photos at the same time very accurately within milliseconds, it will be difficult. Summary of the invention
[0005] The present invention provides a method for synchronous photographing of electric power monitoring equipment, which can ensure that two interconnected devices can accurately photograph within a certain time error range.
[0006] The present invention provides the following technical solutions:
[0007] A method for synchronously photographing an electric power monitoring device comprises a first monitoring device and a second monitoring device, wherein the first monitoring device and the second monitoring device are in the same local area network and are connected via a wired network, and the first monitoring device and the second monitoring device are respectively connected to a host computer via a network, and the method comprises:
[0008] S1: The first monitoring device and the second monitoring device communicate with the host computer respectively, and synchronize their own timestamps according to the timestamp of the host computer;
[0009] S2: The first monitoring device and the second monitoring device respectively obtain a photo-taking schedule from the host computer;
[0010] S3: When it is confirmed that synchronous photography is required according to the photography schedules of the first monitoring device and the second monitoring device, the first monitoring device and the second monitoring device enter a synchronous photography process;
[0011] S4: using one of the first monitoring device and the second monitoring device as a synchronization instruction server and the other as a synchronization instruction client, and using the synchronization instruction client to connect to the synchronization instruction server;
[0012] S5: After the synchronization instruction client is successfully connected to the synchronization instruction server, the synchronization instruction client continuously sends a heartbeat instruction to the synchronization instruction server at a fixed time interval frequency, and the synchronization instruction server immediately sends a heartbeat reply instruction to the synchronization instruction client after receiving the heartbeat instruction;
[0013] Wherein, the heartbeat instruction includes whether the photographing preparation state of the synchronization instruction client is ready, and the heartbeat reply instruction includes whether the photographing preparation state of the synchronization instruction server is ready;
[0014] S6: After receiving the heartbeat reply instruction, the synchronization instruction client records the heartbeat loop time from sending the heartbeat instruction to receiving the heartbeat reply instruction each time, and calculates the average heartbeat loop time Dms;
[0015] S7: When the shooting preparation states of the synchronization command client and the synchronization command server are both ready, the synchronization command client sends a shooting command to the synchronization command server, and the synchronization command server takes a photo immediately upon receiving the shooting command, and the synchronization command client takes a photo after a delay of Dms / 2 from when the shooting command is sent;
[0016] S8: The synchronization instruction client and the synchronization instruction server upload the photo-taking result to the host computer.
[0017] Furthermore, in S1, the first monitoring device and the second monitoring device communicate with the host computer via a wireless network respectively. When synchronizing heartbeats with the host computer, the first monitoring device and the second monitoring device synchronize their own timestamps respectively according to the host computer timestamp carried in the received heartbeat instruction.
[0018] Further, the S3 includes:
[0019] S31: The first monitoring device and the second monitoring device respectively set alarm tasks according to their own photo-taking schedules;
[0020] S32: When the photo-taking moment arrives, the alarm task wakes up the first monitoring device and the second monitoring device;
[0021] S33: Determine whether synchronous photography is required according to a preset flag. If so, the first monitoring device and the second monitoring device enter a synchronous photography process. Otherwise, the first monitoring device and the second monitoring device enter their respective photography processes, and upload their respective photography processes to the host computer after the photography is completed.
[0022] Furthermore, S4 includes that the synchronization command server and the synchronization command client each set a connection time limit. If the synchronization command client and the synchronization command server fail to connect successfully after the connection time limit has expired, the synchronization command server and the synchronization command client determine that the synchronized photo taking has failed and end.
[0023] Furthermore, Dms=(D1+D2+...+Dn) / n, where D1, D2, ..., Dn are heartbeat loop times from the 1st to the nth time respectively.
[0024] Furthermore, in S6, if the photo-taking preparation state of the synchronization instruction client or the synchronization instruction server is not ready within the specified time, it is determined that the synchronization photo-taking has timed out, and the synchronization instruction client sends a termination synchronization photo-taking instruction to the synchronization instruction server to end the synchronization photo-taking.
[0025] Furthermore, in S8, it is also checked whether the photographing is successful; the photographing result includes a flag indicating whether the photographing is successful, the photographing time and the final image file.
[0026] The present invention has the following beneficial effects:
[0027] The present invention performs synchronous photography on two interconnected monitoring devices, calculates the average heartbeat loop time Dms through multiple heartbeat instructions, and when the photography preparations of the two monitoring devices are ready, one monitoring device sends a photography instruction to the other monitoring device, and the other monitoring device takes a photo immediately after receiving the photography instruction, and the monitoring device that sends the photography instruction delays Dms / 2 to take the photo. Through the above-mentioned setting, the present invention can ensure that the two interconnected devices take photos accurately within a certain time error range, and the time difference of the photos obtained when taking photos is controlled within about 10 milliseconds. The present invention can coordinate the cameras on the two devices to take photos at the same time, and is a software implementation method for high-precision binocular photography. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of the connection between the first monitoring device, the second monitoring device and the host computer;
[0029] Figure 2 The present invention is a flow chart of the method for synchronously photographing power monitoring equipment. DETAILED DESCRIPTION
[0030] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0031] The embodiment of the present invention provides a method for synchronously photographing an electric power monitoring device, such as Figure 1As shown, it includes a first monitoring device 1 and a second monitoring device 2. The first monitoring device 1 and the second monitoring device 2 are in the same local area network and are connected through a wired network. The first monitoring device 1 and the second monitoring device 2 are respectively connected to a host computer 3 through the network.
[0032] The present invention requires that the two monitoring devices are connected via a network cable and have fixed IP addresses in the same network segment, that is, the two devices must be in the same local area network and have a physical connection to ensure network stability and reliability. Assume that the two devices that need to take photos synchronously are the first monitoring device 1 and the second monitoring device 2. The two devices have completely independent hardware and software systems, and the hardware and software are exactly the same. The difference is the configuration:
[0033] 1) The first monitoring device 1 and the second monitoring device 2 are respectively configured with different IP addresses for mutual communication, such as the first monitoring device 1 uses 192.168.44.11 and the second monitoring device 2 uses 192.168.44.12.
[0034] 2) Both the first monitoring device 1 and the second monitoring device 2 can be configured as a synchronization instruction client or a synchronization instruction server. For example, the first monitoring device 1 is configured as a synchronization instruction server, and the second monitoring device 2 is configured as a synchronization instruction client.
[0035] Furthermore, the two devices are required to be connected to the host computer 3 through the network, for example, they are connected to the I1 server (host computer) through the State Grid I1 protocol.
[0036] Based on the above scheme, the synchronous photographing method of the first monitoring device 1 and the second monitoring device 2 is as follows: Figure 2 As shown, including:
[0037] S1: The first monitoring device 1 and the second monitoring device 2 communicate with the host computer 3 respectively, and synchronize their own timestamps according to the timestamp of the host computer 3.
[0038] Specifically, the first monitoring device and the second monitoring device communicate with the host computer through a wireless network such as 4G or 5G, respectively. When synchronizing the heartbeat with the host computer, the first monitoring device and the second monitoring device respectively synchronize their own timestamps according to the host computer timestamp carried in the received heartbeat instruction.
[0039] There may still be a certain time difference after the two devices calibrate with the server. And because of the response time of the camera device, system scheduling and other reasons, although the two devices can theoretically take pictures at the same time, in reality the time difference is still relatively large and there will be differences, which will fluctuate within a few seconds to tens of seconds. What we need to do is to try to shorten the time difference when the two devices initiate taking pictures at the same time.
[0040] S2: The first monitoring device 1 and the second monitoring device 2 obtain a photo-taking schedule from the host computer 3 respectively.
[0041] Specifically, the first monitoring device and the second monitoring device communicate with the I1 server (host computer) via the 4G network to obtain the photo schedule. Generally, the photo schedules of the two devices are also the same.
[0042] S3: When it is confirmed that synchronous photography is required according to the photography schedules of the first monitoring device and the second monitoring device, the first monitoring device and the second monitoring device enter into a synchronous photography process.
[0043] A specific implementation of this step includes:
[0044] S31: The first monitoring device and the second monitoring device respectively set alarm tasks according to their own photo-taking schedules, so that when the photo-taking time indicated by the host computer arrives, the system can wake them up to perform the photo-taking task.
[0045] S32: When the photo-taking time arrives, the preset alarm task wakes up the first monitoring device and the second monitoring device, and starts executing the photo-taking task.
[0046] S33: Determine whether synchronous photography is required according to a preset flag. If so, the first monitoring device and the second monitoring device enter a synchronous photography process; otherwise, the first monitoring device and the second monitoring device enter their respective photography processes, and upload their respective photography processes to the host computer after completion.
[0047] When the photo task is executed, there will be a special flag to mark whether synchronous photo taking is required. If the flag indicates that synchronous photo taking is not required, the first monitoring device and the second monitoring device will enter the photo taking process respectively, and upload the photos to the host computer after each of them finishes taking photos. If the flag indicates that synchronous photo taking is required, the first monitoring device and the second monitoring device will enter the synchronous photo taking process respectively and start the synchronization preparation process.
[0048] S4: Use one of the first monitoring device and the second monitoring device as a synchronization instruction server, and the other as a synchronization instruction client, and use the synchronization instruction client to connect to the synchronization instruction server.
[0049] In this step, the synchronization command server and the synchronization command client each set a connection time limit. If the synchronization command client and the synchronization command server fail to connect successfully after the connection time limit, the synchronization command server and the synchronization command client determine that the synchronization photography has failed and end.
[0050] Specifically, when entering the synchronous photography process, the synchronous command server is started, and the photography preparation process is started at the same time. When the synchronous command server times out the connection time limit (for example, 60 seconds, 60 seconds is configurable), that is, when there is no synchronous command client connection for more than 60 seconds, it is automatically determined that this synchronous photography has failed and the photography process ends.
[0051] When entering the synchronous photography process, the synchronous command client is started and attempts are made to connect to the synchronous command server. If the connection fails, it will try to connect to the server again after a certain delay. If the connection is not successfully established after the specified connection time limit, the attempt will be stopped, and the synchronous photography will be automatically determined to have failed and the photography process will end.
[0052] S5: After the synchronization command client is successfully connected to the synchronization command server, the synchronization command client continuously sends heartbeat commands to the synchronization command server at a fixed time interval. After receiving the heartbeat command, the synchronization command server immediately sends a heartbeat reply command to the synchronization command client.
[0053] The heartbeat instruction includes whether the photographing preparation state of the synchronization instruction client is ready, and the heartbeat reply instruction includes whether the photographing preparation state of the synchronization instruction server is ready.
[0054] S6: After receiving the heartbeat reply instruction, the synchronization instruction client records the heartbeat loop time from sending the heartbeat instruction to receiving the heartbeat reply instruction each time, and calculates the average heartbeat loop time Dms (Duration in milliseconds).
[0055] When the shooting preparation states of the synchronization command client and the synchronization command server are both ready, the synchronization command client stops sending the heartbeat command and calculates the average heartbeat loop time Dms.
[0056] Wherein, Dms=(D1+D2+...+Dn) / n, D1, D2,..., Dn are the heartbeat loop times from the 1st to the nth time respectively.
[0057] If the photo-taking preparation status of the synchronization command client or the synchronization command server is not ready within the specified time (for example, 30 seconds), it is determined that the synchronization photo-taking timeout has occurred, and the synchronization command client sends a termination synchronization photo-taking instruction to the synchronization command server to end the synchronization photo-taking process, and the synchronization photo-taking process fails.
[0058] S7: When the shooting preparation states of the synchronization command client and the synchronization command server are both ready, the synchronization command client sends a shooting command to the synchronization command server. The synchronization command server takes a photo immediately upon receiving the shooting command, and the synchronization command client takes a photo after a delay of Dms / 2 from sending the shooting command.
[0059] Specifically, when the synchronization command client sends a photo command to the synchronization command server, it also sets a delayed photo action. Assuming that the time of sending the photo command is T1, the synchronization command client will start taking photos after a delay of Dms / 2, that is, the photo taking time of the synchronization command client should be: T1+Dms / 2. The synchronization command server takes photos immediately upon receiving the photo command. When the photo taking time T1+Dms / 2 preset by the synchronization command client arrives, the synchronization command client will also take photos immediately. Because the synchronization command client and the synchronization command server use a physical network connection and there is no other load, the network bandwidth and load are relatively stable. In theory, the photo taking action execution time of the synchronization command client and the synchronization command server will be basically the same, and the photo taking time error will be very small. After control, this time difference can be controlled to about 10 milliseconds or even shorter.
[0060] S8: The synchronization command client and the synchronization command server upload the photo taking results to the host computer.
[0061] After the synchronization command client and the synchronization command server have each completed the photo-taking action, they will check whether the photo-taking is successful. Regardless of whether the photo-taking is successful or not, the synchronization photo-taking process ends, and the synchronization command client and the synchronization command server will upload the photo-taking results to the host computer. The photo-taking results include the flag of whether the photo-taking is successful, the photo-taking time, and the final image file.
[0062] The present invention performs synchronous photography on two interconnected monitoring devices, calculates the average heartbeat loop time Dms through multiple heartbeat instructions, and when the photography preparations of the two monitoring devices are ready, one monitoring device sends a photography instruction to the other monitoring device, and the other monitoring device takes a photo immediately after receiving the photography instruction, and the monitoring device that sends the photography instruction delays Dms / 2 to take the photo. Through the above-mentioned setting, the present invention can ensure that the two interconnected devices take photos accurately within a certain time error range, and the time difference of the photos obtained when taking photos is controlled within about 10 milliseconds. The present invention can coordinate the cameras on the two devices to take photos at the same time, and is a software implementation method for high-precision binocular photography.
[0063] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for synchronously photographing electric power monitoring equipment, characterized in that: The method comprises a first monitoring device and a second monitoring device, wherein the first monitoring device and the second monitoring device are in the same local area network and connected via a wired network, and the first monitoring device and the second monitoring device are respectively connected to a host computer via a network, and the method comprises: S1: The first monitoring device and the second monitoring device communicate with the host computer respectively, and synchronize their own timestamps according to the timestamp of the host computer; S2: The first monitoring device and the second monitoring device respectively obtain a photo-taking schedule from the host computer; S3: When it is confirmed that synchronous photography is required according to the photography schedules of the first monitoring device and the second monitoring device, the first monitoring device and the second monitoring device enter a synchronous photography process; S4: using one of the first monitoring device and the second monitoring device as a synchronization instruction server and the other as a synchronization instruction client, and using the synchronization instruction client to connect to the synchronization instruction server; S5: After the synchronization instruction client is successfully connected to the synchronization instruction server, the synchronization instruction client continuously sends a heartbeat instruction to the synchronization instruction server at a fixed time interval frequency, and the synchronization instruction server immediately sends a heartbeat reply instruction to the synchronization instruction client after receiving the heartbeat instruction; Wherein, the heartbeat instruction includes whether the photographing preparation state of the synchronization instruction client is ready, and the heartbeat reply instruction includes whether the photographing preparation state of the synchronization instruction server is ready; S6: After receiving the heartbeat reply instruction, the synchronization instruction client records the heartbeat loop time from sending the heartbeat instruction to receiving the heartbeat reply instruction each time, and calculates the average heartbeat loop time Dms; S7: When the shooting preparation states of the synchronization command client and the synchronization command server are both ready, the synchronization command client sends a shooting command to the synchronization command server, and the synchronization command server takes a photo immediately upon receiving the shooting command, and the synchronization command client takes a photo after a delay of Dms / 2 from when the shooting command is sent; S8: The synchronization instruction client and the synchronization instruction server upload the photo taking result to the host computer.
2. The method for synchronous photographing of electric power monitoring equipment according to claim 1, characterized in that: In S1, the first monitoring device and the second monitoring device communicate with the host computer via a wireless network respectively. When synchronizing heartbeats with the host computer, the first monitoring device and the second monitoring device synchronize their own timestamps respectively according to the host computer timestamp carried in the received heartbeat instruction.
3. The method for synchronous photographing of electric power monitoring equipment according to claim 2, characterized in that: The S3 includes: S31: The first monitoring device and the second monitoring device respectively set alarm tasks according to their own photo-taking schedules; S32: When the photo-taking moment arrives, the alarm task wakes up the first monitoring device and the second monitoring device; S33: Determine whether synchronous photography is required according to a preset flag. If so, the first monitoring device and the second monitoring device enter a synchronous photography process. Otherwise, the first monitoring device and the second monitoring device enter their respective photography processes, and upload their respective photography processes to the host computer after the photography is completed.
4. The method for synchronous photographing of electric power monitoring equipment according to claim 3, characterized in that: The S4 includes that the synchronization command server and the synchronization command client each set a connection time limit. If the synchronization command client and the synchronization command server fail to connect successfully after the connection time limit, the synchronization command server and the synchronization command client determine that the synchronization photography fails and end.
5. The method for synchronous photographing of electric power monitoring equipment according to any one of claims 1 to 4, characterized in that: Dms=(D1+D2+...+Dn) / n, where D1, D2, ..., Dn are the heartbeat loop times from the 1st to the nth time respectively.
6. The method for synchronous photographing of electric power monitoring equipment according to claim 5, characterized in that: In S6, if the photographing preparation state of the synchronization instruction client or the synchronization instruction server is not ready within the specified time, it is determined that the synchronization photographing has timed out, and the synchronization instruction client sends a termination synchronization photographing instruction to the synchronization instruction server to end the synchronization photographing.
7. The method for synchronous photographing of electric power monitoring equipment according to claim 6, characterized in that: In S8, it is also checked whether the photographing is successful; the photographing result includes a flag indicating whether the photographing is successful, the photographing time and the final image file.
Citation Information
Cited By
Power system dynamic simulation device multi-equipment operation state snapshot shooting method and system
CN120980352A