A Lossless Event Compression Method Based on Discrete Event System

By establishing a compression automaton model in a discrete event system, a lossless event compression method is proposed, which solves the problems of resource waste and online compression in the prior art, and achieves efficient lossless event compression.

CN111726118BActive Publication Date: 2025-02-07TONGJI ARTIFICIAL INTELLIGENCE RES INST SUZHOU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010557459.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-18
Publication Date
2025-02-07
Estimated Expiration
2040-06-18

AI Technical Summary

Technical Problem

When the prior art deals with lossless event compression based on discrete event systems, it is difficult to effectively utilize the information redundancy generated dynamically by the system, resulting in waste of storage and transmission resources, and it is difficult to realize online lossless compression.

Method used

Using the lossless event compression method based on discrete event system, by establishing a compression automata model, offline and online lossless event compression methods are proposed to ensure the first-order recovery of the compressed event sequence and the satisfaction of the second compression protocol.

Benefits of technology

It realizes the use of storage and transmission resources without losing information. It is suitable for engineering systems such as automobiles, power grids, manufacturing plants, and smart buildings. Especially when the system changes dynamically, it can effectively perform online lossless compression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111726118B_ABST
    Figure CN111726118B_ABST
Patent Text Reader

Abstract

The present invention relates to a lossless event compression method based on a discrete event system, including obtaining a minimum recoverable compressed event sequence given a discrete event system and a source event sequence generated by the system; given a first compression protocol: retaining the last k events in the source event sequence; given a second compression protocol: retaining at least one event for any cyclic sub-event sequence, establishing a compression automaton model to represent all possible source event sequences of the given compressed event sequence, detecting whether the given compressed event sequence is 1-order recoverable and whether it satisfies the second compression protocol based on the compression automaton model, and respectively proposing an offline lossless event compression method and an online lossless event compression method. The present invention utilizes the information redundancy generated dynamically by the system as a compression method based on the system, reduces storage resources, and ensures that all actions occurring in the system can be tracked while saving fewer actions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of information processing, and in particular relates to a lossless event compression method based on a discrete event system. Background Art

[0002] Compression, as a very typical technology, can reduce the resources required to store and transmit information. It is applied in many occasions, such as file systems, databases, message transmission, web page transmission, etc. With the rise of big data technology, people's demand for compression has become more obvious. At present, compression is based on databases and can be lossy or lossless. Lossless compression algorithms usually use statistical redundancy to compress data without losing any information. The LZ compression method is one of them, using a dictionary-based compression model in which dictionary entries are replaced with repeated data strings. Among non-dictionary algorithms, the PPM compression method is an adaptive statistical data compression technology based on context modeling and prediction. It is different from a dictionary because the PPM method predicts what the next symbol will be instead of trying to find the next symbol in the dictionary to encode. Recently, grammar-based codes have become increasingly popular because they can very effectively compress highly repetitive inputs, such as biological data of the same or similar species.

[0003] In many real systems, the information structure is subject to the dynamics of the system itself. For example, in some Web services, the occurrence of certain actions can be predicted based on the actions that have already occurred. Therefore, it is not necessary to store all the information (the occurrence of all actions), but only to keep part of the information (the occurrence of certain actions). Summary of the invention

[0004] The purpose of the present invention is to provide a lossless event compression method based on discrete event system, which adopts the discrete event system framework to study the compression problem and can be applied to engineering systems such as automobiles, power grids, manufacturing plants, and intelligent buildings.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A lossless event compression method based on discrete event system, comprising:

[0007] Given a discrete event system G and its generated source event sequence s, obtain the minimum recoverable compressed event sequence s′ min ; Given the first compression protocol: keep the last k events (k ≥ 1) in the source event sequence; Given the second compression protocol: for any cyclic sub-event sequence, keep at least one event,

[0008] Establish the compression automaton model G s′Represent all possible source event sequences s for a given compressed event sequence s′, detect whether the given compressed event sequence is 1-order recoverable and satisfies the second compression protocol based on the compression automaton model,

[0009] An offline lossless event compression method and an online lossless event compression method are proposed respectively.

[0010] Preferably, the offline lossless event compression method comprises:

[0011] S1. Set s′=s, determine whether s′ is 1-order recoverable, if 1-order recoverable, set s′ min =s and output s′ min ,

[0012] S2, set i = 1 and s * =s, judge s * / σ i Whether the second compression protocol is satisfied, if not, determine whether i=m-1 is true, if true, set s′ min =s * ; If not, set i=i+1 and repeat S2.

