Device operation backtracking method, apparatus, equipment, and medium based on twin components
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-09
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]然而,上述回溯方法因依赖现场多源异构数据采集与复杂存储结构,存在数据存储占用过高的缺陷
[0037]本申请提供一种基于孪生体组件的设备运行回溯方法、装置、设备及介质,其中,本申请的方法提出获取用户指定的时间区间;基于时间区间从数据库表中读取对应的孪生体驱动数据;解析时间区间对应的孪生体驱动数据以生成设备运行状态序列,基于设备运行状态序列控制各孪生体组件以完成设备运行回溯。在该过程中,孪生体驱动数据是在孪生体基于设备实时运行数据运行时,按预设顺序采集各孪生体组件的实时位置值后,将各实时位置值拼接后得到的;通过直接采集孪生体组件的实时位置值而非现场多源异构原始数据,单个孪生体组件仅需采集一组位置值即可记录其位姿状态,大幅减少了采集数据量;同时,按预设顺序拼接各组件位置值形成单一字符串,数据库表仅需存储时间戳+孪生体驱动数据两列,无需为不同设备类型设计独立数据表或复杂存储结构,避免了多表冗余与字段冗余,从而有效降低了存储开销。
Smart Images

Figure CN122573479A_ABST
Abstract
Description
Technical Field
[0001] This application relates to industrial intelligent manufacturing technology, and in particular to a method, apparatus, equipment and medium for equipment operation backtracking based on twin components. Background Technology
[0002] In the field of intelligent manufacturing, the scale of production lines and the number of equipment nodes continue to grow, significantly increasing system coupling and complexity. Faults across equipment and process stages can easily lead to production line shutdowns. The virtual shadow system built by digital twin technology, combined with historical backtracking functions to record equipment runtime sequence data, can provide a reliable basis for fault tracing and process optimization, and has become a core requirement for the operation and maintenance management of complex production lines.
[0003] Currently, the core of known digital twin historical backtracking methods is to collect multi-source heterogeneous data (such as robot joint angles, conveyor belt station signals, equipment pressure and temperature, etc.) from on-site PLCs, sensors, and other equipment, and store it in a time-series database in a structured table or compressed package format. During playback, the data is read according to the timestamp, parsed through a multi-layer nested format, and mapped to the driving parameters of the virtual model to reproduce the historical operating status of the equipment.
[0004] However, the aforementioned backtracking method suffers from excessive data storage due to its reliance on multi-source heterogeneous data acquisition and complex storage structure. Summary of the Invention
[0005] This application provides a device operation backtracking method, apparatus, device, and medium based on twin components to reduce storage overhead.
[0006] In a first aspect, this application provides a device operation backtracking method based on a twin component, the method comprising:
[0007] Get the time range specified by the user;
[0008] Based on the time interval, the corresponding twin driving data is read from the database table; the twin driving data is obtained by splicing together the real-time position values of each twin component after collecting them in a preset order when the twin is running based on the device's real-time operating data.
[0009] The twin drive data corresponding to the time interval is parsed to generate a device operation state sequence, and each twin component is controlled based on the device operation state sequence to complete the device operation backtracking.
[0010] In one possible implementation, the method further includes:
[0011] The real-time position values of each of the twin components are collected in a preset order, and the real-time position values are spliced together to form the twin driving data;
[0012] The twin driver data is stored together with the current timestamp in a database table.
[0013] In one possible implementation, parsing the twin drive data corresponding to the time interval to generate a device operating state sequence includes:
[0014] Based on the preset order, the arrangement position of each twin component is determined, and each twin driving data in the time interval is split by a preset separator to extract the real-time position value corresponding to each twin component, forming the sub-device operating status corresponding to each twin driving data.
[0015] The sub-device operating status corresponding to each twin driver data is associated with the corresponding timestamp, and sorted in ascending order of the timestamps to obtain a continuous sequence of device operating statuses.
[0016] In one possible implementation, after acquiring the real-time position values of each twin component in a preset order, concatenating the real-time position values includes:
[0017] Based on a preset order data structure, each of the twin components is accessed sequentially in the preset order, and the real-time position value of each twin component is collected. The preset order data structure is constructed by traversing the digital twin scene and locating each of the twin components that meet the conditions, and includes each twin component and its corresponding path information.
[0018] The real-time position values of each of the collected twin components are concatenated in the preset order and connected in the middle by the preset separator to obtain the twin driving data.
[0019] In one possible implementation, reading the corresponding twin driver data from the database table based on the time interval includes:
[0020] The start and end times of the time interval are divided according to a preset time interval to obtain at least two time periods;
[0021] According to the preset access method, the database table is accessed in turn for each time period to obtain the corresponding twin driver data and the corresponding timestamp for each time period.
[0022] The twin driving data and timestamps corresponding to each time period are split and recombined in chronological order to obtain the complete data sequence corresponding to the time interval; the complete data sequence includes time series sorted by timestamps and a two-dimensional array of driving values corresponding one-to-one with the time series.
[0023] In one possible implementation, obtaining the user-specified time interval includes:
[0024] In response to an input operation triggered by a user through a preset interaction method, the time interval is obtained; the preset interaction method includes at least one of the following: list selection method, drop-down menu selection method, previous / next episode button switching method, and progress bar dragging method.
[0025] In one possible implementation, controlling each twin component based on the device operating state sequence to complete device operation backtracking includes:
[0026] In response to a user-triggered playback control command, the current playback timestamp and playback status are updated; the playback control command includes at least one of timestamp jump control, playback status switching control, and playback rate adjustment control.
[0027] Based on the updated current playback timestamp and playback rate, the following steps are executed repeatedly until the traversal of the device operating state sequence is completed: obtain the real-time position value of each twin component corresponding to the current playback timestamp from the device operating state sequence; assign the real-time position value to the corresponding twin component according to the preset order.
[0028] Secondly, this application provides a device operation backtracking apparatus based on a twin component, the apparatus comprising:
[0029] Get the time range specified by the user;
[0030] Based on the time interval, the corresponding twin driving data is read from the database table; the twin driving data is obtained by splicing together the real-time position values of each twin component after collecting them in a preset order when the twin is running based on the device's real-time operating data.
[0031] The twin drive data corresponding to the time interval is parsed to generate a device operation state sequence, and each twin component is controlled based on the device operation state sequence to complete the device operation backtracking.
[0032] Thirdly, this application provides an electronic device, including at least one processor and a memory communicatively connected to the processor;
[0033] The memory stores computer-executed instructions;
[0034] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.
[0035] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.
[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.
[0037] This application provides a method, apparatus, device, and medium for device operation backtracking based on twin components. The method involves obtaining a user-specified time interval; reading corresponding twin driving data from a database table based on the time interval; parsing the twin driving data corresponding to the time interval to generate a device operation state sequence; and controlling each twin component based on the device operation state sequence to complete device operation backtracking. In this process, the twin driving data is obtained by collecting the real-time position values of each twin component in a preset order and then concatenating these real-time position values when the twin is running based on the device's real-time operation data. By directly collecting the real-time position values of the twin components instead of multi-source heterogeneous raw data from the field, a single twin component only needs to collect one set of position values to record its pose state, significantly reducing the amount of data collected. Simultaneously, concatenating the position values of each component in a preset order to form a single string means the database table only needs to store two columns: timestamp and twin driving data. This eliminates the need to design independent data tables or complex storage structures for different device types, avoiding multi-table redundancy and field redundancy, thereby effectively reducing storage overhead. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] Figure 1 This application provides an illustration of an application scenario for a device operation backtracking method based on a twin component, as shown in the embodiments of this application.
[0040] Figure 2 A flowchart illustrating a device operation backtracking method based on a twin component provided in this application embodiment. Figure 1 ;
[0041] Figure 3 A flowchart illustrating a device operation backtracking method based on a twin component provided in this application embodiment. Figure 2 ;
[0042] Figure 4 A schematic diagram of a device operation backtracking device based on a twin component is provided in this application embodiment;
[0043] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0044] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0046] In the field of intelligent manufacturing, with the expansion of production line scale and the surge in equipment nodes, the system coupling and operational complexity have significantly increased, and fault chains across equipment and process sections can easily lead to production line shutdowns. Digital twin technology, by constructing a virtual shadow system synchronized with the physical production line and combining it with historical backtracking functions to record the time-series data of equipment operation, can provide engineers with a reliable basis for fault tracing and process optimization, and has become a core requirement for the operation and maintenance management of complex production lines.
[0047] Currently, the core of known digital twin historical backtracking methods is to collect multi-source heterogeneous data from devices such as PLCs and sensors on site (such as robot joint angles, tightening quality torque angles, conveyor belt station signals, equipment pressure and temperature, etc.), design dedicated storage schemes for different equipment types and data categories, or create multiple independent data tables in a time-series database for classified storage, or package and compress status data and action data into a specific format file through dual-end storage rules, and finally store all types of data in a time-series database.
[0048] During playback, the target data must first be accurately located from the database based on the timestamp. Then, the original data is decompressed, deserialized, and key-value pair mapped using multi-layered nested JSON classes and custom parsing tools. The parsed data is then converted into driving parameters that the virtual model can recognize. Some solutions also require additional interpolation, coordinate transformation, and mapping calculations from entity data to twins to drive the virtual model to reproduce the historical operating status of the device.
[0049] However, the aforementioned backtracking methods collect heterogeneous raw data from multiple sources on-site and require the design of dedicated storage schemes for different data types, resulting in complex data storage structures and large space requirements. At the same time, the playback process requires complex parsing and additional mapping calculations, which not only consume a lot of computing resources but also suffer from low playback efficiency, making it difficult to meet the needs of efficient historical backtracking for complex production lines.
[0050] Therefore, this application provides a method, apparatus, device, and medium for device operation backtracking based on twin components to solve the above-mentioned problems. Specifically, the method of this application proposes to first receive a user-specified device operation history backtracking time interval, then retrieve the twin driving data corresponding to the time interval from a preset database table, then parse the twin driving data to generate a device operation state sequence, and finally drive each twin component to reproduce its historical position based on the device operation state sequence, thus completing the backtracking of the device operation process. The twin driving data is formed by stitching together the real-time position values of each twin component collected in a preset fixed order when the twin moves synchronously based on the real-time operation data of the field equipment.
[0051] It is understood that the device operation backtracking method based on twin components in this application is applicable to complex production line operation and maintenance scenarios in any industrial intelligent manufacturing field. For example, Figure 1 This application provides an illustration of an application scenario for a device operation backtracking method based on a twin component, as shown in the following diagram. Figure 1 As shown, the device operation backtracking method based on twin components in this application can be used in the anomaly investigation scenario of electric vehicle power battery assembly line.
[0052] Currently, electric vehicle power battery assembly lines include various equipment such as cell loading robots and laser welding equipment. Existing backtracking methods require collecting multi-source heterogeneous data from the PLCs of each device (such as robot joint angles, welding current parameters, etc.) and designing independent data tables or packaging and compressing them for different devices. This results in complex storage structures, large space occupation, and significant pressure on long-cycle data storage and backtracking.
[0053] When applying the method of this application to the above-mentioned scenarios, such as Figure 1As shown, the digital twin platform server acts as the execution entity: When the assembly line is running in real time, the server first obtains PLC data through the entity data acquisition process to drive the synchronous movement of each twin in the corresponding twin system of the assembly line. At the same time, it collects the real-time position values of twin components such as the cell positioning component and the welding equipment execution component in a preset fixed order. After splicing them to form twin driving data, it stores them together with the timestamp in a database table containing only two columns (timestamp + twin driving data). When troubleshooting assembly anomalies (such as cell welding offset), it receives the abnormal time period specified by the user, retrieves the corresponding twin driving data, parses and generates the equipment operation status sequence, drives the twin components to reproduce the historical position, and achieves accurate backtracking.
[0054] In the above process, by directly collecting the real-time position values of the twin components instead of the multi-source heterogeneous raw data of the assembly line, a single component only needs one set of position values to record its pose state, which greatly reduces the amount of data collected. At the same time, the twin-driven data is spliced in a preset order, and the database table does not need to design independent data tables for different types of equipment. Only two columns are needed to store the historical data of the entire assembly process, avoiding multiple tables and field redundancy and effectively reducing storage overhead.
[0055] It should be understood that, in the above process, the executing entity of the method of this application can also be any device with data acquisition, storage and parsing capabilities, such as an edge computing gateway or an industrial control computer, and this embodiment does not limit this. In addition, the application scenario of the method of this application can also be other scenarios, such as fault tracing in energy storage battery module assembly lines, and this embodiment does not limit this.
[0056] The following detailed description, with reference to the accompanying drawings and using any electronic device as the executing entity, outlines some implementation methods of the device operation backtracking method based on twin components of this application. Where the embodiments do not conflict, the following embodiments and features thereof can be combined with each other.
[0057] This application provides a device operation backtracking method based on twin components. Figure 2 A flowchart illustrating a device operation backtracking method based on a twin component provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method in this application embodiment includes:
[0058] S201. Obtain the time range specified by the user.
[0059] It should be understood that the endpoints of the time interval are the start and end times of the user's request to trace back, which are input by the user through the interactive interface provided by the electronic device.
[0060] In this embodiment, the electronic device obtains a time interval in response to an input operation triggered by a user through a preset interaction method. The preset interaction method includes at least one of the following: list selection, drop-down menu selection, previous / next episode button switching, and progress bar dragging.
[0061] Specifically, the list selection method refers to the electronic device's interactive interface pre-generating and displaying a candidate list containing historical backtracking time periods. The time periods in this list are automatically generated based on the timestamps of the twin component's twin-driven data. Users can directly select the list items corresponding to the target start and end times to complete the time interval acquisition. In this embodiment, the candidate list is a structured table with 7 rows and 48 columns, covering historical time periods of the most recent seven days, and divided into time nodes at half-hour intervals.
[0062] Specifically, the drop-down menu selection method refers to setting two drop-down menus for the start time and end time on the interactive interface of the electronic device. The menu options are associated with timestamp data stored in the database. After the user clicks the drop-down menu to expand the option list, they can select the corresponding time to complete the time range input.
[0063] Specifically, the up / down button switching method means that the electronic device's interface is equipped with up and down buttons for the start and end times, respectively. Users can click the buttons to switch the time value according to a preset time granularity (such as seconds, minutes, or hours). The electronic device updates the time interval in real time based on the currently displayed time value. In this embodiment, users can click the buttons to switch the time value in half-hour increments.
[0064] Specifically, the progress bar dragging method refers to the electronic device's interactive interface displaying a progress bar corresponding to the historical timeline. The two ends of the progress bar correspond to the start and end times of the rewind, respectively. The user drags the sliders at both ends of the progress bar to the target position, and the electronic device can simultaneously obtain the corresponding time interval.
[0065] The total length of the progress bar is dynamically adjusted based on the length of the timestamp list. This adjustment process is automatically executed by the backend code after the historical data is parsed. During the loop of data parsing and assignment driven by the twin, the progress bar will update the progress value in real time. This progress value corresponds one-to-one with the progress of the current parsed timestamp, realizing an intuitive display of the playback progress.
[0066] When the user presses the progress bar cursor, the playback thread is immediately blocked, the playback process is paused synchronously, and the progress bar no longer updates with the playback process; after the user drags the cursor to the target position and releases the mouse, the electronic device assigns the cursor's progress value to the playback progress value, and at the same time unblocks the playback thread, the playback process continues to execute from the target progress position, ensuring precise control of the timing.
[0067] Furthermore, the electronic device's interactive interface is configured with a time display function: after successfully reading the timestamp data from the database table, the interface concatenates the current playback time with the last time value in the timestamp list in the format of current time / total time; during playback, the electronic device updates the displayed value of the current playback time in real time, realizing the time display function of the progress bar.
[0068] In this embodiment, the interactive interface of the electronic device integrates the above four interaction methods: a progress bar is set at the top of the interface for users to quickly select a time range; a drop-down menu with start and end times is configured below the progress bar to support users to accurately select specific times; up and down adjustment buttons are provided next to the drop-down menus to facilitate users to fine-tune the time values; and the sidebar of the interface displays a candidate list of abnormal time periods for users to directly select the fault investigation time period in the history.
[0069] Among them, the three interaction methods of list selection, drop-down menu, and previous / next episode buttons support data linkage. When the user modifies the start / end time through any of the methods, the time values of the other two methods will be automatically updated synchronously to ensure the consistency of the interactive operation.
[0070] In practical applications, users can flexibly switch or combine any of the methods according to their needs. Specifically, two or three methods can be used in any combination, such as a combination of a progress bar for coarse selection and up and down buttons for fine adjustment. Other interaction methods can also be used, such as manual input, where the user directly enters the specific values of the start and end times in the time input box on the interactive interface, and the electronic device completes the acquisition of the time interval after verifying the validity of the values. Other methods include voice input, etc. This application does not limit the use of these methods.
[0071] In the above process, the list selection method can directly access the candidate list of historical backtracking time periods, helping users quickly locate key time periods for anomaly investigation; the drop-down menu selection method supports precise selection of specific moments, meeting the needs of refined backtracking; the up and down button switching method facilitates minor adjustments to the time interval, making operation flexible and convenient; the progress bar dragging method can intuitively display the historical timeline, enabling quick coarse selection of time intervals. Furthermore, multiple interaction methods can be used in combination to adapt to different users' operating habits and actual backtracking scenarios. Compared to solutions with single interaction methods and cumbersome operation steps, the interaction design in this embodiment improves the efficiency of time interval setting, simplifies the operation process, and effectively improves the user experience of device operation backtracking.
[0072] S202. Read the corresponding twin driver data from the database table based on the time interval.
[0073] Among them, the twin-driven data is obtained by collecting the real-time position values of each twin component in a preset order and then splicing the real-time position values together when the twin is running based on the real-time operating data of the device.
[0074] Specifically, in this embodiment, during the real-time operation of the field equipment, the electronic device reads variable information (including variable name and data type) in batches, obtains real-time operating data (such as robot joint angles, welding current parameters, module positioning signals, etc.) from the PLC of the field equipment, stores it in a dictionary, and writes the collected data to a Redis cache after each acquisition cycle and collects it cyclically. In this embodiment, the Redis data is divided into two paths: one path is used to drive the twin's movement, and the other path is stored in the SQL Server database as needed.
[0075] In this embodiment, a database table is created in SQL Server, containing only two columns: a timestamp column of type datetime2(7) and a real-time location value column of type nvarchar(MAX). The electronic device traverses the digital twin scenario through a script, filters the core process-related components, writes them into a data structure containing component and path information in a predetermined order, and generates a fixed-order list of twin components. This list provides a unique order basis for the sequential splicing of subsequent location values.
[0076] Based on this, in this embodiment, the electronic device collects the real-time position values of each twin component in a preset order, and splices the real-time position values into twin driving data; the twin driving data and the current timestamp are stored together in the database table.
[0077] In this embodiment, the electronic device drives the twin's movement based on real-time operating data from the field equipment by calling a motion control script. After the twin completes component pose updates based on real-time operating data in Redis, the electronic device collects the real-time position values of each component at a preset frequency. After accumulating to a preset batch threshold (e.g., 10 seconds / batch), the twin-driven data is then stitched together. In this embodiment, the electronic device adds a Thread.Sleep command after the collection and storage loop code to block the thread of the collection script, thereby achieving the effect of setting the collection period (i.e., the preset frequency).
[0078] In this embodiment, within each acquisition cycle, the real-time position values of each twin component are acquired in a preset order. The preset order is a twin component acquisition sequence predefined based on the process logic of the power battery assembly line, such as the assembly process sequence of cell positioning component → welding equipment execution component → module handling robot joint component → pack packaging positioning component, to ensure that the splicing logic of twin drive data is consistent with the actual production process.
[0079] In this embodiment, the real-time position value is the pose parameter of each twin component in three-dimensional space, specifically including the X / Y / Z axis coordinate value and rotation angle value of the component (such as the roll angle around the X axis, the pitch angle around the Y axis, and the yaw angle around the Z axis). The position value of each component only retains the core pose parameter and does not include redundant intermediate calculation data.
[0080] In this embodiment, the database table is a structured time-series data table, with only two core fields designed: timestamp and twin-driven data. The timestamp field stores the precise time of data acquisition, while the twin-driven data field stores the sequence of position values of each component after splicing.
[0081] Based on this setting, when the electronic device reads the corresponding twin driver data based on a time interval, it first confirms whether the format of the time interval is standardized. Only when the format is standardized will it generate a structured query statement for the database table. This query statement uses the timestamp column as the search condition, limiting the reading to all twin driver data within the range of the start timestamp to the end timestamp, and sorting them in ascending order of timestamp. After executing the query statement, the electronic device encapsulates the twin driver data that meets the conditions and the corresponding timestamp into a structured data set. If the query result is empty, it returns a no data prompt.
[0082] In the above setup, since the twin driver data and timestamps are pre-associated and stored in a lightweight database table, and Redis only serves as a real-time data cache and twin driver, when reading twin driver data based on a time interval, it is only necessary to accurately retrieve the target data through the timestamp field. There is no need to reload the original device data in Redis, nor is it necessary to recalculate the position value of the twin component, nor is it necessary to restart the twin virtual model, thus enabling zero-load data reading.
[0083] Meanwhile, in the above process, the preset order of acquisition logic enables the twin-driven data to conform to the actual process, avoiding parsing redundancy caused by disordered splicing; retaining only the real-time position values of core pose parameters can significantly compress the volume of a single data entry; the two-column database table abandons the redundant design of multi-table storage, and only the timestamp field needs to be matched during retrieval, thereby effectively improving reading efficiency.
[0084] In addition, Redis' dual-path data processing mechanism not only meets the real-time synchronization requirements between the twin and the physical device, but also provides a stable benchmark for location value collection, avoids resource conflicts between real-time collection and persistent storage, and ensures the accuracy of historical backtracking data.
[0085] In practical applications, for ultra-large-scale high-concurrency data collection scenarios, in-memory database Memcached or distributed cache clusters can be used to replace Redis cache; for single-station, small-scale twin backtracking scenarios, local memory caching can be used directly to reduce deployment costs. This application does not limit this.
[0086] In practical applications, the aforementioned batch threshold can be dynamically adjusted according to actual production needs, and this application does not impose any limitations on it. For example, for high-precision operations such as welding stations, the batch threshold can be adjusted to 2 seconds per batch to improve the precision of position value acquisition; for coarse positioning operations such as module handling, the batch threshold can be adjusted to 30 seconds per batch to further reduce data storage pressure.
[0087] In practical applications, the above-mentioned preset sequence can be adjusted from a fixed process sequence to a configurable dynamic sequence. Users can customize the acquisition sequence of the twin components according to different anomaly troubleshooting needs; or they can trigger acquisition based on the motion state of the twin components, and only collect the position values of the components whose motion state has changed, thereby reducing invalid data acquisition. This application does not limit this.
[0088] In practical applications, real-time position values can be supplemented or simplified according to the needs of the scenario, and this application does not impose any restrictions on this. For example, for scenarios that require trajectory analysis, the component's motion speed and acceleration parameters can be supplemented; for scenarios that only require position backtracking, only the X / Y / Z axis coordinate values can be retained to further compress the data volume.
[0089] In practical applications, time-series databases (such as InfluxDB and TimescaleDB) can be used to replace structured data tables to improve the retrieval efficiency of massive time-series data. For scenarios involving data archiving and low-frequency backtracking, file storage methods (such as storing data as CSV files by time shards) can also be used, and this application does not limit this to any particular method.
[0090] More specifically, in this embodiment, the electronic device performs splicing based on the following process: based on a preset sequential data structure, it accesses each twin component in a preset order and collects the real-time position value of each twin component; the collected real-time position values of each twin component are spliced in a preset order and connected in the middle by a preset separator to obtain twin driving data.
[0091] The preset sequential data structure is constructed by traversing the digital twin scene and locating each twin component that meets the conditions. It includes each twin component and its corresponding path information.
[0092] In this embodiment, a digital twin scenario refers to a 1:1 digital mapping of an actual physical scenario. For example, for a power battery assembly line physical scenario, the digital twin scenario includes all production nodes such as cell loading station, laser welding station, module assembly station, and pack packaging station, as well as the twin equipment, twin components, production process logic and spatial topology relationships corresponding to each node. It also covers environmental elements and data interaction links in the physical scenario.
[0093] In this embodiment, the "meeting criteria" means selecting twin components that are directly related to the core process flow of the actual physical scene, and excluding irrelevant auxiliary model components (such as scene lighting models, ground support models, etc.). In practical applications, the criteria can also be set based on user needs, and this embodiment does not limit this.
[0094] In this embodiment, the preset sequential data structure is a tree structure. The root node corresponds to the overall twin model of the actual physical scene, the first-level child nodes correspond to each production station, and the second-level child nodes correspond to the core twin components within the station, ensuring that the acquisition order strictly matches the process logic. Correspondingly, the path information is the unique access path of each twin component in the digital twin scene, such as power battery assembly line → laser welding station → welding equipment execution component → welding torch head component. The target component can be quickly located through this path, avoiding the time loss caused by traversing the entire scene.
[0095] In this embodiment, the electronic device accesses each target twin component sequentially based on the path information in the preset sequential data structure. For each component, it calls the pose acquisition interface provided by its own twin system to read the current three-dimensional coordinates and rotation angle of the component. During the acquisition process, the electronic device performs real-time verification of the data, eliminating abnormal values that exceed the reasonable range to ensure that the acquired real-time position values are accurate and effective. After the position values of all components are acquired, a list of position values corresponding one-to-one with the preset sequence is generated to provide a data basis for subsequent splicing operations.
[0096] Furthermore, the electronic device reads the preset separator configuration parameters, traverses the position value list in a preset order, and arranges the real-time position values (coordinate values and rotation angle values combined into a set of data) of each twin component in sequence, inserting a preset separator between adjacent sets of data; after splicing, a continuous string of data is generated, namely the twin driving data, such as "X1,Y1,Z1,Rx1,Ry1,Rz1,X2,Y2,Z2,Rx2,Ry2,Rz2", where each set of data corresponds to the pose information of a twin component.
[0097] In this embodiment, the preset delimiter is a comma. The advantage of using a comma as a delimiter is that it has strong compatibility and high parsing efficiency, and can be quickly identified and split by mainstream data processing frameworks. In practical applications, other delimiters can also be selected as needed, such as semicolons, vertical bars, underscores, etc., as long as it is ensured that the delimiter does not conflict with the characters of the position value data itself.
[0098] In practical applications, for simple scenarios with a small number of components, a linear array structure can be used instead of a tree structure for the pre-defined sequential data structure, directly storing component path information according to the process order. For scenarios requiring high acquisition efficiency, when acquiring real-time position values, a batch acquisition interface can be used instead of a configuration interface, reading the pose data of all target components at once. When it is necessary to enhance the readability and scalability of the data, JSON format can be used instead of string concatenation, encapsulating the component name, path information, and position value together into a JSON object. This application does not impose any restrictions on this.
[0099] In the above process, the combination of a pre-set sequential data structure and path information enables accurate and rapid positioning of twin components, avoiding resource waste and time delays caused by unordered traversal scenarios. The directional acquisition and splicing logic based on the pre-set sequence ensures that the twin-driven data is fully matched with the actual production process, and no additional data order adjustment is required during subsequent backtracking and parsing. The standardized configuration of the pre-set separator improves the parsing efficiency and compatibility of the twin-driven data. At the same time, the entire splicing process is based on lightweight data processing logic, which does not require a large amount of computing resources, further ensuring the real-time performance and stability of the twin system.
[0100] S203. Parse the twin drive data corresponding to the time interval to generate the device operation status sequence, and control each twin component based on the device operation status sequence to complete the device operation backtracking.
[0101] It should be understood that the time interval contains twin driver data corresponding to multiple timestamps. The electronic device parses each twin driver data to generate a device operating state sequence. The device operating state sequence is a structured data set arranged in timestamp order, containing the pose information of each twin component at different times, which can completely restore the continuous operating state of the device within the specified time interval.
[0102] In this embodiment, the electronic device determines the arrangement position of each twin component based on a preset order, and splits each twin driving data in the time interval using a preset separator to extract the real-time position value corresponding to each twin component, forming the sub-device operating state corresponding to each twin driving data; the sub-device operating state corresponding to each twin driving data is associated with the corresponding timestamp, and sorted in ascending order of timestamp to obtain a continuous sequence of device operating states.
[0103] Specifically, the order refers to the sequential number of each twin component in the preset sequence (e.g., the cell positioning component is number 1, the welding equipment execution component is number 2, the module handling robot joint component is number 3, and the pack packaging positioning component is number 4). This number is bound one-to-one with the splitting result of the position value of each component in the twin drive data to ensure that the split position value can be accurately matched to the corresponding component.
[0104] As mentioned above, the database table stores various timestamps and their corresponding twin driver data pairs. Based on this, in this embodiment, the splitting process is as follows: The electronic device first reads the timestamp-twin driver data pairs within a specified time interval from the database table and parses them into two basic lists (the first list stores the timestamps, and the second list stores the corresponding real-time twin driver data of the twin components). During splitting, the electronic device reads a preset separator and segments the individual twin driver data extracted from the twin driver data list according to the separator, splitting the continuous string into multiple independent pose data sets. Each set of data corresponds to a twin component with a specific position. For example, the string "driveposition1,drive position2,drive position3,drive position4" is split into four sets of data: "driveposition1" (component 1), "drive position2" (component 2), "drive position3" (component 3), and "drive position4" (component 4). It should be understood that each drive position value contains the pose control information of the corresponding twin component, which can directly drive the component to complete the pose update.
[0105] In this embodiment, firstly, all twin driver data belonging to the time interval in the twin driver data list are traversed, and the corresponding timestamps in the timestamp list are associated with each string as a marker. Then, each string is split according to a preset separator to obtain the real-time position value of each twin component, and the position value is matched to the corresponding component based on the order of arrangement to generate the sub-device operating status of timestamp-component-position value. Subsequently, all sub-device operating statuses are sorted according to the order of timestamps, for example, according to the time order of 10:00:00→10:00:10→10:00:20, and the sub-states at different times are concatenated into a continuous sequence of device operating statuses. After sorting, the electronic device will check the time continuity of the sequence. If there are missing timestamps, the missing time period will be marked and the existing data will be retained to ensure the integrity of the sequence.
[0106] In practical applications, it is not necessary to first generate the sub-device operating status corresponding to a single twin driver data. Instead, all twin driver data within the time interval can be split according to a preset delimiter, and the real-time position values of each twin component at different timestamps can be extracted. The data can then be integrated by component dimension and associated with the corresponding timestamps, and then arranged in the order of timestamps to form a sequence of device operating statuses. Alternatively, a batch parsing method based on preprocessing templates or a dynamic generation method based on on-demand loading can be used. This application does not limit the specific methods used.
[0107] The splitting logic based on the preset order and arrangement position in this embodiment can ensure that the position value and the twin component are accurately matched, and the running state sequence generated by sorting by timestamp can completely restore the continuous running process of the device, thus solving the problem of state fragmentation in existing backtracking methods.
[0108] Furthermore, in response to a user-triggered playback control command, the electronic device updates the current playback timestamp and playback status; based on the updated current playback timestamp and playback rate, it repeatedly executes the following steps until the device's operating state sequence is traversed: obtaining the real-time position value of each twin component corresponding to the current playback timestamp from the device operating state sequence; and assigning the real-time position value to the corresponding twin component in a preset order.
[0109] In this embodiment, the playback control commands include at least one of timestamp jump control, playback state switching control, and playback rate adjustment control. Playback control commands are operation commands triggered by the user through the interactive interface to control the device's operation of the backtracking process. They cover core functions such as backtracking time positioning, start / stop status, and speed adjustment, supporting users to flexibly control the backtracking process and adapt to different anomaly troubleshooting needs.
[0110] Specifically, the timestamp jump control includes fast forward and rewind functions. The implementation logic is as follows: the system pre-configures the acquisition frequency of the twin component's position value (e.g., 25 times / second). When the user clicks the fast forward button, the current value is adjusted according to the acquisition frequency. For example, to fast forward ten seconds, the current value is increased by 250 (25 times / second × 10 seconds). Each time the current value is adjusted, the system automatically calculates whether the value exceeds the maximum value of the device's operating state sequence. If it does, it is automatically truncated to the maximum value to prevent exceeding the limit. The rewind function works on the same principle as fast forward, only the current value is adjusted in reverse according to the acquisition frequency. In addition, users can also trigger jumps by inputting a specific timestamp or clicking key nodes on the timeline.
[0111] Specifically, the playback state switching control includes play, pause, and stop functions. The pause function is implemented based on a thread lock mechanism: a thread lock flag is introduced during the loop process of parsing the device's operating state and assigning the position value of the twin component; when the user clicks the pause button, the system activates the thread lock, the loop process is immediately paused, and the twin component maintains its current pose; when the user clicks the play button again, the system releases the thread lock, and the loop process resumes execution; when the stop button is clicked, the system clears the current playback state and resets the current playback value to the sequence start position.
[0112] Specifically, playback speed adjustment control is achieved by dynamically adjusting the assignment cycle duration: during constant speed playback, after each assignment of the twin component position value, the electronic device pauses for a fixed acquisition cycle duration (UpdateTime); based on this, the electronic device is set with an adjustable time interval formula: T = (UpdateTime) (1 / TimeScale)), where TimeScale is a configurable speed value; the main interface configures a speed playlist (such as 0.5x, 1x, 2x, 10x). When the user selects a speed value in the list, that value is assigned to TimeScale. The electronic device calculates a new time interval T using the above formula and modifies the pause period after assignment to T, thereby adjusting the playback speed.
[0113] In this embodiment, the fixed acquisition period is the reciprocal of the acquisition frequency. For example, if the acquisition frequency is 25 times / second, the fixed period is 40 milliseconds.
[0114] In this embodiment, the interactive interface of the electronic device integrates the operation entry points for all the above-mentioned playback control commands: a play / pause / stop button is set at the bottom of the interface, a speed adjustment drop-down menu is configured in the sidebar, and the top timeline supports click jump and manual input of timestamps, meeting the diverse retrospective operation needs of users.
[0115] In this embodiment, after the user triggers a playback control command, the electronic device first reads the start timestamp of the device's operating state sequence and sets it as the current playback timestamp. At the set playback rate, it extracts the position values of each twin component corresponding to the current timestamp from the sequence and assigns these position values to the corresponding components one by one in a preset order, driving the components to update their poses. After the pause ends, the system returns to the data parsing step to continue parsing and assigning the twin position values, completing the position playback for the next time point. After the current frame finishes playing, the electronic device increments the current playback timestamp at the rate. If the user triggers a fast forward / rewind command, the electronic device calculates and updates the current playback timestamp according to the acquisition frequency. If a pause command is triggered, the electronic device activates a thread lock to pause the loop. The backtracking process ends when the current playback timestamp reaches the sequence termination timestamp or the user triggers a stop command.
[0116] It should be understood that the data parsing and assignment steps are executed cyclically until the playback ends, thus achieving the original speed presentation of the twin's history playback.
[0117] In practical applications, playback control commands can also include single-frame stepping / rewinding, loop playback, etc., and this application does not limit this. Furthermore, other alternative solutions can be used for the various playback control implementation processes described above. For example, the fast forward / rewind function can directly jump based on the timestamp difference; the pause function can add state judgment logic to the loop execution steps, skipping the position value assignment and timestamp increment operation when the flag is paused, until the flag switches to playback, avoiding resource occupation issues that may be caused by thread locks; the speed adjustment function can achieve speed adjustment by adjusting the timestamp increment step, and this application does not limit this either.
[0118] Through the above settings, playback control commands cover various types, including jump, start / stop, and speed adjustment. In particular, the combination of fast forward / rewind based on the acquisition frequency and precise pause via thread lock mechanism allows users to pinpoint key time periods and investigate anomalies as needed, effectively improving anomaly troubleshooting efficiency. Furthermore, the playback process only calls pre-generated runtime sequence data, eliminating the need to reload original data or restart the twin model, ensuring zero overload throughout and smooth playback.
[0119] In the method provided in this embodiment, during the process of the twin performing calculations based on the real-time operating data of the device, the electronic device collects the real-time position values of each twin component in a preset order, and then integrates and splices these position data to form the corresponding twin driving data. Only the core position parameters of the twin components are extracted, rather than directly collecting multi-source heterogeneous raw data from the field. Each component only needs one set of position values to record its pose state, significantly reducing the amount of data collected. At the same time, the single twin driving data formed by splicing in a preset order is suitable for the lightweight storage requirements of database tables. That is, the table only needs to set two columns: timestamp and twin driving data. There is no need to design independent data tables or complex storage structures for different device types, fundamentally avoiding multi-table redundancy and field redundancy, effectively reducing the overall overhead of data storage.
[0120] This application also provides an embodiment of a device operation backtracking method based on twin components, which provides a detailed description of the method for reading twin drive data. Figure 3 A flowchart illustrating a device operation backtracking method based on a twin component provided in this application embodiment. Figure 2 ,like Figure 3 As shown, the method in this embodiment includes:
[0121] S301. Divide the start and end times of the time interval according to a preset time interval to obtain at least two time periods.
[0122] Specifically, the preset time interval is a pre-configured fixed time length threshold. The splitting process starts from the beginning time and adds the preset time intervals to obtain each segment node until the segment node covers the end time. If the difference between the last segment node and the end time is less than the preset time interval, the end time of the last time period is directly set as the end time to ensure that the split time periods do not overlap and completely cover the entire target time interval.
[0123] In this embodiment, the preset time interval is specifically 5 minutes, that is, the user-specified time interval is divided equally or supplemented according to the standard of 5 minutes as a time period.
[0124] In practical applications, the preset time interval can also be other values such as 1 minute, 10 minutes, 30 minutes, etc., as long as it can ensure that the split time periods do not overlap and completely cover the target time interval. This embodiment does not limit this.
[0125] It should be understood that if the total duration of the target time interval specified by the user is less than or equal to the preset time interval, there is no need to split the time interval. The target time interval can be directly treated as a single time period, and subsequent operations to access the database table to obtain the corresponding twin driver data can be performed. This application does not limit this.
[0126] S302. Access the database table in each time period according to the preset access method, and obtain the corresponding twin driver data and the corresponding timestamp for each time period.
[0127] It should be understood that preset access methods refer to pre-defined data query rules for database tables. The core of these rules is precise data filtering and secure access control based on time periods, balancing the efficiency of data acquisition with the security of database access.
[0128] In this embodiment, the default access method is a database access mechanism based on Web API. This Web API serves as an interaction bridge between the historical retrospective application and the database, which can effectively intercept insecure database access requests and ensure the security and standardization of data access.
[0129] Specifically, for each segmented time period, the electronic device extracts the start and end times and converts them into hexadecimal encoding. Then, it concatenates the base URL with the two encoded times to generate the complete access path corresponding to that time period. Subsequently, it calls the Web API interface through this access path. The Web API first verifies whether the input time format conforms to the specification "yyyy-MM-ddHH:mm:ss". After verification, it searches the database table for all data between the two times in that time period and organizes each data that meets the condition according to the format of (timestamp, twin driver data). Finally, it returns the timestamp-twin driver data pair for the corresponding time period in JSON format.
[0130] In practical applications, the preset access method can also be based on the access method of passing interface parameters, the access method based on database partition mapping, or other methods, as long as the requirement of obtaining the corresponding data within each time period is met. In addition, even if the segmented access strategy is not adopted, secure access to the database can still be achieved through the Web API. In this case, it is only necessary to directly pass the start / end time of the complete time interval specified by the user to the Web API interface. The API will return the full data after verifying the time format according to the basic logic. This embodiment does not limit this.
[0131] S303. The twin driving data and timestamps corresponding to each time period are split and recombined in chronological order to obtain the complete data sequence corresponding to the time interval.
[0132] The complete data sequence includes time series sorted by timestamps, and a two-dimensional array of driving values that correspond one-to-one with each time series.
[0133] Specifically, the electronic device first receives JSON data in various time periods returned by the Web API, then parses each JSON data packet to extract the timestamp-twin driver data pairs. For each extracted twin driver data (originally in string form), it is split according to a preset delimiter to obtain a one-dimensional array that corresponds one-to-one with the position of the twin component. Each element in the array is the driver value (e.g., drive position) of a single component. Then, based on the order of the timestamps, the "timestamp-one-dimensional arrays" of different time periods are globally sorted to ensure that the data is arranged continuously along the time axis. Next, the sorted one-dimensional arrays of each time period are merged into a two-dimensional array, where the rows of the two-dimensional array correspond to the timestamp order and the columns correspond to the position of the twin component. Finally, duplicate timestamp data that may appear after sorting is removed, and the timestamps of all valid times are extracted to generate an ordered time series, which is then merged with the above two-dimensional array to integrate all valid data pairs into a complete data sequence covering the entire target time interval.
[0134] The method in this embodiment introduces a segmented access mechanism, which effectively avoids the problem of excessive Web API load and response timeout caused by excessive data volume in a single access request, thus improving the stability and efficiency of data reading. On the other hand, relying on the Web API as a data interaction intermediary avoids direct access to the database by historical backtracking applications, improving the security of data access and preventing the risk of illegal data operations. At the same time, the process of segmented acquisition-splitting and reorganizing-ordered integration ensures the integrity and temporal continuity of data in the target time interval, and generates a structured two-dimensional array that can directly drive the twin components, providing reliable data assurance for the accurate realization of twin device operation backtracking.
[0135] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0136] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0137] The above embodiments introduce a device operation backtracking method based on twin components from the perspective of method flow. The following embodiments introduce a device operation backtracking device based on twin components from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0138] This application also provides a device operation backtracking device based on a twin component, used to implement the method in the above method embodiments. Figure 4 A schematic diagram of a device operation backtracking device based on a twin component provided in this application embodiment is shown below. Figure 4 As shown, in this embodiment, the device operation backtracking device based on the twin component may include:
[0139] Module 41 is used to obtain the time range specified by the user;
[0140] The reading module 42 is used to read the corresponding twin driving data from the database table based on the time interval; the twin driving data is obtained by splicing the real-time position values of each twin component after collecting them in a preset order when the twin is running based on the real-time running data of the device.
[0141] The backtracking module 43 is used to parse the twin driving data corresponding to the time interval to generate the device operation status sequence, and control each twin component based on the device operation status sequence to complete the device operation backtracking.
[0142] In one possible implementation of this application embodiment, the apparatus further includes a storage module (not shown in the figure), used for:
[0143] Collect the real-time position values of each twin component in a preset order, and then stitch the real-time position values together to form twin driving data;
[0144] The twin-driven data is stored together with the current timestamp in a database table.
[0145] In one possible implementation of this application embodiment, the backtracking module 43 is specifically used for:
[0146] The arrangement of each twin component is determined based on a preset order. Each twin drive data within the time interval is split using a preset separator. Real-time position values corresponding to each twin component are extracted to form the sub-device operating status corresponding to each twin drive data.
[0147] The sub-device operating status corresponding to each twin driver data is associated with the corresponding timestamp, and sorted in ascending order of timestamps to obtain a continuous sequence of device operating statuses.
[0148] In one possible implementation of this application embodiment, the storage module is specifically used for:
[0149] Based on a preset sequential data structure, each twin component is accessed sequentially in a preset order, and the real-time position value of each twin component is collected. The preset sequential data structure is constructed by traversing the digital twin scene and locating each twin component that meets the conditions, and includes information about each twin component and its corresponding path.
[0150] The real-time position values of each twin component are collected and spliced together in a preset order, with preset separators in between, to obtain twin driving data.
[0151] In one possible implementation of this application embodiment, the reading module 42 is specifically used for:
[0152] The start and end times of the time interval are divided according to a preset time interval to obtain at least two time periods;
[0153] According to the preset access method, the database table is accessed in turn for each time period to obtain the corresponding twin driver data and the corresponding timestamp for each time period.
[0154] The twin driving data and timestamps corresponding to each time period are split and recombined in chronological order to obtain the complete data sequence corresponding to the time interval. The complete data sequence includes the time series sorted by timestamp, and a two-dimensional array of driving values that correspond one-to-one with the time series.
[0155] In one possible implementation of this application embodiment, the acquisition module 42 is specifically used for:
[0156] In response to user input triggered by preset interaction methods, obtain the time range; the preset interaction methods include at least one of the following: list selection method, drop-down menu selection method, previous / next episode button switching method, and progress bar dragging method.
[0157] In one possible implementation of this application embodiment, the backtracking module 43 is specifically used for:
[0158] In response to user-triggered playback control commands, update the current playback timestamp and playback status; playback control commands include at least one of timestamp jump control, playback status switching control, and playback rate adjustment control;
[0159] Based on the updated current playback timestamp and playback rate, the following steps are executed repeatedly until the device operating state sequence is traversed: obtain the real-time position value of each twin component corresponding to the current playback timestamp from the device operating state sequence; assign the real-time position value to the corresponding twin component in a preset order.
[0160] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0161] This application provides an electronic device. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, Figure 5 The illustrated electronic device includes at least one processor 51 and a memory 52. The processor 51 and the memory 52 are connected, for example, via a bus 53. Optionally, the electronic device may also include a transceiver 54. It should be noted that in practical applications, the transceiver 54 is not limited to one, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.
[0162] Processor 51 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 51 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0163] Bus 53 may include a pathway for transmitting information between the aforementioned components. Bus 53 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 53 may be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0164] The memory 52 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0165] The memory 52 is used to store computer execution instructions for implementing the scheme of this application, and the execution is controlled by the processor 51. The processor 51 is used to execute the computer execution instructions stored in the memory 52 to implement the content shown in the foregoing method embodiments.
[0166] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores computer-executable instructions, which are used to implement the methods in the above embodiments.
[0167] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.
[0168] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0169] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0170] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A device operation backtracking method based on twin components, characterized in that, The method includes: Get the time range specified by the user; Based on the time interval, the corresponding twin driving data is read from the database table; the twin driving data is obtained by splicing together the real-time position values of each twin component after collecting them in a preset order when the twin is running based on the device's real-time operating data. The twin drive data corresponding to the time interval is parsed to generate a device operation state sequence, and each twin component is controlled based on the device operation state sequence to complete the device operation backtracking.
2. The method according to claim 1, characterized in that, The method further includes: The real-time position values of each of the twin components are collected in a preset order, and the real-time position values are spliced together to form the twin driving data; The twin driver data is stored together with the current timestamp in a database table.
3. The method according to claim 1 or 2, characterized in that, The step of parsing the twin drive data corresponding to the time interval to generate a device operating state sequence includes: Based on the preset order, the arrangement position of each twin component is determined, and each twin driving data in the time interval is split by a preset separator to extract the real-time position value corresponding to each twin component, forming the sub-device operating status corresponding to each twin driving data. The sub-device operating status corresponding to each twin driver data is associated with the corresponding timestamp, and sorted in ascending order of the timestamps to obtain a continuous sequence of device operating statuses.
4. The method according to claim 3, characterized in that, After collecting the real-time position values of each twin component in a preset order, the real-time position values are then concatenated, including: Based on a preset order data structure, each of the twin components is accessed sequentially in the preset order, and the real-time position value of each twin component is collected. The preset order data structure is constructed by traversing the digital twin scene and locating each of the twin components that meet the conditions, and includes each twin component and its corresponding path information. The real-time position values of each of the collected twin components are concatenated in the preset order and connected in the middle by the preset separator to obtain the twin driving data.
5. The method according to claim 1 or 2, characterized in that, The step of reading the corresponding twin driver data from the database table based on the time interval includes: The start and end times of the time interval are divided according to a preset time interval to obtain at least two time periods; According to the preset access method, the database table is accessed in turn for each time period to obtain the corresponding twin driver data and the corresponding timestamp for each time period. The twin driving data and timestamps corresponding to each time period are split and recombined in chronological order to obtain the complete data sequence corresponding to the time interval; the complete data sequence includes time series sorted by timestamps and a two-dimensional array of driving values corresponding one-to-one with the time series.
6. The method according to claim 1 or 2, characterized in that, The process of obtaining the user-specified time interval includes: In response to an input operation triggered by a user through a preset interaction method, the time interval is obtained; the preset interaction method includes at least one of the following: list selection method, drop-down menu selection method, previous / next episode button switching method, and progress bar dragging method.
7. The method according to claim 1 or 2, characterized in that, The step of controlling each twin component based on the device's operating state sequence to complete device operation backtracking includes: In response to a user-triggered playback control command, the current playback timestamp and playback status are updated; the playback control command includes at least one of timestamp jump control, playback status switching control, and playback rate adjustment control. Based on the updated current playback timestamp and playback rate, the following steps are executed repeatedly until the traversal of the device operating state sequence is completed: obtain the real-time position value of each twin component corresponding to the current playback timestamp from the device operating state sequence; assign the real-time position value to the corresponding twin component according to the preset order.
8. A device operation backtracking device based on twin components, characterized in that, The device includes: The acquisition module is used to acquire a user-specified time range; The reading module is used to read the corresponding twin driving data from the database table based on the time interval; the twin driving data is obtained by splicing the real-time position values of each twin component after collecting them in a preset order when the twin is running based on the device's real-time operating data. The backtracking module is used to parse the twin driving data corresponding to the time interval to generate a device operation state sequence, and control each twin component based on the device operation state sequence to complete the device operation backtracking.
9. An electronic device, characterized in that, It includes at least one processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.