A method and device for compensating data, a storage medium, and an electronic device

By regularly monitoring the status indicators of network equipment and selecting equipment with better network status for compensation operations, the problem of frame drops during IPC transmission in a weak network environment is solved, and the complete data transmission and stability of live video broadcast is achieved.

CN119342180BActive Publication Date: 2025-06-20ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411870245.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-06-20
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

In a weak network environment, the IPC in the network monitoring system cannot save all transmitted data in real time due to no memory card and small built-in cache, resulting in stuttering of live videos, poor visual display effect, and frame loss problems.

Method used

By periodically determining the network status indicators of all network devices connected to the target device, when the data sent by the first network device is not received, the second network device with a good network status is selected for compensation operation, obtain the cached data of the first network device and send it to the target device.

Benefits of technology

It realizes the failed cached data forwarding of the first network device through the second network device with a better network status in a weak network environment, solves the problem of frame drops during data transmission, and ensures the complete transmission of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342180B_ABST
    Figure CN119342180B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, apparatus, storage medium, and electronic device for data compensation. The method includes: determining network status indicators of all network devices connected to a target device according to a predetermined time period; in the case where first data sent by a first network device included in the network devices is not received, determining a second network device included in the network devices based on the network status indicators, where the network status indicator of the second network device is greater than that of other network devices except the second network device included in the network devices; sending a first compensation request to the second network device to instruct the second network device to perform a compensation operation, where the compensation operation includes obtaining cached data of the first network device and sending the cached data to the target device. Through the present invention, the problem of frame loss in the data transmission process in the related art is solved, and the effect of complete data transmission is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of pulling video streams for security monitoring, and in particular, to a method, device, storage medium, and electronic device for compensating data. Background Art

[0002] In the related art, for a network monitoring system, due to factors such as the IPC being restricted by its own lack of a memory card and small built-in cache, it is unable to save all the transmitted data in real time in a weak network environment, resulting in the phenomenon of live video stuttering and poor visual display effects.

[0003] It can be seen from this that there is a problem of frame loss in the data transmission process in the related art.

[0004] In view of the above problems existing in the related art, no effective solution has been proposed yet. Summary of the Invention

[0005] The embodiments of the present invention provide a method, device, storage medium, and electronic device for compensating data, so as to at least solve the problem of frame loss in the data transmission process existing in the related art.

[0006] According to an embodiment of the present invention, a method for compensating data is provided, including: determining network status indicators of all network devices connected to a target device according to a predetermined time period; in the case of not receiving first data sent by a first network device included in the network devices, determining a second network device included in the network devices based on the network status indicators, where the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network devices except the second network device; sending a first compensation request to the second network device to instruct the second network device to perform a compensation operation, where the compensation operation includes obtaining cache data of the first network device and sending the cache data to the target device.

[0007] According to another embodiment of the present invention, there is provided a data compensation device, including: a first determination module, configured to determine network status metrics of all network devices connected to a target device according to a predetermined time period; a second determination module, configured to, in the case that first data sent by a first network device included in the network devices is not received, determine a second network device included in the network devices based on the network status metrics, wherein the network status metrics of the second network device are greater than those of other network devices included in the network devices except the second network device; an execution module, configured to send a first compensation request to the second network device to instruct the second network device to perform a compensation operation, wherein the compensation operation includes obtaining cached data of the first network device and sending the cached data to the target device.

[0008] According to another embodiment of the present invention, there is provided a data compensation device, including: a receiving module, configured to receive network status metrics of all network devices connected to a target device sent by the target device; a third determination module, configured to, in the case that it is determined that sending first data to the target device fails, determine a second network device included in the network devices based on the network status metrics, wherein the network status metrics of the second network device are greater than those of other network devices included in the network devices except the second network device; a second execution module, configured to send a second compensation request to the second network device to instruct the second network device to perform a compensation operation, wherein the compensation operation includes obtaining cached data of a first network device and sending the cached data to the target device.

[0009] According to still another embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0010] According to still another embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0011] According to still another embodiment of the present invention, there is also provided a computer program product, including a computer program, wherein the steps of the methods described in various embodiments of the present application are implemented when the computer program is executed by a processor.

[0012] Through the present invention, in the case where the first data sent by the first network device is not received, the second network device among all network devices is determined according to the network status indicators of all network devices connected to the target device within a predetermined time period, and a first compensation request is sent to the second network device to instruct the second network device to perform a compensation operation, so as to realize forwarding, by the second network device with good network status, the cached data that fails to be sent by the first network device, achieving the effect of frame compensation. Therefore, the problem of frame loss in the data transmission process in the related art can be solved, and the effect of complete data transmission is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a hardware structure block diagram of a mobile terminal for a data compensation method according to an embodiment of the present invention;

[0014] Figure 2 is a flowchart of a data compensation method according to an embodiment of the present invention Figure 1 ;

[0015] Figure 3 is a schematic diagram of NVR forwarding frame compensation according to an embodiment of the present invention;

[0016] Figure 4 is a topology diagram of NVR regularly synchronizing network status tables according to an embodiment of the present invention;

[0017] Figure 5 is a schematic diagram of an NVR frame compensation request process according to an embodiment of the present invention;

[0018] Figure 6 is a schematic diagram of NVR receiving and forwarding frame compensation forwarded by IPC according to an embodiment of the present invention;

[0019] Figure 7 is a schematic diagram of NVR filling the forwarded frame compensation into the buffer according to an embodiment of the present invention;

[0020] Figure 8 is a flowchart of a data compensation method according to an embodiment of the present invention Figure 2 ;

[0021] Figure 9 is a schematic diagram of IPC forwarding frame compensation according to an embodiment of the present invention;

[0022] Figure 10 is a flowchart of IPC forwarding frame compensation according to an embodiment of the present invention;

[0023] Figure 11 is a structure block of a data compensation device according to an embodiment of the present invention Figure 1 ;