[0013] S3. Judgment * / σ i Is it 1-order recoverable? If it is 1-order recoverable, from s * Delete event σ i And set * =s * / σ i ,

[0014] S4, output s′ min .

[0015] Preferably, the online lossless event compression method comprises:

[0016] S1, set j = 1,

[0017] S2. Judge j≤|s′σ i |Is it established?

[0018] If not, set k min (sσ i )=j, output k min (sσ i );

[0019] If established, judge (s′σ i ) -(j-1) Is it 1-order recoverable? If it is 1-order recoverable, set k min (sσ i )=j and output kmin (sσ i ),

[0020] S3. Set j = j + 1, repeat S2, and set k min (sσ i ) = j, and output k min (sσ i ),

[0021] S4. Set l = 1,

[0022] S5. Judge whether it holds,

[0023] If it does not hold, set and output s′ new ;

[0024] If it holds, judge whether it satisfies the second compression protocol. If it does not satisfy the second compression protocol, set l = l + 1 and repeat S5 to detect whether it is first - order recoverable. If it is first - order recoverable, set

[0025] S6. Set l = l + 1, repeat S5,

[0026] S7. Set and output s′ new 。

[0027] Preferably, the construction of the compression automaton model includes:

[0028] S1. Set and re - define the initial state of G s′ as z 0 = ((q 0 ,{q 0}),1), that is

[0029] S2. Set Z m = Z 1 , and then perform the CoAc operation, that is G s′ ←CoAc(G s′ ),

[0030] S3. Set i = 1,

[0031] S4. Judge whether i < j holds,

[0032] If it holds, perform the following operations:

[0033] 1) Add to Gs′ , even if Z=Z∪Z i+1 and

[0034] 2) For each state z∈Z i , state z′∈Z i Do the following:

[0035] determination Is it established? If established,

[0036] If not, set Z = Z ∪ Z t ,

[0037] S5, set i=i+1, repeat S4,

[0038] S6. For each state z∈Z j , do the following:

[0039] 1) Judgment ! Is it true? If true, let

[0040] 2) Set Z m =Z t , and perform the CoAc operation, that is, G s′ ←CoAc(G s′ ),

[0041] S7, output compression automaton model G s′ .

[0042] Further preferably, given a discrete event system G = (Q, Σ, δ, q 0 ), build an augmented automaton model:

[0043] G ins =(Y,Σ,ξ,Y 0 )=Ac(Q×2 Q ,Σ,ξ,Y 0 ), each state y∈Y is a double element, the first element y(1) represents the current state, and the second element y(2) represents the set of all traversed states. On this basis, an augmented automaton model is established for each compression event Among them, Z i ={(y,i):y∈Y}, Z 0,i ={(y,i):y∈Y 0}, For every state z∈Z i, where z(1) = y, z(2) = i, z(1)(1) = y(1), z(1)(2) = y(2), and a compression automaton model is established according to the augmented automaton model.

[0044] Preferably, determining whether the compression automaton model can detect that a given compressed event sequence is 1 - order recoverable includes:

[0045] S1. Set x 0 = {z 0}, and i = 0,

[0046] S2. Calculate all active events of state x i to form a set where is the set of events generated by state z′ in automaton G s′ .

[0047] S3. Determine whether |E(x i )| = 1 ∧ z t ∈ x i holds.

[0048] If it holds, calculate state x i+1 to obtain where σ i+1 is the only event in set E(x i ).

[0049] If it does not hold, set Z m = x i , and execute step 5 to determine whether Z m = {z t} holds. If it holds, it is 1 - order recoverable; if not, it is 1 - order non - recoverable.

[0050] S4. Set i = i + 1 and execute S2.

[0051] Preferably, determining whether the compression automaton model can detect that a given compressed event sequence satisfies the second compression protocol includes:

[0052] S1. Set i = 1,

[0053] S2. Determine whether i < j holds. If it does not hold, it satisfies the second compression protocol. If it holds, perform the following operations:

[0054] 1) Calculate the deleted sub - event sequence

[0055] 2) Set

[0056] 3) Set l = k i-1+1,

[0057] 4) Determine whether l < k i Is it true? If not, set i=i+1 and repeat 2). If true, perform the following operations:

[0058] a) Calculate q′={δ(q 0 ,σ 1 σ 2 …σ l )},

