Data processing method and device for digital twin scene, equipment and medium
By using the equipment inspection animation collected by virtual cameras in the digital twin project for collision detection, and automatically creating and mounting functional scripts for key nodes, the problem of artificial binding data efficiency when there are too many devices in a three-dimensional scenario is solved, and efficient equipment data binding is achieved.
Patent Information
- Application Number
- CN202411835293.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-11
AI Technical Summary
In digital twin projects, when there are many devices in a three-dimensional scenario, it takes a lot of time to bind the device data manually, and omissions or errors are prone to occur.
By obtaining the equipment inspection animation collected by the preset virtual camera, collision detection is performed during the animation playback, collision occurrence information is obtained to automatically create key nodes and mount function scripts, and the automatic binding of device data is realized.
Improve the efficiency of device data binding, avoid omissions and errors in human operations, and significantly reduce binding time.
Smart Images

Figure CN119810272A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital twin technology, and in particular to a data processing method, device, equipment and medium for a digital twin scenario. Background Art
[0002] In many digital twin projects, there is usually a functional requirement to inspect equipment in a 3D scene. To meet this requirement, developers need to create a sequence frame animation of equipment inspection, and then find the key frames where all equipment appears in the screen based on the animation, manually create the key nodes represented by these key frames into the 3D scene one by one, and mount function scripts for them, bind related equipment model objects, and finally manually record the key frames where these key nodes are located to meet the equipment inspection function requirements.
[0003] If the number of devices in the three-dimensional scene is small, the device data can be bound through manual operation, and the omission or error situation is relatively low. However, if the number of devices in the three-dimensional scene is large, it takes a lot of time to manually bind the device data, and omissions or errors are prone to occur. Summary of the invention
[0004] The purpose of the present invention is to provide a data processing method, device, equipment and medium for a digital twin scene in response to the above-mentioned deficiencies in the prior art, so as to automatically bind the target virtual object model and the functional script corresponding to the target virtual object model to the key nodes, thereby improving the binding efficiency.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a data processing method for a digital twin scene, including:
[0007] Obtaining an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, wherein the preset three-dimensional scene is a digital twin scene built based on a preset physical scene;
[0008] During the playing of the equipment inspection animation, performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene;
[0009] If a collision is detected between the preset virtual camera and the camera, collision information is obtained, wherein the collision information includes at least: information about the target virtual object model and key frame information when the collision occurs in the equipment inspection animation;
[0010] According to the key frame information, a key node is created for the target virtual object model in the preset three-dimensional scene, and a function script corresponding to the target virtual object model is mounted on the key node, so that the target virtual object model has the function of the target device corresponding to the target virtual object model.
[0011] In an optional implementation manner, the step of obtaining a device inspection animation of a preset three-dimensional scene captured by a preset virtual camera includes:
[0012] The preset virtual camera is controlled to move in the preset three-dimensional scene, and the pictures captured by the preset virtual camera during the movement are obtained as the equipment inspection animation.
[0013] In an optional implementation, before performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene, the method further includes:
[0014] Mounting a collision box component for the preset virtual camera in the preset three-dimensional scene;
[0015] The performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene includes:
[0016] The collision box component is used to perform collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene.
[0017] In an optional implementation manner, before obtaining the collision occurrence information, the method further includes:
[0018] Mounting a functional component for the preset virtual camera in the preset three-dimensional scene;
[0019] The obtaining of collision occurrence information includes:
[0020] The functional component is used to obtain the collision occurrence information.
[0021] In an optional implementation manner, the adopting the functional component to obtain the collision occurrence information includes:
[0022] The function component is used to trigger a message event, and the collision occurrence information is obtained based on the message event.
[0023] In an optional implementation, before creating a key node for the target virtual object model in the preset three-dimensional scene according to the key frame information and mounting a target function script corresponding to the target virtual object model to the key node, the method further includes:
[0024] After the equipment inspection animation is played, all the collision occurrence information is obtained;
[0025] The step of creating a key node for the target virtual object model in the preset three-dimensional scene according to the key frame information, and mounting a function script corresponding to the target virtual object model to the key node includes:
[0026] According to the key frame information in all the collision occurrence information, a plurality of key nodes are respectively created in the preset three-dimensional scene;
[0027] According to the information of the target virtual object model in all the collision occurrence information, corresponding function scripts are mounted for the multiple key nodes respectively;
[0028] The multiple key nodes are respectively bound to the multiple target virtual object models.
[0029] In an optional implementation manner, after acquiring all the collision occurrence information, the method further includes:
[0030] storing all the collision occurrence information as a device data file of the preset three-dimensional scene;
[0031] Before creating a plurality of key nodes in the preset three-dimensional scene respectively according to the key frame information in all the collision occurrence information, the method further includes:
[0032] All the collision occurrence information is read from the device data file of the preset three-dimensional scene.
[0033] In a second aspect, the embodiment of the present application further provides a data processing device for a digital twin scene, including:
[0034] An acquisition module is used to acquire an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, wherein the preset three-dimensional scene is a digital twin scene built based on a preset physical scene;
[0035] A detection module, used for performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene during the playing of the equipment inspection animation;
[0036] The acquisition module is further used to acquire collision information if a collision is detected with the preset virtual camera, wherein the collision information at least includes: information of the target virtual object model and key frame information when the collision occurs in the equipment inspection animation;
[0037] A mounting module is used to create key nodes for the target virtual object model in the preset three-dimensional scene according to the key frame information, and to mount the function script corresponding to the target virtual object model for the key nodes, so that the target virtual object model has the function of the target device corresponding to the target virtual object model.
[0038] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the data processing method for the digital twin scenario as described in any one of the first aspects.
[0039] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method for the digital twin scene as described in any one of the first aspects are executed.
[0040] The beneficial effects of this application are:
[0041] The embodiments of the present application provide a data processing method, apparatus, device and medium for a digital twin scene, including: obtaining an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, the preset three-dimensional scene being a digital twin scene built based on a preset physical scene, and in the process of playing the equipment inspection animation, performing collision detection on a preset virtual camera and a virtual object model in the preset three-dimensional scene, and if a collision is detected with the preset virtual camera, obtaining collision occurrence information, the collision occurrence information including at least: information of a target virtual object model, and key frame information when a collision occurs in the equipment inspection animation, and creating key nodes for the target virtual object model in the preset three-dimensional scene according to the key frame information, and mounting a function script corresponding to the target virtual object model for the key nodes, so that the target virtual object model has the function of the target device corresponding to the target virtual object model. The method of the present application determines the target virtual object model by performing collision detection on a preset virtual camera and a virtual object model in a preset three-dimensional scene, and then creates key nodes for the target virtual object model in the preset three-dimensional scene based on key frame information, and mounts the function script corresponding to the target virtual object model for the key node, thereby automatically binding the target virtual object model and the function script corresponding to the target virtual object model to the key node, avoiding omissions or errors caused by manual binding, and improving the efficiency of binding. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 One of the flow charts of a data processing method for a digital twin scene provided in an embodiment of the present application;
[0044] Figure 2 A second flow chart of a data processing method for a digital twin scenario provided in an embodiment of the present application;
[0045] Figure 3 A third flow chart of a data processing method for a digital twin scenario provided in an embodiment of the present application;
[0046] Figure 4 A fourth flowchart of a data processing method for a digital twin scenario provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of functional modules of a data processing device for a digital twin scenario provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0050] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0051] In the description of the present application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, or is the orientation or position relationship in which the product of the application is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0052] In addition, the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0053] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0054] In order to realize the automatic mounting of the function script corresponding to the virtual object model for the key frame of the animation corresponding to the three-dimensional scene in the three-dimensional scene of the digital twin project to meet the requirements of the virtual object inspection function, the embodiment of the present application provides a data processing method for the digital twin scene, by obtaining the equipment inspection animation of the preset three-dimensional scene collected by the preset virtual camera, and in the process of playing the equipment inspection animation, the preset virtual camera and the virtual object model are subjected to collision detection in the preset three-dimensional scene, if the preset virtual camera is detected to have a collision, the collision occurrence information is obtained, and the collision occurrence information at least includes: information of the target virtual object model, and key frame information when the collision occurs in the equipment inspection animation, and finally, according to the key frame information, a key node is created for the target virtual object model in the preset three-dimensional scene, and the function script corresponding to the target virtual object model is mounted for the key node, so that the target virtual object model has the function of the target virtual object model corresponding to the target device. By automatically mounting the function script corresponding to the target virtual object model on the key node, it is avoided that manual mounting occurs, and omissions or errors occur.
[0055] The following is a detailed explanation of a data processing method for a digital twin scene provided by an embodiment of the present application through specific examples in conjunction with the accompanying drawings. A data processing method for a digital twin scene provided by an embodiment of the present application can be implemented by running an algorithm or software by a computer device pre-installed with: a detection algorithm or detection software for a preset data processing method. The computer device can be, for example, a server or a terminal, and the terminal can be a user computer. Figure 1 This is one of the flow charts of a data processing method for a digital twin scene provided in an embodiment of the present application. Figure 1 As shown, the method includes:
[0056] S101. Obtain an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, where the preset three-dimensional scene is a digital twin scene built based on a preset physical scene.
[0057] In this embodiment, the preset virtual camera can be a virtual camera, and the equipment inspection animation is obtained by collecting a digital twin scene built based on a preset physical scene, wherein the preset physical scene is an actual scene, and by collecting data in the preset physical scene, a numerical twin scene, that is, a preset three-dimensional scene, is constructed.
[0058] Optionally, a preset virtual camera is controlled to move in a preset three-dimensional scene, and pictures captured by the preset virtual camera during the movement are obtained as equipment inspection animations.
[0059] Specifically, a preset virtual camera is controlled to move along a specified route in a preset three-dimensional scene built based on a preset physical scene to obtain an equipment inspection animation, wherein at least one virtual object model exists in the preset three-dimensional scene.
[0060] S102: During the playback of the equipment inspection animation, collision detection is performed on a preset virtual camera and a virtual object model in a preset three-dimensional scene.
[0061] Specifically, during the playback of the equipment inspection animation, the preset virtual camera moves in the preset three-dimensional scene along a specified route, and can traverse all virtual object models in the preset three-dimensional scene, thereby realizing collision detection between the preset virtual camera and the virtual object models.
[0062] S103: If a collision of the preset virtual camera is detected, collision occurrence information is obtained.
[0063] The collision occurrence information includes at least: information about the target virtual object model and key frame information when the collision occurs in the equipment inspection animation.
[0064] Among them, playing the equipment inspection animation and performing collision detection on the preset virtual camera and virtual object model are all performed in the preset three-dimensional development engine (Unity). If the preset virtual camera collides with the target virtual object model, the preset three-dimensional development engine will detect that the preset virtual camera has collided, and then obtain the collision information, wherein the collision information may also include: information of the preset virtual camera.
[0065] The information of the target virtual object model may include: the object name of the target virtual object model, the position information of the target virtual object model in the world coordinate system, etc., wherein, if the preset three-dimensional scene is a three-dimensional scene built based on a highway section within a preset area, the target virtual object model can be a high-speed blower, a high-infrared gun, etc.
[0066] Since the screen in the equipment inspection animation shows the screen in the preset three-dimensional scene, the preset virtual camera and the target virtual object model collide. The screen where the collision occurred can be determined according to the time of the collision, that is, the key frame information when the collision occurred is determined.
[0067] S104. Create key nodes for the target virtual object model in the preset three-dimensional scene according to the key frame information, and mount function scripts corresponding to the target virtual object model to the key nodes, so that the target virtual object model has the function of the target device corresponding to the target virtual object model.
[0068] Specifically, by creating a key node, the function script corresponding to the target virtual object model is mounted on the key node, so that the target virtual object model has the function of the target device corresponding to the target virtual object model. At the same time, the target virtual object model mounted on the key node and the function script corresponding to the target virtual object model can also be found according to the key node.
[0069] Among them, different target virtual object models correspond to different function scripts. By mounting the function script, the target virtual object model has the function corresponding to the actual target device.
[0070] In summary, an embodiment of the present application provides a data processing method for a digital twin scene, including: obtaining an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, the preset three-dimensional scene being a digital twin scene built based on a preset physical scene, and in the process of playing the equipment inspection animation, performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene, and if a collision is detected with the preset virtual camera, obtaining collision occurrence information, the collision occurrence information including at least: information of the target virtual object model, and key frame information when the collision occurs in the equipment inspection animation, and according to the key frame information, creating key nodes for the target virtual object model in the preset three-dimensional scene, and mounting the function script corresponding to the target virtual object model for the key nodes, so that the target virtual object model has the function of the target device corresponding to the target virtual object model. The method of the present application determines the target virtual object model by performing collision detection on a preset virtual camera and a virtual object model in a preset three-dimensional scene, and then creates key nodes for the target virtual object model in the preset three-dimensional scene based on key frame information, and mounts the function script corresponding to the target virtual object model for the key node, thereby automatically binding the target virtual object model and the function script corresponding to the target virtual object model to the key node, avoiding omissions or errors caused by manual binding, and improving the efficiency of binding.
[0071] The embodiment of the present application also provides another possible implementation method of the data processing method for the digital twin scenario. Figure 2 The second flowchart of a data processing method for a digital twin scene provided in an embodiment of the present application is as follows. Figure 2 As shown, before performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene, the method further includes:
[0072] S201, mounting a collision box component for a preset virtual camera in a preset three-dimensional scene.
[0073] In this embodiment, a collision box (BoxCollider) component is mounted for a preset virtual camera in a preset three-dimensional scene in an editor of a preset three-dimensional development engine.
[0074] Based on the above, collision detection is performed on a preset virtual camera and a virtual object model in a preset three-dimensional scene, including:
[0075] S202: Using a collision box component, perform collision detection on a preset virtual camera and a virtual object model in a preset three-dimensional scene.
[0076] Specifically, when the preset virtual camera moves in the equipment inspection animation, collision detection is performed through the collision box component mounted by the preset virtual camera and the virtual object model.
[0077] Among them, all virtual object models in the preset three-dimensional scene are pre-mounted with collision boxes, and the collision box component mounted by the preset virtual camera collides with the collision box pre-mounted by the virtual object model to realize collision detection between the preset virtual camera and the virtual object model.
[0078] In the method provided in the embodiment of the present application, a collision box component is mounted on a preset virtual camera in a preset three-dimensional scene, and a collision box component is used to perform collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene, and collision detection between the preset virtual camera and the virtual object model is realized through the collision box component.
[0079] The embodiment of the present application also provides another possible implementation method of the data processing method for the digital twin scenario. Figure 3 The third flowchart of a data processing method for a digital twin scene provided in an embodiment of the present application. Figure 3 As shown, before obtaining the collision occurrence information, the method further includes:
[0080] S301, mounting a functional component for a preset virtual camera in a preset three-dimensional scene.
[0081] In this embodiment, a function component is mounted for a preset virtual camera in a preset three-dimensional scene in an editor of a preset three-dimensional development engine, wherein the function component can automatically record collision occurrence information.
[0082] Based on the above, the collision information is obtained, including:
[0083] S302: Use functional components to obtain collision occurrence information.
[0084] Optionally, a functional component is used to trigger a message event, and collision occurrence information is obtained based on the message event.
[0085] Specifically, when a collision is detected with the preset virtual camera, the functional component automatically collects the collision information, triggers a message event (OnCollisionEnter), and returns the collision information automatically collected by the functional component to the preset three-dimensional development engine.
[0086] In the method provided in the embodiment of the present application, a function component is mounted on a preset virtual camera in a preset three-dimensional scene, and collision information is obtained by using the function component. When a collision of the preset virtual camera is detected, the collision information can be collected through the mounted function component.
[0087] The embodiment of the present application also provides another possible implementation method of the data processing method for the digital twin scenario. Figure 4 The fourth flowchart of a data processing method for a digital twin scene provided in an embodiment of the present application is shown in FIG. Figure 4As shown, according to the key frame information, before creating a key node for the target virtual object model in the preset three-dimensional scene and mounting the target function script corresponding to the target virtual object model for the key node, the method also includes:
[0088] S401. After the equipment inspection animation is played, all collision occurrence information is obtained.
[0089] In this embodiment, during the playing of the equipment inspection animation, the preset virtual camera and the virtual object model are always performing collision detection in the preset three-dimensional scene. If a collision is detected with the preset virtual camera, the collision occurrence information at this time is recorded. If the equipment inspection animation is still playing, the preset virtual camera and the virtual object model continue to perform collision detection until the equipment inspection animation is finished playing, and then all collision occurrence information is obtained.
[0090] Based on the above key frame information, a key node is created for the target virtual object model in the preset three-dimensional scene, and a function script corresponding to the target virtual object model is mounted on the key node, including:
[0091] S402: Create multiple key nodes in a preset three-dimensional scene according to the key frame information in all the collision occurrence information.
[0092] S403: According to the information of the target virtual object model in all the collision occurrence information, corresponding function scripts are mounted for multiple key nodes respectively.
[0093] S404: Bind the multiple key nodes to the multiple target virtual object models respectively.
[0094] Specifically, since each collision occurrence information includes key frame information when the collision occurs, multiple key nodes are created in the preset three-dimensional scene according to each key frame information, wherein the preset three-dimensional development engine calls the built-in interface GameObject() to create a game object, i.e., a key node, for each key frame information.
[0095] Then, according to the information of the target virtual object model in all the collision occurrence information, corresponding function scripts are mounted for multiple key nodes respectively, and the multiple key nodes are bound to multiple target virtual object models respectively.
[0096] In the method provided in the embodiment of the present application, after the equipment inspection animation is played, all collision occurrence information is obtained, and multiple key nodes are created in the preset three-dimensional scene according to the key frame information in all the collision occurrence information. According to the information of the target virtual object model in all the collision occurrence information, corresponding function scripts are mounted for the multiple key nodes, and the multiple key nodes are bound to the multiple target virtual object models, thereby achieving the creation of key nodes for all target virtual object models in the preset three-dimensional scene, mounting the function scripts corresponding to the target virtual object models for the key nodes, and automatically binding multiple target virtual object models and the function scripts corresponding to the multiple target virtual object models to the multiple key nodes.
[0097] The embodiment of the present application also provides another possible implementation of the data processing method of the digital twin scene. After obtaining all the collision occurrence information, the method further includes:
[0098] All collision information is stored as a device data file of the preset 3D scene.
[0099] In this embodiment, by calling the file writing interface (File.WriteAllText), all collision occurrence information is stored as a device data file of a preset three-dimensional scene, wherein the file format of the device data file can be a json file format, and the device data file can be saved in a local directory, which is not limited here.
[0100] According to the key frame information in all the collision occurrence information, before creating a plurality of key nodes in the preset three-dimensional scene respectively, the method further includes:
[0101] Read all collision information from the device data file of the preset 3D scene.
[0102] In this embodiment, the saved device data file is read by calling the file reading interface (File.ReadAllText) to obtain all collision occurrence information.
[0103] The following is a corresponding explanation of the data processing device and electronic device that execute the digital twin scenario provided by any of the above embodiments of the present application. The specific implementation process and the technical effects produced are the same as those of the corresponding method embodiments mentioned above. For the sake of brief description, the parts not mentioned in this embodiment can refer to the corresponding content in the method embodiment.
[0104] Figure 5 A functional module diagram of a data processing device for a digital twin scenario provided in an embodiment of the present application. Figure 5 As shown, the data processing device 100 of the digital twin scene includes:
[0105] An acquisition module 110 is used to acquire an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, where the preset three-dimensional scene is a digital twin scene built based on a preset physical scene;
[0106] The detection module 120 is used to perform collision detection on a preset virtual camera and a virtual object model in a preset three-dimensional scene during the playback of the equipment inspection animation;
[0107] The acquisition module 110 is further used to acquire collision information if a collision of the preset virtual camera is detected, and the collision information at least includes: information of the target virtual object model and key frame information when the collision occurs in the equipment inspection animation;
[0108] The mounting module 130 is used to create key nodes for the target virtual object model in a preset three-dimensional scene according to the key frame information, and mount the function script corresponding to the target virtual object model for the key nodes, so that the target virtual object model has the function of the target device corresponding to the target virtual object model.
[0109] Optionally, the acquisition module 110 is further used to control a preset virtual camera to move in a preset three-dimensional scene, and acquire a picture captured by the preset virtual camera during the movement as an equipment inspection animation.
[0110] Optionally, the mounting module 130 is further used to mount a collision box component for a preset virtual camera in a preset three-dimensional scene.
[0111] Optionally, the detection module 120 is further configured to use a collision box component to perform collision detection on a preset virtual camera and a virtual object model in a preset three-dimensional scene.
[0112] Optionally, the mounting module 130 is further used to mount a functional component for a preset virtual camera in a preset three-dimensional scene;
[0113] Optionally, the acquisition module 110 is further configured to acquire collision occurrence information using functional components.
[0114] Optionally, the acquisition module 110 is further configured to trigger a message event using a functional component, and acquire collision occurrence information returned based on the message event.
[0115] Optionally, the acquisition module 110 is further used to acquire all collision occurrence information after the equipment inspection animation is played;
[0116] Optionally, the mounting module 130 is also used to create multiple key nodes in a preset three-dimensional scene according to the key frame information in all the collision occurrence information; mount corresponding function scripts for the multiple key nodes according to the information of the target virtual object model in all the collision occurrence information; and bind the multiple key nodes to multiple target virtual object models.
[0117] Optionally, the data processing device 100 of the digital twin scene further includes:
[0118] The storage module is used to store all collision occurrence information as a device data file of a preset three-dimensional scene.
[0119] Optionally, the data processing device 100 of the digital twin scene further includes:
[0120] The reading module is used to read all collision occurrence information from the device data file of the preset three-dimensional scene.
[0121] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0122] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0123] Figure 6 The following is a schematic diagram of an electronic device provided in an embodiment of the present application, which can be used for data processing in a digital twin scenario. Figure 6 As shown, the electronic device 200 includes: a processor 210 , a storage medium 220 , and a bus 230 .
[0124] The storage medium 220 stores machine-readable instructions executable by the processor 210. When the electronic device is running, the processor 210 communicates with the storage medium 220 via the bus 230, and the processor 210 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0125] Optionally, the present application further provides a storage medium 220, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method embodiment are executed. The specific implementation method and technical effect are similar and will not be repeated here.
[0126] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0129] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0130] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data processing method for a digital twin scene, characterized in that: include: Obtaining an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, wherein the preset three-dimensional scene is a digital twin scene built based on a preset physical scene; During the playing of the equipment inspection animation, performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene; If a collision is detected between the preset virtual camera and the camera, collision information is obtained, wherein the collision information includes at least: information about the target virtual object model and key frame information when the collision occurs in the equipment inspection animation; According to the key frame information, a key node is created for the target virtual object model in the preset three-dimensional scene, and a function script corresponding to the target virtual object model is mounted on the key node, so that the target virtual object model has the function of the target device corresponding to the target virtual object model.
2. The method according to claim 1, characterized in that The method of obtaining the equipment inspection animation of the preset three-dimensional scene captured by the preset virtual camera includes: The preset virtual camera is controlled to move in the preset three-dimensional scene, and the pictures captured by the preset virtual camera during the movement are obtained as the equipment inspection animation.
3. The method according to claim 1, characterized in that Before performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene, the method further includes: Mounting a collision box component for the preset virtual camera in the preset three-dimensional scene; The performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene includes: The collision box component is used to perform collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene.
4. The method according to claim 1, characterized in that: Before obtaining the collision occurrence information, the method further includes: Mounting a functional component for the preset virtual camera in the preset three-dimensional scene; The obtaining of collision occurrence information includes: The functional component is used to obtain the collision occurrence information.
5. The method according to claim 4, characterized in that The adopting the functional component to obtain the collision occurrence information includes: The function component is used to trigger a message event, and the collision occurrence information is obtained based on the message event.
6. The method according to claim 1, characterized in that Before creating a key node for the target virtual object model in the preset three-dimensional scene according to the key frame information and mounting a target function script corresponding to the target virtual object model to the key node, the method further includes: After the equipment inspection animation is played, all the collision occurrence information is obtained; The step of creating a key node for the target virtual object model in the preset three-dimensional scene according to the key frame information, and mounting a function script corresponding to the target virtual object model to the key node includes: According to the key frame information in all the collision occurrence information, a plurality of key nodes are respectively created in the preset three-dimensional scene; According to the information of the target virtual object model in all the collision occurrence information, corresponding function scripts are mounted for the multiple key nodes respectively; The multiple key nodes are respectively bound to the multiple target virtual object models.
7. The method according to claim 6, characterized in that After obtaining all the collision occurrence information, the method further includes: storing all the collision occurrence information as a device data file of the preset three-dimensional scene; Before creating a plurality of key nodes in the preset three-dimensional scene respectively according to the key frame information in all the collision occurrence information, the method further includes: All the collision occurrence information is read from the device data file of the preset three-dimensional scene.
8. A data processing device for a digital twin scene, characterized in that: include: An acquisition module is used to acquire an equipment inspection animation of a preset three-dimensional scene captured by a preset virtual camera, wherein the preset three-dimensional scene is a digital twin scene built based on a preset physical scene; A detection module, used for performing collision detection on the preset virtual camera and the virtual object model in the preset three-dimensional scene during the playing of the equipment inspection animation; The acquisition module is further used to acquire collision information if a collision is detected with the preset virtual camera, wherein the collision information at least includes: information of the target virtual object model and key frame information when the collision occurs in the equipment inspection animation; A mounting module is used to create key nodes for the target virtual object model in the preset three-dimensional scene according to the key frame information, and to mount the function script corresponding to the target virtual object model for the key nodes, so that the target virtual object model has the function of the target device corresponding to the target virtual object model.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the data processing method for the digital twin scene as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, executes the steps of the data processing method for the digital twin scene as described in any one of claims 1 to 7.