[0024] Figure 12Structure block diagram of the data compensation device according to an embodiment of the present invention Figure 2 . Detailed implementation manners

[0025] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.

[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.

[0027] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is the hardware structure block diagram of a mobile terminal of a data compensation method according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in the figure is only schematic, and it does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown in the figure.

[0028] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the data compensation method in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of a mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, a data compensation method 1 is provided. Figure 2 It is a flowchart of the data compensation method according to the embodiment of the present invention, as Figure 2 shown, and the process includes the following steps:

[0031] Step S202, determine the network status indicators of all network devices connected to the target device according to a predetermined time period;

[0032] Step S204, in the case where the first data sent by the first network device included in the network device is not received, determine the second network device included in the network device based on the network status indicator, where the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network device except the second network device;

[0033] Step S206, send a first compensation request to the second network device to instruct the second network device to perform a compensation operation, where the compensation operation includes obtaining the cached data of the first network device and sending the cached data to the target device.

[0034] In the above embodiment, the target device may be a monitoring background system, a Network Video Recorder (NVR), etc. When the target device is an NVR, it may be an embedded NVR or a PC-based NVR. Among them, due to the non-standard nature of its IP cameras, the embedded NVR generally only supports IP cameras of a certain manufacturer; the PC-based NVR (PC-Based NVR) can be understood as a set of video monitoring software installed on the PC side, server or industrial computer with an X86 architecture. The network device may be an IP camera IPC, a monitoring device, etc. A target device may be connected to multiple network devices.

[0035] In the above embodiments, the network status indicator can be understood as a network status table generated by sorting the network status values of all network devices. The predetermined time period can be understood as a fixed detection period, that is, the network status indicators of all network devices are determined regularly. The first network device can be any one of all network devices that fails to transmit data to the target device. The first data can be the current frame data stored in the IPC local cache. The second network device can be the network device ranked first in terms of network status among all network devices except the first network device. The first compensation request can be a frame compensation operation request sent by the target device to the second network device. Of course, the network statuses of multiple network devices can also be sorted according to the network status indicators to determine the top N network devices as candidate network devices. The second network device can be a device among the candidate network devices. When the target device does not receive the first data sent by the first network device, the second network device can be determined from the candidate network devices. Determining the second network device from the candidate network devices can include determining the number of compensation operations being performed by each device included in the candidate network devices, and determining the device with the smallest number of compensation operations being performed as the second network device. For example, the target device is connected to six network devices, namely IPC1, IPC2, IPC3, IPC4, IPC5, and IPC6. The candidate network devices include IPC2 and IPC3. When the target device does not receive the first data sent by the first network device IPC1, determine the number of compensation operations being performed by IPC2 and IPC3. If IPC2 is currently forwarding the data of IPC4 and IPC5, the number of compensation operations being performed by IPC2 is 2. If IPC3 is currently forwarding the data of IPC6, the number of supplementary operations being performed by IPC3 is 1. Then IPC3 can be determined as the second network device.

[0036] In the above embodiments, frames can be sent in a UDP connectionless manner. In this way, the IPC cannot sense frame loss. Therefore, the frame compensation process actions should start from the target device receiver NVR. For example, starting from the NVR, the forwarding and frame compensation schematic diagram of the target device NVR can be referred to in the appendix Figure 3 , such as Figure 3As shown: Under normal working conditions, each IPC (i.e., the above-mentioned network device) stores the current frame data in the local cache while sending data frames to the NVR (i.e., the above-mentioned target device). When storing, frame caching can be performed according to the size of the local cache, and only the latest video frames are cached. Since most of the scenarios detected by the device are live cache situations, considering the timeliness issue, it is not necessary to cache a large amount of frame data. Therefore, there is no need to increase the local cache, and only the original cache of the IPC can be used to achieve frame compensation in case of frame loss, and the maintenance cost of the system is ensured not to increase. In addition, by caching the currently sent frame while the IPC sends frame data (only storing about 200ms of cache data volume, which does not impose a burden on the memory), it does not occupy excessive network bandwidth additionally. Under normal or restored network conditions, it will not continuously consume performance and network bandwidth due to IPC forwarding (because frame forwarding is only used for frame compensation in case of temporary network jitter, which is short and stops forwarding immediately after recovery).

[0037] In the above embodiment, when there is a network fluctuation in the first network device IPC1, the NVR first notices that IPC1 does not send frame data to itself (i.e., the above-mentioned first data), indicating that the NVR judges that IPC1 has a network anomaly at this time, and then starts a frame compensation operation request (i.e., the above-mentioned first compensation request). The NVR selects the IPC4 with the best network status index (i.e., the above-mentioned second network device) from the network status table that records the network status of each IPC and sends the first compensation request to it. Among them, the first compensation request may include the identifier of the network device to perform the compensation operation. When the first network device is to perform the compensation operation, the first compensation request sent by the target device includes the identifier of the first network device. For example, when the first network device is IPC1 and the second network device is IPC4, the target device can send the first compensation request to IPC4, and the first compensation request includes the identifier of IPC1, requesting IPC4 to forward the current frame data that IPC1 did not send. After IPC4 obtains the request information, it starts to perform the compensation operation, that is, sends a request for the current frame data to IPC1, that is, the cached data. After receiving the cached data, it sends the cached data to the target device. Among them, the second network device can change at any time according to the network status table, not just the fixed IPC4, which ensures the reliability of the network status of the IPC currently doing the forwarding.

[0038] In the above embodiments, the second network device obtaining the cache data of the first network device may include: the second network device receiving the cache data sent by the first network device. Among them, the first network device may send the cache data to the second network device via Bluetooth or other wireless means. When the first network device and the second network device are in the same local area network, the first network device may store the cache data in a shared file, and the second network device obtains the cache data from the shared file. To ensure that when the network status of the first network device is poor or it is unable to send the cache data, the second network device can obtain the cache data in a timely manner.

[0039] Through the present invention, in the case of not receiving the first data sent by the first network device, the second network device among all network devices is determined according to the network status indicators of all network devices connected to the target device at a predetermined time period, and a first compensation request is sent to the second network device to instruct the second network device to perform a compensation operation, so as to realize the forwarding of the cache data that the first network device fails to send by the second network device with good network status, achieving the effect of frame compensation. Therefore, the problem of frame loss in the IPC transmission process during data transmission in the related art can be solved, and the effect of complete data transmission is achieved.

[0040] The execution subject of the above steps may be a target device, such as an NVR or the background processor of a monitoring device, but is not limited thereto.

[0041] In an exemplary embodiment, determining the network status indicators of all network devices connected to the target device at a predetermined time period includes: for any one target network device included in all the network devices, the following operations are performed to determine the network status indicator of each target network device: determining the first number of times the target network device is executed for the compensation operation within the predetermined time period; determining the second number of times the target network device is disconnected from the network within the predetermined time period; determining the target status of the target network device, where the target status is used to indicate whether the target network device has a network anomaly; and determining the network status indicator based on the first number, the second number, and the target status.

[0042] In the above embodiments, when the target device fails to receive the first data sent by the first network device and sends a first compensation request to the second network device, the second network device performs a compensation operation and sends the cached data of the first network device to the target device. In this process, the second network device is the device performing the compensation operation, and the first network device is the device on which the compensation operation is performed. That is, the first number of times on which the compensation operation is performed can be the number of times that the target network device has its cached data forwarded by other network devices within a predetermined time period, which can be represented by N. For example, when IPC1 fails to send a frame and its cached data is forwarded by other network devices, the value of N is incremented by 1. The second number can be represented as the number of times of network disconnection within a predetermined time period, which can be represented by M. When IPC1 has a network disconnection state once, the value of M is incremented by 1. The target state can represent whether this network device has had a network anomaly state within a predetermined time period, which can be represented by D. Among them, network anomalies can include disconnection. For example, when a certain network device does not have a network anomaly state during this period, D is 1; if a network anomaly occurs during this period, D is 0.

[0043] In the above embodiments, determining the network state index based on the first number, the second number, and the target state may include: determining the reciprocal of the sum value of the first number, the second number, and the target state as the network state index.

[0044] In an exemplary embodiment, determining the network state index of the target network device based on the first number, the second number, and the target state includes: determining the historical network state index of the target network device in the previous period of the predetermined time period; determining the first product of the first number and the first weight; determining the second product of the second number and the second weight; determining the third product of the target value corresponding to the target state and the third weight; determining the difference between the historical network state index and the first product and the second product; determining the sum value of the difference and the third product; in the case where the sum value is within a preset interval, determining the sum value as the network state index; in the case where the sum value is less than the minimum value of the preset interval, determining the minimum value as the network state index; in the case where the sum value is greater than the maximum value of the preset interval, determining the maximum value as the network state index.

[0045] In the above embodiments, the specific calculation formula of the network state index can be shown as follows:

[0046] F 网络状态 =S max,min (F – f B * N – f D * M + f T * D), where F网络状态 Indicates the network status indicator, f B Indicates the weight value of the IPC having a supplementary frame behavior (i.e., the first weight above), f D Indicates the weight value of an IPC network disconnection (i.e., the second weight above), f T Indicates a positive value (i.e., the third weight above), and the first product can be expressed as f B The product with N, and the second product can be expressed as f D The product with M, and the third product can be expressed as f T The product with D, F represents the historical value obtained in the previous statistical period (the initial value is 100), which is equivalent to the above historical network status indicator, S max,min Indicates a limit function (the upper and lower limits are max = 100, min = 10, i.e., the above maximum and minimum values). N can represent the first number of times the compensation operation is performed, that is, the number of times the target network device forwards its cached data by other network devices within a predetermined time period. M can represent the second number of times, that is, the number of times of network disconnection within the predetermined time period. D can represent whether this network device has had a network exception status within the predetermined time period. When the sum value is within the interval of the limit function, the sum value is determined as the network status indicator; when the sum value is less than the minimum value of the limit function interval, the minimum value is determined as the network status indicator; when the sum value is greater than the maximum value of the limit function interval, the maximum value is determined as the network status indicator. By setting the limit function, meaningless sharp increases and decreases of values can be avoided.

[0047] In the above embodiment, the larger the values of N and M, the more network anomalies occur, and the smaller the F network status value, the lower the ranking. To prevent a ranking - lower IPC from always remaining in a lower position and to enable the ranking to rise when the network status of the IPC improves, the positive value f T and the sum value D (taking values of 0, 1) are added. When there is no network exception status in this period, set D = 1, and at this time, the value of this IPC increases by f T which helps the ranking to rise. However, if there is a network exception in this period, f T is not increased (i.e., D = 0). Sort according to the network status of different IPCs. When the values of IPCs are tied, sort according to the order of IP addresses, ensuring the consistency of the network status tables shared on the NVR and IPC, that is, eliminating the workload of each device to statistically collect data and generate a network status table by itself, and also avoiding the differences in the network status tables of each device. In addition, the above - mentioned various data weight values can be defined by users according to different products and environments.

[0048] In the above embodiments, when there is a newly added IPC or an IPC after restart (including after network recovery), the IPC can actively obtain network status metrics from the NVR, such as Figure 4 as shown Figure 4 which represents the topology diagram of the NVR periodically synchronizing the IPC network status table to each IPC. This ensures that devices (NVR and IPC) in the entire local area network can obtain a unified network status table. In the event of a network anomaly, the IPC can quickly obtain information about other IPCs with good network status from the table and forward frames.

[0049] In an exemplary embodiment, after sending the first supplementary frame request to the second network device, the method further includes: when receiving the second data sent by the first network device, sending a first stop compensation command to the second network device to instruct the second network device to stop performing the compensation operation.

[0050] In the above embodiments, when the NVR re - receives the AN frame data from IPC1 (i.e., the above - mentioned second data), reference can be made to Figure 5 , Figure 5 which is a schematic diagram of the supplementary frame request process according to an embodiment of the present invention, indicating that the network anomaly status of IPC1 and the NVR has returned to normal. At this time, the NVR sends a command to IPC4 to request IPC4 to stop applying for and forwarding cached frames to IPC1 (i.e., the above - mentioned first stop compensation command), that is, everything returns to the normal working state, and IPC1 continues to send frame data such as AN + 1, AN + 2, etc. to the NVR.

[0051] In an exemplary embodiment, after sending the first compensation request to the second network device, the method further includes: receiving the cached data; determining the tag information included in the cached data, where the tag information includes the identification information of the device to which the cached data belongs and the position information of the cached data in the data stream sent by the device to which the cached data belongs; determining a first storage area for storing the data stream sent by the first network device; and storing the cached data in the first storage area according to the position information.

[0052] In the above embodiments, the tag information can be information indicating which IPC this frame data belongs to, as well as the position of this frame in the original video stream, etc. Reference can be made to Figure 6 , Figure 6Schematic diagram of the NVR receiving and forwarding supplementary frames forwarded by the IPC according to an embodiment of the present invention. IPC1 sends buffered frame data carrying tags to IPC4. IPC4 forwards the obtained tagged frame data to the NVR. When the NVR receives the frame data forwarded by IPC4, it reads and parses the tag information carried by this frame, checks and strips the tags, and determines the correct position of the buffer queue of the original IPC1 frame (i.e., the above-mentioned first storage area) according to the tag information.

[0053] In the above embodiment, when the correct position of the buffer queue of the original IPC1 frame is determined, the process of filling the forwarded supplementary frame into the buffer area is as Figure 7 shown, adding the frame data of the original IPC1 carried in IPC4 to the IPC1 buffer.

[0054] In this embodiment, a data compensation method is provided. Figure 8 is the flow of the data compensation method according to an embodiment of the present invention Figure 2 as Figure 8 shown, and this flow includes the following steps:

[0055] Step S802, receiving network status metrics of all network devices connected to the target device sent by the target device;

[0056] Step S804, when it is determined that the transmission of the first data to the target device fails, determining a second network device included in the network devices based on the network status metrics, where the network status metric of the second network device is greater than the network status metrics of other network devices included in the network devices except the second network device;

[0057] Step S806, sending a second compensation request to the second network device to instruct the second network device to perform a compensation operation, where the compensation operation includes obtaining cached data of a first network device and sending the cached data to the target device.

[0058] In the above embodiment, the target device can be a monitoring background system, a Network Video Recorder (NVR), etc. When the target device is an NVR, it can be an embedded NVR or a PC-based NVR. Among them, due to the non-standard nature of its IP cameras, the embedded NVR generally only supports IP cameras of a certain manufacturer; the PC-based NVR (PC-Based NVR) can be understood as a set of video surveillance software installed on the PC side, server or industrial computer with an X86 architecture. The network device can be a network camera IPC, a monitoring device, etc. A target device can be connected to multiple network devices.

[0059] In the above embodiments, the network status indicator can be understood as a network status table generated by sorting the network status values of all network devices. The predetermined time period can be understood as a fixed detection period, that is, regularly determining the network status indicators of all network devices.

[0060] In the above embodiments, the network status indicator can be determined by a target device. The target device can determine the network status indicators of all network devices connected to the target device according to a predetermined time period. Determining the network status indicators of all network devices connected to the target device according to a predetermined time period may include: for any one target network device included in all the network devices, performing the following operations to determine the network status indicator of each target network device: determining the first number of times the target network device has been subjected to the compensation operation within the predetermined time period; determining the second number of times the target network device has been disconnected from the network within the predetermined time period; determining the target state of the target network device within the predetermined time period, where the target state is used to indicate whether the target network device has a network anomaly; determining the network status indicator based on the first number of times, the second number of times, and the target state. Determining the network status indicator of the target network device based on the first number of times, the second number of times, and the target state includes: determining the historical network status indicator of the target network device in the previous period of the predetermined time period; determining the first product of the first number of times and the first weight; determining the second product of the second number of times and the second weight; determining the third product of the target value corresponding to the target state and the third weight; determining the difference between the historical network status indicator and the first product and the second product; determining the sum value of the difference and the third product; in the case where the sum value is within a preset interval, determining the sum value as the network status indicator; in the case where the sum value is less than the minimum value of the preset interval, determining the minimum value as the network status indicator; in the case where the sum value is greater than the maximum value of the preset interval, determining the maximum value as the network status indicator.

[0061] In the above embodiments, the first network device may be any network device among all network devices that fails to transmit data to the target device. The first data may be the current frame data stored in the IPC local cache. The second network device may be the network device with the first-ranked network status metric among all network devices except the first network device. When the first network device fails to send data to the target device, after the first network device sends a first compensation request to the second network device, the second network device performs a compensation operation to send the cached data of the first network device to the target device. In this process, the second network device is the device performing the compensation operation, and the first network device is the device on which the compensation operation is performed. That is, the first number of times on which the compensation operation is performed may be the number of times the target network device forwards its cached data by other network devices within a predetermined time period, which may be represented by N. For example, when IPC1 fails to send a frame and its cached data is forwarded by other network devices, the value of N is incremented by 1. The second number of times may be represented as the number of times of network disconnection within a predetermined time period, which may be represented by M. When the network of IPC1 is in a disconnection state once, the value of M is incremented by 1. The target state may represent whether this network device has experienced a network anomaly within a predetermined time period, which may be represented by D. Among them, network anomalies may include disconnection. For example, when a certain network device does not experience a network anomaly during this period, D is 1; if a network anomaly occurs during this period, D is 0.

[0062] In the above embodiments, determining the network status metric based on the first number of times, the second number of times, and the target state may include: determining the reciprocal of the sum value of the first number of times, the second number of times, and the target state as the network status metric.

[0063] In the above embodiments, the specific calculation formula of the network status metric may be shown as follows:

[0064] F 网络状态 =S max,min (F – f B * N – f D * M + f T * D), where F 网络状态 represents the network status metric, f B represents the weight of the frame compensation behavior of this IPC (i.e., the above-mentioned first weight), f D represents the weight of one IPC network disconnection (i.e., the above-mentioned second weight), f T represents a positive value (i.e., the above-mentioned third weight). The first product may be represented as the product of f B and N. The second product may be represented as the product of f D and M. The third product may be represented as the product of f TThe product of D, where F represents the historical value obtained in the previous statistical period (with an initial value of 100), which is equivalent to the above-mentioned historical network status indicator, S max,min represents a limit function (with upper and lower limits of max = 100 and min = 10, i.e., the above-mentioned maximum and minimum values). N can represent the first number of times the compensation operation is performed, that is, the number of times the target network device forwards its cached data by other network devices within a predetermined time period. M can represent the second number of times, that is, the number of times of network disconnection within a predetermined time period. D can represent whether this network device has had a network anomaly status within a predetermined time period. When the sum value is within the interval of the limit function, the sum value is determined as the network status indicator; when the sum value is less than the minimum value of the limit function interval, the minimum value is determined as the network status indicator; when the sum value is greater than the maximum value of the limit function interval, the maximum value is determined as the network status indicator. By setting the limit function, meaningless sharp increases and decreases in values can be avoided.

[0065] In the above embodiment, the larger the values of N and M, the more network anomalies occur, and the smaller the F network status value, the lower the ranking. To prevent a lower-ranked IPC from always staying at the bottom and to enable the ranking to rise when the network status of the IPC improves, a positive value f T and the sum value D (taking values of 0, 1) are added. When there is no network anomaly status in this period, set D = 1, and at this time the value of this IPC increases by f T which helps the ranking to rise. However, if there is a network anomaly in this period, f is not increased T (i.e., D = 0). Sort according to the network status of different IPCs. When the values of IPCs are tied, sort according to the order of IP addresses, ensuring that the network status tables shared on the NVR and IPCs are consistent. This not only eliminates the workload of each device having to statistically analyze data and generate a network status table on its own but also avoids the differences in the network status tables of each device. In addition, the above data weights can be defined by users according to different products and environments.

[0066] In the above embodiment, when there is a newly added IPC or an IPC after restart (including after network recovery), the IPC can actively obtain the network status indicator from the NVR, such as Figure 4 shown Figure 4 represents the topology diagram of the NVR regularly synchronizing the IPC network status table to each IPC. This ensures that all devices (NVR and IPCs) in the entire local area network can obtain a unified network status table. In the event of a network anomaly, the IPC can quickly obtain information about other IPCs with good network status from the table and forward frames.

[0067] In the above embodiments, after determining the network status metrics, the target device may send the network status metrics to all network devices connected to it. All network devices connected to the target device may be connected in the same local area network to enable communication between network devices. In this local area network, all devices may broadcast the received network status metrics to ensure that network devices with poor network status or unable to receive the network status metrics sent by the target device can receive the network status metrics. Of course, network devices may also be connected via Bluetooth to form a mesh network to enable synchronous sharing of the received network status metrics among network statuses.

[0068] In the above embodiments, any one of the network devices connected to the target device may store the network status metrics in the shared area of the local area network where all network devices are located after receiving the network status metrics. When there is a device among the network devices that cannot receive the network status metrics, this device may obtain the latest network status metrics from the shared area. In the above embodiments, the second network device may be determined by the first network device. The first network device determines the top N network devices as candidate network devices. Determining the second network device from the candidate network devices may include determining the number of compensation operations being executed by each device included in the candidate network devices, and determining the device with the smallest number of compensation operations being executed as the second network device. For example, the target device is connected to six network devices, namely IPC1, IPC2, IPC3, IPC4, IPC5, and IPC6. The candidate network devices include IPC2 and IPC3. When the first network device fails to send data, determine the number of compensation operations being executed by IPC2 and IPC3. If IPC2 is currently forwarding data of IPC4 and IPC5, the number of compensation operations being executed by IPC2 is 2. IPC3 is currently forwarding data of IPC6, then the format of the supplementary operation being executed by IPC3 is 1. Then IPC3 may be determined as the second network device.

[0069] In the above embodiments, the execution entity may be an IPC, and frames may be sent in the way of TPC connection. In this way, after the IPC sends data to the NVR, the NVR will give a feedback response. Thus, the IPC can perceive the frame loss situation caused by network fluctuations, and therefore the IPC that fails to send frames initiates a request action for frame compensation. For the schematic diagram of frame forwarding and compensation of the network device IPC, please refer to the appendix Figure 9 For the flowchart of frame forwarding and compensation of the network device IPC, please refer to the appendix Figure 10 such as Figure 9 、 Figure 10As shown: Under normal working conditions, each IPC (i.e., the above-mentioned network device) stores the current frame data in the local cache while sending data frames to the NVR (i.e., the above-mentioned target device). When there is a network fluctuation in IPC1 and the sending of the current frame data (i.e., the above-mentioned first data) to the NVR fails, IPC1 selects IPC4 with the best network status metrics (i.e., the above-mentioned second network device) through the network status table of the network status, sends a request (i.e., the above-mentioned second compensation request) to IPC4 to obtain its own cached frame. After IPC4 receives the request information, it initiates the acquisition of the current frame data from IPC1 and forwards the acquired frame to the NVR (i.e., the above-mentioned execution of the compensation operation). Of course, the network status of multiple network devices can also be sorted according to network status metrics to determine the top N network devices as candidate network devices. The second network device can be a device among the candidate network devices. When the first network device determines that the sending of the first data fails, the second network device can be determined from the candidate network devices. Determining the second network device from the candidate network devices can include determining the number of compensation operations being executed by each device included in the candidate network devices, and determining the device with the smallest number of compensation operations being executed as the second network device. For example, the target device is connected to six network devices, namely IPC1, IPC2, IPC3, IPC4, IPC5, and IPC6. The candidate network devices include IPC2 and IPC3. When the first network device IPC1 fails to send the first data, determine the number of compensation operations being executed by IPC2 and IPC3. If IPC2 is currently forwarding the data of IPC4 and IPC5, the number of compensation operations being executed by IPC2 is 2. If IPC3 is currently forwarding the data of IPC6, the format of the supplementary operation being executed by IPC3 is 1. Then IPC3 can be determined as the second network device.

[0070] In the above embodiment, the second network device obtaining the cached data of the first network device may include: the second network device receiving the cached data sent by the first network device. Among them, the first network device may send the cached data to the second network device through Bluetooth or other wireless means. When the first network device and the second network device are in the same local area network, the first network device may store the cached data in a shared file, and the second network device obtains the cached data from the shared file. To ensure that when the network status of the first network device is poor or it is unable to send the cached data, the second network device can obtain the cached data in a timely manner.

[0071] Through the present invention, when a first device determines that the transmission of first data to a target device fails, it first receives network status metrics of all network devices sent by the target device, determines a second network device among all network devices according to the network status metrics, and sends a second compensation request to the second network device to instruct the second network device to perform a compensation operation, thereby realizing the forwarding of cached data that fails to be sent by the first network device through the second network device with better network status, achieving the effect of frame compensation. Therefore, the problem of frame loss in the IPC transmission process during data transmission in the related art can be solved, and the effect of complete data transmission is achieved.

[0072] Optionally, the execution subject of the above steps may be a first network device, such as an IPC, etc., but is not limited thereto.

[0073] In an exemplary embodiment, after sending the second compensation request to the second network device, the method further includes: when receiving a request for obtaining the cached data sent by the second network device, adding tag information to the initial data to obtain the cached data, where the tag information includes identification information of the device to which the cached data belongs and position information of the cached data in the data stream sent by the device to which the cached data belongs; and sending the cached data to the second network device.

[0074] In the above embodiment, the tag information may be information indicating which IPC this frame of data belongs to, and the position of this frame in the original video stream, etc. For reference Figure 10 , IPC1 actively sends the cached frame data with tags to IPC4.

[0075] In an exemplary embodiment, after sending the second compensation request to the second network device, the method further includes: when determining that the transmission of second data to the target device is successful, sending a second stop compensation command to the second network device to instruct the second network device to stop performing the compensation operation.

[0076] In the above embodiment, continue to refer to the appendix Figure 10 , when IPC1 redetects that the transmission of its own frame data (i.e., the above second data) is successful, it indicates that the abnormal network status between IPC1 and the NVR has returned to normal. At this time, IPC1 sends a stop requesting cached frames (i.e., the above second stop compensation command) to IPC4, and then the normal working state is restored between IPC1 and the NVR, and frame data such as AN+1 and AN+2 is sent.

[0077] According to the present invention, in the case where the first data sent by the first network device is not received, the second network device among all network devices is determined according to the network status indicators of all network devices connected to the target device within a predetermined time period, and a first compensation request is sent to the second network device, instructing the second network device to perform a compensation operation. Therefore, the problem of frame loss in IPC transmission during data transmission can be solved, and the effect of complete data transmission is achieved.

[0078] In the foregoing embodiment, in a weak network scenario, frame data is forwarded to the NVR through other IPCs with good network status, realizing the frame compensation operation, avoiding the need to add an additional server for caching to perform frame caching, and without incurring additional expenses. By the NVR periodically counting the network status indicators of the connected IPCs, updating them to the network status table in real time, and sending them to all connected IPCs, a unified network status table is used for devices within a cluster. The management of the network status table is sorted in descending order according to the network status indicator, and the IPC with the best network status indicator is placed at the front. The evaluation criteria for the network status indicator mainly include: counting the number of times the IPC is offline from the network within a certain period of time, the network packet loss rate of the IPC (the number of times frame compensation occurs), etc. In the UDP connection mode, by the NVR periodically detecting the speed of receiving frames, it is inferred whether the IPC encounters network problems when sending frames, resulting in frame failures. After determining that there are network problems, the NVR itself actively requests other IPCs to assist in forwarding. In the TCP connection mode, the sending IPC detects whether the sent frame is successful, infers whether there are network anomalies, and actively requests other IPCs to assist in forwarding. By caching the current frame locally by the IPC before sending the frame, a backup of the frame is realized. The data of the cached frame is based on the currently supported cache capacity, and only the latest frame data is saved. Before the cached frame is to be forwarded by other IPCs, by tagging the frame, information such as the position information of this frame in the IPC to which it belongs and the frame in the stream is recorded, so that after this frame is sent to the NVR, by parsing the information in the tag, it can be filled into the cache belonging to the original IPC to realize the integrity of the NVR video stream cache for this path. A method for compensating for lost frames is realized during the NVR live stream pulling process in a weak network environment. When there are network jitters in the IPC, the current frame information is cached by the IPC and forwarded to the NVR through other IPCs with good network status, thereby avoiding frame loss in NVR video live broadcasts.

[0079] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.

[0080] In this embodiment, a data compensation device is further provided. This device is used to implement the above embodiments and preferred embodiments, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0081] Figure 11 is the structural block diagram of the data compensation device according to the embodiment of the present invention Figure 1 , as Figure 11 shown, the device includes:

