A method and system for anti-shake scheduling of object model data publishing, a server and a medium
Patent Information
- Application Number
- CN202611143391.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-09
AI Technical Summary
其原因在于,边缘网关的中央处理器CPU、内存和调度资源有限,无法长期稳定承载数万个独立计时器对象;独立计时器过多时,创建、销毁、重置和上下文切换本身就会成为额外负担;当大量物模型同时活跃时,计时器管理开销甚至可能高于业务计算开销,造成边缘节点吞吐下降;边缘场景对该类技术的要求并不只是“防抖”本身,而是需要同时满足多个目标,即对同一聚合发布单元内多个测点到达时间前后不一致的情况进行防抖与聚合,在属于该聚合单元的最后一个测点到来后能够尽快发出聚合结果而不额外拖慢后续计算流程,并且在边缘低硬件条件下实现前述效果的同时,仍可并发维护数万个物模型缓存池,现有公开技术中对物模型设定防抖延迟的技术大多仅适用于通用函数、事件流、键盘输入或单一快照发布场景,解决的是“一个对象如何防抖”或“少量对象如何防抖”的问题,并没有针对“边缘低硬件条件下,针对万级物模型的防抖需求,如何同时完成测点异步到达聚合、防抖后快速发出以及大规模并发调度”,提出一体化实现框架是当前亟需解决的技术难题
(1)、本发明并非针对单个事件或少量对象的普通防抖处理,而是面向边缘物联网场景中万级物模型缓存池并发运行这一实际工程问题提出的整体技术方案;本发明以物模型缓存池作为聚合单元,将到达时间前后不一致的测点数据先写入活动缓存池,再通过普通防抖与最大防抖协同控制发布时机,使系统既能够等待测点数据在短时间内完成聚合,又能够避免持续输入导致长期不发布;与此同时,本方发明过共享全局定时器堆timerHeap、版本化timerId 校验和懒取消机制,避免为每个物模型缓存池维护独立系统计时器,从而降低边缘硬件上的计时器数量、线程或协程调度压力以及堆内删除开销;
Smart Images