[0059] b) Determine q′∈Q v Is it true? If true, the second compression protocol is not satisfied. If not true, set Q v ←Q v ∪{q′},

[0060] 5) Set l=l+1 and repeat S2.4.

[0061] S3. Set i=i+1 and repeat S2.

[0062] A lossless event compression method based on discrete event system, comprising:

[0063] Given a discrete event system G and its generated source event sequence s, obtain the minimum recoverable compressed event sequence s′ min ; Given the first compression protocol: keep the last k events (k ≥ 1) in the source event sequence; Given the second compression protocol: for any cyclic sub-event sequence, keep at least one event,

[0064] Establish the compression automaton model G s′ Represent all possible source event sequences s of a given compressed event sequence s′, detect whether the given compressed event sequence is 1-order recoverable based on the compressed automaton model, if the source event sequence s can be uniquely determined based on the given discrete event system G and the compressed event sequence s′, then the compressed event sequence s′ is recoverable; then detect whether the given compressed event sequence satisfies the second compression protocol based on the compressed automaton model,

[0065] An offline lossless event compression method and an online lossless event compression method are proposed respectively. Specifically:

[0066] Given a discrete event system G = (Q, Σ, δ, q 0 ), we can directly build the augmented automaton model:

[0067] G ins =(Y,Σ,ξ,Y 0 )=Ac(Q×2 Q ,Σ,ξ,Y 0), each state \(y\in Y\) is a pair, the first element \(y(1)\) represents the current state, and the second element \(y(2)\) represents the set of all traversed states. On this basis, continue to build an augmented automaton model for each compression event. where \(Z\) i =\(\{(y, i): y\in Y\}\), \(Z\) 0,i =\(\{(y, i): y\in Y\) 0 \}\). For each state \(z\in Z\) i , where \(z(1) = y\), \(z(2) = i\), \(z(1)(1) = y(1)\), \(z(1)(2) = y(2)\). Finally, use the following algorithm (as Figure 1 shown) to construct the compression automaton model whose input is the compression event sequence and the augmented automaton model

[0068] The construction of the compression automaton model includes:

[0069] S1. Set and redefine the initial state of \(G\) s′ as \(z\) 0 = \(((q\) 0 , \(\{q\) 0 \}), 1)\), that is

[0070] S2. Set \(Z\) m = \(Z\) 1 , and then perform the CoAc operation, that is \(G\) s′ ← CoAc(\(G\) s′ ).

[0071] S3. Set \(i = 1\),

[0072] S4. Judge whether \(i < j\) holds.

[0073] If it holds, perform the following operations:

[0074] 1) Add to \(G\) s′ , that is \(Z = Z\cup Z\) i+1 and

[0075] 2) For each state \(z\in Z\) i , state \(z'\in Z\) i perform the following operations:

[0076] Judge whether (1) holds. If it holds, let

[0077] If not, set Z = Z ∪ Z t ,

[0078] S5, set i=i+1, repeat S4,

[0079] S6. For each state z∈Z j , do the following:

[0080] 1) Judgment ! Is it true? If true, let

[0081] 2) Set Z m =Z t , and perform the CoAc operation, that is, G s′ ←CoAc(G s′ ),

[0082] S7, output compression automaton model G s′ .

[0083] Since the compression automaton model G s′ is uncertain, so it is difficult to check the recoverability of the compressed event sequence. One way is to transform the uncertain automaton model G s′ is a deterministic automaton (its observer), however, in the worst case, its computational complexity is exponential. Therefore, in the compressed automaton model G s′ Based on the recoverability detection algorithm (such as Figure 2 (shown in Figure 2) detects whether a given compressed event sequence s′ is 1-order recoverable without constructing an observer. This detection method attempts to find a path from the initial state z 0 To the end state z t The computational complexity of the path is linear with the length of the source event sequence s. In addition, the compressed event sequence s′ is 1-order recoverable if and only if Z m ={z t}, where Z m It is a set of flag states. The specific judgment method is as follows: (hereinafter referred to as method 2)

[0084] S1. Set x 0 ={z 0}, and i=0,

[0085] S2, calculate the state x i All active events of constitute the set in It is an automaton G s′ The set of events generated by state z′ in

[0086] S3. Determine whether |E(x i )| = 1 ∧ z t ∈ x i holds.

[0087] If it holds, calculate the state x i+1 , and obtain where σ i+1 is the only event in the set E(x i ).

[0088] If it does not hold, set Z m = x i , and execute step 5 to determine whether Z m = {z t} holds. If it holds, it is 1 - order recoverable; if not, it is 1 - order unrecoverable.

[0089] S4. Set i = i + 1 and execute S2.

[0090] Now, given a source event sequence s, when solving for the minimum compressible event sequence s′ min , it is necessary to ensure that s′ obtained by deleting events from s each time does not violate the first compression protocol and the second compression protocol. The first compression protocol is easy to comply with as long as s′ retains the last k events, but it is difficult to directly see whether the second compression protocol is complied with. Therefore, to determine whether the given compressed event sequence s′ (as shown Figure 3 ) satisfies the second compression protocol, the specific determination method is as follows: (hereinafter referred to as Method 3)

[0091] S1. Set i = 1.

[0092] S2. Determine whether i < j holds. If it does not hold, the second compression protocol is satisfied. If it holds, perform the following operations:

[0093] 1) Calculate the deleted sub - event sequence

