Data compensation method and device, storage medium and electronic device

By regularly monitoring the network status of network devices and selecting devices with better network status for data compensation, the problem of IPC frame loss in weak network environments is solved and stable transmission of live video is achieved.

CN119342180AActive Publication Date: 2025-01-21ZHEJIANG DAHUA TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In a weak network environment, IPC cannot save all transmitted data in real time due to no memory card and small built-in cache, resulting in lag in live video, poor visual display effect, and frame loss problem.

Method used

By regularly 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 better network status is determined and a compensation request is sent to it, instructing it to perform Compensation operation: obtain the cached data of the first network device and forward it to the target device.

Benefits of technology

The cached data that failed to be sent by the first network device is forwarded through the second network device with good network status, which solves the problem of frame loss during data transmission and achieves the effect of complete data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342180A_ABST
    Figure CN119342180A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data compensation method and device, a storage medium and an electronic device, and the method comprises the steps: determining the network state indexes of all network equipment connected with target equipment according to a preset time period; under the condition that first data sent by first network equipment included in the network equipment is not received, determining second network equipment included in the network equipment based on a network state index, the network state index of the second network equipment is greater than the network state indexes of other network equipment except the second network equipment in the network equipment; and sending a first compensation request to a second network device to instruct the second network device to execute a compensation operation, the compensation operation comprising obtaining cache data of the first network device and sending the cache data to the target device. According to the data transmission method and device, the problem of frame loss in the data transmission process in the prior 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 security monitoring video streaming, and in particular, to a data compensation method, device, storage medium and electronic device. Background Art

[0002] In the related technology, for the network monitoring system, due to the IPC's lack of storage card and small built-in cache, it is unable to save all transmitted data in real time in a weak network environment, resulting in live video freezes and poor visual display effects.

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

[0004] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention

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

[0006] According to one embodiment of the present invention, a data compensation method is provided, comprising: determining network status indicators of all network devices connected to a target device according to a predetermined time period; determining a second network device included in the network device based on the network status indicator when first data sent by a first network device included in the network device is not received, 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; and 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 cached data of the first network device and sending the cached data to the target device.

[0007] According to another embodiment of the present invention, there is provided a data compensation device, comprising: a first determination module, configured to determine network status indicators of all network devices connected to a target device according to a predetermined time period; a second determination module, configured to determine a second network device included in the network device based on the network status indicator when first data sent by a first network device included in the network device is not received, 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; and 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 comprises 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, a data compensation device is provided, comprising: a receiving module, used to receive network status indicators of all network devices connected to the target device and sent by the target device; a third determination module, used to determine a second network device included in the network device based on the network status indicator when it is determined that sending the first data to the target device fails, 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 second execution module, used 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 the first network device and sending the cached data to the target device.

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

[0010] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, 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 yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0012] 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 in 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 that the cache data that failed to be sent by the first network device is forwarded by the second network device with a good network status, and the effect of frame supplement is achieved. Therefore, the problem of frame loss in the data transmission process existing in the related art can be solved, and the effect of complete data transmission can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 2 The process of the data compensation method according to the embodiment of the present invention is as follows Figure 1 ;

[0015] Figure 3 2. It is a schematic diagram of NVR forwarding supplementary frames according to an embodiment of the present invention;

[0016] Figure 4 is a topology diagram of a network status table of a NVR periodically synchronized according to an embodiment of the present invention;

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

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

[0019] Figure 7 is a schematic diagram of an NVR filling a buffer area with forwarded supplementary frames according to an embodiment of the present invention;

[0020] Figure 8 The process of the data compensation method according to the embodiment of the present invention is as follows Figure 2 ;

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

[0022] Fig.10 is a flow chart of forwarding frame supplementation of IPC according to an embodiment of the present invention;

[0023] Fig.11 is a structural frame of a data compensation device according to an embodiment of the present invention Figure 1 ;

[0024] Fig.12is a structural frame of a data compensation device according to an embodiment of the present invention Figure 2 . DETAILED DESCRIPTION

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

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