[0082] The first determination module 1102 is used to determine the network status indicators of all network devices connected to the target device according to a predetermined time period;

[0083] The second determination module 1104 is used to determine a second network device included in the network devices based on the network status indicators when the first data sent by the first network device included in the network devices is not received, where the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network devices except the second network device;

[0084] The first execution module 1106 is used to send a first compensation request to the second network device to instruct the second network device to perform a compensation operation, where the compensation operation includes obtaining the cached data of the first network device and sending the cached data to the target device.

[0085] In an exemplary embodiment, the first determination module 1102 may determine the network status metrics of all network devices connected to the target device according to a predetermined time period in the following manner: for any target network device included in all the network devices, the following operations are performed to determine the network status metrics of each target network device: determine the first number of times the target network device performs the compensation operation within the predetermined time period; determine the second number of times the target network device is disconnected from the network within the predetermined time period; determine the target status of the target network device within the predetermined time period, where the target status is used to indicate whether the target network device has a network anomaly; determine the network status metrics based on the first number of times, the second number of times, and the target status.

[0086] In an exemplary embodiment, the first determination module 1102 may determine the network status metrics of the target network device based on the first number of times, the second number of times, and the target status in the following manner: determine the historical network status metrics of the target network device in the previous period of the predetermined time period; determine the first product of the first number of times and the first weight; determine the second product of the second number of times and the second weight; determine the third product of the target value corresponding to the target status and the third weight; determine the difference between the historical network status metrics and the first product and the second product; determine the sum value of the difference and the third product; in the case where the sum value is within a preset interval, determine the sum value as the network status metrics; in the case where the sum value is less than the minimum value of the preset interval, determine the minimum value as the network status metrics; in the case where the sum value is greater than the maximum value of the preset interval, determine the maximum value as the network status metrics.