[0094] 2) Set

[0095] 3) Set l = k i-1 + 1.

[0096] 4) Determine whether l < k i holds. If it does not hold, set i = i + 1 and repeat 2). If it holds, perform the following operations:

[0097] a) Calculate q′ = {δ(q0, σ 1 σ 2 …σ l )}.

[0098] b) Determine whether q′ ∈ Qv Is it true? If true, the second compression protocol is not satisfied. If not true, set Q v ←Q v ∪{q′},

[0099] 5) Set l=l+1 and repeat S2.4.

[0100] S3. Set i=i+1 and repeat S2.

[0101] Combining the above methods, a complete offline event compression method is further established. This method requires that the source event sequence in the first compression protocol can only retain the last event. That is, given a discrete event system G and a source event sequence s, if the source event sequence s is 1-order recoverable, an offline event compression method is constructed (such as Figure 4 As shown in Figure 2, solve the first-order minimum recoverable compression event sequence s′ min , the specific steps are as follows:

[0102] S1. Set s′=s, and use method 2 to determine whether s′ is 1-order recoverable. If 1-order recoverable, set s′ min =s and output s′ min ,

[0103] S2, set i = 1 and s * =s, use method 3 to determine s * / σ i Whether the second compression protocol is satisfied, if not, determine whether i=m-1 is true, if true, set s′ min =s * ; If not, set i=i+1 and repeat S2.

[0104] S3, use method 2 to determine s * / σ i Is it 1-order recoverable? If it is 1-order recoverable, from s * Delete event σ i And set * =s * / σ i ,

[0105] S4, output s′ min .

[0106] On the contrary, if the source event sequence s is not 1-order recoverable, it is necessary to establish an online event compression method to solve the minimum recoverable compressed event sequence. The key lies in the introduction of k-order lossless compression technology, that is, the source event sequence in the first compression protocol can retain k events. The specific method is to give a discrete event system G, the event sequence s is known to occur, and when a new event σ occurs iAfter that, the source event sequence is updated to sσ i , Figure 5 A complete online event compression algorithm is constructed to obtain the updated source event sequence sσ i Determine k min (sσ i ) and solve for k min (sσ i )-order minimum recoverable compressed event sequence s′ new , the specific steps are as follows:

[0107] S1. Set s′=s, determine whether s′ is 1-order recoverable, if 1-order recoverable, set s′ min =s and output s′ min ,

[0108] S2, set i = 1 and s * =s, judge s * / σ i Whether the second compression protocol is satisfied, if not, determine whether i=m-1 is true, if true, set s′ min =s * ; If not, set i=i+1 and repeat S2.

[0109] S3. Judgment * / σ i Is it 1-order recoverable? If it is 1-order recoverable, from s * Delete event σ i And set * =s * / σ i ,

[0110] S4, output s′ min .

[0111] Preferably, the online lossless event compression method comprises:

[0112] S1, set j = 1,

[0113] S2. Judge j≤|s′σ i |Is it established?

[0114] If not, set k min (sσ i )=j, output k min (sσ i );

[0115] If established, judge (s′σ i ) -(j-1) Is it 1-order recoverable? If it is 1-order recoverable, set k min (sσi )=j and output k min (sσ i ),

[0116] S3, set j = j + 1, repeat S2, set k min (sσ i )=j, output k min (sσ i ),

[0117] S4, set l = 1,

[0118] S5. Judgment Is it established?

[0119] If not, set Output s′ new ;

[0120] If established, judge Whether the second compression protocol is satisfied, if not, set l=l+1 and repeat S5 to detect Is it 1-order recoverable? If it is 1-order recoverable, set

[0121] S6, set l=l+1, repeat S5,

[0122] S7. Settings Output s′ new .

[0123] Due to the application of the above technical solution, the present invention has the following advantages compared with the prior art:

[0124] The present invention utilizes the information redundancy dynamically generated by the system as a system-based compression method; as the system evolves, the generated information is updated as more actions occur. Online lossless compression is also a very practical requirement, which reduces storage resources and ensures that all actions occurring in the system can be tracked while saving fewer actions. BRIEF DESCRIPTION OF THE DRAWINGS

[0125] Attached Figure 1 The construction process of the compression automaton model in this embodiment is shown.

[0126] Attached Figure 2 The recoverability detection process of the compressed event sequence in this embodiment is shown.

[0127] Attached Figure 3 The following is a flow chart showing the detection process of the compression event sequence satisfying protocol 2 in this embodiment.

[0128] Attached Figure 4 The construction process of the offline lossless compression method in this embodiment is shown.

[0129] Attached Figure 5 The construction process of the online lossless compression method in this embodiment is shown.

[0130] Attached Figure 6 The Alipay online transaction system automaton model G in the first embodiment is shown.

[0131] Attached Figure 7 The augmented automaton model G of the Alipay online transaction system in the first embodiment is shown. ins ,

[0132] Attached Figure 8 The compressed automaton model G of the Alipay online transaction system in the first embodiment is shown. s′ ,

[0133] Attached Fig. 9 The online order process in the second embodiment is shown.

[0134] Attached Fig.10 The online order system automaton model in the second embodiment is shown.

[0135] Attached Fig.11 The automaton model of the indoor positioning system in the third embodiment is shown. DETAILED DESCRIPTION

[0136] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0137] Embodiment 1:

