Electronic equipment and component control method
By setting the target component library as a global variable in the electronic equipment and changing the component library configuration, the problem of component library switching and expansion in BIM applications is solved, seamless switching of the component library is achieved and the amount of code changes is reduced, and the component library is improved portability and application flexibility.
Patent Information
- Application Number
- CN202310232724.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In BIM applications, the component library implementation methods and interfaces provided by various BIM manufacturers are not uniform, resulting in a huge amount of code changes, making it difficult to achieve seamless switching and expansion between component libraries.
By setting the target component library as a global variable in the electronic device, changing the specific configuration of the component library, realizing switching of the BIM component library, and instantiating and updating the component library according to the configuration file of the target component, reducing the amount of code changes and improving the efficiency of the component library. Scalability and portability.
It achieves seamless switching and expansion of the BIM component library, reduces the amount of code changes, and improves the portability and application flexibility of the component library.
Smart Images

Figure CN118627155A
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing and discloses an electronic device and a component control method. Background Art
[0002] Building Information Modeling (BIM) is a three-dimensional building model that manages all relevant information data of construction projects. It simulates the real information of buildings through digital information simulation, and has the advantages of information completeness, information relevance, information consistency, visualization, coordination, and simulatability.
[0003] BIM can enable construction units, design units, construction units, establishment units and other participants to share the same building information model on the same platform, which is conducive to project visualization and refined construction. It can be seen that BIM is an important tool that is conducive to the refined and information management of the construction industry.
[0004] BIM lightweight technology refers to the technology that, after the BIM model of an engineering building is established, uses technical means such as compression processing of the BIM model to allow BIM to be used on various WEB browsers and mobile apps.
[0005] BIM lightweight technology can expand the scope of BIM application, so that the three-dimensional visualized and digitized BIM model can not only stay in the design stage, but also be applied to the construction stage and operation and maintenance stage, covering the entire life cycle of the engineering building. With the increase in the application of BIM lightweight and the increase in BIM manufacturers, each manufacturer provides its own component library, which includes a variety of components to assist developers in building WEB applications.
[0006] Usually, a component library provided by a single BIM manufacturer is used in BIM applications. If it is adjusted to a component library provided by other BIM manufacturers, the BIM application code will need to be changed significantly due to the inconsistency in the implementation methods and component interfaces of the component libraries provided by each BIM manufacturer. Summary of the invention
[0007] The present application provides an electronic device and a component control method, which can adjust the code modification amount of a component library used in a BIM application.
[0008] In a first aspect, the present application provides an electronic device, which may include an instruction receiving device, a display screen, and a processor. The instruction receiving device may be configured to receive an operation from a user, or an instruction triggered by a user. The instruction receiving device may include, but is not limited to, a touch screen, a keyboard, a mouse, an image acquisition device, and a voice acquisition device. The display screen is configured to display a user interface. The processor may be coupled to the display screen and the instruction receiving device, respectively. The processor may control or adjust the content displayed on the display screen.
[0009] The first user interface displayed on the display screen includes one or more scene objects. The user can select a scene object through the instruction receiving device, so as to facilitate the introduction of recording the scene object as a target scene object. The processor can respond to the selection instruction of the target scene object in the first user interface, and instantiate the component library corresponding to the first building information model BIM component library identifier according to the configuration file of the target scene object, wherein the configuration file of the target scene object includes the component library identifier of the first BIM component library and at least one target component type identifier, wherein the first user interface includes one or more scene objects, the target scene object is any one of the multiple scene objects, there are two scene objects in the multiple scene objects, and the component library identifiers of the BIM component libraries in the configuration files of the two scene objects are different; and according to the creation method corresponding to the pre-configured component type identifier, the creation method corresponding to each component type identifier in the at least one target component type identifier is executed to achieve the creation of the target component represented by the target component type identifier in the first BIM component library. The display screen can also display a second user interface, wherein the second user interface includes the target component.
[0010] In an embodiment of the present application, the process of creating components in the present application has a low reliance on the creation method of components in a single component library. The component library used by the target scene object can be adjusted by adjusting the BIM component library identifier in the configuration file of the target scene object. After the BIM component library identifier in the configuration file is updated, the processor can proceed according to the BIM component library identifier in the configuration file to instantiate the updated BIM component library. And according to the creation method corresponding to the pre-configured component type identifier, the creation method corresponding to each component type identifier in the at least one target component type identifier is executed to achieve the creation of components in the updated BIM component library.
[0011] In one possible design, when the processor executes the creation method corresponding to each component type identifier in the at least one target component type identifier according to the creation method corresponding to the preconfigured component type identifier, the processor is further configured to:
[0012] Based on the pre-stored correspondence between each component type identifier and the component interface of the first BIM component library, searching for the component interface corresponding to the target component type identifier;
[0013] Call the creation method in the component interface corresponding to the target component type identifier.
[0014] In one possible design, the processor may configure the first BIM component library as a target component library, wherein the target component library is a global variable. Based on the correspondence between each component type identifier and the component interface of the target component library, the component interface corresponding to the target component type identifier is searched. The creation method in the component interface corresponding to the target component type identifier is called to achieve the creation of the target component represented by the target component type identifier in the first BIM component library.
[0015] Even if different BIM component libraries provide components of the same component type, the implementation methods of each component are different, making it difficult to directly reuse the code. The electronic device provided by this application does not directly use the components in each component library. In the electronic device provided by this application, the target component library is set as a global quantity, and the BIM component library is switched by changing the specific configuration of the target component library, and then the components in the switched BIM component library are used. Such a design can improve the scalability of the BIM component library and the portability of the components in a single BIM component library.
[0016] In one possible design, the target component has associated data; and the processor is further configured to:
[0017] Acquire the associated data of the target component;
[0018] Based on the acquired associated data, the display form of the target component in the second user interface is updated.
[0019] In one possible design, the processor is further configured to:
[0020] In response to the hide operation instruction of the target component, if the attribute of the target component is a leaf-type component, call the hide operation method of the target component, wherein the number of components in the leaf-type component is 1; or, if the attribute of the target component is an aggregate-type component, determine multiple subcomponents of the target component and call the hide operation method in each subcomponent, wherein the number of components in the aggregate-type component is a positive integer greater than 1.
[0021] In a second aspect, an embodiment of the present application provides a component control method, which may include: in response to a selection instruction of a target scene object in a first user interface, instantiating a component library corresponding to a first building information model BIM component library identifier according to a configuration file of the target scene object, wherein the configuration file of the target scene object includes a component library identifier of the first BIM component library and at least one target component type identifier, wherein the first user interface includes one or more scene objects, the target scene object is any one of the multiple scene objects, there are two scene objects in the multiple scene objects, and the component library identifiers of the BIM component libraries in the configuration files of the two scene objects are different;
[0022] And according to the creation method corresponding to the pre-configured component type identifier, the creation method corresponding to each component type identifier in the at least one target component type identifier is executed to achieve the creation of the target component represented by the target component type identifier in the first BIM component library.
[0023] In a possible design, executing the creation method corresponding to each component type identifier in the at least one target component type identifier according to the creation method corresponding to the pre-configured component type identifier further includes:
[0024] Based on the pre-stored correspondence between each component type identifier and the component interface of the first BIM component library, searching for the component interface corresponding to the target component type identifier;
[0025] Call the creation method in the component interface corresponding to the target component type identifier.
[0026] In a possible design, searching for the component interface corresponding to the target component type identifier based on the correspondence between each component type identifier and the component interface of the pre-stored first BIM component library may include:
[0027] Configure the first BIM component library as a target component library, wherein the target component library is a global variable;
[0028] Based on the correspondence between each component type identifier and the component interface of the target component library, the component interface corresponding to the component type identifier is searched.
[0029] In a possible design, the target component has associated data; and the method further includes:
[0030] Acquire the associated data of the target component;
[0031] Based on the acquired associated data, the display form of the target component in the second user interface is updated.
[0032] In one possible design, the method further includes:
[0033] In response to the hide operation instruction of the target component, if the attribute of the target component is a leaf-type component, the hide operation method in the target component interface is called, wherein the number of components in the leaf-type component is 1; or, if the attribute of the target component is an aggregate-type component, multiple sub-components of the target component are determined, and the hide operation method in the interface of each sub-component is called, wherein the number of components in the aggregate-type component is a positive integer greater than 1.
[0034] In a third aspect, an embodiment of the present application also provides a component control device, which may include a memory and a processor; the memory stores computer program instructions; the processor calls the computer program instructions to execute the method described in the second aspect and any design thereof.
[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the second aspect and any one of its designs.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method described in the second aspect and any one of its designs.
[0037] In addition, the technical effects brought about by the second aspect and any possible design thereof may refer to the technical effects brought about by the different designs in the first aspect, the technical effects brought about by the third aspect and any possible design thereof may refer to the technical effects brought about by the different designs in the first aspect, the technical effects brought about by the fourth aspect and any possible design thereof may refer to the technical effects brought about by the different designs in the first aspect, and the technical effects brought about by the fifth aspect and any possible design thereof may refer to the technical effects brought about by the different designs in the first aspect, and they will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of a flow chart of a component control method provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram exemplarily showing a first user interface;
[0042] Figure 4 A schematic diagram exemplarily showing a second user interface;
[0043] Figure 5 Schematic diagram of an exemplary component library and components;
[0044] Figure 6 A schematic diagram of a flow chart of a component control method provided in an embodiment of the present application;
[0045] Figure 7 Schematic diagram of a leaf-type component and an aggregate-type component provided in an embodiment of the present application;
[0046] Figure 8 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0047] Fig. 9 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0048] Fig.10 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0049] Fig.11 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0050] Fig.12 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0051] Fig.13 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0052] Fig.14 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0053] Fig.15 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application;
[0054] Fig.16 A schematic diagram of a processor execution process in an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0056] It should be noted that the multiple involved in the embodiments of the present application refers to two or more. In addition, it should be understood that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0057] The embodiment of the present application provides an electronic device 100, including: a processor 101, an instruction receiving device 102, and a display 103. The processor 101 may be coupled to the instruction receiving device 102. The processor 101 may be coupled to the display 103.
[0058] The instruction receiving device 102 is used to receive the user's operation. In some examples, the instruction receiving device 102 may include a keyboard, and the user may control the operation through the keyboard. In some examples, the instruction receiving device 102 may include a mouse, and the user may control the operation through the mouse. In some examples, the instruction receiving device 102 may be an image acquisition device, and the user may trigger the control operation through gestures, and the instruction receiving device 102 may acquire the user's image. In some examples, the instruction receiving device 102 may be a voice acquisition device, and the user may trigger the control operation through voice, and the instruction receiving device 102 may acquire the user's voice.
[0059] The processor 101 may be directly or indirectly coupled to the instruction receiving device 102, so that the processor 101 directly or indirectly interacts with the instruction receiving device 102. The processor 101 may provide information representing the user's operation through the instruction receiving device 102 to determine the control instruction triggered by the user. In some examples, the processor 101 may have image recognition capability and / or voice recognition capability.
[0060] The display 103 may be used to display a user interface. The processor 101 may be directly or indirectly coupled to the display 103, so that the processor 101 is directly or indirectly coupled to the display 103. The processor 101 may adjust the content in the user interface.
[0061] Optionally, the electronic device 100 may include a bus 104. In some examples, the processor 101 and the instruction receiving device 102 may be connected via the bus 104. Figure 1 In the figure, the bus 104 is shown by a bold line, and the bus 104 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 1 In some examples, the processor 101 may be connected to the display 103 via the bus 104 .
[0062] Optionally, the electronic device may include a memory 105, which is used to store computer program instructions. The processor 101 can execute the computer program instructions in the memory 105 to implement the component control method provided in the present application. The memory 105 can be a volatile memory (volatile memory), such as a random access memory (random-access memory, RAM); the memory 105 can also be a non-volatile memory (non-volatile memory), such as a read-only memory, a flash memory (flash memory), a hard disk drive (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD); or the memory 105 can be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory 105 can be a combination of the above memories.
[0063] In the electronic device provided by any of the above embodiments, the processor 101 may include one or more central processing units (CPU), graphics processing units (GPU) or digital processing units, etc.
[0064] Based on the electronic device provided by any of the above embodiments, the electronic device can use components in multiple BIM component libraries. In the embodiment of the present application, all components provided by a BIM component supplier (ie, a BIM factory) are recorded as a BIM component library. It should be understood that different BIM component libraries represent different BIM component suppliers. In addition, component suppliers can be understood as component providers, component manufacturers, and component factories.
[0065] A BIM component library can include one or more of the following component types: heat map component, model component, floor component, area component, label component, dialog component, roaming component, flame component, water surface component, camera component, etc. Each component type contains only one component. Therefore, in a BIM component library, a component type can actually point to only one component.
[0066] For ease of introduction, this application will refer to the BIM component library as a component library. The number of component types in different component libraries may be the same or different. For example, the number of component types in component library A is different from the number of component types in component library B. Component library A and component library B may both include the same component type. In some examples, a component type may exist in component library A, but may not be included in component library B.
[0067] In a possible design, a component library may include one or more of the following components:
[0068] Heat map component, model component, floor component, area component, label component, dialog component, roaming component, flame component, water surface component, camera component.
[0069] Among them, the heat map component, the component type is the heat map class. The heat map component can represent the density level of a certain indicator in an area. The model component, the component type is the model class. The model component can represent the building model in the BIM scene. The floor component, the component type is the floor class. The floor component can represent the floor model in the BIM scene. The area component, the component type is the area class. The area component can represent the specified position coordinates (usually specified by the user) to draw an area in the BIM scene. The area component can be configured with different colors, flashing and other display effects. The label component, the component type is the label class. The label component can be used to display text in the BIM scene. The dialog component, the component type is the dialog class. The dialog component can be used to provide a dialog box for human-computer interaction in the BIM scene. The roaming component, the component type is the roaming class. The roaming component can be used to create roaming information and plan roaming paths in the BIM scene. The flame component, the component type is the flame class. The flame component can be used to set the flame effect at a specified position or area (usually specified by the user) in the BIM scene. Water surface component, component type is water surface class. Water surface component can be used to set water surface effect at a specified position or area (usually specified by the user) in the BIM scene. Camera component, component type is camera class. Camera component can be used to set the viewing angle of the BIM scene.
[0070] The above BIM scenario can be understood as a scenario model that applies BIM components. As an example, the BIM scenario may include but is not limited to an operation and maintenance scenario model, a smart station scenario model, a smart park scenario model, etc. This embodiment of the application does not specifically limit this.
[0071] The electronic device may display one or more scene objects in the first user interface so that the user can select a scene object. In the present application, the scene object may be in the form of an icon, text, button, etc. that can represent a scene. The present application embodiment does not specifically limit this.
[0072] The electronic device provided in the embodiments of the present application may support displaying one or more scene objects. In some examples, the electronic device may display multiple scene objects, and the multiple scene objects may all use components in the same BIM component library. In other examples, the electronic device may display multiple scene objects, of which two scene objects may use components in different BIM component libraries.
[0073] For any BIM scenario, the processor in the electronic device can execute the component control method provided in the embodiment of the present application. Figure 2 As shown, the component control method may include the following steps:
[0074] Step 201: In response to a selection instruction of a target scene object in a first user interface, a component library corresponding to a first BIM component library identifier is instantiated according to a configuration file of the target scene object.
[0075] The electronic device may receive the configuration file of each scene object, or pre-store the configuration file of each scene object. The embodiment of the present application does not specifically limit the manner in which the electronic device obtains the configuration file of each scene object. The configuration file of a scene may include the component library identifier of the BIM component library used, and the component type identifier of the component used.
[0076] In the embodiment of the present application, the target scene object can be any scene object among the scene objects supported by the electronic device for display. The configuration file of the target scene object may include a component library identifier of the first BIM component library and at least one target component type identifier. Among them, the component library identifier in the configuration file is the identifier of the BIM component library used by the target scene object. The target component type identifier in the configuration file is the component type of the component used by the target scene object. That is, the target scene object uses a component whose component type in the first BIM component library is the target component type.
[0077] It should be noted that the embodiment of the present application does not specifically limit the form of the configuration file of the target scene object. Any data carrying form including the target component library identifier and the target component type can be used as the configuration file of the scene object.
[0078] The electronic device may instantiate the first BIM component library according to the first BIM component library identifier in the configuration file of the target scene object. Generally, the instantiation process is the process of concretizing an abstract concept into an entity. The electronic device instantiates the first BIM component library and may load the information of the first BIM component library into the memory, such as to load the components in the first BIM component library. The information of the first BIM component library loaded into the memory may include, but is not limited to, the component library identifier (ID), the component library name, the interface information of the component library, methods, code segments, variables, handles, reference instances, etc.
[0079] In one possible design, please combine Figure 3 , the electronic device can display multiple scene objects in the first user interface, such as scene object 1, scene object 2, scene object 3, scene object 4, etc. Figure 3 Scene objects 1 to 4 are only used to distinguish different scene objects and are not used as a specific limit on the number of scene objects. Optionally, a scene object list area can be displayed in the first user interface. The first user interface can also include other display areas, which are not specifically limited in the embodiment of the present application.
[0080] The user can select a scene object (referred to as a target object) through the instruction receiving device 102 to trigger a selection instruction for the target scene object. The processor 101 receives the selection instruction for the scene object and can execute the operation in step 201 .
[0081] Step 202: The electronic device executes a creation method corresponding to each component type identifier in at least one target component type identifier according to a creation method corresponding to a pre-configured component type identifier, to achieve creation of a target component represented by the target component type identifier in the first BIM component library.
[0082] The electronic device is pre-configured with a creation method corresponding to each component type identifier. After instantiating the first BIM component library, the electronic device executes the creation method corresponding to the target component type identifier to create a component in the first BIM component library whose component type is the target component type identifier, which can also be understood as instantiating a component whose component type in the first BIM component library is the target component type. The display screen of the electronic device can display the target component represented by the target component type identifier in the first BIM component library in the second user interface.
[0083] In an embodiment of the present application, the electronic device may be pre-configured with a creation method corresponding to each component type identifier. When the electronic device executes a creation method for a component type identifier, it may also create a component corresponding to the component type identifier in the currently instantiated BIM component library.
[0084] Please combine Figure 4 , the electronic device can display a second user interface, wherein the second user interface may include a target scene object display area. The target scene object display area is used to display the target scene object. The second user interface includes components (i.e., target components) corresponding to all target component type identifiers in the configuration file of the target scene object. For example, the number of target components included in the target scene object is 3, and the target components corresponding to the target component types included in the configuration file of the target scene object are target component 1, target component 2, and target component 3, respectively. Target component 1, target component 2, and target component 3 can be displayed in the second user interface.
[0085] In some examples, in the configuration file of the target scene object, the number of target component type identifiers may be a positive integer. For example, in the configuration file of the target scene object, the number of floor component type identifiers is 2.
[0086] In the electronic device and component creation method provided in the embodiment of the present application. The electronic device executes the creation method corresponding to the component type identifier according to the component type identifier in the configuration file, rather than directly the creation method of the component type identifier in the first BIM component library. If the component library used by the target scene object is replaced, the component library identifier in the configuration file of the target scene object can be directly adjusted, and the code of the target component included in the target scene object does not need to be changed. Such a design can reduce the amount of code changes for the scene object.
[0087] For a possible implementation, see Figure 5 , the processor 101 is configured with an application layer. The application layer may include at least one BIM scene object (application). For example, an operation and maintenance system, a smart station system, a smart park system, etc. Optionally, a BIM scene object may include a basic scene and at least one component. After executing step 201, the electronic device may call the loadScene() method to load the basic scene to create (load) the basic scene of the target scene object. The electronic device may then execute the operation in step 202 to create the target component of the target object.
[0088] For a possible design, see Figure 5 As shown, in the electronic device provided by the embodiment of the present application, the processor 101 is configured with a component library layer. The component library layer may include an abstract component library and a specific component library.
[0089] The abstract component library is also called the abstract component library class (BimComponentFactory). The abstract component library class is configured with public data, common methods and abstract methods. The public data may include a component library identifier (ID).
[0090] The abstract methods in the abstract component library class include the preset creation methods of each component type. For example, the abstract method may include one or more of the following creation methods:
[0091] Method for creating heat map component (makeBimHeatMapComponent), method for creating BIM model (makeBimModelComponent), method for creating floor component (makeBimFloorMapComponent), method for creating area component (makeBimAreaComponent), method for creating label component (makeBimLabelComponent), method for creating dialog component (makeBimDialogComponent), method for creating walkthrough component (makeBimWalkThroughComponent), method for creating flame component (makeBimFireComponent), method for creating water surface component (makeBimWaterComponent), method for creating camera component (makeBimCameraComponent).
[0092] The concrete component library is a subclass of the abstract component library class. The concrete component library completes the creation process by implementing the abstract method of the abstract component library class. For example, the concrete component library of the ABIM component library corresponds to ABimComponentFactory, the concrete component library of the BBIM component library corresponds to BBimComponentFactory, and the concrete component library of the CBIM component library corresponds to CBimComponentFactory.
[0093] Please see again Figure 5 The processor 101 is also configured with a component layer. The component layer can be understood as a collection of all components. According to the abstraction level, the component layer can include root components, abstract components and specific components.
[0094] The root component can be regarded as a public base class. Each abstract component and concrete component is a subclass of the root component. The root component is configured with public data and public methods. The public data of the root component includes the component identifier (also known as the component type identifier), the component's location information, the component's size information, the display or hiding state, and the viewing angle information. The public methods in the root component include the component display method, the hiding method, the method for determining the floor to which the component belongs, and some methods for checking illegal parameters.
[0095] An abstract component can be regarded as a collection, which includes some abstract component classes and interfaces (functions).
[0096] The abstract component class inherits from the root component, including multiple component classes, and each component class is configured with dependent data and methods. The abstract component classes include heat map class (BimHeatMapComponent), BIM model class (BimModelComponent), floor class (BimFloorMapComponent), area class (BimAreaComponent), label class (BimLabelComponent), dialog class (BimDialogComponent), walkthrough class (BimWalkThroughComponent), flame class (BimFireComponent), water surface class (BimWaterComponent), and camera class (BimCamera).
[0097] The interface (function) in the abstract component defines the interface that the specific component needs to implement. These interfaces depend on the specific implementation of the specific manufacturer. The interfaces include heat map component (IBimHeatMapComponent), BIM model component (IBimModelComponent), floor component (IBimFloorMapComponent), area (IBimAreaComponent), label component (IBimLabelComponent), dialog component (IBimDialogComponent), walkthrough component (IBimWalkThroughComponent), flame component (IBimFireComponent), water surface component (IBimWaterComponent), and camera component (IBimCamera). In some examples, the method interface in each component interface. For example, the heat map component provides interfaces for methods such as creation, display, hiding, data update, destruction, and redraw. The model component provides interfaces for methods such as creation, destruction, setting color, canceling color setting, flashing, canceling flashing, hiding, and showing. The floor component provides method interfaces such as creation, destruction, display, hiding, adding components, deleting components, hiding components, and showing components. The region component provides interfaces for methods such as creation, destruction, display, hiding, adding components, deleting components, hiding components, and displaying components. The label component provides interfaces for methods such as creation, destruction, display, hiding, and data update. The dialog component provides interfaces for methods such as creation, destruction, display, and hiding data update positions. The roaming component provides interfaces for methods such as creation, destruction, adding keyframes, adding keyframe callbacks, deleting keyframes, getting keyframes, situation keyframes, pausing, and playing. The flame component provides interfaces for methods such as creation, destruction, display, hiding, and data update. The water surface component provides interfaces for methods such as creation, destruction, display, hiding, and data update. The camera component provides interfaces for methods such as creation, destruction, and setting the viewing angle.
[0098] Specific components, component implementation methods provided by each component library. Each specific component inherits the corresponding component class and implements the interface. For example, the model component in the ABIM component library is defined as ABimModelComponent. This component inherits from BimModelComponent and implements the interface IBimModelComponent.
[0099] In some examples, the configuration file of the target scene object includes a component library identifier of the ABIM component library and a heat map type identifier. The processor 101 can instantiate the ABIM component library according to the component library identifier of the ABIM component library in the target scene object. The processor 101 can convert the ABIM component library into an abstract component library class (BimComponentFactory). The processor 101 can call the load basic scene method in the abstract component library class, instanceBimComponentFactory.loadScence(), to load the basic scene of the target scene object.
[0100] The processor 101 can call the creation method (makeBimHeatMapComponent) of the heat map component in the pre-configured abstract component library class (BimComponentFactory) according to the heat map type identifier (BimHeatMap) in the configuration file of the target scene object, and the processor 101 can call the instanceBimComponentFactory.makeBimHeatMapComponent interface to create the heat map component in the ABIM component library. The heat map component in the ABIM component library can be displayed in the second user interface.
[0101] The processor 101 calls the creation method in the target component interface in the first BIM component library to create the target component. The target component interface is executed, that is, the target component is instantiated, and the name or identifier of the target component can be returned. For example, the processor 101 can call the instanceBimComponentFactory.makeBimHeatMapComponent interface to return the name of the heat map component, heatMap.
[0102] Based on the electronic device and component control method provided by any of the above embodiments, when the electronic device executes the creation method corresponding to each component type identifier in the at least one target component type identifier according to the creation method corresponding to the pre-configured component type identifier, it is also configured to: search for the component interface corresponding to the target component type identifier based on the correspondence between each component type identifier and the component interface of the first BIM component library pre-stored, and realize the search for the component interface corresponding to the target component type identifier in the first BIM component library, and the electronic device can call the creation method in the component interface corresponding to the target component type identifier. In the process of the electronic device calling the creation method in the component interface corresponding to the target component type identifier, the parameters of the target component, such as point information, viewing angle information, animation properties and other parameters, can be obtained.
[0103] In some examples, the configuration file of the target scene object includes a component library identifier of the ABIM component library, and a heat map type identifier. After the processor 101 instantiates the ABIM component library, the processor 101 calls the creation method (makeBimHeatMapComponent) of the heat map component in the pre-configured abstract component library class (BimComponentFactory), and the processor 101 can call the instanceBimComponentFactory.makeBimHeatMapComponent interface. The processor 101 can call the instanceBimComponentFactory.makeBimHeatMapComponent interface, and can perform the following: According to the correspondence between each component type identifier and the component interface of the ABIM component library, search for the component interface corresponding to the heat map type identifier (BimHeatMap) in the ABIM component library.
[0104] Optionally, the correspondence between each component type identifier and the component interface of the ABIM component library can be pre-stored in a database. The processor 101 can obtain the identifier (target identifier) of the component interface corresponding to the heat map type identifier (BimHeatMap) in the ABIM component library from the database. The processor 101 can search the component interface corresponding to the target identifier from the code of the ABIM component library, call the creation method in the interface corresponding to the target identifier, that is, call the creation method of the heat map component encapsulated in the code of the ABIM component library.
[0105] In a possible application scenario, in the second user interface, the display form of the target component can be dynamically adjusted. The display form includes but is not limited to: color, shape, text and other forms. Optionally, the display form of the target component can be dynamically adjusted according to a pre-configured change mode. Alternatively, the display form of the target component can be dynamically adjusted according to the associated data of the component. Exemplarily, the associated data of the target component can be collected by a sensor. The processor of the electronic device can obtain the associated data of the target component. And based on the acquired associated data, the display form of the target component is updated.
[0106] In some examples, the processor 101 of the electronic device can receive the associated data of the target component based on any communication protocol. Optionally, the electronic device can subscribe to the associated data of the target component based on the websocket protocol. After receiving the associated data of the target component, the processor 101 of the electronic device can execute the data update method of the target component. For example, the processor 101 of the electronic device can call the data update method update(data) in the target component interface, where data is the associated data of the target component.
[0107] Assume that the configuration file of the target scene object includes the component library identifier of the ABIM component library and the heat map type identifier. The aforementioned target component is a heat map component. The electronic device can subscribe to the associated data of the heat map component based on the websocket protocol. The processor 101 of the electronic device can call the data update method heatMap.update(data) corresponding to the heat map component type identifier, where data is the associated data of the heat map component. The processor 101 can search the identifier (target identifier) of the component interface corresponding to the heat map component type identifier from the code of the ABIM component library, and call the data update method in the interface corresponding to the target identifier. Thus, the processor 101 calls heatMap.update(data), which can implement the data update method in the heat map component interface encapsulated in the code of the ABIM component library.
[0108] In a possible scenario, the user can trigger a control operation on any component in the second user interface through the instruction receiving device to implement a control operation instruction for the triggering component. The embodiment of the present application does not specifically limit the manner in which the user triggers the operation instruction of the component.
[0109] In a possible implementation, the components included in the target scene object displayed in the second user interface can be used as controls. A component can be configured with multiple control operations, for example, a component can be configured with one or more control operations including but not limited to the following:
[0110] Display control operation, data update control operation, destruction control operation, update position control operation, hide control operation.
[0111] Among them, the display control operation can realize the function of displaying the component. The data update control operation can realize updating the display form of the component based on the associated data of the component. The destruction control operation can realize deleting the data of the component in the memory. The hiding control operation can realize not displaying the component in the second user display interface.
[0112] In the electronic device, the processor 101 may be configured with a first operation method for implementing various control operations. For example, the processor 101 may be configured with a first operation method for display control, a first operation method for data update control, a first operation method for destruction control, a first operation method for update position control, a first operation method for hiding control operation, and the like.
[0113] The processor 101 may receive a target operation instruction of a target component, and the processor 101 may execute a first operation method corresponding to the target operation instruction on the target component. For example, the processor 101 receives a data update operation instruction of a heat map component, and the processor 101 may execute a first operation method on the heat map component. The processor 101 may execute the heatMap.update() method, where heatMap represents an instantiated heat map component, and update represents a data update control first operation method.
[0114] In the code of each component library, one or more second operation methods may be configured in each component interface. Multiple second operation methods of a component interface may be used for display control operations, data update control operations, destruction control operations, update position control operations, and hide control operations of the component. As a distinction, the second operation method is a method in a component interface encapsulated in the component library code. The first operation method is an abstract method configured by the processor 101. Multiple second operation methods in a component interface may include a display control second operation method, a data update control second operation method, a destruction control second operation method, an update position control second operation method, and a hide control second operation method of the component.
[0115] Multiple second operation methods in a component interface may have corresponding first operation methods, for example, the display control second operation method corresponds to the display control first operation method, the data update control second operation method corresponds to the data update control first operation method, the destruction control second operation method corresponds to the destruction control first operation method, the update position control second operation method corresponds to the update position control first operation method, and the hiding control second operation method corresponds to the hiding control first operation method.
[0116] The processor 101 can execute the target first operation method on the target component, and can implement the call of the target second operation method in the target component instance, and the target second operation method is the second operation method corresponding to the target first operation method. For example, heatMap represents the instantiated heat map component, update represents the first operation method of data update control, and the processor 101 executes the heatMap.update() method, which can implement the call of heatMap.updateA(), and updateA represents the second operation method of data update control in the heat map component instance.
[0117] In such a design, since the operation instruction is not directly associated with the second operation method in the component, but executes the first operation method on the component, the second operation method in the component can be called. In the case of changing the component library used by the scene object, there is no need to modify the first operation method, thereby reducing the amount of code modification.
[0118] In some examples, in the component library code, the heat map component interface can be configured with a display method, a hiding method, a data update method, a destruction method, a redraw method and other control second operation methods; the model component interface can be configured with a destruction method, a color setting method, a color cancellation method, a flashing method, a flash cancellation method, a hiding method, a display method and other second operation methods; the floor component interface can be configured with a destruction method, a display method, a hiding method, a component addition method, a component deletion method, a component hiding method, a component display method and other second operation methods; the area component interface can be configured with a destruction method, a display method, a hiding method, a component addition method, a component deletion method, a component hiding method, a component display method and other second operation methods; the label component interface can be configured with a pin The second operation methods such as destruction method, display method, hiding method, and data update method can be configured in the dialog component interface; the second operation methods such as destruction method, display method, hiding method, and data update position method can be configured in the roaming component interface; the second operation methods such as destruction method, new key frame method, new key frame callback method, key frame deletion method, key frame acquisition method, situation key frame method, pause method, and play method can be configured in the roaming component interface; the second operation methods such as destruction method, display method, hiding method, and data update method can be configured in the flame component interface; the second operation methods such as destruction method, display method, hiding method, and data update method can be configured in the water surface component interface; the second operation methods such as method destruction method and setting viewing angle method can be configured in the camera component interface.
[0119] As an example, assume that the configuration file of the target scene object includes the component library identifier of the ABIM component library and the heat map type identifier. The aforementioned target component is a heat map component. The electronic device can respond to the data update operation instruction of the heat map component, and based on the correspondence between the pre-configured operation instruction and the first operation method, execute the data update first operation method update(data) corresponding to the data update operation instruction on the heat map component. Wherein data is the associated data of the heat map component, that is, the processor 101 of the electronic device can execute the heatMap.update(data) method, and can call the heatMap.updateA(data) method, that is, the processor 101 of the electronic device can call the data update second operation method updateA in the heat map component instance. The electronic device is implemented to update the display form of the heat map component in the second user interface based on the associated data of the heat map component.
[0120] In such a design, the operation instructions for the components in the target scene object are not directly associated with the methods in the interface of each component. In the case of adjusting the component library used by the target scene object, it is not necessary to change the code of the method in the interface called by the operation instructions of the components in the target scene object. Such a component control method can improve the adjustment flexibility of the component, that is, improve the portability of the component code and reduce the development complexity.
[0121] Based on the electronic device provided in any of the above embodiments, the present application embodiment also provides a component control method, such as Figure 6 As shown, the method may include the following steps:
[0122] Step 301: In response to a selection instruction of a target scene object in a first user interface, a component library corresponding to a first building information model (BIM) component library identifier is instantiated according to a configuration file of the target scene object.
[0123] In a specific implementation, the configuration file of the target scene object includes a component library identifier of a first BIM component library and at least one target component type identifier, wherein the first user interface includes one or more scene objects, the target scene object is any one of the multiple scene objects, there are two scene objects among the multiple scene objects, and the component library identifiers of the BIM component libraries in the configuration files of the two scene objects are different.
[0124] Assume that the first BIM component library is an ABIM component library. When the electronic device instantiates the component library corresponding to the ABIM component library identifier, the electronic device may execute the program code instanceBimComponentFactory=newABimComponentFactory().
[0125] Step 302: configure the first BIM component library as a target component library, wherein the target component library is a global variable.
[0126] Assume that the first BIM component library is an ABIM component library. The target component library is an abstract component library class BimComponentFactory. The electronic device can execute BimComponentFactory=ABimComponentFactory to convert the ABIM component library into the abstract component library class BimComponentFactory.
[0127] Step 303: based on the correspondence between each component type identifier and the component interface of the target component library, search for the component interface corresponding to the target component type identifier.
[0128] The target component library is used as a global variable, and the target component library points to the first BIM component library. The electronic device can query the correspondence between each component type identifier and the component interface of the target component library from the database, that is, query the correspondence between each component type identifier and the component interface of the first BIM component library from the database. Find the component interface information in the first BIM component library corresponding to the target component type, such as the component interface identifier or name.
[0129] Step 304 , calling a creation method in a component interface corresponding to the target component type identifier to create a target component represented by the target component type identifier in the first BIM component library.
[0130] In a possible implementation, after step 302, the electronic device may execute a creation method corresponding to a preconfigured component type identifier and execute a creation method corresponding to each component type identifier in at least one target component type identifier.
[0131] Assuming that at least one target component type identifier includes a heat map component type identifier, the electronic device can execute the code heatMap=instanceBimComponentFactory.makeBimHeatMapComponent(), call step 303, search for the component interface corresponding to the heat map type identifier in the first BIM component library, and the operation in step 304, call the creation method in the heat map component interface in the first BIM component library, and instantiate the heat map component.
[0132] In the actual application scenario, the component library of the target scene object is adjusted. For example, in the case where the component library of the target scene object is adjusted from the ABIM component library to the BBIM component library, the identifier of the BIM component library in the configuration file of the target scene object can be adjusted. In this case, the electronic device instantiates the BBIM component library in step 301, and the electronic device configures the BBIM component library as the target component library in 302, that is, the BBIM component library is configured as a global variable. The electronic device can continue to perform the operations in steps 303 and 304.
[0133] Based on any of the above embodiments, please combine Figure 7 , multiple components can be combined (aggregated) into a more complex component (which can be understood as a component tree), and the properties of the component formed after aggregation are aggregated components. It can be understood that an aggregated component is composed of multiple sub-components, and the number of components in an aggregated component is a positive integer greater than 1. Components that are not aggregated with other components are also independent components, and the properties of this component are leaf-type components. It can be understood that the number of components in a leaf-type component is 1. For example, heat map components, water surface components, label components, and flame components are all leaf-type components. For another example, a floor component may include area components, water surface components, flame components, etc. A floor component can be an aggregated component.
[0134] In some examples, the processor 101 may execute a first operation method of hidden control on the target component in response to a hidden operation instruction of the target component.
[0135] In a possible scenario, the target component is a leaf-type component, and the processor 101 may execute a first hiding control operation method on the target component to call a second hiding control operation method in the target component instance, thereby hiding the target component in the second user interface.
[0136] In another possible scenario, the attribute of the target component is an aggregate component. The processor 101 can determine the multiple sub-components of the target component based on the configuration information of the target component, and recursively execute the first operation method of hiding control on each sub-component, thereby recursively calling the second operation method of hiding control in each sub-component instance, thereby hiding the target component in the second user interface.
[0137] In a possible implementation, the attribute of a component is an aggregate component, and the attribute of the subcomponent in the component may also be an aggregate component. For example, the multiple subcomponents of the area component A may include multiple label components and multiple heat map components. The multiple subcomponents of the area component B may include multiple label components, a heat map component, and the area component A. When the processor 101 executes the first operation method of hiding control on the area component B, it may execute the second operation method of hiding control in each label component instance, the second operation method of hiding control in the heat map component instance, the second operation method of hiding control in each label component instance in the area component A, and the second operation method of hiding control in each heat map component instance in the area component B.
[0138] In the component control method provided in the embodiment of the present application, the user does not need to write the logic of hiding the subcomponent, and only needs to execute the first operation method of hiding control on the aggregate component. The processor 1010 executes the calling logic of the first operation method of hiding control, which is invisible to the user and not facing the user, and can improve the development efficiency of the scene object.
[0139] Based on the electronic device or component control method provided in any of the above embodiments, the execution process of the processor 101 is introduced in combination with actual application scenarios.
[0140] In one possible implementation, please combine Figure 8 , the processor 101 can create an instance of the A component library according to the component library identifier in the configuration file of the target scene as the A component library identifier, that is, instantiate the A component library (ABimComponentFactory). The processor 101 converts the A component library (ABimComponentFactory) into a target component library (BimComponentFactory), and the target component library is an abstract component library class.
[0141] Processor 101 can call the basic scene loading method in the target component library, instanceBimComponentFactory.loadScence(), to call the basic scene loading method in the A component library (ABimComponentFactory), and load the basic scene of the A component library. For example, the basic scene is displayed in the second user interface. Optionally, after executing the basic scene loading method in the A component library (ABimComponentFactory), the loading result can be returned to processor 101. If the loading is successful, the loading result can be true. If the loading fails, the loading result can be false.
[0142] In one possible implementation, the configuration file of the target scene includes a component type identifier of the floor class. The processor 101 can determine the component creation method makeBimFloorComponent() of the floor class according to the creation method corresponding to the pre-configured component type identifier. The processor 101 executes makeBimFloorComponent() to search for the component interface name corresponding to the floor class identifier, that is, the floor component interface in the A component library, based on the correspondence between each component type identifier and the component interface of the pre-stored A component library; and call the creation method in the floor component interface to create the floor component in the A component library. The processor 101 can receive the name floorComponent of the floor component instance. The processor 101 can save the name of the floor component instance to the floor list of the component library.
[0143] Optionally, when the processor 101 creates other components, the floor on which each component is located can be calculated. The processor 101 can call the addComponent() method of the floor component in the target component library. For example, the floor on which component A is located is the floor component floorComponent, and the processor 101 can execute floorComponent.addComponent(component A) to add component A to the floor component floorComponent. Component A is a subcomponent of the floor component floorComponent.
[0144] In one possible implementation, a good viewing angle is provided to the user to improve the user experience. Fig. 9 After the base scene of the target scene object is loaded, the processor 101 creates a camera component instance camera through the creation method makeBimCameraComponent() of the camera component in the target component library. The camera component instance is a singleton and can only be created once. The processor 101 can call the initialization viewpoint method camera.setViewpot in the camera instance camera to display the target scene object according to the initialization viewpoint.
[0145] Optionally, the user may trigger the initialization perspective control operation instruction of the camera component through the instruction receiving device, and the processor 101 may call the initialization perspective method camera.setViewpot in the camera instance camera, so that the target scene object is displayed in the second user interface with the initialization perspective.
[0146] In a possible implementation, the target scene configuration file includes a component type identifier of the heat map class. The processor 101 can determine the component creation method makeBimHeatMapComponent() of the heat map class according to the creation method corresponding to the pre-configured component type identifier. Fig.10 , the processor 101 executes makeBimHeatMapComponent(), which can realize the correspondence between each component type identifier and the component interface of the pre-stored A component library, find the component interface name corresponding to the heat map class identifier, that is, the heat map component interface in the A component library; and call the creation method in the heat map component interface to create the heat map component ABimHeatMapComponent in the A component library. The processor 101 can receive the name heatMap of the heat map component instance. Optionally, after the processor 101 creates the heat map component, it can calculate the floor where the heat map component is located, and add the heat map component to the floor component corresponding to the floor where the heat map is located.
[0147] In some exemplary embodiments, the processor 101 can obtain the data of the heat map component in response to the data update operation instruction of the heat map component. For example, the processor 101 can subscribe to the data associated with the heat map component, such as the passenger flow data in the rail transit intelligent operation and maintenance scenario, by creating a websocket connection. The processor 101 can execute the first operation method of data update control of the heat map component to implement the call of the second operation method update() of data update control in the heatMap instance of the heat map component.
[0148] In some examples, when the user switches scene objects, the destruction operation instructions of each component in the current scene object can be triggered. Taking the destruction operation instruction of the heat map component as an example, the processor can respond to the destruction operation instruction of the heat map component, and the processor 101 can execute the first destruction control operation method of the heat map component to implement the call of the second destruction control operation method destroy() in the heat map component instance heatMap.
[0149] In a possible implementation, the target scene object includes a model component. The processor 101 may receive an alarm message, wherein the alarm message carries a device identifier. The device identifier has a corresponding model component. Fig.11 After the processor 101 creates the model component corresponding to the device identifier, it can call the second operation method setColor() for setting color control in the model component in response to the received alarm information to change the color of the model component in the user interface, or switch the display form of the model component in the user interface to flashing.
[0150] In some examples, when the user switches scene objects, the destruction operation instructions of each component in the current scene object can be triggered. Taking the destruction operation instruction of the model component as an example, the processor can respond to the destruction operation instruction of the model component, and the processor 101 can execute the first destruction control operation method of the model component to implement the call of the second destruction control operation method destroy() in the model component instance.
[0151] In some examples, a user clicking on a model component can trigger the creation of a dialog component. The processor 101 can respond to the operation instruction for dialog component creation, and determine the component creation method makeBimDialogComponent() of the dialog class according to the creation method corresponding to the pre-configured component type identifier. The processor 101 executes makeBimDialogComponent(), which can realize the correspondence between each component type identifier and the component interface of the pre-stored A component library, find the component interface name corresponding to the dialog class identifier, that is, the dialog component interface in the A component library; and call the creation method in the dialog component interface to create the dialog component ABimDialogComponent in the A component library. The processor 101 can receive the name dialogComponent of the dialog component instance. Optionally, the processor 101 can respond to the destruction operation instruction of the dialog component, and the processor 101 can execute the first operation method of destruction control of the dialog component to call the second operation method of destruction control destroy() in the dialog component instance dialogComponent.
[0152] In a possible implementation, the target scene configuration file includes a component type identifier of the area class. The processor 101 can determine the component creation method makeBimAreaComponent() of the area class according to the creation method corresponding to the pre-configured component type identifier. Fig.12 , the processor 101 executes makeBimAreaComponent(), which can realize the correspondence between each component type identifier and component interface of the pre-stored A component library, find the component interface name corresponding to the area class identifier, that is, the area component interface in the A component library; and call the creation method in the area component interface to create the area component ABimAreaComponent in the A component library. The processor 101 can receive the name areaComponent of the area component instance. Optionally, after the processor 101 creates the area component, it can calculate the floor where the area component is located, and add the area component to the floor component corresponding to the floor where the area is located.
[0153] In some exemplary embodiments, the processor 101 can obtain the data of the area component in response to the data update operation instruction of the area component. For example, the processor 101 can subscribe to the data associated with the area component, such as the passenger flow data in the intelligent operation and maintenance scenario of rail transit, by creating a websocket connection. The processor 101 can execute the first operation method of data update control of the area component to implement the call of the second operation method of data update control update() in the area component instance areaComponent, which can implement the coloring of the area component and display of the associated data.
[0154] In some examples, when the user switches scene objects, the destruction operation instructions of each component in the current scene object can be triggered. Taking the destruction operation instruction of the area component as an example, the processor can respond to the destruction operation instruction of the area component, and the processor 101 can execute the first destruction control operation method of the area component to implement the call of the second destruction control operation method destroy() in the area component instance areaComponent.
[0155] In a possible implementation, the configuration file of the target scene includes a component type identifier of the floor class. The processor 101 can determine the component creation method makeBimFloorComponent() of the floor class according to the creation method corresponding to the pre-configured component type identifier. Fig.13 , the processor 101 executes makeBimFloorComponent(), which can realize the correspondence between each component type identifier and component interface of the pre-stored A component library, find the component interface name corresponding to the floor class identifier, that is, the floor component interface in the A component library; and call the creation method in the floor component interface to create the floor component ABimFloorComponent in the A component library. The processor 101 can receive the name FloorComponent of the floor component instance.
[0156] The user can trigger the hidden floor component control operation instruction through the instruction receiving device, for example, the user can click the floor component displayed in the user interface to trigger the operation instruction of hiding the floor component. The processor 101 can respond to the hidden control operation instruction of the floor component, execute the hidden control first operation instruction of the floor component, and call the hidden control second operation instruction in each sub-component instance in the floor component.
[0157] In some examples, when the user switches scene objects, the destruction operation instructions of each component in the current scene object can be triggered. Taking the destruction operation instruction of the floor component as an example, the processor can respond to the destruction operation instruction of the floor component, and the processor 101 can execute the first destruction control operation method of the floor component to implement the call of the second destruction control operation method destroy() in the floor component instance.
[0158] In a possible implementation, the configuration file of the target scene includes a component type identifier of the label class. The processor 101 can determine the component creation method makeBimLabelComponent() of the label class according to the creation method corresponding to the pre-configured component type identifier. Fig.14 , the processor 101 executes makeBimLabelComponent(), which can realize the correspondence between each component type identifier and the component interface of the pre-stored A component library, find the component interface name corresponding to the label class identifier, that is, the label component interface in the A component library; and call the creation method in the label component interface to create the label component ABimLabelComponent in the A component library. The processor 101 can receive the name labelComponent of the label component instance. Optionally, after the processor 101 creates the label component, it can calculate the floor where the label component is located, and add the label component to the floor component corresponding to the floor where the label is located.
[0159] In some exemplary embodiments, the processor 101 may obtain the data of the label component in response to the data update operation instruction of the label component. For example, the processor 101 may subscribe to the data associated with the label component by creating a websocket connection. The processor 101 may execute the first operation method of data update control of the label component to implement the call of the second operation method of data update control update() in the label component instance Label.
[0160] In some examples, when the user switches scene objects, the destruction operation instructions of each component in the current scene object can be triggered. Taking the destruction operation instruction of the label component as an example, the processor can respond to the destruction operation instruction of the label component, and the processor 101 can execute the first destruction control operation method of the label component to implement the call of the second destruction control operation method destroy() in the label component instance labelComponent.
[0161] In a possible implementation, the configuration file of the target scene includes a component type identifier of the roaming class. The processor 101 can determine the component creation method of the roaming class according to the creation method corresponding to the pre-configured component type identifier, and can implement the correspondence between each component type identifier and the component interface of the pre-stored A component library, find the component interface name corresponding to the roaming class identifier, that is, the roaming component interface in the A component library; and call the creation method in the roaming component interface to create the roaming component in the A component library. The processor 101 can control the display to display the key frame, and in response to the play operation triggered by the user, the roaming animation starts to execute, pauses when reaching the next key frame, and executes the corresponding callback.
[0162] In a possible implementation, the target scene configuration file includes a water surface component type identifier. The processor 101 can determine the water surface component creation method makeBimWaterComponent() according to the creation method corresponding to the pre-configured component type identifier. Fig.15 , the processor 101 executes makeBimWaterComponent(), which can realize the correspondence between each component type identifier and the component interface of the pre-stored A component library, find the component interface name corresponding to the water surface class identifier, that is, the water surface component interface in the A component library; and call the creation method in the water surface component interface to create the water surface component ABimWaterComponent in the A component library. The processor 101 can receive the name waterComponent of the water surface component instance. Optionally, after the processor 101 creates the water surface component, it can calculate the floor where the water surface component is located, and add the water surface component to the floor component corresponding to the floor where the water surface is located.
[0163] In some exemplary embodiments, the processor 101 can obtain the data of the water surface component in response to the data update operation instruction of the water surface component. For example, the processor 101 can subscribe to the data associated with the water surface component, such as the passenger flow data in the rail transit intelligent operation and maintenance scenario, by creating a websocket connection. The processor 101 can execute the first operation method of data update control of the water surface component to implement the call of the second operation method of data update control update() in the water surface component instance Water.
[0164] In some examples, when the user switches scene objects, the destruction operation instructions of each component in the current scene object can be triggered. Taking the destruction operation instruction of the water surface component as an example, the processor can respond to the destruction operation instruction of the water surface component, and the processor 101 can execute the first destruction control operation method of the water surface component to implement the call of the second destruction control operation method destroy() in the water surface component instance waterComponent.
[0165] In a possible implementation, the target scene configuration file includes a flame class component type identifier. The processor 101 can determine the flame class component creation method makeBimFireComponent() according to the creation method corresponding to the pre-configured component type identifier. Fig.16 , the processor 101 executes makeBimFireComponent(), which can realize the correspondence between each component type identifier and component interface of the pre-stored A component library, find the component interface name corresponding to the flame class identifier, that is, the flame component interface in the A component library; and call the creation method in the flame component interface to create the flame component ABimFireComponent in the A component library. The processor 101 can receive the name FireComponent of the flame component instance. Optionally, after the processor 101 creates the flame component, it can calculate the floor where the flame component is located, and add the flame component to the floor component corresponding to the floor where the flame is located.
[0166] In some exemplary embodiments, the processor 101 can obtain the data of the flame component in response to the data update operation instruction of the flame component. For example, the processor 101 can subscribe to the data associated with the flame component, such as the passenger flow data in the rail transit intelligent operation and maintenance scenario, by creating a websocket connection. The processor 101 can execute the first operation method of data update control of the flame component to implement the call of the second operation method update() of data update control in the flame component instance Fire.
[0167] In some examples, when the user switches the scene object, the destruction operation instruction of each component in the current scene object can be triggered. Taking the destruction operation instruction of the flame component as an example, the processor can respond to the destruction operation instruction of the flame component, and the processor 101 can execute the first destruction control operation method of the flame component to implement the call of the second destruction control operation method destroy() in the flame component instance FireComponent.
[0168] Based on the same technical concept, the embodiment of the present application provides a component control device, which may include a memory and a processor. The memory stores computer program instructions, and the processor executes the computer program instructions to implement the functions of the processor in the above embodiment, or implement the component control method in the above embodiment, and can achieve the same technical effect, which will not be repeated here.
[0169] On the other hand, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes a component control method.
[0170] On the other hand, an embodiment of the present application provides a computer program product, comprising a computer program, wherein the computer program implements the steps of the above-mentioned component control method when executed by a computer.
[0171] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0172] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0175] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An electronic device, characterized in that: include: An instruction receiving device, configured to receive at least one operation from a user; a display screen configured to display a first user interface; A processor is coupled to the display screen and the instruction receiving device, and the processor is configured to: In response to a selection instruction of a target scene object in the first user interface, instantiating a component library corresponding to a first building information model BIM component library identifier according to a configuration file of the target scene object, wherein the configuration file of the target scene object includes a component library identifier of the first BIM component library and at least one target component type identifier, wherein the first user interface includes one or more scene objects, the target scene object is any one of the multiple scene objects, there are two scene objects in the multiple scene objects, and the component library identifiers of the BIM component libraries in the configuration files of the two scene objects are different; and executing a creation method corresponding to each component type identifier in the at least one target component type identifier according to a creation method corresponding to a pre-configured component type identifier, so as to achieve creation of a target component represented by the target component type identifier in the first BIM component library; The display screen is further configured to display a second user interface, wherein the second user interface includes the target component.
2. The electronic device according to claim 1, wherein: When the processor executes the creation method corresponding to each component type identifier in the at least one target component type identifier according to the creation method corresponding to the pre-configured component type identifier, the processor is further configured to: Based on the pre-stored correspondence between each component type identifier and the component interface of the first BIM component library, searching for the component interface corresponding to the target component type identifier; Call the creation method in the component interface corresponding to the target component type identifier.
3. The electronic device according to claim 2, characterized in that: The processor searches for the component interface corresponding to the target component type identifier based on the pre-stored correspondence between each component type identifier and the component interface of the first BIM component library, and is further configured to: Configure the first BIM component library as a target component library, wherein the target component library is a global variable; Based on the correspondence between each component type identifier and the component interface of the target component library, the component interface corresponding to the component type identifier is searched.
4. The electronic device according to claim 1 or 2, characterized in that: The target component has associated data; the processor is further configured to: Acquire the associated data of the target component; Based on the acquired associated data, the display form of the target component in the second user interface is updated.
5. The electronic device according to claim 4, characterized in that: The processor is further configured to: In response to the hide operation instruction of the target component, if the attribute of the target component is a leaf-type component, call the hide operation method of the target component, wherein the number of components in the leaf-type component is 1; or, if the attribute of the target component is an aggregate-type component, determine multiple subcomponents of the target component and call the hide operation method in each subcomponent, wherein the number of components in the aggregate-type component is a positive integer greater than 1.
6. A component control method, characterized in that: The method comprises: In response to a selection instruction of a target scene object in a first user interface, instantiating a component library corresponding to a first building information model BIM component library identifier according to a configuration file of the target scene object, wherein the configuration file of the target scene object includes a component library identifier of the first BIM component library and at least one target component type identifier, wherein the first user interface includes one or more scene objects, the target scene object is any one of the multiple scene objects, there are two scene objects in the multiple scene objects, and the component library identifiers of the BIM component libraries in the configuration files of the two scene objects are different; And according to the creation method corresponding to the pre-configured component type identifier, the creation method corresponding to each component type identifier in the at least one target component type identifier is executed to achieve the creation of the target component represented by the target component type identifier in the first BIM component library.
7. The method according to claim 6, characterized in that The step of executing the creation method corresponding to each component type identifier in the at least one target component type identifier according to the creation method corresponding to the pre-configured component type identifier further includes: Based on the pre-stored correspondence between each component type identifier and the component interface of the first BIM component library, searching for the component interface corresponding to the target component type identifier; Call the creation method in the component interface corresponding to the target component type identifier.
8. The method according to claim 6, characterized in that Based on the pre-stored correspondence between each component type identifier and the component interface of the first BIM component library, searching for the component interface corresponding to the target component type identifier includes: Configure the first BIM component library as a target component library, wherein the target component library is a global variable; Based on the correspondence between each component type identifier and the component interface of the target component library, the component interface corresponding to the component type identifier is searched.
9. The method according to claim 6 or 7, characterized in that The target component has associated data; the method further comprises: Acquire the associated data of the target component; Based on the acquired associated data, the display form of the target component in the second user interface is updated.
10. The method according to claim 9, characterized in that The method further comprises: In response to the hide operation instruction of the target component, if the attribute of the target component is a leaf-type component, the hide operation method in the target component interface is called, wherein the number of components in the leaf-type component is 1; or, if the attribute of the target component is an aggregate-type component, multiple sub-components of the target component are determined, and the hide operation method in the interface of each sub-component is called, wherein the number of components in the aggregate-type component is a positive integer greater than 1.