[0087] In an exemplary embodiment, the device may be used to, after sending a first supplementary frame request to the second network device: in the case of receiving second data sent by the first network device, send a first stop compensation command to the second network device to instruct the second network device to stop performing the compensation operation.

[0088] In an exemplary embodiment, the device may also be used to, after sending a first compensation request to the second network device: receive the cached data; determine the tag information included in the cached data, where the tag information includes the identification information of the device to which the cached data belongs and the position information of the cached data in the data stream sent by the device to which the cached data belongs; determine the first storage area for storing the data stream sent by the first network device; store the cached data in the first storage area according to the position information.

[0089] Figure 12 is the structural block diagram of the compensation device for data according to an embodiment of the present invention Figure 2 , as Figure 12 shown, the device includes:

[0090] A receiving module 1202, configured to receive network status metrics of all network devices connected to the target device sent by the target device;

[0091] A third determination module 1204, configured to, when it is determined that the transmission of the first data to the target device fails, determine a second network device included in the network devices based on the network status metrics, where the network status metrics of the second network device are greater than the network status metrics of other network devices included in the network devices except the second network device;

[0092] A second execution module 1206, configured to send a second compensation request to the second network device to instruct the second network device to perform a compensation operation, where the compensation operation includes obtaining cached data of a first network device and sending the cached data to the target device.

