Background
The micro-service architecture is a new technology for deploying applications and services in the cloud, can run in a 'self program', and communicates with an HTTP type API through a 'lightweight device'. The key is that the service can run in its own program. By this we can distinguish service exposure from microservice architecture (distributing an API in existing systems). In service publishing, many services may be restricted by internal independent processes. If one of the services requires some functionality to be added, the process must be narrowed. In the micro-service architecture, only the required functions need to be added in a specific certain service, and the architecture of the whole process is not influenced.
The product prototype model is to divide the prototype model of the industrial product into five parts of product, characteristic, behavior, state (starting) and state (stopping), wherein the product refers to the industrial product. The characteristics refer to relevant attributes of the industrial product under a certain state, such as shape, material, environment, system and the like. Behavior refers to the relevant actions of the product itself or externally to the industrial product, such as analysis, assembly, rotation, etc. The state refers to a form that an industrial product exhibits under a certain environment. The state parameters and behavior relationships are specifically shown in fig. 1 as follows:
in fig. 1, the product directly interacts with the features and the behaviors, the features reflect certain real-time attributes of the product, and the behaviors directly act on the product. The initial state of the product obtains a value reflecting the initial state of the product from the characteristics of the product. The product changes its state under the action of action to form a termination state. The corresponding value of the parameter that generated the end state change is returned to the feature.
Engines are the same name term used by the machine industry to show the core position in the whole system. It may also be referred to as "supporting the application-underlying function library". Currently, the outstanding graphics engines include OGRE, OpenGVS, Vtree, OSG, etc. And a three-dimensional graphic development environment which encapsulates hardware operation and graphic algorithm, is simple and easy to use and has rich functions can be called as a three-dimensional graphic engine.
In the prior art, the product functions encountered by industrial software in a networked mode are difficult to display, the corresponding functions cannot be displayed according to needs, and the expansibility is low.
The prior art is therefore still subject to further development.
Disclosure of Invention
In view of the above technical problems, embodiments of the present invention provide a method and a system for implementing product visual display based on a micro-service architecture, which can solve the technical problems that the product function display is difficult, the corresponding function cannot be displayed as required, and the expansibility is low in the existing industrial software in a networking mode.
The first aspect of the embodiments of the present invention provides a method for implementing product visual display based on a micro-service architecture, including:
acquiring product characteristics of a product, and acquiring a business process of the product characteristics according to the product characteristics;
performing micro-service architecture according to the service flow of the product characteristics;
calling a model machine model service of the product according to the micro-service architecture, and importing model machine model data into a three-dimensional display engine according to the model machine model service of the product;
and drawing and displaying the basic characteristics in a three-dimensional display engine according to the model data of the sample.
Optionally, after the basic features are drawn and displayed in the three-dimensional display engine according to the sample model data, the method further includes:
and when the change of the model data of the sample machine is detected, displaying the dynamic effect of the displacement or state change process of the model data of the sample machine.
Optionally, the performing a micro-service architecture according to the business process of the product features includes:
extracting public services in the business process, and establishing independent input and output API services;
acquiring a business service in a business process, and defining a product business service;
designing a data model according to the defined product business service, and defining a group of unique APIs at a service interface at the top layer of the data model;
and acquiring a prototype model of the product, registering the prototype model of the product in the service cluster, and generating prototype model service of the product.
Optionally, the invoking a prototype model service of the product according to the micro-service architecture, and importing prototype model data into the three-dimensional display engine according to the prototype model service of the product includes:
calling a model machine model service of a product according to the micro-service architecture, reading and analyzing a general file, constructing point set and unit set information of model data, and constructing complete model machine data;
and importing prototype model data of the product into a three-dimensional display engine.
Optionally, the drawing and displaying the basic features in the three-dimensional display engine according to the sample model data includes:
registering display services of a three-dimensional display engine in a service cluster in advance;
analyzing the model data of the sample machine through a display service, and acquiring renderer and model data of the sample machine required by display;
and establishing a mapper to map the model data of the prototype to generate mapping data, and converting the mapping data into a graph for displaying.
A second aspect of the embodiments of the present invention provides a system for implementing product visual display based on a micro service architecture, where the system includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of:
performing micro-service architecture according to the service flow of the product characteristics;
calling a model machine model service of the product according to the micro-service architecture, and importing model machine model data into a three-dimensional display engine according to the model machine model service of the product;
and drawing and displaying the basic characteristics in a three-dimensional display engine according to the model data of the sample.
Optionally, the computer program when executed by the processor further implements the steps of:
and when the change of the model data of the sample machine is detected, displaying the dynamic effect of the displacement or state change process of the model data of the sample machine.
Optionally, the computer program when executed by the processor further implements the steps of:
extracting public services in the business process, and establishing independent input and output API services;
acquiring a business service in a business process, and defining a product business service;
designing a data model according to the defined product business service, and defining a group of unique APIs at a service interface at the top layer of the data model;
and acquiring a prototype model of the product, registering the prototype model of the product in the service cluster, and generating prototype model service of the product.
A third aspect of the embodiments of the present invention provides a non-transitory computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the one or more processors may be enabled to execute the above method for implementing product visualization based on a microservice architecture.
According to the technical scheme provided by the embodiment of the invention, the product characteristics of the product are obtained, and the business process of the product characteristics is obtained according to the product characteristics; performing micro-service architecture according to the service flow of the product characteristics; calling a model machine model service of the product according to the micro-service architecture, and importing model machine model data into a three-dimensional display engine according to the model machine model service of the product; and drawing and displaying the basic characteristics in a three-dimensional display engine according to the model data of the sample. Compared with the prior art, the embodiment of the invention can simply and quickly carry out extended display on the product, solves the problems of new product display and analysis, and greatly improves the work efficiency of engineers.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following detailed description of embodiments of the invention refers to the accompanying drawings.
Referring to fig. 2, fig. 2 is a flowchart illustrating an embodiment of a method for implementing product visual display based on a micro service architecture according to the present invention. As shown in fig. 2, includes:
s100, acquiring product characteristics of a product, and acquiring a business process of the product characteristics according to the product characteristics;
step S200, performing micro-service architecture according to the service process of the product characteristics;
step S300, calling model machine model service of the product according to the micro-service architecture, and importing model machine model data into a three-dimensional display engine according to the model machine model service of the product;
and S400, drawing and displaying basic characteristics in a three-dimensional display engine according to the model data of the sample machine.
Specifically, firstly, the product business process is combed, the product characteristics of the product are combed, the product characteristics comprise geometric information, attributes, subcomponents, type information and the like of the product, and the characteristic process displayed by the product is cleared. The change process of the state involved in the business process is explained.
And constructing a micro-service architecture according to the product business process.
And calling a prototype model service, importing prototype model data into the three-dimensional display, calling the display service, and constructing a display window.
Three-dimensionally displaying model characteristic data of a prototype, drawing basic characteristic display in a three-dimensional display window by using the model data of the prototype, drawing points by acquiring point data of the model data, and drawing and displaying units of corresponding types by acquiring unit types and points contained in the units. An initial or default state of the graphic is presented.
The embodiment of the invention provides a method for realizing visual display of a product based on a micro-service framework aiming at the problems of difficult product function display and low expansibility in the networking mode of the current industrial software, and the method can solve the problems of display and analysis of new products and greatly improve the working efficiency of engineers. The method supports the servitization of independent products through a micro-service framework mode, can quickly show the behavior characteristics of the products through product services, and analyzes the product data. Any product is displayed by invoking a three-dimensional display. According to the requirements of a three-dimensional display engine, product levels and feature contents of a prototype model are defined, and spatial position node coordinate features, line unit connection node features, surface unit connection node features and deformation features are given, so that the model is displayed and animation is generated.
Furthermore, when displaying, product levels and feature contents of the prototype model are defined according to the requirements of a three-dimensional display engine, and spatial position node coordinate features, line unit connection node features, surface unit connection node features and deformation features are given, so that the model is displayed and animation is generated.
Further, after drawing and displaying the basic features in the three-dimensional display engine according to the sample model data, the method further comprises the following steps:
and when the change of the model data of the sample machine is detected, displaying the dynamic effect of the displacement or state change process of the model data of the sample machine.
Specifically, animation effect display is performed, and dynamic effect display is performed on displacement or state feature change of model feature data. The change process state can be more vividly and concretely displayed.
When the model data of the prototype changes, the model data of the prototype is obtained through cyclic execution, and basic characteristics are drawn on the three-dimensional engine, so that the technical animation display process of the transformation process of displaying the current state and the change state in the three-dimensional display window, and the position transformation, characteristic and state change process of points, lines, surfaces and bodies are demonstrated. The animation process is carried out along with the time, the model data of the model machine are changed within a certain range, and when the change reaches the range boundary, the animation playing is finished.
Further, the micro-service architecture is performed according to the business process of the product characteristics, and the micro-service architecture comprises the following steps:
extracting public services in the business process, and establishing independent input and output API services;
acquiring a business service in a business process, and defining a product business service;
designing a data model according to the defined product business service, and defining a group of unique APIs at a service interface at the top layer of the data model;
and acquiring a prototype model of the product, registering the prototype model of the product in the service cluster, and generating prototype model service of the product.
Specifically, the public service is extracted and stripped, and the public service refers to a part which is not related to the business. An API service is established with independent inputs and outputs.
And product business service definition, wherein after the public service is extracted, the rest part in the business process is the business service, so that the service is ensured not to generate a dependency relationship with other services as much as possible.
And designing a data model, wherein the bottom layer data model is defined to be sample model data, and the sample model data comprises a coordinate system (x, y, z) of points, and the type and the characteristic information of ordered points and units contained in line units, surface units and body units.
Defining a service interface, and defining a group of APIs which have single responsibility, are globally unique and are convenient to identify on the service interface at the top layer after the design of the data model at the bottom layer is completed.
And (4) registering the prototype model service to the service framework, packaging and registering the released prototype model service to the framework, and registering the service for discovery and access of other services.
And searching and calling the product service through the service framework.
As shown in fig. 3, the micro service architecture comprises a client, a service gateway, a prototype model service, a three-dimensional display service, a service registry and a service configuration center. The client is also called as a user side and refers to a process which corresponds to the server and provides local service for the client; the service gateway is used for protecting, enhancing and controlling the access to the service; the service registration and configuration center is used for managing all service addresses in the system, and the started service is registered in the registration center to inquire available service addresses.
Through research on the domain model, the domain model is divided into a physical model, a mechanism model and a prototype model. The physical model describes the organization structure of a physical object, and is divided into a product, the behavior of the product, the characteristics of the product and various states of the product according to the specific organization structure of the object. The mechanism model is an accurate mathematical model which describes the intrinsic mechanism of a physical object and is established according to the internal mechanism of the object, the production process or the transfer mechanism of material flow. The method is a mathematical abstract expression of a research object, and is divided into units, characteristics, loads, analysis and results according to the concrete object. Its advantages are very clear physical meaning of parameters, easy regulation and high adaptability. The prototype model finally organizes the physical model and the mechanism model together, establishes the incidence relation between the physical model and the mechanism model, and maps the incidence relation with the computer model.
The prototype model service is a structural model with a data structure without data, where all point data in the model is recorded with Grids; all unit data of the model are recorded by Elements, and the service is provided with a parameter visualization interface which can select a general model file or a view interface of data characteristic parameter information.
Model data is the necessary data to prepare the features, states and behaviors of the prototype model, and the data is mainly derived from a universal data file and parameterized modeling.
The model service is registered in the service cluster, the model service registration and discovery are realized, the cluster is realized by using a container docker, and the service registration center consul is used for realizing the service registration and discovery.
Further, calling a prototype model service of the product according to the micro-service architecture, and importing prototype model data into the three-dimensional display engine according to the prototype model service of the product, wherein the method comprises the following steps:
calling a model machine model service of a product according to the micro-service architecture, reading and analyzing a general file, constructing point set and unit set information of model data, and constructing complete model machine data;
and importing prototype model data of the product into a three-dimensional display engine.
In specific implementation, the sample model reads a general file of an analytic model, the file format is shown in fig. 4, the file is derived from a file generated by other software or written according to the format, information such as a point set, a unit set and a unit containing node information and characteristics of model data is constructed, information of all points is recorded into Grids, the unit information is recorded into Elements, and a complete data model is constructed.
The prototype model constructs a point set Grids, a unit set Elements, a unit containing node information Association Points, characteristic Features and other information of data by inputting characteristic information required by the model through parametric modeling, records the information of all points into the Dictionary set Grids, and records the unit information into the Elements. The information of the point includes coordinates (x, y, z) of the point, the number of the point, and the name of the point; the unit set is a Dictionary set for recording all units, the nodes contained in the unit are the numbers of the nodes, and the unit acquires the corresponding points from the node set through the contained node numbers.
The data structures Grids and Elements adopt Dictionary structures in C # to store the model related data read from the data files (the data files are interactive data files of prototype model services and display module services), and create structure variables as Elements of the Dictionary structures to acquire the required model information.
A data module: and generating a model text data module as a data display file of the three-dimensional display service according to the prototype model data.
The prototype model data is generated into a data format file in a specific manner as shown in figure 4,
acquiring the number count of POINTs through Grids, and writing POINT $ count float into a file;
traversing the whole point set from the model data Grids of the model, and according to the coordinates x1, y1 and z1 of the points; x2, y2, z 2; … xn, yn, zn (the number of single-row data is multiple of 3) writing the data set of the file point;
acquiring the number count of units through Elements, traversing the Elements to calculate a total data number array (the total data number is the sum of the number of points contained in all the units plus the number of the units), writing the polygos count array into a file, wherein the polygos is a polygon format label, the count is the number of the units (one row is one unit, the number of the units is the number of lines of the data), the array is the total data number (the total data number is the sum of the number of points contained in all the units plus the number of the units), and the macro label is represented by a band $ for representing a dynamic specific value;
traversing the whole unit set from prototype model data Elements, and writing unit information into the file unit type set according to the unit type and the sequence of points contained in the unit.
The number of CELL _ DATA CELLs and the number of POINT _ DATA POINTs are written.
And automatically generating a format text file according to the format to be used as a data source of the display module.
Further, drawing and displaying the basic features in a three-dimensional display engine according to the model data of the sample, wherein the drawing and displaying process comprises the following steps:
registering display services of a three-dimensional display engine in a service cluster in advance;
analyzing the model data of the sample machine through a display service, and acquiring renderer and model data of the sample machine required by display;
and establishing a mapper to map the model data of the prototype to generate mapping data, and converting the mapping data into a graph for displaying.
In specific implementation, the three-dimensional display engine obtains renderer and model data required for display through establishing a rendering engine pipeline and analyzing by a file analysis method in the display service, establishes mapper mapping model data, and converts the mapping data into graphic display. Parsing file as shown in fig. 4, parsing data Reader under POINTS into point data, where every three data of each line is coordinates (x, y, z) of a point, creating a point Grid according to a coordinate system of the point, the name of the point is the number of the point, such as the first three data of the first line represents a point (x1, y1, z1) with the name of 1, the last three numbers represent a point (x2, y2, z2) with the name of 2, the number of the point is automatically generated according to GUID as a label, and the parsed point is stored into a point set; the method comprises the steps that data recorded under POLYGONS are unit information, each line represents a unit, the first data of each line represents the number of points contained in the unit, the following data represents the names of the points, the point numbers can be obtained from a front point set through the names of the points, analyzed units are stored in the unit set, analyzed file data are written into aggregated data PolyDataReader, then a role Actor is created, a Mapper is created, a Renderer is created, the aggregated data PolyDataReader is assigned to the Mapper, the Mapper is assigned to the role Actor, and finally the role Actor is added into the Renderer to be drawn and displayed. The model can be shown in three dimensions in the drawing object window, and the characteristics, behaviors and states of the model can be comprehensively shown.
The three-dimensional display service is registered in a service cluster, the registration and the discovery of the three-dimensional display service are realized, the data source and the data display are separated, the cluster is realized by using a container docker, and the registration and the discovery of the service are realized by using a service registration center consul.
The three-dimensional display service comprises a data module and a three-dimensional display module, wherein the three-dimensional display module comprises static display and animation display. And (4) three-dimensional static display, after the prototype model data text file is generated, calling a display interface of the three-dimensional display service, and executing the graphic display of the three-dimensional display module.
Model machine model and three-dimensional display, namely model text data is generated by model machine model data, then the text data is transmitted to a three-dimensional display service, and a three-dimensional display module displays a graph by analyzing the text data.
The embodiment of the invention also provides a specific application embodiment of the method for realizing the product visual display based on the micro-service architecture, as shown in figure 5,
in the parameterization design of the expandable support frame, the model support framework of the prototype needs to be displayed in three-dimensional display. The unit object mainly includes an arm and a joint as shown in fig. 5. The characteristic data of the arm rod unit comprises an A-end coordinate and a B-end coordinate, and the inner diameter and the wall thickness of the cylinder are shown in FIG. 6; the feature data of the joint unit includes joint point coordinates and local coordinate systems of the a-side and the B-side as shown in fig. 7. The created initial unit object is displayed, and the multi-arm rods and the joints can be assembled into a new state through assembling information such as a structure and a material layering required by the unit, wherein the specific operation is to firstly create 2-N arm rods, then create 1-N joints, and then assemble the arm rods and the joints required by the link, and the assembling of the two arm rods and the joint is as follows:
case 1: the end A of the arm rod 1 is connected with the end A of the joint 1, and the end B of the joint 1 is connected with the end A of the arm rod 2;
case 2: the end A of the arm rod 1 is connected with the end A of the joint 1, and the end B of the joint 1 is connected with the end B of the arm rod 2;
case 3: the end A of the arm rod 1 is connected with the end B of the joint 1, and the end A of the joint 1 is connected with the end A of the arm rod 2;
case 4: the end A of the arm rod 1 is connected with the end B of the joint 1, and the end A of the joint 1 is connected with the end B of the arm rod 2;
case 5: the end B of the arm rod 1 is connected with the end A of the joint 1, and the end B of the joint 1 is connected with the end A of the arm rod 2;
case 6: the end B of the arm rod 1 is connected with the end A of the joint 1, and the end B of the joint 1 is connected with the end B of the arm rod 2;
case 7: the end B of the arm rod 1 is connected with the end B of the joint 1, and the end A of the joint 1 is connected with the end A of the arm rod 2;
case 8: the end B of the arm rod 1 is connected with the end B of the joint 1, and the end A of the joint 1 is connected with the end B of the arm rod 2;
thereby achieving the purpose of assembling the whole supporting framework. The method comprises the steps of establishing characteristic model data of a prototype model, generating a text file according to a file format shown in fig. 4 after the prototype model data is completed, calling a three-dimensional display service in a micro-service frame, importing the prototype model data format file into the three-dimensional display service, drawing arm rod display through the type and characteristic data of a prototype model data arm rod and point coordinate data contained in the arm rod display service, drawing a shutdown graph in the same way, then drawing a whole support framework graph through converting the position of the graph in the display service through assembled information data, analyzing the assembled state, simulating the movable motion state of an arm rod joint, and checking motion state animations through multi-layer state combined operation.
According to the method and the device, the product level and the feature content of the prototype model are defined, the spatial position node coordinate feature, the line unit connecting node feature, the surface unit connecting node feature and the deformation feature are given, and the model display and the animation generation are achieved.
It should be noted that, a certain order does not necessarily exist between the above steps, and those skilled in the art can understand, according to the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, may be executed in parallel, may also be executed interchangeably, and the like.
The above description is given to the method for implementing product visual display based on micro service architecture in the embodiment of the present invention, and the following description is given to a system for implementing product visual display based on micro service architecture in the embodiment of the present invention, please refer to fig. 8, fig. 8 is a schematic diagram of a hardware structure of another embodiment of the system for implementing product visual display based on micro service architecture in the embodiment of the present invention, as shown in fig. 8, the system 10 includes: a memory 101, a processor 102 and a computer program stored on the memory and executable on the processor, the computer program realizing the following steps when executed by the processor 101:
acquiring product characteristics of a product, and acquiring a business process of the product characteristics according to the product characteristics;
performing micro-service architecture according to the service flow of the product characteristics;
calling a model machine model service of the product according to the micro-service architecture, and importing model machine model data into a three-dimensional display engine according to the model machine model service of the product;
and drawing and displaying the basic characteristics in a three-dimensional display engine according to the model data of the sample.
The specific implementation steps are the same as those of the method embodiments, and are not described herein again.
Optionally, the computer program when executed by the processor 101 further implements the steps of:
and when the change of the model data of the sample machine is detected, displaying the dynamic effect of the displacement or state change process of the model data of the sample machine.
The specific implementation steps are the same as those of the method embodiments, and are not described herein again.
Optionally, the computer program when executed by the processor 101 further implements the steps of:
extracting public services in the business process, and establishing independent input and output API services;
acquiring a business service in a business process, and defining a product business service;
designing a data model according to the defined product business service, and defining a group of unique APIs at a service interface at the top layer of the data model;
and acquiring a prototype model of the product, registering the prototype model of the product in the service cluster, and generating prototype model service of the product.
The specific implementation steps are the same as those of the method embodiments, and are not described herein again.
Optionally, the computer program when executed by the processor 101 further implements the steps of:
calling a model machine model service of a product according to the micro-service architecture, reading and analyzing a general file, constructing point set and unit set information of model data, and constructing complete model machine data;
and importing prototype model data of the product into a three-dimensional display engine.
The specific implementation steps are the same as those of the method embodiments, and are not described herein again.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, e.g., to perform method steps S100-S400 of fig. 2 described above.
By way of example, non-volatile storage media can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory components or memory of the operating environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.