[0138] This embodiment refers to the attached Figure 6-8 Alipay is one of the most popular trading platforms in China. This embodiment uses the Alipay online transaction process for example verification. According to the Alipay transaction agreement, merchants conduct transactions with customers through the Alipay transaction platform. When a customer places an order through the Alipay transaction platform, the system will start the Alipay online transaction process, and a series of actions will be executed. These actions are usually stored by the system so that customers and merchants can track them in real time. This is a typical lossless event compression problem. The offline event compression algorithm proposed in this embodiment can save fewer actions while ensuring that all actions occurring in the system can be tracked. These actions can be defined as the following events:

[0139] Table 1 Alipay automaton event set Σ

[0140]

[0141] Every time Alipay reaches a state, it will perform corresponding actions to prompt customers or merchants. The state set Q of the Alipay automaton is as follows:

[0142] Table 2 Alipay automaton state set Q

[0143]

[0144]

[0145] According to the event set Σ and state set Q of the Alipay transaction system, we can establish Figure 6 The compression automaton model G shown, Figure 7 The augmented automaton model G shown ins , by compressing the automaton model building process (such as Figure 1 As shown) can be established Figure 8 The compression automaton model G shown s′ If the system has event sequence e 1 e 2 e 5 e 7 e 8 e 5 e 10 e 13 , which indicates that the customer applied for a replacement and then applied for a refund before receiving the goods. Figure 4 As shown in Figure 2, solve the minimum recoverable compression event sequence s′ min , we delete event e 1 , e 2 , e 5 , e 8 and e 5 , and finally successfully solved the minimum recoverable compression event sequence s′ min =e 7 e 10 e 13 Therefore, the system only needs to save e 7 、e 10 、e 13 Three events without saving e 1 、e 2 、e 5 、e 7 、e 8 、e 5 、e 10 、e 13 Through eight events, customers and merchants can still track the historical and current status of the order without any information loss.

[0146] Embodiment 2:

[0147] This embodiment refers to the attached Figure 9-10 Considering that actual systems generally require dynamic real-time compression, it can be found from the previous introduction that the offline event compression algorithm based on the DES system has a limitation that it requires knowing all the events generated by a given DES system and their order of occurrence in advance. Therefore, this embodiment proposes an online event compression algorithm, and takes the online order system as an example. The order process is as follows Fig. 9 As shown in Table 3, all actions are performed by customers, and the system saves these actions to track the transaction status online. As the executed actions are updated online, the system requires that while saving fewer actions, all the actions that have occurred can still be tracked. This is a typical online lossless compression problem. The event set Σ of the order system is shown in Table 3. Fig.10 Automaton model for the order system.