[0093] In an exemplary embodiment, after the device sends the second compensation request to the second network device, in the case of receiving a request for obtaining the cached data sent by the second network device, tag information is added to the initial data to obtain the cached data, where the tag information includes identification information of the device to which the cached data belongs and position information of the cached data in the data stream sent by the device to which the cached data belongs; the cached data is sent to the second network device.

[0094] In an exemplary embodiment, after the device sends the second compensation request to the second network device, in the case of determining that the transmission of the second data to the target device is successful, a second stop compensation command is sent to the second network device to instruct the second network device to stop performing the compensation operation.

[0095] It should be noted that the above-mentioned various modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned various modules are respectively located in different processors in any combination form.

[0096] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0097] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disks, magnetic disks, or optical discs. An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0098] In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input / output device. Among them, the transmission device is connected to the above-mentioned processor, and the input / output device is connected to the above-mentioned processor.

[0099] An embodiment of the present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the methods in various embodiments of the present application.

[0100] For the specific examples in this embodiment, reference may be made to the examples described in the above embodiments and the exemplary embodiments. Details will not be repeated herein.

[0101] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to be implemented. Thus, the present invention is not limited to any specific combination of hardware and software.

[0102] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data compensation method, characterized in that: include: Determine network status indicators of all network devices connected to the target device according to a predetermined time period; In a case where the first data sent by the first network device included in the network devices is not received, determining the second network device included in the network devices based on the network status indicator, wherein the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network devices except the second network device; Sending a first compensation request to the second network device to instruct the second network device to perform a compensation operation, wherein the compensation operation includes obtaining cache data of the first network device and sending the cache data to the target device; Determining the network status indicators of all network devices connected to the target device according to a predetermined time period includes: for any target network device included in all the network devices, performing the following operations to determine the network status indicator of each target network device: determining a first number of times the compensation operation is performed on the target network device within the predetermined time period; determining a second number of times the target network device is disconnected from the network within the predetermined time period; determining a target state of the target network device within the predetermined time period, wherein the target state is used to indicate whether a network abnormality occurs in the target network device; determining the network status indicator based on the first number, the second number, and the target state; Determining the network status indicator of the target network device based on the first number, the second number and the target state includes: determining the historical network status indicator of the target network device in the previous period of the predetermined time period; determining a first product of the first number and a first weight; determining a second product of the second number and a second weight; determining a third product of a target value corresponding to the target state and a third weight, wherein the third weight is a positive value; determining the difference between the historical network status indicator and the first product and the second product; determining the sum of the difference and the third product; when the sum is within a preset interval, determining the sum as the network status indicator; when the sum is less than a minimum value of the preset interval, determining the minimum value as the network status indicator; when the sum is greater than a maximum value of the preset interval, determining the maximum value as the network status indicator.