[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a data compensation method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 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, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[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 embodiment 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, to implement the above 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 memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an 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. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to 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 can 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 is a flow chart of a method for compensating data according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

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

[0032] Step S204, in a case where the first data sent by the first network device included in the network device is not received, determining 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;

[0033] Step S206: 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.

[0034] In the above embodiments, 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, the embedded NVR generally only supports IP cameras of a certain manufacturer due to the non-standard nature of its IP camera; PC-based NVR (PCBased NVR) can be understood as a set of video monitoring software installed on a PC, server or industrial computer with an X86 architecture. The network device can be a network camera IPC, monitoring equipment, etc. A target device can be connected to multiple network devices.

[0035] In the above embodiment, the network status indicator can be understood as a network status table generated by sorting the network status values ​​of all network devices, and the predetermined time period can be understood as a fixed detection period, that is, the network status indicators of all network devices are regularly determined. 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 with the first ranking of the network status indicator among all network devices except the first network device, and the first compensation request can be a frame supplement operation request sent by the target device to the second network device. Of course, the network status of multiple network devices can also be sorted according to the network status indicator, and the topN network devices are determined as candidate network devices. The second network device can be a device in the candidate network device. 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 device. Determining the second network device from the candidate network device can include determining the number of compensation operations being performed by each device included in the candidate network device, 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, the number of compensation operations being performed by IPC2 and IPC3 is determined. If IPC2 is currently forwarding data from IPC4 and IPC5, the number of compensation operations being performed by IPC2 is 2. If IPC3 is currently forwarding data from 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 embodiment, frames can be sent in a connectionless manner using UDP. In this manner, the IPC cannot sense frame loss. The frame filling process should start from the target device receiving end NVR. For example, if it starts from the NVR, the forwarding frame filling diagram of the target device NVR can refer to the attached figure. Figure 3 ,like Figure 3As shown in the figure: Under normal working conditions, each IPC (i.e. the above network device) stores the current frame data in the local cache while sending data frames to the NVR (i.e. the above target device). When storing, the frame can be cached according to the size of the local cache and only the latest video frame can be cached. Since most of the scenes detected by the device are live broadcast caches, considering the timeliness issue, it is not necessary to cache a lot of frame data, so there is no need to increase the local cache. It is only necessary to use the original cache of the IPC to achieve frame supplementation in the case of frame loss, and ensure that the maintenance cost of the system does not increase. In addition, when sending frame data, the current frame is cached by IPC (only about 200ms of cache data is stored, which does not burden the memory), and it will not occupy too much network bandwidth. When the network is normal or restored, IPC forwarding will not be used to continuously consume performance and network bandwidth (because frame supplementation is only performed through frame forwarding when the network is temporarily jittered, the time is short, and the forwarding operation is stopped immediately after recovery).

[0037] In the above embodiment, when the first network device IPC1 experiences network fluctuation, the NVR first notices that IPC1 does not send frame data (i.e., the above first data) to itself, indicating that the NVR determines that IPC1 has a network abnormality at this time, and starts to make a frame supplement operation request (i.e., the above first compensation request). The NVR selects IPC4 (i.e., the above second network device) with the best network status indicator by querying the network status table that records the network status of each IPC, and sends a first compensation request to it. Among them, the first compensation request may include the identifier of the network device on which the compensation operation is performed. When the first network device is subjected to 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 a 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 has not sent. After obtaining the request information, IPC4 starts to perform the compensation operation, i.e., initiates a request to IPC1 for the data of the current frame, i.e., cached data, and after receiving the cached data, sends the cached data to the target device. Among them, the second network device can be changed at any time according to the network status table, and is not just a fixed IPC4, which ensures the reliability of the current forwarding IPC network status.

[0038] In the above embodiment, 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. The first network device may send the cache data to the second network device via Bluetooth or other wireless methods. 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. This ensures that when the network status of the first network device is poor or the cache data cannot be sent, the second network device can obtain the cache data in time.

[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 in 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 that the cache data that failed to be sent by the first network device is forwarded by the second network device with a good network status, and the effect of frame supplement is achieved. Therefore, the problem of frame loss in the IPC transmission process in data transmission in the related art can be solved, thereby achieving the effect of complete data transmission.

[0040] The execution subject of the above steps may be a target device, such as an NVR or a 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 according to a predetermined time period includes: 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 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; and determining the network status indicator based on the first number, the second number, and the target state.

[0042] In the above embodiment, when the target device does not receive the first data sent by the first network device, after sending the first compensation request to the second network device, the second network device performs the compensation operation and sends the cached data of the first network device to the target device. In this process, the second network device is a device that performs the compensation operation, and the first network device is a device that is subjected to the compensation operation. That is, the first number of times the compensation operation is performed can be the number of times the target network device forwards its cached data 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 N value is increased by 1. The second number can be represented by the number of network disconnections within a predetermined time period, which can be represented by M. When the IPC1 network is disconnected once, the M value is increased by 1. The target state can indicate whether this network device has experienced a network abnormality within a predetermined time period, which can be represented by D. Among them, the network abnormality can include disconnection. For example, when a network device does not experience a network abnormality during this period, D is 1, and if a network abnormality occurs during this period, D is 0.

[0043] In the above embodiment, determining the network status indicator based on the first number, the second number and the target status may include: determining the reciprocal of the sum of the first number, the second number and the target status as the network status indicator.

[0044] In an exemplary embodiment, determining the network status indicator of the target network device based on the first number, the second number and the target status 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 status and a third weight; 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.

[0045] In the above embodiment, the specific calculation formula of the network status indicator 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 The weight indicating that this IPC has frame supplement behavior (i.e. the first weight mentioned above), f D represents the weight of an IPC network disconnection (i.e., the second weight mentioned above), f T represents a positive value (i.e., the third weight mentioned above), the first product can be expressed as f B The second product can be expressed as f D The third product can be expressed as f T The product of S and 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 indicators, S max,min Represents a restriction function (with upper and lower limits of max=100, min=10, i.e., the maximum and minimum values ​​mentioned above), N can represent the first number of times the compensation operation is performed, i.e., 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, i.e., the number of times the network is disconnected within a predetermined time period, and D can represent whether this network device has experienced a network abnormality within a predetermined time period. When the sum value is within the interval of the restriction function, the sum value is determined as the network status indicator; when the sum value is less than the minimum value of the restriction function interval, the minimum value is determined as the network status indicator; when the sum value is greater than the maximum value of the restriction function interval, the maximum value is determined as the network status indicator. By setting a restriction function, meaningless surges and falls in values ​​can be avoided.

[0047] In the above embodiment, the larger the values ​​of N and M, the more abnormal conditions there are in the network, and the smaller the value of F network status, the lower the ranking. In order to prevent an IPC with a low ranking from always being in the low ranking state, and to enable the ranking to move up when the network status of the IPC improves, a positive value f is added. T and value D (values ​​are 0, 1). If there is no network abnormality in this cycle, set D = 1, and the value of this IPC increases by f T It helps to improve the ranking, but if there is a network anomaly during this cycle, there is no increase in f T (i.e. D=0). Sort by network status of different IPCs. When there are parallel IPC values, sort by order of IP addresses. This ensures that the network status table shared by NVR and IPC is consistent, which eliminates the workload of each device to collect statistics and generate network status table, and avoids the differences in network status table of each device. In addition, the weights of each of the above data can be defined by users according to different products and environments.

[0048] In the above embodiment, when there is a new IPC or an IPC after restart (including after network recovery), the IPC can actively obtain network status indicators from the NVR, such as Figure 4 As shown, Figure 4 It means that NVR regularly synchronizes the IPC network status table to the topology diagram of each IPC, which ensures that all devices in the entire LAN (NVR and IPC) can obtain a unified network status table. In the event of network anomalies, IPC can quickly obtain the information of IPCs with good network status other than itself from the table and forward frames.

[0049] In an exemplary embodiment, after sending a first frame supplement request to the second network device, the method further includes: upon receiving 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 embodiment, when the NVR receives the AN frame data (ie, the above second data) from IPC1, it can refer to Figure 5 , Figure 5 This is a schematic diagram of the frame compensation request process according to an embodiment of the present invention, indicating that the abnormal network status of IPC1 and NVR has returned to normal. At this time, NVR sends a command to IPC4, requesting IPC4 to stop applying for and forwarding cache frames to IPC1 (that is, the first stop compensation command mentioned above), that is, everything returns to normal working status, and IPC1 continues to send AN+1, AN+2 and other frame data to NVR.

[0051] In an exemplary embodiment, after sending a first compensation request to the second network device, the method further includes: receiving the cached data; determining tag information included in 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 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 location information.

[0052] In the above embodiment, the tag information may be information indicating which IPC the frame data belongs to, and the position of the frame in the original video stream, etc. Figure 6 , Figure 6The schematic diagram of the supplementary frame forwarded by the IPC received by the NVR according to the embodiment of the present invention. The IPC1 sends the cached frame data carrying the label to the IPC4, and the IPC4 sends the acquired frame data with the label to the NVR. When the NVR receives the frame data forwarded by the IPC4, it reads and parses the label information carried by the frame, checks and strips the label, and determines the correct position of the cache queue of the original IPC1 frame (i.e., the first storage area mentioned above) according to the label information.

[0053] In the above embodiment, after the correct position of the cache queue of the original IPC1 frame is determined, the process of filling the forwarded supplementary frame into the cache area is as follows: Figure 7 As shown, the original IPC1 frame data carried in IPC4 is added to the IPC1 cache.

[0054] In this embodiment, a data compensation method is provided. Figure 8 The process of the data compensation method according to the embodiment of the present invention is as follows Figure 2 ,like Figure 8 As shown, the process includes the following steps:

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

[0056] Step S804, 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;

[0057] Step S806: 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.

[0058] In the above embodiments, 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, the embedded NVR generally only supports IP cameras of a certain manufacturer due to the non-standard nature of its IP camera; PC-based NVR (PCBased NVR) can be understood as a set of video monitoring software installed on a PC, server or industrial computer with an X86 architecture. The network device can be a network camera IPC, monitoring equipment, etc. A target device can be connected to multiple network devices.

[0059] In the above embodiment, the network status indicator can be understood as a network status table generated by sorting the network status values ​​of all network devices, and 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 embodiment, the network status indicator can be determined by the target device, and 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 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 compensation operation is performed on the target network device 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 state of the target network device within the predetermined time period, wherein 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, 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; determining a difference between the historical network status indicator and the first product and the second product; determining a 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.

[0061] In the above embodiment, the first network device may be any one of all network devices that fails to transmit data to the target device, the first data may be the current frame data stored in the local cache of the IPC, and the second network device may be the network device with the highest ranking of network status indicators 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 the 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 a device that performs the compensation operation, and the first network device is a device that is subjected to the compensation operation. That is, the first number of times 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 increases by 1. The second number may be represented by the number of times the network is disconnected within a predetermined time period, which may be represented by M. When the IPC1 network is disconnected once, the value of M increases by 1. The target state may represent whether this network device has experienced a network abnormality within a predetermined time period, which may be represented by D. The network abnormality may include disconnection. For example, when a network device does not experience a network abnormality during this cycle, D is 1; if a network abnormality occurs during this cycle, D is 0.

[0062] In the above embodiment, determining the network status indicator based on the first number, the second number and the target status may include: determining the reciprocal of the sum of the first number, the second number and the target status as the network status indicator.

[0063] In the above embodiment, the specific calculation formula of the network status indicator can be shown as follows:

[0064] F 网络状态 =S max,min (F – f B * N – f D * M + f T * D), where F 网络状态 Indicates the network status indicator, f B The weight indicating that this IPC has frame supplement behavior (i.e. the first weight mentioned above), f D represents the weight of an IPC network disconnection (i.e., the second weight mentioned above), f T represents a positive value (i.e., the third weight mentioned above), the first product can be expressed as f B The second product can be expressed as f D The third product can be expressed as f TThe product of S and 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 indicators, S max,min Represents a restriction function (with upper and lower limits of max=100, min=10, i.e., the maximum and minimum values ​​mentioned above), N can represent the first number of times the compensation operation is performed, i.e., 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, i.e., the number of times the network is disconnected within a predetermined time period, and D can represent whether this network device has experienced a network abnormality within a predetermined time period. When the sum value is within the interval of the restriction function, the sum value is determined as the network status indicator; when the sum value is less than the minimum value of the restriction function interval, the minimum value is determined as the network status indicator; when the sum value is greater than the maximum value of the restriction function interval, the maximum value is determined as the network status indicator. By setting a restriction function, meaningless surges and falls in values ​​can be avoided.

[0065] In the above embodiment, the larger the values ​​of N and M, the more abnormal conditions there are in the network, and the smaller the value of F network status, the lower the ranking. In order to prevent an IPC with a low ranking from always being in the low ranking state, and to enable the ranking to move up when the network status of the IPC improves, a positive value f is added. T and value D (values ​​are 0, 1). If there is no network abnormality in this cycle, set D = 1, and the value of this IPC increases by f T It helps to improve the ranking, but if there is a network anomaly during this cycle, there is no increase in f T (i.e. D=0). Sort by network status of different IPCs. When there are parallel IPC values, sort by order of IP addresses. This ensures that the network status table shared by NVR and IPC is consistent, which eliminates the workload of each device to collect statistics and generate network status table, and avoids the differences in network status table of each device. In addition, the weights of each of the above data can be defined by users according to different products and environments.

[0066] In the above embodiment, when there is a new IPC or an IPC after restart (including after network recovery), the IPC can actively obtain network status indicators from the NVR, such as Figure 4 As shown, Figure 4 It means that NVR regularly synchronizes the IPC network status table to the topology diagram of each IPC, which ensures that all devices in the entire LAN (NVR and IPC) can obtain a unified network status table. In the event of network anomalies, IPC can quickly obtain the information of IPCs with good network status other than itself from the table and forward frames.

[0067] In the above embodiment, after determining the network status indicator, the target device can send the network status indicator to all network devices connected to it, and all network devices connected to the target device can be connected in the same local area network to achieve communication between network devices. In the local area network, all devices can broadcast the received network status indicator to ensure that the network status indicator is received by the network device with poor network status or unable to receive the network status indicator sent by the target device. Of course, the network devices can also be connected via Bluetooth to form a mesh network to achieve the synchronous sharing of the received network status indicator between network states.

[0068] In the above embodiment, after receiving the network status indicator, any one of the network devices connected to the target device can store the network status indicator in the share of the local area network where all network devices are located. When there is a device in the network device that cannot receive the network status indicator, the device can obtain the latest network status indicator from the share. In the above embodiment, the second network device can be determined by the first network device, and the first network device determines the topN network devices as 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 first network device fails to send data, the number of compensation operations being performed by IPC2 and IPC3 is determined. If IPC2 is currently forwarding data from IPC4 and IPC5, the number of compensation operations being performed by IPC2 is 2. IPC3 is currently forwarding data of IPC6, and the format of the supplementary operation being executed by IPC3 is 1. Then IPC3 can be determined as the second network device.

[0069] In the above embodiment, the execution subject can be an IPC, which can send frames through a TPC connection. In this way, after the IPC sends data to the NVR, the NVR will feedback a response, so that the IPC can sense the frame loss caused by network fluctuations, so the IPC that fails to send the frame initiates a request for frame supplement. The schematic diagram of the forwarding frame supplement of the network device IPC can be seen in the attached Fig. 9 , the network equipment IPC forwarding frame filling flow chart can be found in the attached Fig.10 ,like Fig. 9 , Fig.10As shown: Under normal working conditions, each IPC (i.e., the above network device) stores the current frame data in the local cache while sending data frames to the NVR (i.e., the above target device). When IPC1 experiences network fluctuations, it fails to send the current frame data (i.e., the above first data) to the NVR. IPC1 selects IPC4 (i.e., the above second network device) with the best network status indicator through the network status table of the network status, sends a request (i.e., the above second compensation request) to IPC4, obtains its own cache frame, and after IPC4 obtains the request information, it initiates to obtain the data of the current frame to IPC1 and forwards the obtained 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 the network status indicator, and the topN network devices can be determined as candidate network devices. The second network device can be a device in 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 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 first network device IPC1 fails to send the first data, the number of compensation operations being performed by IPC2 and IPC3 is determined. 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 format of the supplementary operation being performed 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 cache data of the first network device may include: the second network device receiving the cache data sent by the first network device. The first network device may send the cache data to the second network device via Bluetooth or other wireless methods. 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. This ensures that when the network status of the first network device is poor or the cache data cannot be sent, the second network device can obtain the cache data in time.

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

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

[0073] In an exemplary embodiment, after sending a second compensation request to the second network device, the method further includes: upon receiving a request sent by the second network device to obtain the cached data, 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; and sending the cached data to the second network device.

[0074] In the above embodiment, the tag information may be information indicating which IPC the frame data belongs to, and the position of the frame in the original video stream, etc. Fig.10 , IPC1 actively sends the cache frame data carrying the tag to IPC4.

[0075] In an exemplary embodiment, after sending a second compensation request to the second network device, the method further includes: when it is determined that sending the 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, see the attached Fig.10 When IPC1 re-detects that its sent frame data (i.e., the second data) is sent successfully, it indicates that the abnormal network status of IPC1 and NVR has returned to normal. At this time, IPC1 sends a stop request for cache frames to IPC4 (i.e., the second stop compensation command), and then IPC1 and NVR resume normal working status and send frame data such as AN+1 and AN+2.

[0077] Through the present invention, when 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 in 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. Therefore, the problem of IPC transmission frame loss in data transmission can be solved, thereby achieving the effect of complete data transmission.

[0078] In the above embodiment, in the case of weak network, frame data is forwarded to NVR through other IPCs with good network status, so as to realize the frame supplement operation, avoid the need to add additional servers for caching, and do frame caching without adding additional expenses. The network status indicators of the connected IPCs are regularly counted by NVR, updated in real time to the network status table, and sent to all connected IPCs to realize the unified use of a network status table by devices in a cluster. The management of the network status table is sorted in descending order according to the network status indicator, and the best network status indicator is placed at the front. The evaluation criteria of the network status indicator are mainly: the number of network offline times of IPCs, the network packet loss rate of IPCs (the number of times frame supplement occurs) and so on within a certain period of time. In the UDP connection mode, the NVR regularly detects the speed of receiving frames, infers whether the IPC encounters network problems when sending frames, resulting in frame failure. After determining that there is a network problem, the NVR itself actively requests other IPCs to assist in forwarding. In the TCP connection mode, the sender IPC detects whether the frame is sent successfully, infers whether there is a network abnormality, and actively requests other IPCs to assist in forwarding. The IPC caches the current frame locally before sending the frame to achieve frame backup. 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 forwarded by other IPCs, the frame is tagged to record the information such as the position of the frame in the IPC and the frame in the stream. When the frame is sent to the NVR, it can be filled into the cache of the original IPC by parsing the information in the tag to achieve the complete cache of this video stream of the NVR. In the process of NVR live streaming in a weak network environment, when there is network jitter in the IPC, the method of caching the current frame information through the IPC and forwarding it to the NVR through other IPCs with good network status is implemented to supplement the frame loss phenomenon, thereby avoiding frame loss in NVR video live broadcast.

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

[0080] In the present embodiment, a data compensation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0081] Fig.11 is a structural frame of a data compensation device according to an embodiment of the present invention Figure 1 ,like Fig.11 As shown, the device comprises:

[0082] A first determining module 1102, configured to determine network status indicators of all network devices connected to the target device according to a predetermined time period;

[0083] A second determining module 1104 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;

[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, wherein the compensation operation includes obtaining cache data of the first network device and sending the cache data to the target device.

[0085] In an exemplary embodiment, the first determination module 1102 can determine 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: determine the first number of times the compensation operation is performed on the target network device 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 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; determine the network status indicator based on the first number, the second number and the target state.

[0086] In an exemplary embodiment, the first determination module 1102 can determine 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: determine the historical network status indicator of the target network device in the previous period of the predetermined time period; determine the first product of the first number and the first weight; determine the second product of the second number and the second weight; determine the third product of the target value corresponding to the target state and the third weight; determine the difference between the historical network status indicator and the first product and the second product; determine the sum of the difference and the third product; when the sum is within a preset interval, determine the sum as the network status indicator; when the sum is less than the minimum value of the preset interval, determine the minimum value as the network status indicator; when the sum is greater than the maximum value of the preset interval, determine the maximum value as the network status indicator.

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

[0088] In an exemplary embodiment, the device can also be used to, after sending a first compensation request to the second network device: receive the cached data; determine tag information included in 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 the 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; and store the cached data in the first storage area according to the location information.

[0089] Fig.12 is a structural frame of a data compensation device according to an embodiment of the present invention Figure 2 ,like Fig.12 As shown, the device comprises:

[0090] A receiving module 1202 is used to receive network status indicators of all network devices connected to the target device and sent by the target device;

[0091] A third determining module 1204 is configured 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;

[0092] The second execution module 1206 is used 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.

[0093] In an exemplary embodiment, the device can be used to send a second compensation request to the second network device: upon receiving a request sent by the second network device to obtain the cached data, add 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 the data stream sent by the device to which the cached data belongs; and send the cached data to the second network device.

[0094] In an exemplary embodiment, the apparatus may also be used to, after sending a second compensation request to the second network device: when it is determined that the second data is sent to the target device successfully, send a second stop compensation command 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 modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

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

[0097] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk. An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

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

[0099] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.

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

[0101] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general 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 a program code executable by a 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 made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent 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; A first compensation request is sent 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.

2. The method according to claim 1, characterized in that Determine the network status indicators of all network devices connected to the target device according to a predetermined time period, including: 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 network disconnections of the target network device 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 anomaly occurs in the target network device; The network status indicator is determined based on the first number, the second number, and the target state.

3. The method according to claim 2, characterized in that 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 status includes: Determine the historical network status indicator of the target network device in the previous period of the predetermined time period; Determine a first product of the first number and a first weight; Determine a second product of the second number and a second weight; Determine a third product of the target value corresponding to the target state and a third weight; Determine a difference between the historical network status indicator and the first product and the second product; determining a sum of the difference and the third product; When the sum is within a preset range, 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, the maximum value is determined as the network status indicator.

4. 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.

5. 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.

6. 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; A second compensation request is sent 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.

7. The method according to claim 6, 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.

8. The method according to claim 6, 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.

9. 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; The first execution module is used 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.

10. 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; The second execution module is used 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.

11. 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 5, or execute the method described in any one of claims 6 to 8 when executed.

12. 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 5, or to execute the method described in any one of claims 6 to 8.

13. 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 5, or executes the steps of the method described in any one of claims 6 to 8.

Citation Information

Patent Citations

  • Intelligent equipment control method and device, storage medium and electronic device

    CN115002206A

  • Joint transmission method, terminal device, target network device and cooperative network device

    CN116325577A

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

    CN117915436A

  • Data compensation method, driving equipment or mobile terminal, system and medium

    CN118590835A

  • Streaming media processing method, apparatus, and system

    US20160134900A1