[0148] Table 3 Order system event set Σ

[0149]

[0150]

[0151] The compression automaton model of the known order system requires an online compression algorithm (such as Figure 5 As shown in Figure 2, the minimum recoverable compressed event sequence is solved online. That is, for any source event sequence s, when a new event σ occurs i After that, the source event sequence is updated to sσ i , now we need to update the source event sequence sσ i Determine k min (sσ i ) with k min (sσ i )-order compression event sequence s′ new The specific calculation results are shown in Table 4:

[0152] Table 4 Order system online event compression results

[0153]

[0154] If the system has the event sequence e 1 e 2 e 3 e 4 e 5 e 6 e 7 e 9 , indicating that the customer successfully placed an order. According to Table 4, the system only needs to save e 2 、e 5 、e 6 、e 7 、e9 Five events without saving e 1 、e 2 、e 3 、e 4 、e 5 、e 6 、e 7 、e 9 Eight events, customers can still track the transaction status online in real time without any information loss.

[0155] Embodiment three:

[0156] This embodiment will refer to the attached Fig.11 This embodiment uses finite automata to model and analyze the indoor positioning system, and then performs lossless event compression on the system. This method reduces the impossible position jumps caused by factors such as indoor environment layout during the positioning process, improves positioning accuracy, and can avoid complex algorithms in probabilistic positioning, reduce resource consumption, and extend the life cycle of the network.

[0157] In order to use the positioning method of finite automata, the positioning stage is divided into two parts: preliminary position decision and finite automata position estimation stage. In the preliminary position decision stage, the K-nearest neighbor algorithm is used to make preliminary position decisions, and the distance d between the current position estimate and the previous final position estimate is calculated. These two values ​​are transmitted as input to the finite automata positioning method. In the finite automata position estimation stage, the process of decision-making position is divided into three categories: decision positioning state 1, correction positioning state 2, and jump positioning state 3. The first positioning is taken as the initial state 0, and the reception termination or the received signal strength is not within the positioning area is taken as the final state 4. Then the non-empty finite set Q of states can be expressed as Q = {0, 1, 2, 3, 4}, and the initial state set Q 0 Represented as Q 0 = {0}, the final state set F is represented by Q m ={4}.

[0158] The motion process of the node to be located always maintains certain motion characteristics. The distance difference formed by two consecutive positioning should be within a certain range. Assume that the distance difference threshold β of the two positionings. In the process of indoor personnel positioning, indoor personnel mainly walk, and the average walking speed of people is 1-1.5m / s, so β=2 is set. When the distance result d between the preliminary estimate of the unknown node and the previous final position estimate is less than the positioning distance difference threshold β, the state jumps to the decision positioning state 1, and the positioning result is output as the position value estimated by the K neighbor algorithm. When the distance difference d is greater than β, positioning correction is required, and the finite state needs to jump to the correction positioning state 2, and the position is corrected to the result of the previous position estimation plus the distance of this movement. The distance can be evaluated and the direction determined using the previous speed and the mobile node transmission time difference. Errors are inevitable in the positioning process. If the errors accumulate to a certain extent, it will cause errors. In order to avoid errors as much as possible, the positioning error flag a and threshold α are set for control. α is set to 2. When aα, it is considered that the cumulative error has reached the limit, and it is not possible to simply perform positioning corrections. The state needs to jump to the transition positioning state 3 and display the result as the current positioning result. During the positioning process, a is incremented each time it jumps to the correction positioning state, but a is cleared as long as no correction positioning is performed. When the node to be located no longer sends information and the received signal strength is always zero, the state will transfer to the final state 4. When the received signal strength obtained does not belong to the pending area, no matter what state it was in before, it will jump to the final state and prompt that it cannot be identified.

[0159] Considering that the event set of finite state transition is related to the received signal strength value and the state flag, we define the following four events and identify them with numbers. The event set Σ can be expressed as Σ={e 1 ,e 2 ,e 3 ,e 4}, the specific event definition is shown in Table 5:

[0160] Table 5 Indoor positioning system event set Σ

[0161]

[0162] Therefore, we can obtain the finite automaton G = {Q, Σ, δ, Q 0 ,Q m},Q,Σ,Q 0 , Q m The specific definitions are given above, where the state transition function δ can be expressed as δ(0,e 1 )=4,δ(0,e 2 )=1,δ(0,e 3 )=2,δ(1,e 1 )=4,δ(1,e2 )=1,δ(1,e 3 )=2,δ(2,e 1 )=4,δ(2,e 2 )=1,δ(2,e 3 )=2,δ(2,e 4 )=3,δ(3,e 1 )=4,δ(3,e 2 )=1,δ(3,e 3 )=2. Finally, we get the finite automaton model of the indoor positioning system as follows Fig.11 shown.

[0163] If the indoor positioning system has an event sequence e 2 e 3 e 4 e 1 , it can be shown that the movement route of the node to be located is as follows: first jump from the initial state to the decision positioning state 1, the positioning result is output as the position value estimated by the K-nearest neighbor algorithm, and then jump to the correction positioning state 2, the position is corrected to the result of the previous position estimation plus the distance of this movement, and then it is found that the cumulative error has reached the limit, and no positioning correction is performed, but jump to the jump positioning state 3, and display the result as the current positioning result, and finally the received signal strength does not belong to the pending area, jump to the final state 4 and prompt that it cannot be identified. Now use the offline event compression algorithm proposed in this embodiment to solve the minimum recoverable compressed event sequence s′ min .according to Figure 4 Using the offline compression algorithm shown in the figure, we find that we can only delete event e 3 , e 2 and e 4 Cannot be deleted, and finally the minimum recoverable compressed event sequence s′ is obtained min =e 2 e 4 e 1 If you delete event e 4 , e 2 e 1 It can be recovered into two source event sequences, namely e 2 e 3 e 4 e 1 and e 2 e 3 e 1 , then e 2 e 1 It is not 1-order recoverable, so it cannot be deleted. Similarly, event e cannot be deleted. 2 , because e 4 e 1 It can also be restored into two source event sequences, e 2 e3 e 4 e 1 and e 3 e 4 e 1 , that is, e 4 e 1 It is not 1-order recoverable either.

[0164] Next, an online compression algorithm (such as Figure 5 The minimum recoverable compression event sequence is solved online (as shown in Table 6). The specific calculation results are shown in Table 6:

[0165] Table 6 Online event compression results of indoor positioning system

[0166]

[0167] If the system has the event sequence e 2 e 2 e 3 e 1 , which shows that the movement route of the node to be located is as follows: first jump from the initial state to the decision-making positioning state 1, the positioning result output is the position value estimated by the K-nearest neighbor algorithm, continue to stay in the decision-making positioning state 1, and then jump to the correction positioning state 2, correct the position to the result of the previous position estimation plus the distance of this movement, and finally the received signal strength does not belong to the pending area, jump to the final state 4 and prompt that it cannot be identified. According to Table 6, e 2 e 3 is the source event sequence e 2 e 2 e 3 The system continues to experience event e 1 , the source event sequence is updated to e 2 e 2 e 3 e 1 , which can be restored into two source event sequences, namely e 2 e 2 e 3 e 1 and e 2 e 2 e 3 e 4 e 1 , violate Figure 4 The offline compression algorithm constructed by the author cannot realize offline compression, but needs the k-order lossless compression technology in the online compression algorithm to solve it, and finally calculate e 2 e 2 e 3 e 1 is 2-order compressible, and its 2-order minimum recoverable compression event sequence is e2 e 3 e 1 .

[0168] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A lossless event compression method based on discrete event system, characterized in that: Including: Given a discrete event system G and its generated source event sequence s, obtain the minimum recoverable compressed event sequence s ′ min ; Given the first compression protocol: keep the last k events (k ≥ 1) in the source event sequence; Given the second compression protocol: for any cyclic sub-event sequence, keep at least one event, Establish the compression automaton model G s′ Represents a given compressed event sequence s ′ All possible source event sequences s are used to detect whether a given compressed event sequence is 1-order recoverable and whether it satisfies the second compression protocol based on the compression automaton model. An offline lossless event compression method and an online lossless event compression method are established respectively. If the source event sequence s is 1-order recoverable, an offline event compression method is established to solve its 1-order minimum recoverable compressed event sequence. If the source event sequence s is not 1-order recoverable, an online event compression method is established to solve the minimum recoverable compressed event sequence. In the first compression protocol, the source event sequence can retain k events. Given a discrete event system G, the event sequence that is known to occur is s. When a new event σ occurs i After that, the source event sequence is updated to sσ i , is the updated source event sequence sσ i Determine k min (sσ i ) and solve for k min (sσ i )-order minimum recoverable compression event sequence s ′ new , the online lossless event compression method comprises: S1. Set j = 1, S2. Judge j≤|s′σ i |Is it established? If not, set k min (sσ i )=j, output k min (sσ i ); If established, judge (s′σ i ) -(j-1) Is it 1-order recoverable? If it is 1-order recoverable, set k min (sσ i )=j and output k min (sσ i ), S3, set j = j + 1, repeat S2, set k min (sσ i )=j, output k min (sσ i ), S4. Set l = 1, S5. Judgment Is it established? If not, set Outputs ′ new ; If established, judge Whether the second compression protocol is satisfied, if not, set l=l+1 and repeat S5 to detect Is it 1-order recoverable? If it is 1-order recoverable, set S6. Set l = l + 1, repeat S5, S7. Settings Outputs ′ new .

2. The lossless event compression method based on discrete event system according to claim 1, characterized in that: The offline lossless event compression method described above includes: S1. Settings ′ =s, judge s ′ Is it 1-order recoverable? If it is 1-order recoverable, set s ′ min =s and output s ′ min , S2, set i = 1 and s * =s, judge s * / σ i Whether the second compression protocol is satisfied, if not, determine whether i=m-1 is true, if true, set s′ min =s * ; If not, set i=i+1 and repeat S2. S3. Judgment * / σ i Is it 1-order recoverable? If it is 1-order recoverable, from s * Delete event σ i And set * =s * / σ i , S4, output s ′ min .

3. The lossless event compression method based on discrete event system according to claim 1, characterized in that: The compression automaton model The build includes: S1. Settings And redefine G s′ The initial state is z0=((q0,{q0}),1), that is, S2. Set Z m = Z1, and then do CoAc operation, that is, G s′ ←CoAc(G s′ ), S3. Set i = 1, S4. Judge whether i < j holds, If it holds, perform the following operations: 1) Join G s′ , even if Z=Z∪Z i+1 and 2) For each state z∈Z i , state z ′ ∈Z i Do the following: determination Is it established? If established, If not, set Z = Z ∪ Z t , S5. Set i = i + 1, repeat S4, S6. For each state z∈Z j , do the following: 1) Judgment Is it established? If established, 2) Set Z m =Z t , and perform the CoAc operation, that is, G s′ ←CoAc(G s′ ), S7, output compression automaton model G s′ .

