English 中文(简体)
跟踪和发现一系列缺失数据(如安全记录数据)的技术
原标题:Technique to track and detect missing data in a series (e.g. Security Log data)

我有一个数据流,以不断上升的指数(n++)向我发送数据。 其中一些数据有可能按顺序发送,丢失或以其他方式需要重新发送。

<><>Example>

  1. Assume I有一份安全记录文件,由我的评估进行监测。 可能会有一种坏的幌子来压制或防止几个条目的传播。 我要提醒我注意这一事实。

  2. 还假设这一数据可按顺序送交记录员。

It seems this logic is everywhere I don t want to reinvent the wheel and do something less than efficient.

<<><><><><>>>>><><><>>>>>

How should I implement (or what reference implementation exists) that allows me to track data received out of order and may contain missing data in a sequence?

(请你协助提出这一问题)

最佳回答

Okay, well I did this using a linked list. There has to be a prior work for this somewhere... either way, this is optimized for an input series that is more or less increasing in nature.

让我知道,你们是否看到任何ug,或我能够作出的改进。

    public class ContiguousDataValue
    {
        public int UpperInt { get; set; }
        public int LowerInt { get; set; }

        public override string ToString()
        {
            return "Upper" + UpperInt + " Lower" + LowerInt; 
        }
    }


public class ContiguousData 
{
    LinkedList<ContiguousDataValue> ranges = new LinkedList<ContiguousDataValue>();

    public void AddValue(int val)
    {
        for (LinkedListNode<ContiguousDataValue> range = ranges.Last; range != null; range = range.Previous)
        {
            if (val > range.Value.UpperInt)
            {
                // increment current node if applicable 
                if (val == range.Value.UpperInt + 1)
                    range.Value.UpperInt = val;
                else
                    ranges.AddAfter(range, new ContiguousDataValue() { UpperInt = val, LowerInt = val });
                return;
            }
            else if (val < range.Value.LowerInt)
            {
                if (val == range.Value.LowerInt - 1)
                {
                    range.Value.LowerInt = val;
                    return;
                }
                else
                {
                    continue;
                }
            }
        }
        // Anything that reaches this line is either a very new low value, or the first entry
        ranges.AddLast(new ContiguousDataValue() { UpperInt = val, LowerInt = val });
    }
 }
问题回答

您提到了贵方办公室的坦诚执行:TCP。 因此,将你的数据寄给技术方案,会产生一些可喜的后果。

  • whenever (ifever) data arrives out of sequence, you can safely assume, that your either your sending or your receiving process is misbehaving.
  • Whenever data is missing in the sequence, you can assume the same
  • The same is true for acknowledgement, so your sending process has a perfect last-known-good at all times.

我强烈建议,简单地将TCP作为你的运输,(如果这不能直接使用)简单地将TCP数据表输入你的网络。

简言之,使你得以顺利执行。

首先,如果你有潜在的种族条件,你就应当予以解决。

TCP通过等待,克服了排外数据的问题。 如果包装6在包装后到达,TCP将等到包装5到达。 如果包装5 吨 t 到达一定时期,则技术促委会将要求重新转售第5类包装,这将导致第5类包装失去效用。

(说明——我知道TCP/IP按tes计,而不是包装,这里没有关联)

如果你可以要求您的umb带装置重新发送,你可以采用同样的技术。 我说,你可以这样做,因此,你需要诉诸另一种机制。 它可以与TCP的做法相似。 你只是需要决定,在你决定入境之前,你会再等待多久。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签