2. The method according to claim 1, characterized in that After sending the first frame supplement request to the second network device, the method further includes: When receiving the second data sent by the first network device, a first stop compensation command is sent to the second network device to instruct the second network device to stop performing the compensation operation.

3. The method according to claim 1, characterized in that After sending the first compensation request to the second network device, the method further includes: Receiving the cache data; Determine tag information included in the cached data, wherein the tag information includes identification information of a device to which the cached data belongs and location information of the cached data in a data stream sent by the device to which the cached data belongs; Determine a first storage area for storing the data stream sent by the first network device; The cache data is stored in the first storage area according to the location information.

4. A data compensation method, characterized in that: include: Receiving network status indicators of all network devices connected to the target device and sent by the target device; In the case of determining that sending the first data to the target device fails, determining a second network device included in the network devices based on the network status indicator, wherein the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network devices except the second network device; Sending a second compensation request to the second network device to instruct the second network device to perform a compensation operation, wherein the compensation operation includes obtaining cache data of the first network device and sending the cache data to the target device; The network status indicator is determined by the target device according to a predetermined time period in the following manner: for any target network device included in all the network devices, the following operations are performed to determine the network status indicator of each target network device: determining a first number of times the compensation operation is performed on the target network device within the predetermined time period; determining a second number of times the network of the target network device is disconnected within the predetermined time period; determining a target state of the target network device within the predetermined time period, wherein the target state is used to indicate whether a network abnormality occurs in the target network device; determining the network status indicator based on the first number, the second number and the target state; The target device determines the network status indicator of the target network device based on the first number, the second number and the target status, including: determining the historical network status indicator of the target network device in the previous period of the predetermined time period; determining the first product of the first number and the first weight; determining the second product of the second number and the second weight; determining the third product of the target value corresponding to the target status and the third weight, wherein the third weight is a positive value; determining the difference between the historical network status indicator and the first product and the second product; determining the sum of the difference and the third product; when the sum is within a preset interval, determining the sum as the network status indicator; when the sum is less than the minimum value of the preset interval, determining the minimum value as the network status indicator; when the sum is greater than the maximum value of the preset interval, determining the maximum value as the network status indicator.