4. The lossless event compression method based on discrete event system according to claim 3, characterized in that: Given a discrete event system G = (Q, Σ, δ, q0), establish an augmented automaton model: G ins =(Y,Σ,ξ,Y0)=Ac(Q×2 Q ,Σ,ξ,Y0), each state y∈Y is a double element, the first element y(1) represents the current state, and the second element y(2) represents the set of all traversed states. On this basis, an augmented automaton model is established for each compression event Among them, Z i ={(y,i):y∈Y}, Z 0,i ={(y,i):y∈Y0}, For every state z∈Z i , where z(1)=y, z(2)=i, z(1)(1)=y(1), z(1)(2)=y(2), and a compressed automaton model is established based on the augmented automaton model.

5. The lossless event compression method based on discrete event system according to claim 1 or 2, characterized in that: Judging whether the compressed automaton model detects that a given compressed event sequence is 1-order recoverable includes: S1. Set x0 = {z0}, and i=0, S2, calculate the state x i All active events of constitute the set in It is an automaton G s′ The set of events generated by state z′ in S3, judge |E(x i )|=1∧z t ∈x i Is it established? If true, calculate the state x i+1 ,get where σ i+1 is the set E(x i ), If not, set Z m =x i , and execute step 5 to determine Z m ={z t } is true, if true, 1-order can be recovered, if not true, 1-order cannot be recovered, S4. Set i = i + 1 and execute S2.

6. The method for lossless event compression based on discrete event system according to claim 1 or 2, characterized in that: Judging whether the compressed automaton model detects that a given compressed event sequence satisfies the second compression protocol includes: S1. Set i = 1, S2. Judge whether i < j holds. If it does not hold, the second compression protocol is satisfied. If it holds, perform the following operations: 1) Calculate the deleted sub-event sequence 2) Setup 3) Set l = k i-1 +1, 4) Judge l <k i Is it true? If not, set i=i+1 and repeat 2). If true, perform the following operations: a) Calculate q′={δ(q0,σ1σ2…σ l )}, b) Determine q′∈Q v Is it true? If true, the second compression protocol is not satisfied. If not true, set Q v ←Q v ∪{q′}, 5) Set l = l + 1, repeat S2.4, S3. Set i = i + 1, repeat S2.