Figure CN122884630A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of IoT edge data processing technology, and more specifically relates to a jitter-resistant scheduling method and system for object model data publishing. Background Technology
[0002] In IoT device access and edge computing scenarios, devices often continuously report measurement point data (such as time-series indicators such as temperature, humidity, voltage, and current) in the form of single messages. However, cloud-based IoT platforms typically use "Thing Models" as abstract units, and each Thing Model has a corresponding Thing Model Code (Thing Model tmCode). If each message triggers a publication immediately for multiple measurement points under the same Thing Model, it will bring a series of problems. For example, data reporting becomes very frequent, and messages exhibit significant fragmentation, making it difficult for the platform or downstream consumers to form a complete snapshot of the object model. When the same measurement point changes continuously within a short period of time, a large number of invalid intermediate states are generated, thereby increasing network and computational overhead. If a simple timer scheme is used for the release of each object model, it is usually necessary to maintain an independent timer task for each measurement point or each update. Frequent creation, cancellation, or modification of timers will lead to lock contention and scheduling overhead. When data arrives continuously, general debouncing mechanisms may cause timers to be constantly reset, resulting in long-term inability to release and forming a "starvation" problem. When multiple object models are waiting to be released at the same time, if the scheduling structure is not designed properly, it is also difficult to maintain stable performance under high concurrency. In addition, when mapping real object model data to virtual object models, without an independent caching and scheduling mechanism, it is easy to have disordered release order, duplicate releases, or overwrite errors.
[0003] Especially in edge deployment scenarios, the number of object models is not in the tens or hundreds, but may reach thousands or even tens of thousands. The conventional implementation of "one independent timer for each object model cache pool" or "creating an independent timed task thread or coroutine for each update" is usually not feasible under current edge hardware conditions. This is because the CPU, memory, and scheduling resources of the edge gateway are limited and cannot stably support tens of thousands of independent timer objects for a long period; when there are too many independent timers, the creation, destruction, reset, and context switching themselves become an additional burden; when a large number of object models are active simultaneously, the overhead of timer management may even exceed the overhead of business computation, causing a decrease in edge node throughput; the requirements of edge scenarios for this type of technology are not just "debouncing" itself, but also need to meet multiple objectives simultaneously, namely, debouncing and aggregating situations where the arrival times of multiple measurement points within the same aggregation release unit are inconsistent, and ensuring that the arrival time of the last measurement point belonging to that aggregation unit is minimized. The goal is to quickly generate aggregation results without slowing down subsequent calculations, and to achieve the aforementioned effects under low-hardware conditions at the edge while still maintaining a cache pool of tens of thousands of object models concurrently. Most existing publicly available technologies for setting debouncing delays for object models are only applicable to general functions, event streams, keyboard input, or single snapshot publishing scenarios. They address the questions of "how to debounc a single object" or "how to debounc a small number of objects," but do not address the question of "how to simultaneously complete asynchronous aggregation of measurement points, rapid generation after debouncing, and large-scale concurrent scheduling for the debouncing requirements of tens of thousands of object models under low-hardware conditions at the edge." Proposing an integrated implementation framework is a technical challenge that urgently needs to be solved. Summary of the Invention
[0004] The purpose of this invention is to provide a de-jittering scheduling method and system for object model data publishing. This invention enables the caching and aggregation of individually collected and reported object model measurement point data at the edge, reducing fragmented publishing. By uniformly managing publishing tasks across multiple cache pools through a minimum heap, it reduces the overhead of heap deletion, lock contention, and redundant scheduling. To achieve the above objectives, this invention adopts the following technical solution: According to one aspect of the present invention, a de-jitter scheduling method for object model data publishing is provided, the de-jitter scheduling method comprising the following steps: Receive measurement point data of the measurement point where the object model is located. The measurement point data includes at least the object model code of the real object model, the measurement point identifier, the timestamp, and the measurement point value. Construct a corresponding active cache pool based on the object model code of the real object model to which the measurement point belongs. The validity of the measurement point data is verified. If the verification is successful, the corresponding active cache pool is searched or created according to the object model code. If the active cache pool corresponding to the object model code does not exist, the active cache pool corresponding to the object model code is dynamically created according to the object model template. A measurement point item is created for the measurement point identifier in the active cache pool, and the measurement point value is written into the active cache pool to which the measurement point item of the corresponding object model code belongs. Once the measurement point value corresponding to any object model encoding is written to the active cache pool, two types of anti-shake scheduling tasks are maintained and generated for each active cache pool. The two types of anti-shake scheduling tasks include normal anti-shake task normalTimerTask and maximum anti-shake task maxTimerTask. Both types of anti-shake scheduling tasks are written into the same global timer heap and wait for the triggering of a timed task for unified scheduling. The task scheduling type is distinguished by the task type identifier taskType. The version of the anti-shake scheduling task corresponding to the object model code is verified. If the version verification passes, the data integration and release process of the corresponding object model code is triggered. Wait for the activity cache pool that triggered the release task to publish the complete object model and measurement point data. After the release of this anti-shake scheduling task is completed, clear the activity cache pool of the object model and wait to receive the next round of measurement point data.
[0005] In a further preferred embodiment of the above scheme, after the measurement point value is written into the current active cache pool to which the measurement point item of the object model code belongs, the measurement point value is the current measurement point value of the measurement point item in the current window, and the last update time of the active cache pool and the version of the normal image stabilization task are updated.
[0006] In a further preferred embodiment of the above scheme, when validating the measurement point data, if the validation fails, the measurement point data is discarded and not written to the active cache pool, nor is the subsequent action of the anti-shake scheduling task triggered.
[0007] A further preferred embodiment of the above scheme includes validating the measurement point data by: Data format verification: Verify whether the received measurement point data conforms to the preset protocol format, including whether the required fields exist and whether the data type is correct; Value range verification: Verify whether the measured point value is within the reasonable range defined by the real object model; the specific process is as follows: load the corresponding object model template according to the object model code, locate the measured point template information corresponding to the measured point in the object model template according to the measured point identifier, read the reasonable range constraints defined in the measured point template information, and verify whether the measured point value meets the reasonable range constraints defined by the real object model. Timestamp verification: Verify whether the timestamp is greater than or equal to the timestamp of the last successful writing of the measurement point identifier; Measurement point identifier matching verification: Check whether the measurement point identifier exists in the object model template and whether the measurement point type is consistent with the object model definition; to prevent out-of-order or replay; In the measurement point identifier matching verification, the corresponding object model template is loaded according to the object model code, and the measurement point list defined in the object model template is traversed. If the current measurement point identifier is not in the measurement point list, or the measurement point type does not match the object model definition, the verification fails. Data integrity verification: Verify the integrity of measurement point data that contains a check code or signature.
[0008] In a further preferred embodiment of the above scheme, the measurement point data includes single measurement point data, batch measurement point data, or event stream data, and the method further includes the following steps before performing legality verification on the measurement point data: If the received measurement point data is a single measurement point data, then the corresponding active cache pool is searched or created according to the object model code; If the received measurement point data is batch measurement point data or event stream data, the multiple measurement point data or event stream data are first grouped according to the object model code. The validity check is performed independently on the measurement point data in each object model code group. After the check passes, the measurement point value of each valid measurement point data in the group is written into the activity cache pool where the corresponding measurement point item is located. The object model code of the real object model only triggers the anti-shake scheduling once in this batch processing. The value of each measurement point item after being written is used as the current value of its respective measurement point. The last update time of the cache pool and the version of the normal anti-shake task are updated together. The check results between different groups do not affect each other.
[0009] In a further preferred embodiment of the above scheme, when the measurement point value corresponding to any object model code is cached, if the anti-shake scheduling task cycle is triggered, it is determined whether the object model code is triggering the current anti-shake cycle for the first time or is already in the current anti-shake cycle; the determination process for triggering the current anti-shake cycle for the first time is as follows: determine whether there is an active cache pool or whether the active cache pool is in an active state. If there is no active cache pool, or although it exists but has not yet been activated, it is considered to be entering the current anti-shake cycle for the first time. If this is the first time the current anti-shake cycle is triggered, then create or activate the active cache pool for the object model code, record the start time (timerStartTime) when the measurement point data first arrives, set the current active timer task (timerActive) for the active cache pool, generate the current valid normal anti-shake task version number (normalTimerId) for the active cache pool, and construct a normal anti-shake task identifier containing the object model code of the real object model, task type identifier (taskType), normal anti-shake number (task.timerId), and expiration time (expireTime) and push it into the global timer heap (timerHeap). At the same time, the maximum effective anti-shake task version number maxTimerId of the current active cache pool is generated, and a maximum anti-shake task identifier containing the object model code, task type identifier taskType, maximum anti-shake number max-task.timerId and expiration time expireTime is constructed and put into the global timer heap timerHeap; If the object model encoding is already within the current stabilization cycle, then only a normal stabilization task is generated, the normal stabilization expiration time is recalculated, a new normal stabilization task version number normalTimerId is generated, and a new normal stabilization task normalTimerTask is constructed and pushed into the same global timer heap timerHeap. The original normal timer task is not deleted from the heap, and the maximum timer task, maximum timer task version number, and start time in the active cache pool remain unchanged, thus ensuring that there is still a maximum release time that cannot be postponed in continuous input scenarios.
[0010] A further preferred embodiment of the above scheme, after writing the measurement point value into the active cache pool to which the measurement point item encoded by the object model belongs, also includes: Check if there is a mapping relationship between the object model code of the real object model and the virtual object model code of at least one virtual object model; if so, extract the corresponding measurement point from the current value of the measurement point written this time according to the mapping relationship, generate virtual measurement point data, and find or dynamically create the corresponding virtual object model cache pool with the virtual object model code of the virtual object model, write the virtual measurement point data into the virtual cache pool, and update the last update time of the virtual cache pool and the normal anti-shake task version.
[0011] A further preferred embodiment of the above scheme, which verifies the version of the anti-shake scheduling task corresponding to the object model encoding, includes the following steps: Periodically check the top-of-the-line debouncing task in the global timer heap (timerHeap) for the earliest expiring debouncing task. If the top-of-the-line debouncing task has expired... Then, read the object model code of the real object model from the anti-shake scheduling task, look up the anti-shake scheduling task version number in the activity cache pool corresponding to the object model code, read the anti-shake task identifier corresponding to the anti-shake scheduling task version number, and compare whether the task scheduling type identifier is consistent with the anti-shake task identifier. If the comparison results are consistent, the stabilization scheduling task is the latest normal stabilization task or the maximum stabilization task. If the object model encoding does not receive new valid data within the normal stabilization time and meets the conditions for silent release of normal stabilization, then the release process begins. If the comparison results are inconsistent, the anti-shake scheduling task is directly determined to be an old task and discarded.
[0012] A further optimized version of the above scheme, which publishes the complete object model and measurement point data, includes the following steps: According to the measurement point order pre-recorded by the object model code of the current real object model, the current window cache is traversed, the current value Val of each measurement point is retrieved in turn, and the corresponding last published value LastVal is read. The data is then assembled to form the message body Payload of the object model code of the current real object model, which is used as a complete data snapshot obtained by aggregating the object model code of the current real object model within the current anti-shake cycle, and the complete data snapshot is published. After the release is completed, the current value Val of each measurement point is written back to the active cache pool where the last released value LastVal is located. Then, all measurement point values in the current active cache pool are cleared, as are the normal timerId, the maximum timerId, and other values maintained in the active cache pool.
[0013] In a further preferred embodiment of the above scheme, the mapping relationship between the object model code (tmCode) of the real object model and the virtual object model code (tmCode) of the virtual object model is implemented through mapping rule configuration, which includes one or all of the following: The virtual object model code tmCode of each virtual object model contains measurement point identifiers, which are taken from the object model template of the real object model; Each virtual object model's tmCode has independent anti-shake parameters; The virtual measurement point value is obtained by converting the current measurement point value of the real measurement point according to the calculation rules.
[0014] In a further preferred embodiment of the above scheme, upon checking for the existence of a mapping relationship, the following virtual mapping steps are immediately executed: (11) Mapping list lookup; (12) Generate virtual measurement point data by encoding each virtual object model with tmCode; (13) Write the measurement point value into the virtual measurement point value for inspection; (14) Generate independent debouncing scheduling tasks for the activity cache pool.
[0015] According to another aspect of the present invention, the present invention provides a multi-buffer pool anti-jitter scheduling system for object model data publishing, the anti-jitter scheduling system being used to execute an anti-jitter scheduling method for object model data publishing according to the present invention, the anti-jitter scheduling system being deployed on an Internet of Things edge gateway or edge computing node, the anti-jitter scheduling system including an input access module, an object model cache module, an anti-jitter scheduling module, a timer stack module, a version verification module, a publishing assembly module, and a virtual object model mapping module; The input access module is used to receive single measurement point data, batch measurement point data, or event stream data from the device. The object model caching module is used to establish an independent active cache pool according to the object model code, and to save the measurement point values, templates, last published values and publication order in the current window; The de-jitter scheduling module is used to maintain regular de-jitter tasks and maximum de-jitter tasks for each active buffer pool; The timer heap module is used to store timed tasks to be triggered using a min-heap and schedule them uniformly according to their expiration time. The version verification module is used to determine whether a task is still valid and discard expired tasks by using the timerId or version number of the scheduled task. The release assembly module is used to generate the message payload for external release in the order of measurement points after the anti-shake expires, and to carry the last release value LastVal; The virtual object model mapping module is used to support the mapping update and independent release of real object models to virtual object models.
[0016] The present invention also provides a server, the server including a processor, a memory, and a computer program stored in the memory for running a stabilization scheduling system. When the processor executes the computer program, it runs the stabilization scheduling system stored in the memory. When the stabilization scheduling system is run, it implements the steps of the stabilization task scheduling method for object model data publishing of the present invention.
[0017] The present invention also provides a machine-readable storage medium storing a computer program for running a stabilization scheduling system, wherein the computer program, when executed by a processor, implements the steps of a stabilization task scheduling method for object model data publishing according to the present invention.
[0018] In summary, because the present invention adopts the above-described technical solution, the present invention has the following technical effects: (1) This invention is not a general anti-shake processing for a single event or a small number of objects, but a comprehensive technical solution proposed for the practical engineering problem of concurrent operation of tens of thousands of object model cache pools in edge IoT scenarios. This invention uses the object model cache pool as the aggregation unit, writes the measurement point data with inconsistent arrival times into the active cache pool first, and then controls the release timing through the coordination of ordinary anti-shake and maximum anti-shake, so that the system can wait for the measurement point data to be aggregated in a short time, and avoids long-term non-release due to continuous input. At the same time, this invention has invented a shared global timer heap, versioned timerId verification and lazy cancellation mechanism to avoid maintaining an independent system timer for each object model cache pool, thereby reducing the number of timers on edge hardware, the pressure of thread or coroutine scheduling and the overhead of in-heap deletion. (2) This invention can simultaneously achieve asynchronous arrival aggregation of measurement points, rapid release after anti-shake, and concurrent maintenance of a cache pool of tens of thousands of object models under low hardware conditions at the edge. Compared with traditional anti-shake technology, the focus of this invention is not on a single anti-shake action, but on combining cache pool organization, dual anti-shake strategy, shared timed scheduling, versioned failure judgment, batch group update, and virtual object model mapping into a complete framework suitable for IoT edge data release. This framework can be used in industrial acquisition gateways, edge computing nodes, IoT platform access components, device status aggregation services, and rule engine front-end data processing modules, and has strong engineering implementation value and further expansion space.
[0019] (3) It can cache and aggregate the single object model measurement point data collected and reported from scattered sources at the edge, reducing fragmented releases; it balances the goals of "waiting in silence" and "must be released at the latest" by combining ordinary anti-shake and maximum anti-shake; it manages the release tasks of multiple cache pools in a unified manner through a min-heap, which is suitable for scenarios that maintain a large number of objects waiting to be released at the same time; it achieves lazy cancellation through timerId version verification, reducing the overhead caused by in-heap deletion, lock contention and repeated scheduling; it supports batch input and grouping updates by object model, which improves throughput and reduces scheduling frequency; it supports the mapping release from real object model to virtual object model, which is convenient to extend to rule engine, derived index and complex model scenarios; it retains LastVal in the release payload, which can enhance the downstream support for change trend, differential calculation and state playback; the overall implementation is suitable for edge gateways, industrial acquisition, equipment platforms and high-frequency state reporting scenarios, which is convenient to be quickly deployed in existing IoT systems.
[0020] (4) This invention addresses the problem of concurrent maintenance of cache pools for tens of thousands of object models under low-hardware conditions at the edge. It can simultaneously achieve the following: even if the arrival times of multiple measurement points participating in aggregation under the same object model are inconsistent, accurate debouncing and aggregation can still be completed at the cache pool level; when the last key measurement point arrives and meets the silent condition, the aggregation result can be sent out as soon as possible without artificially slowing down the subsequent rule calculation or process processing time; there is no need to maintain an independent timer for each object model cache pool, so that tens of thousands or even tens of thousands of cache pools can be concurrently maintained on edge resource-constrained devices; compared with traditional debouncing technology that can only handle single objects or a small number of objects, this invention is more suitable for stable operation in large-scale edge object model publishing scenarios. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating the principle of a jitter-reducing scheduling system for object model data publishing according to the present invention; Figure 2 This is a flowchart illustrating a de-jitter scheduling method for object model data publishing according to the present invention. Figure 3 This is a schematic diagram of the validity verification process for the measurement point data of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, preferred embodiments will be listed below with reference to the accompanying drawings to provide a clear and complete description of the invention. However, it should be noted that the examples in the specification are preferred examples, not all examples. Furthermore, many details listed in the specification are merely to provide the reader with a deep understanding of the key issues of this invention; the invention can be implemented even without these specific details.
[0023] To clarify the meaning of the technical terms in this invention, the following definitions are made: Measurement point data: A single message reported by the device includes at least the physical object model code (tmCode), measurement point identifier (propertyId / eventId), timestamp (ts), and measurement point value (Val); measurement point data is the smallest raw unit received by the system. Measurement point value: The numerical value itself carried in the measurement point data, namely the numerical field Val, is the direct object of verification and write operations; for example, if the current measurement point reports 5.00A, then the current value of 5.00A is the measurement point value.
[0024] Current value of a test point: The most recently successfully written value of a test point identifier in the "current window" of the cache pool corresponding to the object model code tmCode. When the same test point is reported multiple times in the same window, the current value of the test point is updated in an overwrite manner. The same test point identifier may be written multiple times in the same window. Each write will overwrite the previous value. The last written value is the current value of the test point in this window. The current window is cleared or closed after the release is triggered. When a new window is opened, the current value of the test point starts to accumulate again. Object Model Template: Structured data that corresponds one-to-one with the object model code tmCode, describing all the measurement point identifiers, measurement point types, and the corresponding measurement point template information associated with each measurement point identifier in the object model.
[0025] Measurement point template information: The identifier for a single measurement point in the physical model template must at least include a data type (int, float, string, enum, bool, etc.) and reasonable range constraints (numerical type: minimum value min, maximum value max; enumerated type: set of allowed values; string type: maximum length; boolean type: list of legal values). Activity Cache Pool (Object Model Cache Pool): An in-memory data structure maintained by the edge side for each object model code tmCode, containing the current window cache (stored in the form of a HashMap<measurement point identifier, measurement point current value>) and the last update time lastUpdateTime; Real Object Model: The object model natively registered by the device, which has a real object model code (tmCode) identifier. It is the object model code (tmCode) carried by the device when reporting measurement point data.
[0026] Virtual object model: A business dimension object model derived from a real object model according to mapping rules. It has the object model tmCode identifier of the virtual object model, has an independent object model template (which can be a subset or derived template of the real template), and independently maintains a cache pool and debouncing task.
[0027] In this invention, such as Figure 1 As shown, according to one aspect of the present invention, the present invention provides a jitter-reducing scheduling system for publishing object model data, the jitter-reducing scheduling system comprising an input access module, an object model caching module, a jitter-reducing scheduling module, a timer stack module, a version verification module, a publishing assembly module, and a mapping processing module; The input access module is used to receive single measurement point data, batch measurement point data, or event stream data from the device. The object model caching module is used to establish an independent active cache pool according to the object model code, and to save the measurement point values, templates, last published values and publication order in the current window; The de-jitter scheduling module is used to maintain regular de-jitter tasks and maximum de-jitter tasks for each active buffer pool; The timer heap module is used to store timed tasks to be triggered using a min-heap and schedule them uniformly according to their expiration time. The version verification module is used to determine whether a task is still valid and discard expired tasks by using the timerId or version number of the scheduled task. The release assembly module is used to generate the message payload for external release in the order of measurement points after the anti-shake expires, and to carry the last release value LastVal (release metadata); The anti-shake scheduling system also includes a virtual object model mapping module, which supports the mapping update and independent release of real object models to virtual object models. In this invention, the anti-shake scheduling system is deployed on an IoT edge gateway or edge computing node. The virtual object model mapping is maintained by the edge side, and the cloud receives batch measurement point updates according to the object model code tmCode of the virtual object model.
[0028] In this invention, such as Figure 1 , Figure 2 As shown, this invention provides a de-jitter scheduling method for object model data publishing, the de-jitter scheduling method comprising the following steps: Step 1: Receive the measurement point data of the measurement point where the object model is located. The measurement point data includes at least the object model code (tmCode) of the real object model, the measurement point identifier, the timestamp, and the measurement point value. The object model code (tmCode), the measurement point identifier, the timestamp, and the measurement point value constitute the uniqueness of the measurement point data at a certain moment. The measurement point value is the reading of a specific measurement point at a specific moment. Construct a corresponding active cache pool based on the object model code of the real object model to which the measurement point belongs. Each object model corresponds to one active cache pool. The active cache pool includes at least the real-time value mapping of the measurement points in the current window, the measurement point template information, the cache of the last published values, and the measurement point data. The system includes an encoding order list, the current normal image stabilization timer task version identifier (timerId), the current maximum image stabilization timer task version identifier (timerId), a timer activation flag, the last update time, and the timer start time. The real-time value mapping for measurement points within the current window only saves data that meets valid conditions; data that does not meet the conditions is not cached, thus preventing invalid values from contaminating the published results. Upon receiving measurement point data, the system searches for or creates a corresponding object model cache pool based on the object model's object model code. Each object model code corresponds to an independent active cache pool, which stores the measurement point data that has arrived within the current image stabilization cycle for that object model. Step 2: Perform a validity check on the measurement point data. If the check passes, find or create the corresponding active cache pool based on the object model code. If the active cache pool corresponding to the object model code does not exist, dynamically create the active cache pool corresponding to the object model code according to the object model template, and create a measurement point item for the measurement point identifier in the active cache pool. Write the measurement point value to the active cache pool to which the measurement point item of the corresponding object model code belongs. After writing the measurement point value to the current active cache pool to which the measurement point item of the object model code belongs, the measurement point value is the current measurement point value of the measurement point item in the current window. Update the last update time of the active cache pool and the version of the normal anti-shake task. If the validity check of the measurement point data fails, discard the measurement point data and do not write it to the active cache pool, nor trigger subsequent actions of the anti-shake scheduling task, that is, do not trigger the anti-shake scheduling task and subsequent actions such as inserting the timer heap action.
[0029] In embodiments of the present invention, such as Figure 3 As shown, the validity verification of the measurement point data includes: Data format verification: Verify whether the received measurement point data conforms to the preset protocol format, including whether the required fields exist and whether the data type is correct; Value range verification: Verify whether the measured point value is within the reasonable range defined by the real object model; the specific process is as follows: load the corresponding object model template according to the object model code, locate the measured point template information corresponding to the measured point in the object model template according to the measured point identifier, read the reasonable range constraints defined in the measured point template information, and verify whether the measured point value meets the reasonable range constraints defined by the real object model. Timestamp verification: Verify whether the timestamp is greater than or equal to the timestamp of the last successful writing of the measurement point identifier; Measurement point identifier matching verification: Check whether the measurement point identifier exists in the object model template and whether the measurement point type is consistent with the object model definition; to prevent out-of-order or replay; In the measurement point identifier matching verification, the corresponding object model template is loaded according to the object model code, and the measurement point list defined in the object model template is traversed. If the current measurement point identifier is not in the measurement point list, or the measurement point type does not match the object model definition, the verification fails. Data integrity verification: Verify the integrity of measurement point data that contains check codes or signatures; In this embodiment of the invention, the measurement point data includes single measurement point data, batch measurement point data, or event stream data. Each of the single measurement point data, batch measurement point data, or event stream data contains at least the object model code of the real object model, the measurement point identifier, the timestamp, and the measurement point value. Before performing legality verification on the measurement point data, the following steps are also included: If the received measurement point data is batch measurement point data or event stream data, the multiple measurement point data or event stream data are first grouped according to the object model code. The legality verification is performed independently on the measurement point data in each object model code group. After the verification is passed, the measurement point value of each legal measurement point data in the group is written into the activity cache pool where the corresponding measurement point item is located. The legal batch measurement point data or event stream data are batched into the same activity cache pool. The object model code of the real object model only triggers the anti-shake scheduling once in this batch processing. The value of each measurement point item after being written is used as the current value of its respective measurement point. The last update time of the cache pool and the version of the normal anti-shake task are updated together. The verification results between different groups do not affect each other. Step 3: After the measurement point value corresponding to any object model code is written to the active cache pool, two types of anti-shake scheduling tasks are maintained and generated for each active cache pool. The two types of anti-shake scheduling tasks include the normal anti-shake task normalTimerTask and the maximum anti-shake task maxTimerTask. After the measurement point value corresponding to any object model code is cached, the following anti-shake judgment is also included: If the anti-shake scheduling task cycle is triggered, it is determined whether the object model encoding is triggering the current anti-shake cycle for the first time or is already in the current anti-shake cycle; the determination process for triggering the current anti-shake cycle for the first time is as follows: determine whether there is an active buffer pool or whether the active buffer pool is in an active state. If there is no active buffer pool, or although it exists but has not yet been activated, it is considered to be entering the current anti-shake cycle for the first time. If this is the first time the current anti-shake cycle is triggered, then create or activate the active cache pool for the object model code, record the start time (timerStartTime) when the measurement point data first arrives, set the current active timer task (timerActive) in the active cache pool, generate the current valid normal anti-shake task version number (normalTimerId) in the active cache pool, and construct a normal anti-shake task identifier containing the object model code of the real object model, task type (taskType), normal anti-shake number (identifier) (task.timerId), and expiration time (expireTime) and push it into the global timer heap (timerHeap). Since this round of anti-shake cycle is the first trigger, the active buffer pool of object model encoding will also create the maximum anti-shake task while creating the normal anti-shake task. At the same time, it will generate the version number maxTimerId of the currently valid maximum anti-shake task in the active buffer pool, and construct a maximum anti-shake task identifier that includes object model encoding, task type taskType, maximum anti-shake number (identifier) max-task.timerId and expiration time expireTime and put it into the global timer heap timerHeap. If the object model encoding is already within the current stabilization cycle, then only a normal stabilization task is generated, the normal stabilization expiration time is calculated, a new normal stabilization task version number normalTimerId is generated, and a new normal stabilization task normalTimerTask is constructed and pushed into the same global timer heap timerHeap. The original normal timer task is not deleted from the heap, and the maximum timer task, maximum timer task version number, and start timerStartTime in the active cache pool remain unchanged, thus ensuring that there is still a maximum release time that cannot be moved back in the continuous input scenario. In this embodiment of the invention, after writing the measurement point value into the active cache pool to which the measurement point item encoded by the object model belongs, the method further includes: The system checks whether a mapping relationship exists between the object model code of the real object model and the virtual object model code tmCode of at least one virtual object model. If it exists, the system extracts the corresponding measurement point from the current value of the measurement point being written, generates virtual measurement point data, and searches for or dynamically creates the corresponding virtual object model cache pool using the virtual object model code of the virtual object model. The system writes the virtual measurement point data into the virtual cache pool and updates the last update time and the normal anti-shake task version of the virtual cache pool. Thus, the system independently maintains the corresponding normal anti-shake task normalTimerTask_v and the maximum anti-shake task maxTimerTask_v for the virtual activity cache pool corresponding to the virtual object model code tmCode of each virtual object model. The mapping relationship between the physical object model's object model code (tmCode) and the virtual object model's virtual object model code (tmCode) is implemented through mapping rule configuration, which includes one or all of the following: The virtual object model code tmCode of each virtual object model contains measurement point identifiers, which are taken from the object model template of the real object model; Each virtual object model is encoded with an independent debouncing parameter tmCode, which includes the silent window duration T_d and the maximum waiting time T_max; The derived expression of the virtual measuring point is used to declare and convert the current measuring point value of the real measuring point according to the calculation rules to obtain the virtual measuring point value. The virtual measuring point itself does not set the object model (sensor). The virtual measuring point value is converted from the real measuring point, constant, and attribute according to the calculation rules. The virtual measuring point does not store the measuring point value. It is only converted according to the calculation rules when querying. Upon checking for the existence of a mapping relationship, immediately execute the following virtual mapping steps: The mapping list lookup uses the object model code TmCode of the real object model to look up the task mapping table Map and obtain the corresponding list of virtual object model codes tmCode; if there is no mapping, all subsequent virtual steps are skipped and the task directly enters the debouncing scheduling task in the real activity cache pool. Virtual measurement point data is generated by encoding the tmCode of each virtual object model: It is determined whether the measurement point identifier reported this time is in the measurement point identifier of the current real object model. If it does not exist, the virtual object model encoding tmCode is skipped; if it exists, the virtual measurement point value is calculated by converting the current real measurement point value of the relevant measurement point in the real activity cache pool; otherwise, the virtual measurement point value = the real measurement point value, and a data packet of virtual measurement point {virtual object model encoding tmCode, virtual measurement point identifier, timestamp ts, current value val} is generated. Virtual measurement point value check: Check whether the virtual measurement point identifier is in the virtual object model template of the virtual object model code TmCode, and whether the virtual measurement point value meets the interval constraints of the virtual object model template. If the check fails, the virtual measurement point data is discarded. Write to the virtual activity cache pool: Locate the corresponding virtual activity cache pool using the virtual object model code TmCode. If the virtual activity cache pool does not exist, dynamically create it according to the virtual object model template, then write the virtual measurement point value to the activity cache pool belonging to the corresponding measurement point item, and update the last update time of the virtual activity cache pool; Independent debouncing scheduling for the active cache pool: Two types of debouncing scheduling tasks (normal debouncing task normalTimerTask_v and maximum debouncing task maxTimerTask_v) are maintained and generated for each virtual active cache pool, and both types of debouncing scheduling tasks are written to the global timer heap timerHeap at the same time; thus making the versioning lazy cancellation, worker thread or worker coroutine task verification, and mutual exclusion triggering logic of virtual tasks completely consistent with those of the real active cache pool.
[0030] Step 4: Write both types of anti-shake scheduling tasks into the same global timer heap (timerHeap) and wait for the triggering of a timed task for unified scheduling. The task scheduling type is distinguished by the taskType field. Perform version verification on the anti-shake scheduling task corresponding to the object model code. If the version verification passes, trigger the data integration and release process for the corresponding object model code. The activity cache pool of each object model code (tmCode) is associated with the two types of anti-shake tasks. The activity cache pool of each real object model independently maintains the corresponding two types of anti-shake tasks. The task type identifier (taskType) containing the normal timerTask field for normal anti-shake tasks and the max timerTask field for maximum anti-shake tasks is used to distinguish the task scheduling type. During unified scheduling, one or more worker threads or worker goroutines retrieve expired debouncing tasks from the global timer heap (timerHeap). Based on the object model code (tmCode), task type identifier (taskType), and the normal timer task version number (normalTimerId) or the maximum timer task version number (maxTimerId) carried by the debouncing task, they perform verification, publication, or discard processing on the active cache pool, and only publish when the version number matches. The global timer heap (timerHeap) uses a min-heap data structure to manage all timed tasks to be triggered (normal timerTask and maximum timerTask). Tasks in the heap are arranged in ascending order of their absolute expiration time (expireTime), indicating the time when the task should be triggered for inspection. Worker threads or worker goroutines only need to check whether the task at the top of the heap has expired. All virtual object models' two types of timed tasks are also written into the timerheap for unified scheduling. Each virtual activity cache pool independently maintains the corresponding two types of anti-jitter tasks. The task type identifier taskType, which includes the normal timerTask field, the maximum timerTask field, and the scope field, is used to distinguish the task scheduling type and the mapping range to which it belongs. The task type identifier taskType is represented by the normal timerId field and the maximum timerTask field to distinguish the task scheduling type. The timer version identifier timerId is directly encoded as the absolute expiration time expireTime, so that the min-heap is sorted by the timer version identifier timerId, which is equivalent to sorting by the absolute expiration time expireTime. In the case of normal timerId, the absolute expiration time expireTime = the time of the most recent measurement point write of the current object model code tmCode + the silent window duration T_d; in the case of maximum timerId, the absolute expiration time expireTime = the time of the first measurement point write of the current window of the object model code tmCode + the maximum waiting time T_max. In this embodiment of the invention, version verification of the debouncing scheduling task corresponding to the object model code tmCode includes the following steps: Step 41: Periodically check the earliest expiring debouncing scheduled task at the top of the global timer heap (timerHeap). Step 42: Read the object model code of the real object model in the anti-shake scheduling task, look up the anti-shake scheduling task version number in the activity cache pool corresponding to the object model code, read the anti-shake task identifier corresponding to the anti-shake scheduling task version number, and compare whether the task scheduling type identifier is consistent with the anti-shake task identifier. Step 43: If the comparison results are consistent, then the latest anti-shake scheduling task is the latest normal anti-shake task or the maximum anti-shake task. This indicates that the object model encoding has not received any new valid data within the normal anti-shake time. Therefore, the version number of the normal anti-shake task is consistent with the version number of the anti-shake scheduling task that expired at the top of the stack. This satisfies the conditions for silent release of normal anti-shake, so the release process begins. Step 44: If the comparison results are inconsistent, the anti-shake scheduling task is directly determined to be an old task and discarded. Step 5: Wait for the activity cache pool that triggered the release task to publish the complete object model and measurement point data. After the release of this anti-shake scheduling task is completed, clear the activity cache pool of the object model and wait to receive the next round of measurement point data. The process of the activity cache pool publishing the complete object model and measurement point data includes the following steps: According to the measurement point order pre-recorded by the object model code of the current real object model, the current window cache is traversed, the current value Val of each measurement point is retrieved in turn, and the corresponding last published value LastVal is read. The data is assembled to form the message body Payload of the object model code of the current real object model and published externally. The message body Payload is used as a complete data snapshot obtained by aggregating the object model code of the current real object model within the current anti-shake cycle, and the complete data snapshot is published. After the release is completed, the current value Val of each measurement point is written back to the active cache pool where the last released value LastVal is located. Then, all measurement point values in the current active cache pool are cleared, as are the normal timerId, the maximum timerId, and other values maintained in the active cache pool.
[0031] According to another aspect of the present invention, a server is also provided, the server comprising a processor, a memory, and a computer program stored in the memory for running a dejitter scheduling system. When the processor executes the computer program, it runs the dejitter scheduling system stored in the memory. When the dejitter scheduling system is run, the dejitter task scheduling method for object model data publishing of the present invention is implemented. In embodiments of the present invention, the processor may be a general-purpose processor, including a central processing unit (CPU), a programmable logic controller (PLC), a network processor (NP), a graphics processing unit (GPU), etc. The processor can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or a field-programmable gate array (FPGA). Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0032] In this invention, a machine-readable storage medium is also provided, on which a computer program for running a jitter-reducing scheduling system is stored. The machine-readable storage medium may include random access memory (RAM) or non-volatile memory (Non-volatile memory). Volatile Memory (NVM) or flash memory, such as at least one disk storage device.
[0033] To more clearly illustrate and understand the anti-shake scheduling method of the present invention, specific examples are provided below for further explanation.
[0034] In this embodiment of the invention, it is assumed that there exists a real object model TM_REAL_E2E with a sampling type of COLL and a normal stabilization time T_debounce of 20ms. This real object model includes a temperature measurement point P_TEMP (DOUBLE, unit °C) and a power measurement point P_POWER (INT, unit Kw). Simultaneously, a virtual object model TM_VIRTUAL_E2E is configured, with a data acquisition type of VIRTUAL and a standard image stabilization time of 20ms. This virtual object model includes a virtual temperature measurement point VP_TEMP and a virtual power measurement point VP_POWER; where: The mapping relationship between VP_TEMP and alias_tm_code=TM_REAL_E2E and alias_prop_code=P_TEMP is configured via AddCfgFrmContent; the mapping relationship between the virtual power measurement point VP_POWER and alias_tm_code=TM_REAL_E2E and alias_prop_code=P_POWER is configured in the same way, thereby establishing a single-hop mapping from the real measurement point to the virtual measurement point; After receiving the measurement point data, the system first performs a validity check. If the check passes, it searches for the corresponding real activity cache pool based on the real object model code TM_REAL_E2E. Since this real activity cache pool does not yet exist, the system dynamically creates it according to the real object model template and establishes a measurement point item for P_TEMP within it. Subsequently, it uses the pre-established virtual mapping routing index: Find all virtual targets with TM_REAL_E2E.P_TEMP as the source, and obtain the target as TM_VIRTUAL_E2E.VP_TEMP. After generating virtual measurement point data, use the virtual object model code TM_VIRTUAL_E2E to find the corresponding virtual activity cache pool. Since the virtual activity cache pool does not yet exist, the system dynamically creates a virtual activity cache pool according to the virtual object model template, and establishes a measurement point item for VP_TEMP in it. The real activity cache pool and the virtual activity cache pool independently maintain information such as the current measurement point value, the last published value, the measurement point order, the normal anti-shake task identifier normalTimerId, the maximum anti-shake task identifier maxTimerId, the timer activation status, the last update time, and the timer start time. Regular debouncing tasks and maximum debouncing tasks are pushed into the same global timer heap for scheduling, and the task type is distinguished by the task type identifier taskType (NORMAL_DEBOUNCE or MAX_DEBOUNCE). The global timer heap adopts a min-heap structure, is sorted by expiration time, and the top task of the heap is periodically checked by worker threads or worker goroutines. t=0ms: Upon receiving the real measurement point data TM_REAL_E2E.P_TEMP=36.5, the system completes the validity check, finds the real activity cache pool corresponding to TM_REAL_E2E and dynamically creates it, writes the current value of P_TEMP measurement point to 36.5, and updates the last update time of the cache pool.
[0035] Since the real-activity cache pool is writing data for the first time and the timer has not yet been activated, the system sets the timer's activation status to active, records the first write time timerStartTime, generates a normal debouncing task identifier normalTimerId and a maximum debouncing task identifier maxTimerId, and constructs a normal debouncing task (expiration time approximately t=20ms, taskType=NORMAL_DEBOUNCE) and a maximum debouncing task (expiration time determined by the system's maximum debouncing parameter, taskType=MAX_DEBOUNCE) and pushes them into the timer heap. At the same time, the system uses the pre-built mapping route index. The virtual mapping relationship from TM_REAL_E2E.P_TEMP to TM_VIRTUAL_E2E.VP_TEMP is found, and virtual measurement point data VP_TEMP=36.5 is generated. The virtual active buffer pool corresponding to TM_VIRTUAL_E2E is found and dynamically created. The current value of VP_TEMP measurement point is written to 36.5. The virtual active buffer pool is also written for the first time. Similarly, a pair of normal image stabilization tasks and maximum image stabilization tasks are generated and pushed into the timer stack.
[0036] t=5ms: Receive real measurement point data TM_REAL_E2E.P_POWER=123. After completing the validity check, search the existing TM_REAL_E2E real activity cache pool, create a measurement point entry for P_POWER and write the current measurement point value 123, and update the last update time of the cache pool. Since the real activity cache pool is already within the current anti-jitter cycle, the timer activation state remains active. The system does not regenerate the maximum anti-jitter task, but instead generates a new normal anti-jitter task identifier normalTimerId, calculates the normal anti-jitter expiration time as the current time plus 20ms (approximately t=25ms), and pushes the new normal anti-jitter task into the timer stack; the maximum anti-jitter task, its identifier maxTimerId, and the first write time timerStartTime remain unchanged, thus ensuring that the real activity cache pool has a latest release time that cannot be postponed. Simultaneously, the system writes the virtual measurement point data VP_POWER=123 into the existing TM_VIRTUAL_E2E virtual activity cache pool according to the mapping relationship; the virtual activity cache pool also generates a new normal anti-jitter task identifier and pushes the new normal anti-jitter task onto it, while the maximum number of anti-jitter tasks remains unchanged. Previously, the old normal anti-jitter tasks pushed into the two cache pools at t=0ms are not deleted from the timer stack; since the timerId carried by the old task is inconsistent with the normalTimerId currently stored in the cache pool, when the old task expires later, the Worker determines it as an invalid task through version verification and discards it, thus achieving lazy cancellation.
[0037] At approximately t=25ms: The timer stack worker detects the expired normal dejitter task corresponding to the real activity cache pool, compares the timerId carried by the task with the normalTimerId currently stored in the TM_REAL_E2E real activity cache pool. If they match, it means that the task is a currently valid normal dejitter task, and the real object model has not received any new valid measurement point data within the 20ms normal dejitter time, thus meeting the silent release condition. The Worker sets the timer state of the real-activity cache pool to inactive, traverses the current window cache according to the pre-recorded measurement point order (P_TEMP, P_POWER), retrieves the current value of each measurement point in turn, and reads the corresponding last published value LastVal (empty on the first publication). It then assembles these values into a TM_REAL_E2E external publication message body and publishes it. After publication, the system writes P_TEMP=36.5 and P_POWER=123 back to the LastVal cache of the corresponding measurement point in the real-activity cache pool. Clear the current values of all measurement points within the current window in the real activity cache pool, and reset the normalTimerId, maxTimerId, timerStartTime, and timer activation status of the real activity cache pool. Real maximum debouncing tasks previously pushed onto the timer stack are deemed invalid and discarded upon expiration because maxTimerId has been cleared. Similarly, the timer stack worker obtains the current valid normal debouncing task corresponding to the virtual activity buffer pool at approximately t=25ms, independently publishes the message body of the virtual object model TM_VIRTUAL_E2E, which includes VP_TEMP=36.5 and VP_POWER=123. After publication, the system saves the current values of VP_TEMP and VP_POWER as the last published value cache LastVal of the virtual activity buffer pool, clears the current measurement point data in the virtual activity buffer pool, and resets its timer state without affecting the real activity buffer pool.
[0038] The above example corresponds to the end-to-end test TestVirtualMappingEndToEndWithBusIO: The system receives two physical object model measurement point records (P_TEMP=36.5, sendDelayMs=0ms; P_POWER=123, sendDelayMs=5ms) via the input event bus, and receives the anti-jitter post-loads published by the physical and virtual object models respectively from the output event bus. The test verifies that the physical load includes P_TEMP=36.5 and P_POWER=123, and the virtual load includes VP_TEMP=36.5 and VP_POWER=123, and the first output of both object models is no earlier than 18ms after the last input. The test has passed.
[0039] This example demonstrates that the present invention can locate or dynamically create a corresponding active cache pool when real-world model measurement point data arrives, and synchronously write virtual measurement point data to one or more virtual cache pools according to a pre-established mapping relationship. The real cache pool and the virtual cache pool independently execute the processes of normal debouncing, maximum debouncing, task version verification, payload release, writing back the last released value, and clearing the current data. For measurement point data arriving consecutively in the same cache pool, the old normal debouncing task is lazily discarded upon expiration by updating the normalTimerId, avoiding high-overhead deletion operations in the timer stack; at the same time, the maximum debouncing task maintains the latest release time determined when it first enters the debouncing cycle, preventing continuous input from causing long-term inability to release.
[0040] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A de-jitter scheduling method for object model data publishing, characterized in that: The anti-shake scheduling method includes the following steps: Receive measurement point data of the measurement point where the object model is located. The measurement point data includes at least the object model code of the real object model, the measurement point identifier, the timestamp, and the measurement point value. Construct a corresponding active cache pool based on the object model code of the real object model to which the measurement point belongs. The validity of the measurement point data is verified. If the verification is successful, the corresponding active cache pool is searched or created according to the object model code. If the active cache pool corresponding to the object model code does not exist, the active cache pool corresponding to the object model code is dynamically created according to the object model template. A measurement point item is created for the measurement point identifier in the active cache pool, and the measurement point value is written into the active cache pool to which the measurement point item of the corresponding object model code belongs. Once the measurement point value corresponding to any object model encoding is written to the active cache pool, two types of anti-shake scheduling tasks are maintained and generated for each active cache pool. The two types of anti-shake scheduling tasks include normal anti-shake task normalTimerTask and maximum anti-shake task maxTimerTask. Both types of anti-shake scheduling tasks are written into the same global timer heap and wait for the triggering of a timed task for unified scheduling. The task scheduling type is distinguished by the task type identifier taskType. The version of the anti-shake scheduling task corresponding to the object model code is verified. If the version verification passes, the data integration and release process of the corresponding object model code is triggered. Wait for the activity cache pool that triggered the release task to publish the complete object model and measurement point data. After the release of this anti-shake scheduling task is completed, clear the activity cache pool of the object model and wait to receive the next round of measurement point data.
2. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: After the measurement point value is written into the current active cache pool of the measurement point item to which the object model is encoded, the measurement point value is the current measurement point value of the measurement point item in the current window. The last update time of the active cache pool and the version of the normal stabilization task are updated.
3. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: When validating the measurement point data, if the validation fails, the measurement point data is discarded and not written to the active cache pool, nor is the subsequent action of the debouncing scheduling task triggered.
4. A de-jitter scheduling method for object model data publishing according to any one of claims 1-3, characterized in that: The measurement point data includes single measurement point data, batch measurement point data, or event stream data. Before performing validity verification on the measurement point data, the following steps are also included: If the received measurement point data is a single measurement point data, then the corresponding active cache pool is searched or created according to the object model code; If the received measurement point data is batch measurement point data or event stream data, the multiple measurement point data or event stream data are first grouped according to the object model code. The validity check is performed independently on the measurement point data in each object model code group. After the check passes, the measurement point value of each valid measurement point data in the group is written into the activity cache pool where the corresponding measurement point item is located. The object model code of the real object model only triggers the anti-shake scheduling once in this batch processing. The value of each measurement point item after being written is used as the current value of its respective measurement point. The last update time of the cache pool and the version of the normal anti-shake task are updated together. The check results between different groups do not affect each other.
5. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: Once the measurement point value corresponding to any object model code has been cached, if the anti-shake scheduling task cycle is triggered, it is determined whether the object model code is triggering the current anti-shake cycle for the first time or is already in the current anti-shake cycle. The process of determining the first trigger of this stabilization cycle: determine whether there is an active buffer pool or whether the active buffer pool is active. If there is no active buffer pool, or if it exists but is not yet active, it is considered to be the first time entering this stabilization cycle. If this is the first time the current anti-shake cycle is triggered, then create or activate the active cache pool for the object model code, record the start time (timerStartTime) when the measurement point data first arrives, set the current active timer task (timerActive) for the active cache pool, generate the current valid normal anti-shake task version number (normalTimerId) for the active cache pool, and construct a normal anti-shake task identifier containing the object model code of the real object model, task type identifier (taskType), normal anti-shake number (task.timerId), and expiration time (expireTime) and push it into the global timer heap (timerHeap). At the same time, the maximum effective anti-shake task version number maxTimerId of the current active cache pool is generated, and a maximum anti-shake task identifier containing the object model code, task type identifier taskType, maximum anti-shake number max-task.timerId and expiration time expireTime is constructed and put into the global timer heap timerHeap; If the object model encoding is already within the current stabilization cycle, then only a normal stabilization task is generated, the normal stabilization expiration time is recalculated, a new normal stabilization task version number normalTimerId is generated, and a new normal stabilization task normalTimerTask is constructed and pushed into the same global timer heap timerHeap. The original normal timer task is not deleted from the heap, and the maximum timer task, maximum timer task version number, and start time in the active cache pool remain unchanged, thus ensuring that there is still a maximum release time that cannot be postponed in continuous input scenarios.
6. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: After writing the measurement point values into the active cache pool of the measurement point item encoded by the object model, the following steps are also included: Check if there is a mapping relationship between the object model code of the real object model and the virtual object model code of at least one virtual object model; if so, extract the corresponding measurement point from the current value of the measurement point written this time according to the mapping relationship, generate virtual measurement point data, and find or dynamically create the corresponding virtual object model cache pool with the virtual object model code of the virtual object model, write the virtual measurement point data into the virtual cache pool, and update the last update time of the virtual cache pool and the normal anti-shake task version.
7. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: Version verification of the dejitter scheduling task corresponding to the object model encoding includes the following steps: Periodically check the oldest expiring debouncing task at the top of the global timer heap (timerHeap). If the debouncing task at the top of the heap has expired... Then, read the object model code of the real object model from the anti-shake scheduling task, look up the anti-shake scheduling task version number in the activity cache pool corresponding to the object model code, read the anti-shake task identifier corresponding to the anti-shake scheduling task version number, and compare whether the task scheduling type identifier is consistent with the anti-shake task identifier. If the comparison results are consistent, the stabilization scheduling task is the latest normal stabilization task or the maximum stabilization task. If the object model encoding does not receive new valid data within the normal stabilization time and meets the conditions for silent release of normal stabilization, then the release process begins. If the comparison results are inconsistent, the anti-shake scheduling task is directly determined to be an old task and discarded.
8. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: Publishing a complete object model and measurement point data includes the following steps: According to the measurement point order pre-recorded by the object model code of the current real object model, the current window cache is traversed, the current value Val of each measurement point is retrieved in turn, and the corresponding last published value LastVal is read. The data is then assembled to form the message body Payload of the object model code of the current real object model, which is used as a complete data snapshot obtained by aggregating the object model code of the current real object model within the current anti-shake cycle, and the complete data snapshot is published. After the release is completed, the current value Val of each measurement point is written back to the active cache pool where the last released value LastVal is located. Then, all measurement point values in the current active cache pool are cleared, as are the normal timerId, the maximum timerId, and other values maintained in the active cache pool.
9. The anti-jitter scheduling method for object model data publishing according to claim 1, characterized in that: The mapping relationship between the physical object model's object model code (tmCode) and the virtual object model's virtual object model code (tmCode) is implemented through mapping rule configuration, which includes one or all of the following: The virtual object model code tmCode of each virtual object model contains measurement point identifiers, which are taken from the object model template of the real object model; Each virtual object model's tmCode has independent anti-shake parameters; The current measurement point value of the real measurement point is converted into the virtual measurement point value according to the calculation rules.
10. A de-jitter scheduling method for object model data publishing according to claim 1 or 9, characterized in that: Upon checking for the existence of a mapping relationship, immediately execute the following virtual mapping steps: (11) Mapping list lookup; (12) Generate virtual measurement point data by encoding each virtual object model with tmCode; (13) Write the measurement point value into the virtual measurement point value for inspection; (14) Generate independent debouncing scheduling tasks for the activity cache pool.
11. A jitter-resistant scheduling system for object model data publishing, characterized in that: The anti-shake scheduling system is used to execute the anti-shake scheduling method for publishing object model data as described in any one of claims 1 to 10. The anti-shake scheduling system is deployed on an IoT edge gateway or edge computing node. The anti-shake scheduling system includes an input access module, an object model cache module, an anti-shake scheduling module, a timer stack module, a version verification module, a publishing assembly module, and a virtual object model mapping module. The input access module is used to receive single measurement point data, batch measurement point data, or event stream data from the device. The object model caching module is used to establish an independent active cache pool according to the object model code, and to save the measurement point values, templates, last published values and publication order in the current window; The de-jitter scheduling module is used to maintain regular de-jitter tasks and maximum de-jitter tasks for each active buffer pool; The timer heap module is used to store timed tasks to be triggered using a min-heap and schedule them uniformly according to their expiration time. The version verification module is used to determine whether a task is still valid and discard expired tasks by using the timerId or version number of the scheduled task. The release assembly module is used to generate the message payload for external release in the order of measurement points after the anti-shake expires, and to carry the last release value LastVal; The virtual object model mapping module is used to support the mapping update and independent release of real object models to virtual object models.
12. A server, characterized in that: The server includes a processor, a memory, and a computer program stored in the memory for running the anti-shake scheduling system. When the processor executes the computer program, it runs the anti-shake scheduling system. When the anti-shake scheduling system runs, it implements the steps of the anti-shake task scheduling method for object model data publishing as described in any one of claims 1 to 10.
13. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores a computer program for running a stabilization scheduling system, which, when executed by a processor, implements the steps of a stabilization task scheduling method for object model data publishing as described in any one of claims 1 to 10.