5. The method according to claim 4, characterized in that After sending the second compensation request to the second network device, the method further includes: When receiving a request for obtaining the cached data sent by the second network device, adding tag information to the initial data to obtain the cached data, wherein the tag information includes identification information of the device to which the cached data belongs and location information of the cached data in a data stream sent by the device to which the cached data belongs; The cached data is sent to the second network device.

6. The method according to claim 4, characterized in that After sending the second compensation request to the second network device, the method further includes: When it is determined that the second data is successfully sent to the target device, a second stop compensation command is sent to the second network device to instruct the second network device to stop performing the compensation operation.

7. A data compensation device, characterized in that: include: A first determination module, used to determine the network status indicators of all network devices connected to the target device according to a predetermined time period; A second determining module is configured to determine, in a case where the first data sent by the first network device included in the network device is not received, a second network device included in the network device based on the network status indicator, wherein the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network device except the second network device; A first execution module, configured to send a first compensation request to the second network device to instruct the second network device to perform a compensation operation, wherein the compensation operation includes obtaining cache data of the first network device and sending the cache data to the target device; The first determination module determines the network status indicators of all network devices connected to the target device according to a predetermined time period in the following manner: for any target network device included in all the network devices, the following operations are performed to determine the network status indicator of each target network device: determining a first number of times the compensation operation is performed on the target network device within the predetermined time period; determining a second number of times the network of the target network device is disconnected within the predetermined time period; determining a target state of the target network device within the predetermined time period, wherein the target state is used to indicate whether a network abnormality occurs in the target network device; determining the network status indicator based on the first number, the second number and the target state; The first determination module determines the network status indicator of the target network device based on the first number, the second number and the target state in the following manner: determining the historical network status indicator of the target network device in the previous period of the predetermined time period; determining the first product of the first number and the first weight; determining the second product of the second number and the second weight; determining the third product of the target value corresponding to the target state and the third weight, wherein the third weight is a positive value; determining the difference between the historical network status indicator and the first product and the second product; determining the sum of the difference and the third product; when the sum is within a preset interval, determining the sum as the network status indicator; when the sum is less than the minimum value of the preset interval, determining the minimum value as the network status indicator; when the sum is greater than the maximum value of the preset interval, determining the maximum value as the network status indicator.

