There are various types of equipment in the DT workshop, such as machine tools, AGVs and warehouses, and it is necessary to design their representations separately for each equipment type. Saving the information of the scene equipment in the workshop is the precondition for loading. This procedure concerns data reading/writing between the workshop software, runtime memory and local disk. This section introduces the information model of various workshop elements, including the types of elements and the information contained in each element; it also proposes the model of workshop scene equipment saving and loading and describes the system’s composition and the connection between each module.
3.1.1. Workshop Element Information Model
The data from the DT service system control the presence and operation of the equipment in the virtual workshop. Each workshop element contains two types of information: a 3D model and attribute behavior information, among which the 3D model is the external expression of workshop elements in the virtual workshop. This allows the workshop administrator to review them in an intuitive form, while attribute behavior information is used to describe the status and behavior of workshop elements; for example, the machine tool possesses attribute information such as the machine code, manufacturer, etc., and behavior information such as the machining action and working status.
Figure 1 depicts the types of data contained in the various elements of the workshop. Based on the logical relations, the information about the workshop elements is divided into five levels from the inside out.
Layer 1: DT Object. DT Object is an abstract concept used to describe the overall integration of all objects in the workshop. Workshop assets that can be digitally represented and can directly affect physical objects may be considered DT Objects.
Layer 2: Workshop information base class. This is the base class of all objects contained in the workshop, and it contains three classes in total according to the type of workshop information: element class, viewer class and info class. It contains the basic functions, such as the ability to create and destroy the objects. The use of a unified abstract base class to manage the creation and destruction of objects, memory allocation and release can improve system performance and code reusability.
Layer 3: Workshop information-derived class. Derived from the workshop information base class, it further elaborates the information type for the workshop element and initially specifies six major types of information contained in the workshop: machine tool, storage, transport, saved archive, fixed viewer and roam viewer classes.
Layer 4: Workshop information-specific object. Due to the presence of numerous variations within the same major device category, they are abstracted into another layer. This is the most fine-grained shop equipment specific object, which can be defined based on the workshop information derived class and the actual workshop situation.
Layer 5: Workshop information detail object. The information contained in the workshop information-specific object, which is mostly defined in the form of structures or fields within the concrete object class, is used to store the state and properties of the object. Such hierarchical classification allows for better management of extensive device information within the workshop.
To elaborate on the relationships between the components of the workshop elemental information in more detail and with greater specificity, a formal description method is introduced to explain them. The symbols, meanings and schematic use cases for representing the relations between the components of the element information are presented in
Table 2.
As shown in Formula (1), the DT Object refers to all of the objects in the workshop, from which it is further divided into three workshop information base classes:
The second layer of the workshop information model is explained here. Element class is a real physical entity in the workshop, which is the most basic element used to build the virtual workshop; viewer class is an abstract type used to help the workshop administrator view the workshop scene in the DT system, including a fixed viewer and roam rover, which do not actually exist in the physical workshop; the info class is used to store the archive data on the workshop and contains the information presented to the workshop administrator at the viewport level. Each workshop information-specific object has different properties and behavioral information, which are described in detail below:
Machine tool class: Machine tools are an important part of a workshop, which undertakes various machining and cutting tasks. There may be several types of machine tools in a workshop, such as a vertical machining center, a horizontal machining center, a lathe, a milling machine and a grinding machine. The information describing the machine elements in the virtual shop includes their machine code, manufacturer, working status, alarm information, etc. The relationship between the machine tool class and the element class can be expressed by Formula (2). In addition, the machine tool class can instantiate a variety of objects. Each instance object has a variety of member attributes, and this relationship can be expressed by Formula (3).
Transport class: Transport machines (AGVs, forklifts, conveyors, etc.) are responsible for transferring workblanks and (semi-)finished products from the workshop to the target location. The information describing the transport machines in the virtual workshop includes their equipment code, location, transport status, alarm information, etc. The relationship between the transport class and the elements class can be expressed by Formula (4). Transport class can instantiate a variety of objects. Each instance object has a variety of member attributes, and this relationship can be expressed by Formula (5).
Storage class: Storage elements are responsible for storing raw materials, finished products, etc., in the workshop, including shelves and warehouses, etc. In the virtual workshop, the storage elements are described by information such as capacity, area and storage records. The relationship between the storage class and the element class can be represented by Formula (6). The storage class can instantiate a variety of objects. Each instance object has a variety of member attributes, and this relationship can be represented by Formula (7).
- (2)
Viewer class
Fixed viewer: Fixed viewer acts as a “fixed camera” in the virtual workshop; it is responsible for displaying the real-time images of the specified position and angle in the workshop software. It is worth mentioning that the “fixed viewer” proposed in this paper and the “roam viewer”, which will be described below, are not real devices that exist in the physical workshop, but viewers that exist in the workshop software to allow users to observe the real-time 3D graphical screen of the workshop. The fixed viewer’s screen position and perspective are generally unchangeable. The workshop-fixed viewer is used to monitor important points in the workshop, such as the warehouse, machine tool spindle, conveyor belt, etc. The relationship between the fixed viewer class and the viewer class can be represented by Formula (8). The fixed viewer class can instantiate a variety of objects. Each instance object has a variety of member attributes; the relationship can be expressed by Formula (9).
Roam viewer: Unlike fixed rovers, the roam viewer can move freely and adjust its viewpoint. Similar to a person walking through the workshop, a roam viewer allows the workshop administrator to roam freely through the virtual workshop and view the status and actions of its elements in real time. A roam viewer object is described in the virtual workshop according to its position, rotation and viewing angle. The relationship between the roam viewer class and the viewer class can be represented by Formula (10). The roam viewer class can instantiate an object that has multiple member attributes, and this relationship can be represented by Formula (11).
- (3)
Info class
Saved archive class: Used to record and display information about the saved archive in the software interface, including the archive name, timestamp, controller name and workshop name. When an archive is created, this type of information is collected and updated in the software viewport. The relationship between the saved archive class and the info class can be expressed by Formula (12). The saved archive class can instantiate multiple objects, each with multiple member properties, and the relationship can be represented by Formula (13).
3.1.2. Workshop Scene Equipment Saving and Loading Model
For the massive amounts of data covered in the DT workshop, a workshop scene equipment saving and loading method is proposed. This method can save the historical scene equipment data of the DT workshop and load the saved data into the DT software when analyzing the implicit problems of the workshop, which helps the workshop administrator to identify the problems in historical manufacturing tasks. As shown in
Figure 2, the method framework is divided into three layers: the data layer, the system layer and the viewport layer.
For the data contained in the element information model presented in
Section 3.1.1, this process takes place in the “data layer” of the saving and loading model. The information saving and loading operation is the process of serializing, deserializing, reading and writing the data contained in the data layer.
- (1)
Data layer
In the data layer, various data structures are defined to store different types of workshop information. The data layer is the cornerstone of the saving and loading system and contains almost all the scene equipment data in the workshop. It is described in detail below.
Slot information: This object contains a type of structural data that cover the basic information of the workshop-saving profile. When there is a saving or loading requirement, a saving information object is constructed and the data to be saved or loaded are assigned to the member properties of the object, which is then (de)serialized to complete the requirement.
Slot data: Slot data form an aggregated relationship with the above saved information object. This structure contains the name of the archive, a timestamp detailing when the archive was created, the name of the scene and the name of the user in the scene.
Object data: Object data contain information about the subcomponents contained in the workshop object. This structure is the basic unit of saving, and it has an aggregated relationship with various data units.
Object component data: These data are also of structure type and contain the name, transform and other data information of the subcomponents of the workshop object.
Controller data: The workshop controller is used to control the workshop roam viewer, which records the perspective pitch and rotation for real-time control of the roam viewer.
Viewer data: There are two types of workshop viewer data: location information and rotation information. The location information records the coordinate data of the viewer in the workshop, while the rotation information records the rotation status data of the workshop viewer. It is important to note that the view rotation data of the controller used to control the workshop viewer is not the same as the rotation data of the viewer itself.
Script data: Workshop scripts are used to specify operations or rules in the workshop at a macro level, usually as visual scripts based on a blueprint system. The script names and the script data will be saved or loaded.
Element data: Element data are used to carry scenes or equipment in the workshop. These data include the class information, name information, transform information and type information of all scenes and equipment.
- (2)
System layer
The system layer provides functions for saving and loading, which can be considered as an intermediate link between the data layer and the viewport layer, enabling the operation of the data layer and the presentation of important information to the workshop administrator through the viewport layer. This is described in further detail below.
Workshop subsystem: The workshop subsystem class is responsible for managing workshop system instances, storing workshop states and data. It has initialization and deinitialization functions; the initialization function can create the workshop subsystem object, allocate memory for it and load the workshop configuration and archive data, while the deinitialization operation can remove the workshop subsystem object, release memory and clean up the workshop state data. In addition, this class contains the logical flow framework for saving and loading functions, through which the steps specified in the framework are completed with the cooperation of other classes to implement these functions.
Async task: This task is used to start a multi-thread async task and perform corresponding operations after the user issues a save/load instruction, which includes the function to create an asynchronous task.
Save and load interface: This interface receives the saving or loading instructions requested by the workshop subsystem class, and it has two dummy functions that are implemented by the saving/loading system. Introducing the interface can increase the flexibility of the whole system, making it easy to extend and simplifying the implementation of functions.
Save and Load System: This class implements the saving and loading interface and forwards the saving or loading task to the file helper class. It also retrieves the archive file path. By entering the specified archive name, it can retrieve the full archive save path, which facilitates read and write operations on the archive.
File Helper: The file helper has methods used to save byte files to computer disks or load saved files from disks to byte files. The implementation of the file helper class functionality depends on the file manager class.
File Manager: The file manager can create or open an archive file, in addition to its functions of creating a reader/writer, obtaining a timestamp, etc.
Archive system: The archive system has serialization and deserialization methods. With the help of serialization methods, objects in the runtime data can be serialized to memory to await subsequent operations such as compression and writing to local files.
Compress manager: The compress manager is used to compress the saved data to the storage space of the memory, which utilizes a data compression method; in this study, the Zlib compression method was used.
Decompress manager: The reloaded data are subjected to data decompression methods.
- (3)
Viewport layer
The graphical interface helps the workshop administrator rapidly and intuitively save or load workshop data. The user interacts with the interface at the viewport layer to ensure the system layer executes the relevant code to achieve the intended function. This process is described in detail below:
User Interface Module: The user interface is the direct medium between the user and the system operations. It contains methods for adding the interface to the viewport, as well as declaring delegated events that are triggered by mouse clicks on buttons in the interface.
User-defined delegate: This delegate has a trigger event bound to it; for example, when the user clicks the saving button in the interface, it conveys the saving command to the system layer.