8. A data compensation device, characterized in that: include: A receiving module, used for receiving network status indicators of all network devices connected to the target device and sent by the target device; A third determining module is used to determine, when it is determined that sending the first data to the target device fails, a second network device included in the network devices based on the network status indicator, wherein the network status indicator of the second network device is greater than the network status indicators of other network devices included in the network devices except the second network device; a second execution module, configured to send a second compensation request to the second network device to instruct the second network device to perform a compensation operation, wherein the compensation operation includes obtaining cache data of the first network device and sending the cache data to the target device; The network status indicator is determined by the target device according to a predetermined time period in the following manner: for any target network device included in all the network devices, the following operations are performed to determine the network status indicator of each target network device: determining a first number of times the compensation operation is performed on the target network device within the predetermined time period; determining a second number of times the network of the target network device is disconnected within the predetermined time period; determining a target state of the target network device within the predetermined time period, wherein the target state is used to indicate whether a network abnormality occurs in the target network device; determining the network status indicator based on the first number, the second number and the target state; The target device determines the network status indicator of the target network device based on the first number, the second number and the target status in the following manner: determining the historical network status indicator of the target network device in the previous period of the predetermined time period; determining the first product of the first number and the first weight; determining the second product of the second number and the second weight; determining the third product of the target value corresponding to the target status and the third weight, wherein the third weight is a positive value; determining the difference between the historical network status indicator and the first product and the second product; determining the sum of the difference and the third product; when the sum is within a preset interval, determining the sum as the network status indicator; when the sum is less than the minimum value of the preset interval, determining the minimum value as the network status indicator; when the sum is greater than the maximum value of the preset interval, determining the maximum value as the network status indicator.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 3, or execute the method described in any one of claims 4 to 6 when running.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 3, or to execute the method described in any one of claims 4 to 6.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 3, or executes the steps of the method described in any one of claims 4 to 6.

Citation Information

Patent Citations

  • Farm equipment networking communication method and device, farm equipment and storage medium

    CN117915436A