CAD front-end and back-end interaction method and system based on service message passing mechanism

Through the CAD front-end and back-end interaction method based on the service messaging mechanism, the problem of high coupling of front-end logic of existing CAD software is solved, and the high availability of code and multi-front-end support are realized.

CN119903262AActive Publication Date: 2025-04-29ZHEJIANG HUADONG ENG DIGITAL TECH CO LTD +1
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202510400957.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-04-29
Estimated Expiration
2045-04-01

AI Technical Summary

Technical Problem

The front and back end logic of existing CAD software is highly coupled, resulting in difficulty in maintaining code, limited function expansion, and it is difficult to adapt to various front-end types such as web and desktop.

Method used

The CAD front-end and back-end interaction method based on the service messaging mechanism is adopted. The corresponding process is started according to the front-end type during system initialization, and the front-end decoupling is realized, and multiple front-end operations are supported through a set of code.

Benefits of technology

It realizes the front-end decoupling of the CAD platform, reduces duplicate code, improves the high availability and reusability of system code, and supports interactive engineering modeling design in multi-front-end environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903262A_ABST
    Figure CN119903262A_ABST
Patent Text Reader

Abstract

The invention provides a CAD front-end and back-end interaction method and system based on a service message passing mechanism, and the method comprises the steps: S1, starting a process corresponding to a front-end type according to the front-end type when a system is initialized, including loading all tools, registering a public message processing class object, and starting a message manager and a tool setting manager, registering an extended message processing class object and a tool setting view corresponding to the front-end type, and starting a tool setting view manager corresponding to the front-end type; and S2, responding to user operation, transmitting and processing messages between the front end and the cloud CAD service, and executing modeling operation. According to the scheme, the front end and the rear end are separated by considering the coexistence condition of the end and the cloud in the CAD platform, a set of codes support multi-front-end operation in a unified framework, and interactive engineering modeling design in a multi-front-end environment is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of engineering digitization, and in particular to a CAD front-end and back-end interaction method and system based on a service message transmission mechanism. Background Art

[0002] CAD (Computer Aided Design) is the core digital tool for modern engineering design. Through the deep integration of computer graphics and numerical computing technology, it provides designers with full-process support such as geometric modeling, parameter analysis, solution optimization and drawing generation.

[0003] CAD is an important technical means in the field of modern engineering design. The current mainstream CAD software, such as AutoCAD, Revit, Microstation, CATIA, etc., are all heavy desktop software that require high-performance computers and large software installation packages. With the improvement of design work efficiency, its shortcomings such as high requirements for client computer performance, inconvenient use, difficulty in collaboration, difficulty in data management, and cumbersome software upgrades have gradually emerged. In response to these problems, some cloud CAD solutions have also been derived.

[0004] However, at the current stage, client-side CAD software is still the mainstream, and at the same time, cloud-based CAD platforms are gradually being accepted by designers. However, the existing CAD platform architecture has the following problems: (1) The front-end and back-end logic of existing CAD software are highly coupled, which makes code maintenance difficult and limits functional expansion; (2) Existing CAD software is difficult to adapt to multiple front-end types such as the Web end and the desktop end at the same time. Summary of the invention

[0005] The present invention provides a CAD front-end and back-end interaction method and system based on a service message transmission mechanism, which can realize the decoupling of the front-end and back-end in applications where the CAD platform and the cloud coexist, and support the operation of multiple front-ends through a set of codes, thereby realizing interactive engineering modeling and design in a multiple front-end environment.

[0006] In a first aspect, the present disclosure provides a CAD front-end and back-end interaction method based on a service message transmission mechanism, comprising: Step S1: When the system is initialized, according to the front-end type, the process corresponding to the front-end type is started, including: loading all tools, registering public message processing class objects, starting the message manager and tool setting manager, registering the extended message processing class objects and tool setting views corresponding to the front-end type, and starting the tool setting view manager corresponding to the front-end type; Among them, the front-end types include Web and desktop; the public message processing class includes the command message processing class; the extended message processing class includes the Web tool setting view message processing class and the desktop tool setting view message processing class; Step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, and performing modeling operations, including: starting the tool; Among them, starting the tool includes the following steps: the user starts the tool through the front end, the front end triggers a command message, sends the command message to the cloud CAD service, the cloud CAD service receives the command message, distributes the message to the command message processing class object for processing through the message manager, runs the command in the message, and starts a specific tool; When constructing a specific tool, the tool setting data class object of the specific tool is created or queried by calling the Get Tool Setting Data method of the Tool Setting Manager, and the tool setting data class object is maintained; During the specific tool loading process, a tool setting view message corresponding to the front-end type is created, and the tool setting view message processing class object corresponding to the front-end type sends the tool setting view message corresponding to the front-end type to the front-end; The tool setting view manager corresponding to the front-end type receives the tool setting view message, queries the corresponding view, and displays it.

[0007] In some embodiments, when the current end type is a Web end, the Web end tool setting view message processing class object formats the tool setting view message and sends it to the front end through the data channel, and the Web end tool setting view manager receives and parses the formatted tool setting view message; when the current end type is a desktop end, the desktop end tool setting view message processing class object implements front-end and back-end message transmission through in-process communication and memory sharing.

[0008] In some embodiments, the common message processing class also includes a mouse message processing class and a keyboard message processing class; Step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, performing modeling operations, and also including: running tools; Running the tool includes the following steps: After starting the tool, the system enters the tool state and performs the tool operation process through user interaction, which specifically includes: when running the tool, receiving the mouse message input by the user, which is processed and responded by the mouse message processing class object; receiving the keyboard message input by the user, which is processed and responded by the keyboard message processing class object, and the response result is passed to the specific tool; The specific tool draws the model by monitoring the mouse messages and keyboard messages and setting the data class object according to the tool of the specific tool.

[0009] In some embodiments, the command message includes instructions to enable / disable a specified tool through a menu and toolbar component in a UI interface.

[0010] In some embodiments, in step S1, the extended message processing class further includes a tool setting data change message processing class; In step S2, after starting the tool, the system enters the tool state, and the tool operation process is performed through user interaction, which also includes: When the user performs model drawing operations through mouse and keyboard operations, and the cloud CAD service triggers a change in the attribute value of the tool setting data class object, the tool setting data change message processing class object corresponding to the front-end type sends the change to the tool setting view corresponding to the front-end type, and updates the tool setting view corresponding to the front-end type.

[0011] In some embodiments, in step S2, after starting the tool, the system enters the tool state, and the tool operation process is performed through user interaction, further comprising: When the user performs a tool setting data class object attribute value modification operation in the tool setting view corresponding to the front-end type, the tool setting view corresponding to the front-end type sends the change amount to the cloud CAD service, which is processed by the tool setting data change message processing class object corresponding to the front-end type to update the tool setting data class object of the corresponding tool; The specific tool sets the data class object attribute value according to the modified tool and draws the model.

[0012] In some embodiments, between the front end and the cloud CAD service, when the front end type is a Web end, the Web end tool setting data change message processing class object serializes the change amount and sends it to the Web end tool setting view through a data channel, and updates the view; the Web end tool setting view serializes the change amount and sends it to the cloud CAD service through a data channel, and is processed by the Web end tool setting data change message processing class object, parses the change amount through deserialization, and updates the tool setting data class object; When the front-end type is desktop, the desktop tool setting data change message processing class object and the desktop tool setting view realize front-end and back-end data synchronization through in-process communication and memory sharing.

[0013] In some embodiments, the tool setting data class inherits the observable object base class, which is the implementation class of the message interface, and is used to monitor the changes in the attribute values ​​of its subclass objects. When an operation on one end of the front-end or cloud-based CAD service causes the attribute value of the subclass object to change, the observable object message is triggered to notify the other end, thereby realizing data synchronization between the front-end and cloud-based CAD services.

[0014] In some embodiments, the Web-side or desktop-side tool setting data change message processing class relies on observable object messages to implement the transmission and synchronization of the change in the attribute value of the front-end and cloud-based CAD service tool setting data class objects.

[0015] In a second aspect, the present disclosure provides a CAD front-end and back-end interaction system based on a service message transmission mechanism, which is used to execute the CAD front-end and back-end interaction method based on a service message transmission mechanism, and the system includes: The initialization module is used to start the process corresponding to the front-end type according to the front-end type when the system is initialized, including: loading all tools, registering public message processing class objects, starting the message manager and tool setting manager, registering the extended message processing class objects and tool setting views corresponding to the front-end type, and starting the tool setting view manager corresponding to the front-end type.

[0016] The system operation module is used to respond to user operations, transmit and process messages between the front end and the cloud CAD service, and perform modeling operations.

[0017] The beneficial effects of the present disclosure are that, compared with the prior art, the present disclosure has the following advantages: 1) In the technical solution disclosed in the present invention, by comprehensively considering the coexistence of the middle-end and cloud of the CAD platform, the CAD desktop application is SAAS-based to achieve separation of the front-end and back-end, and common classes and specific classes for different front-ends are created in a unified framework to achieve a set of code to support multiple front-end operations. Specifically, the web-side (Web-side) application and the desktop application use the same set of codes. The system determines the front-end type during initialization and dynamically loads the corresponding implementation method. In this way, on the one hand, it can minimize duplicate codes and improve the high availability and reusability of the system code; on the other hand, it can achieve multi-end adaptation and perfectly integrate the web-side (Web-side) application and the desktop application to ensure that a set of codes supports multiple front-end operations, thereby realizing interactive engineering modeling and design in a multi-front-end environment.

[0018] 2) By defining multiple message classes and message processing classes, and creating tool setting data classes and specific tool classes, we ensure efficient processing and transmission of different types of messages and data between the front and back ends. Through this classification and specialized processing mechanism, we can achieve efficient communication and operation between the front and back ends in various interaction scenarios.

[0019] 3) In this public solution, the front-end and back-end realize data synchronization based on observable objects. Data changes on any end can trigger synchronization on the other end in real time, reducing the risk of manual coding and data inconsistency. At the same time, due to the complete decoupling of the interface (View) and business logic, it provides a technical foundation for the multi-front-end fusion framework, allowing the platform to flexibly adapt to a variety of front-end applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0021] Figure 1 A schematic diagram of a CAD front-end and back-end interaction method flow based on a service message transmission mechanism provided in an embodiment of the present disclosure; Figure 2 A schematic diagram of a UI interface for CAD front-end and back-end interaction based on a service message transmission mechanism provided in an embodiment of the present disclosure; Figure 3 A basic schematic diagram of a multi-front-end implementation framework of a CAD front-end and back-end interaction method based on a service message transmission mechanism provided in an embodiment of the present disclosure; Figure 4 A schematic diagram of a multi-front-end implementation framework of a CAD front-end and back-end interaction method based on a service message transmission mechanism provided in an embodiment of the present disclosure.

[0022] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0023] The present disclosure is further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present disclosure, and cannot be used to limit the protection scope of the present disclosure.

[0024] It should be noted that the sequence of steps in the present disclosure is only an example. In actual implementation, the sequence can be adjusted as needed, or some steps can be executed in parallel. Unless the execution of a certain step clearly depends on the result of the previous step, the sequence between the steps does not constitute a limitation on the present disclosure.

[0025] Example 1

[0026] like Figure 1 As shown, this embodiment provides a CAD front-end and back-end interaction method based on a service message transmission mechanism, including: Step S1: When the system is initialized, the process corresponding to the front-end type is started according to the front-end type, including: loading all tools, registering public message processing class objects, starting the message manager and tool setting manager, registering the extended message processing class objects and tool setting views corresponding to the front-end type, and starting the tool setting view manager corresponding to the front-end type.

[0027] Among them, the front-end types include Web and desktop.

[0028] Specifically, the desktop side includes wpf front end, winforms front end, QT front end, etc.

[0029] Optionally, when the front-end type is a Web end, in step S1, when the system is initialized, according to the front-end type, a process corresponding to the front-end type is started, and the process also includes: creating a data channel.

[0030] It should be noted that the public message processing class objects, the web-side extended message processing class objects, the desktop-side extended message processing class objects, the message manager, and the tool setting manager are created in the cloud CAD service; The web-side tool setting view, the desktop-side tool setting view, the web-side tool setting view manager and the desktop-side tool setting view manager are created on the system front end.

[0031] The common message processing class includes the command message processing class.

[0032] The command message processing class depends on the command message. When the command operation is triggered, the command message processing class calls the system method to execute the command.

[0033] As an example, in a CAD platform, the UI interface includes several UI functional components configured in different areas, including a drawing area (workspace), a tool setting panel component, a resident command interaction component, a property panel component, a message display component, and a menu and toolbar component. Figure 2 As shown, it is divided into six areas: A, B, C, D, E, and F, among which: Area A: menu and toolbar components; Area B: property panel components; Area C: tool setting view components; Area D: drawing area (workspace); Area E: message display components; Area F: resident command interaction components.

[0034] Command messages include commands to start / stop specified tools through menus and toolbar components (area A) in the UI interface, and may also include other modeling commands or auxiliary modeling commands. Command messages include a command string. Specifically, command messages mainly include modeling commands such as creation, modification, editing, deletion, and query of model elements, as well as auxiliary modeling commands such as view control, capture, and precise drawing.

[0035] For example, a user starts a tool through the front end, the front end triggers a command message, and sends the command message to the back end. The back end receives the command message, and the command message processing class object processes it, obtains the command content, runs the command in the message, and starts a specific tool. In this embodiment, the extended message processing class includes a Web-side tool setting view message processing class and a desktop-side tool setting view message processing class.

[0036] The Web-side tool setting view message processing class aggregates a data channel object. When the tool setting view needs to be displayed / closed, the tool setting view message is sent to the web front end through the data channel; The desktop tool setting view message processing class, when the tool setting view needs to be displayed / closed, transmits the tool setting view message to the desktop front end through in-process communication and memory sharing; Among them, the tool setting view message is used to notify the front end to perform operations including displaying the view and closing the view.

[0037] Optionally, the Web-side tool settings view is an instance of the Web-side tool settings view class, which inherits from the Web-side tool settings view base class. The Web-side tool settings view base class provides basic display / close methods, aggregates data channels and observable object messages, and binds tool settings data class objects to the view. When the attribute value of the tool settings data class object changes, the Web-side tool settings view base class serializes the change and sends it to the cloud CAD service through the data channel.

[0038] Since the Web-side tool setting view class inherits from the Web-side tool setting view base class, the Web-side tool setting view class is used to provide basic display / close methods, aggregate data channels and observable object messages, and bind the tool setting data class object to the view. Relying on observable object messages, when the attribute value of the tool setting data class object changes, the Web-side tool setting view class serializes the change and sends it to the cloud CAD service through the data channel.

[0039] Optionally, the desktop tool settings view is an instance of the desktop tool settings view class, which inherits from the desktop tool settings view base class, wherein the desktop tool settings view base class provides basic display / close methods, aggregates observable object messages, and binds the tool settings data class object to the view. When the attribute value of the tool settings data class object changes, the desktop tool settings view base class serializes the change and synchronizes it to the cloud CAD service through in-process communication and memory sharing.

[0040] Since the desktop tool setting view class inherits from the desktop tool setting view base class, it also provides basic display / close methods, aggregates observable object messages, and binds the tool setting data class object to the view. Relying on observable object messages, when the attribute value of the tool setting data class object changes, the desktop tool setting view class serializes the change and synchronizes it to the cloud CAD service through in-process communication and memory sharing.

[0041] It can be understood that the tool setting view refers to the interface for displaying tool setting data when each tool is started, generally referring to Figure 2 Area C in the tool setting data is used to display and interact with tool setting data. For example, the tool setting data of the line drawing tool includes the selection of whether to specify the length, the length value input, whether to specify the angle, and the angle value input. It can display the length and angle value of the current free-drawn line segment when the length and angle are not specified, and can also receive user operations to specify the current length value and angle.

[0042] Specifically, the tool setting data class includes various input tool setting data for specifying tool operation parameters when users perform two- or three-dimensional free modeling and parametric modeling in the CAD platform. For example, the cube drawing tool setting data includes: whether orthogonal, whether to specify the length, length, whether to specify the width, width, whether to specify the height, height.

[0043] like Figure 4 As shown, the tool setting data class inherits the observable object base class, which is the data foundation class for all front-end and back-end data synchronization operations within the framework described in this example. It is the implementation class of the message interface, which can monitor the attribute value changes of its subclass objects (such as tool setting data class objects). When the attribute value of the subclass object changes due to an operation on one end of the front-end or cloud-based CAD service, the observable object message is triggered to notify the other end, thereby realizing data synchronization between the front-end and cloud-based CAD services.

[0044] It is understandable that since the tool setting data class inherits the observable object base class, when the attribute value of the tool setting data class object changes, the observable object message is triggered. When the operation on one end of the front-end or cloud CAD service causes data changes, the other end is notified through the observable object message to achieve data synchronization between the front-end and cloud CAD services. Tools refer to various interactive tools for creating / editing models. Free modeling can be performed in the drawing area (area D) through the mouse and keyboard, and data interaction and parametric modeling can be performed through the tool setting view component (area C). Tools include, for example, line drawing tools, rectangle tools, spline curve tools, etc.

[0045] "Tool state" refers to the overall state of the system during the tool operation period from the start of the tool to the end of the tool. The tool is generally a state machine. The entire tool operation period is the overall state of the system. The operation period is divided into several sub-states. From the start, the transition between sub-states is driven by user interaction (such as mouse and key operations) or parameterized input (such as tool setting data) until the tool ends. When the next tool is started, the system enters the next tool state.

[0046] Optionally, the tool class inherits the tool base class, which is a basic class for implementing interactive two-dimensional and three-dimensional modeling, including a tool setting data class object, some mouse and key interaction methods, and the like.

[0047] Since the tool class inherits from the tool base class, it also includes a tool setting data class object and is responsible for maintaining the object, that is, it aggregates the tool setting data class object. That is, when the front end changes (user input) the attribute value of the object, the tool draws the corresponding model according to the modified attribute value of the object. When the front end does not change (no user input), the tool completes the modeling operation according to the attribute value of the instance.

[0048] Optionally, the common message processing class also includes a mouse message processing class and a keyboard message processing class.

[0049] Specifically, the mouse message processing class relies on mouse messages to respond to mouse input in the front-end interface.

[0050] The keyboard message processing class relies on keyboard messages and is used to respond to keyboard input in the front-end interface.

[0051] In this embodiment, all messages are instances of a message class, and the message class is an implementation of a message interface.

[0052] It should be noted that, in this embodiment, mouse messages and keyboard messages specifically refer to mouse and key operations in the drawing area (area D) in the tool state after the tool is started, to complete view operations (translation / rotation / zooming, etc.), model element picking, point coordinate acquisition, etc. That is to say, in area D, mouse messages and keyboard messages will be transmitted to the backend, and will be responded and processed by the mouse message processing class object and the keyboard message processing class object respectively.

[0053] The mouse and keyboard events in other areas of the UI interface are processed by the front end and will not be passed to the back end. For example, when the user clicks the line drawing button, the front end will process the click event, interpret the behavior of clicking the line drawing button as starting the line drawing tool, and construct a command to start the line drawing tool, pass it to the back end, and the back end will start the line drawing tool according to this command. After that, when the user enters parameters in the line drawing tool setting view, the front end obtains the keyboard input and sends the tool setting data change to the back end, which is processed by the tool setting data change message processing class object. In other words, unlike the "mouse messages and keyboard messages" in this embodiment, the mouse and keyboard events in other areas of the UI interface can be considered global, and each interactive tool requires the cooperation of the mouse and keyboard.

[0054] Optionally, in the cloud CAD service, the message manager is used to manage all messages and message processing objects, maintain the relationship between message types and corresponding message processing objects, and mainly includes registering message processing methods, unregistering message processing methods, triggering message methods, etc. When the trigger message method is called, the message will be forwarded to the message processing object for specific processing.

[0055] The tool setting manager is used to maintain the relationship between tools and tool setting data class objects. It relies on the tool setting view message and message manager, including methods for obtaining tool setting data and displaying / closing tool setting view methods.

[0056] Among them, the method for obtaining tool setting data is to obtain the current tool setting data class object according to the current tool type and tool setting data type. The tool setting data class object is a singleton mode, and its singleton state is maintained by the tool setting manager, that is, the tool setting data class object is created only when the method for obtaining tool setting data is called for the first time, and subsequent calls will no longer generate new tool setting data class objects, thereby improving the system response efficiency and ensuring the consistency and global accessibility of tool setting data.

[0057] The method for displaying / closing the tool setting view is to trigger the tool setting view message through the message manager, call the tool setting view message processing class object on the Web or desktop side to pass the tool setting view message to the front end, and implement the operation of displaying / closing the view.

[0058] Optionally, in the front end, the tool setting view manager is used to manage the tool setting views of all tools of the system, and maintain the relationship between the tool setting data class objects and specific tool setting views; wherein the tool setting view manager includes a web-side tool setting view manager and a desktop-side tool setting view manager.

[0059] Step S2: Respond to user operations, transmit and process messages between the front end and the cloud CAD service, and perform modeling operations.

[0060] It should be noted that since the front-end and back-end of desktop software are only logically separated, their data can still access each other in memory, while the front-end and back-end of Web applications are physically separated. The front-end and back-end data can only be transmitted through the network, and a dedicated data channel needs to be established. Therefore, in the multi-front-end implementation, the desktop and Web implementations differ mainly in the data transmission method.

[0061] Based on this, in this embodiment, the multi-front-end framework determines the running logic of the entire program, and the main difference lies in the processing method of the message processing class.

[0062] Specifically, step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, and performing modeling operations, including: 1) starting the tool.

[0063] 1) Start the tool, including the following steps: Step S2.1, the user starts the tool through the front end, the front end triggers a command message, and sends the command message to the cloud CAD service. The cloud CAD service receives the command message, distributes the message to the command message processing class object through the message manager for processing, runs the command in the message, and constructs a tool class instance, that is, starts a specific tool; Step S2.2, when constructing a specific tool, by calling the Get Tool Setting Data method of the Tool Setting Manager, a tool setting data class object of the specific tool is created or queried, and the tool setting data class object is maintained; Step S2.3, during the specific tool loading process, a tool setting view message corresponding to the front-end type is created, and the tool setting view message processing class object corresponding to the front-end type sends the tool setting view message corresponding to the front-end type to the front-end; Step S2.4: The tool setting view manager corresponding to the front-end type receives the tool setting view message, queries the corresponding view, and displays it.

[0064] Among them, when the current end type is the Web end, the message sending / receiving method between the front and back ends includes: the Web-side tool setting view message processing class object formats the tool setting view message and sends it to the front end through the data channel, and the Web-side tool setting view manager receives and parses the formatted tool setting view message.

[0065] When the front-end type is desktop, the desktop tool sets the view message processing class object to implement front-end and back-end message transmission through in-process communication and memory sharing.

[0066] As an optional implementation, when the front end is a Web end, the system startup tool is implemented as follows: The user starts the tool through the front end, which triggers a command message and sends it to the cloud CAD service module through the data channel. The cloud CAD service receives the command message and distributes it to the command message processing class object through the message manager for processing. It obtains and runs the command in the message and constructs a tool class instance, that is, starts a specific tool. When constructing a specific tool, the tool setting data class object of the current tool is created or queried by calling the Get Tool Setting Data method of the Tool Setting Manager, and the tool setting data class object is maintained; During the specific tool loading process, the display tool setting view method of the tool setting manager is called to create a tool setting view message, and the trigger message event method of the message manager is called according to the object to distribute the message. The tool setting view message processing class object on the Web side formats the tool setting view message and transmits it to the web front end through the data channel; The Web-side tool setting view manager receives and parses the formatted tool setting view message, and queries the corresponding view and displays it according to the tool setting data type and tool setting view registered and bound during initialization.

[0067] When the front end is the desktop, the system startup tool is implemented as follows: The user starts the tool through the front end, which triggers a command message and sends it to the cloud CAD service module. The cloud CAD service receives the command message and distributes it to the command message processing class object through the message manager for processing. It obtains and runs the command in the message and constructs a tool class instance, that is, starts a specific tool. When constructing a specific tool, the tool setting data class object of the current tool is created or queried by calling the Get Tool Setting Data method of the Tool Setting Manager, and the tool setting data class object is maintained; During the specific tool loading process, the display tool setting view method of the tool setting manager is called to create a tool setting view message, and the trigger message event method of the message manager is called according to the object to distribute the message. The tool setting view message processing class object on the desktop side sends the tool setting view message to the front end. The desktop tool setting view manager receives the tool setting view message, and queries the corresponding view according to the tool setting data type registered and bound during initialization and the corresponding tool setting view on the desktop, and displays it.

[0068] Among them, the message processing class objects corresponding to the desktop end realize front-end and back-end message transmission through in-process communication and memory sharing.

[0069] Optionally, step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, and performing modeling operations, also includes: 2) running the tool.

[0070] 2) Running the tool, including the following steps: After starting the tool, the system enters the tool state and performs the tool running process through user interaction, including: Step S2.5, when the tool is running, the mouse message input by the user is received, and the mouse message processing class object processes it, and responds to the mouse message (including mouse movement, key, wheel and other messages); the keyboard message input by the user is received, and the keyboard message processing class object processes it, and responds to all keyboard key messages, and passes the response result to the specific tool; Step S2.6, the specific tool draws the model by monitoring the mouse messages and keyboard messages and setting the data class object according to the tool of the specific tool.

[0071] Example 2 Based on the method described in Example 1, this embodiment further defines steps S1-S2, and the specific scheme is as follows: In step S1, the extended message processing class also includes a tool setting data change message processing class. That is, when the system is initialized, according to the front-end type, the process corresponding to the front-end type is started, and the tool setting data change message processing class corresponding to the front-end type is registered.

[0072] It should be noted that, in this embodiment, the tool setting data change message processing class is effective only in the tool state after the tool is started. Its functions include: responding to the user's modification operation on the tool setting data class object in the tool setting view component (area C) of the front-end UI interface, and when the cloud CAD service operation causes the attribute value of the tool setting data class object to change, synchronizing these changes to the tool setting view.

[0073] Specifically, the Web-side tool setting data change message processing class is used for, when the cloud CAD service operation causes the attribute value of the tool setting data class object to change, the Web-side tool setting data change message processing class object serializes the change amount, sends it to the Web-side tool setting view through the data channel, and updates the Web-side tool setting view; When a user modifies the attribute value of a tool setting data class object in the Web-side tool setting view, the Web-side tool setting view serializes the change and sends it to the cloud CAD service through the data channel. The Web-side tool setting data change message processing class object processes it, parses it, and updates the tool setting data class object of the corresponding tool. Among them, the Web-side tool sets the data change message processing class, which relies on observable object messages to realize the transmission and synchronization of the changes in the attribute values ​​of the data class objects set by the above front-end and back-end tools, and aggregates a data channel object.

[0074] The desktop tool setting data change message processing class is used to send the change to the desktop tool setting view and update the desktop tool setting view when the cloud CAD service operation causes the attribute value of the tool setting data class object to change; When the user modifies the attribute value of the tool setting data class object in the desktop tool setting view, the desktop tool setting view sends the change to the cloud CAD service, which is processed by the desktop tool setting data change message processing class object, and the tool setting data class object of the corresponding tool is parsed and updated; The desktop tool setting data change message processing class relies on observable object messages to realize the transmission and synchronization of the change in the attribute values ​​of the above-mentioned front-end and back-end tool setting data class objects, and realizes the front-end and back-end data transmission through in-process communication and memory sharing.

[0075] In step S2, 2) running the tool, including the following steps: After the tool is started, the system enters the tool state and the tool runs through user interaction, including: Step S2.5, when the tool is running, the mouse message input by the user is received, and the mouse message processing class object processes it, and responds to the mouse message (including mouse movement, key, wheel and other messages); the keyboard message input by the user is received, and the keyboard message processing class object processes it, and responds to the keyboard key message, and transmits the response result to the specific tool; Step S2.6, the specific tool draws the model by monitoring the mouse message and keyboard message and setting the data class object according to the tool of the specific tool; Step S2.7, when the user performs model drawing operations through mouse and keyboard operations, and the attribute value of the tool setting data class object is changed in the cloud CAD service, the tool setting data change message processing class object corresponding to the front-end type sends the change amount to the tool setting view corresponding to the front-end type, and updates the tool setting view corresponding to the front-end type; Further optionally, after step S2.7, the following steps may also be included: Step S2.8, when the user performs a tool setting data class object attribute value modification operation in the tool setting view corresponding to the front-end type, the tool setting view corresponding to the front-end type sends the change amount to the cloud CAD service, which is processed by the tool setting data change message processing class object corresponding to the front-end type to update the tool setting data class object of the corresponding tool; Step S2.9, the specific tool sets the data class object attribute value according to the modified tool and draws the model.

[0076] Among them, between the front end and the cloud CAD service, when the front end type is the Web end, the Web end tool setting data change message processing class object serializes the change amount and sends it to the Web end tool setting view through the data channel, and updates the view; the Web end tool setting view serializes the change amount and sends it to the cloud CAD service through the data channel, which is processed by the Web end tool setting data change message processing class object, parses the change amount through deserialization, and updates the tool setting data class object; When the front-end type is desktop, the desktop tool setting data change message processing class object and the desktop tool setting view realize front-end and back-end data synchronization through in-process communication and memory sharing.

[0077] The data change message processing class of the web or desktop tool settings relies on observable object messages to realize the transmission and synchronization of the changes in the attribute values ​​of the data class objects set by the above front-end and back-end tools.

[0078] It can be seen that in this embodiment, the front-end and back-end realize data synchronization based on observable objects, and data changes on any end can trigger synchronization on the other end in real time, reducing the risk of manual coding and data inconsistency; at the same time, due to the complete decoupling of the interface (View) and business logic, it provides a technical foundation for the multi-front-end fusion framework, allowing the platform to flexibly adapt to a variety of front-end applications.

[0079] Example 3 This embodiment further defines step S2 based on the method described in Embodiment 1-Embodiment 2, and the specific scheme is as follows: Optionally, step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, and performing modeling operations, also includes: 3) switching tools after starting the tool or running the tool.

[0080] 3) After starting the tool or running the tool, switch the tool, including the following steps: Step S2.10: The user starts a new tool through the front end, and the front end triggers a command message and sends the command message to the cloud CAD service. The cloud CAD service receives the command message and distributes the message to the command message processing class object for processing through the message manager, runs the command in the message object, and ends the current tool. Step S2.11, calling the close tool setting view method of the tool setting manager, creating a tool setting view message, and calling the trigger message event method of the message manager according to the object, distributing the message, and the tool setting view message processing class object corresponding to the front-end type sends the tool setting view message to the front-end; Step S2.12, the tool setting view manager corresponding to the front-end type receives the tool setting view message, and queries the corresponding view according to the tool setting data type and tool setting view registered and bound during initialization, and closes it; Step S2.13, execute the command in the command message, start the new tool, execute the step of starting the tool, and return to step S2.1.

[0081] Among them, when the current end type is the Web end, the Web end tool setting view message processing class object formats the tool setting view message and sends it to the front end through the data channel. The Web end tool setting view manager receives and parses the formatted tool setting view message.

[0082] When the front-end type is desktop, the message processing class object corresponding to the desktop realizes front-end and back-end message synchronization through in-process communication and memory sharing.

[0083] Specifically, the formatting of messages can be transmitted using data formats such as JSON or XML, and the serialization and deserialization of messages can use standard serialization libraries such as Java's Jackson or Python's pickle library.

[0084] In the above embodiment, if Figure 3 , Figure 4 As shown, the message processing class (including the common message processing class and the extended message processing class) is an implementation of the message processing interface, which is used to respond to and process specific messages. That is, the message processing interface defines the types of all message processing classes in the framework of this embodiment, and all message processing classes in the framework of this embodiment are an implementation of the interface. The processing includes but is not limited to: message interface, serialized message interface string, and other various forms of messages.

[0085] It should be noted that, for the embodiments of the present disclosure, during the operation of the system, after the cloud-based CAD service receives a message, the message manager distributes the message to the corresponding message processing class object for processing. Therefore, regardless of whether it is explicitly stated in the above steps, after the cloud-based CAD service receives a message, the message manager distributes the message to the corresponding message processing class object for processing.

[0086] In an optional implementation, the extended message processing class also includes a Web-side prompt information message processing class and a Web-side view size setting message processing class, a desktop-side prompt information message processing class and a desktop-side view size setting message processing class, etc.

[0087] The Web-side prompt information message processing class aggregates a data channel. When the prompt message method is called in the tool class, the prompt message processing class serializes the message and sends the prompt message to the web front end through the data channel. The web front end synchronizes the interface data according to the message content; Specifically, prompt information messages refer to messages in the CAD platform that provide users with feedback on operation status, error information, warnings or suggestions, such as operation success / failure prompts, progress information and warning reminders.

[0088] The Web-side view size setting message processing class includes an encoder object and a view object. When the front-end view changes, the view size setting message is triggered. The Web-side view size setting message processing class sets the encoder size and the view size according to the message content.

[0089] The desktop prompt information message processing class notifies the front end to synchronize the interface data according to the message content when the prompt message method is called in the tool class; The desktop-side view size setting message processing class includes a view object. When the front-end view changes, the view size setting message is triggered. The view size setting message processing class sets the view size according to the message content.

[0090] It can be seen that in the disclosed solution, by defining multiple message classes and message processing classes, and creating tool setting data classes and specific tool classes, efficient processing and transmission of different types of messages and data between the front and back ends are ensured. Through this classification and specialized processing mechanism, efficient communication and operation between the front and back ends in various interaction scenarios are achieved.

[0091] Example 4 This embodiment further defines step S1 on the basis of the methods described in embodiments 1 to 3. The specific scheme is as follows: Optionally, step S1 specifically includes: Step S1.1: When the system is initialized, in response to the system startup, the front-end type is determined. If the front-end type is a Web end, the process proceeds to step S1.2; if the front-end type is a desktop end, the process proceeds to step S1.3; Step S1.2: Start the web-side process, including: creating a data channel, loading all tools, and registering public message processing classes and Web-side extended message processing class objects; calling the message manager's registration message processing method to register and bind the public message processing class objects and Web-side extended message processing class objects to the corresponding message types; calling the Web-side tool setting view manager to bind the tool setting data type to the corresponding tool setting view on the Web side.

[0092] Step S1.3: Start the desktop process, including: loading all tools, and registering the public message processing class and the desktop extended message processing class objects; calling the message manager's registration message processing method, registering and binding the public message processing class objects and the desktop extended message processing class objects with the corresponding message types respectively; calling the desktop tool setting view manager, binding the tool setting data type with the corresponding tool setting view on the desktop.

[0093] Example 5 This embodiment provides a CAD front-end and back-end interaction system based on a service message transmission mechanism, which is used to execute the CAD front-end and back-end interaction method based on a service message transmission mechanism as described in Embodiments 1 to 4. The system includes: The initialization module is used to start the process corresponding to the front-end type according to the front-end type when the system is initialized, including: loading all tools, registering public message processing class objects, starting the message manager and tool setting manager, registering the extended message processing class objects and tool setting views corresponding to the front-end type, and starting the tool setting view manager corresponding to the front-end type.

[0094] The system operation module is used to respond to user operations, transmit and process messages between the front end and the cloud CAD service, and perform modeling operations.

[0095] It can be seen that in the above embodiments, by comprehensively considering the coexistence of the middle end and the cloud of the CAD platform, the CAD desktop application is SAAS-based, the front-end and back-end are separated, and public classes and specific classes for different front-ends are created in a unified framework, so that one set of code supports multiple front-end operations. Specifically, the web-side (Web-side) application and the desktop application use the same set of codes. The system determines the front-end type during initialization and dynamically loads the corresponding implementation method. In this way, on the one hand, it can minimize duplicate codes and improve the high availability and reusability of the system code; on the other hand, it can achieve multi-end adaptation, perfectly integrate the web-side (Web-side) application and the desktop application, ensure that one set of code supports multiple front-end operations, and thus realize interactive engineering modeling and design in a multi-front-end environment.

[0096] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0097] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0098] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A CAD front-end and back-end interaction method based on service message transmission mechanism, characterized in that: include: Step S1: When the system is initialized, according to the front-end type, the process corresponding to the front-end type is started, including: loading all tools, registering public message processing class objects, starting the message manager and tool setting manager, registering the extended message processing class objects and tool setting views corresponding to the front-end type, and starting the tool setting view manager corresponding to the front-end type; Among them, the front-end types include Web and desktop; the public message processing class includes the command message processing class; the extended message processing class includes the Web tool setting view message processing class and the desktop tool setting view message processing class; Step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, and performing modeling operations, including: starting the tool; Among them, starting the tool includes the following steps: the user starts the tool through the front end, the front end triggers a command message, sends the command message to the cloud CAD service, the cloud CAD service receives the command message, distributes the message to the command message processing class object for processing through the message manager, runs the command in the message, and starts a specific tool; When constructing a specific tool, the tool setting data class object of the specific tool is created or queried by calling the Get Tool Setting Data method of the Tool Setting Manager, and the tool setting data class object is maintained; During the specific tool loading process, a tool setting view message corresponding to the front-end type is created, and the tool setting view message processing class object corresponding to the front-end type sends the tool setting view message corresponding to the front-end type to the front-end; The tool setting view manager corresponding to the front-end type receives the tool setting view message, queries the corresponding view, and displays it.

2. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 1 is characterized in that: When the front-end type is Web, the Web-side tool setting view message processing class object formats the tool setting view message and sends it to the front-end through the data channel. The Web-side tool setting view manager receives and parses the formatted tool setting view message. When the front-end type is desktop, the desktop tool sets the view message processing class object to implement front-end and back-end message transmission through in-process communication and memory sharing.

3. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 2 is characterized in that: The public message processing class also includes a mouse message processing class and a keyboard message processing class; Step S2: responding to user operations, transmitting and processing messages between the front end and the cloud CAD service, performing modeling operations, and also including: running tools; Running the tool includes the following steps: After starting the tool, the system enters the tool state and performs the tool operation process through user interaction, which specifically includes: when running the tool, receiving the mouse message input by the user, which is processed and responded by the mouse message processing class object; receiving the keyboard message input by the user, which is processed and responded by the keyboard message processing class object, and the response result is passed to the specific tool; The specific tool draws the model by monitoring the mouse messages and keyboard messages and setting the data class object according to the tool of the specific tool.

4. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 1 is characterized in that: The command message includes instructions for starting / closing a specified tool through menu and toolbar components in the UI interface.

5. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 3 is characterized in that: In step S1, the extended message processing class also includes a tool setting data change message processing class; In step S2, after starting the tool, the system enters the tool state, and the tool operation process is performed through user interaction, which also includes: When the user performs model drawing operations through mouse and keyboard operations, and the cloud CAD service triggers a change in the attribute value of the tool setting data class object, the tool setting data change message processing class object corresponding to the front-end type sends the change to the tool setting view corresponding to the front-end type, and updates the tool setting view corresponding to the front-end type.

6. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 5 is characterized in that: In step S2, after starting the tool, the system enters the tool state, and the tool operation process is performed through user interaction, which also includes: When the user performs a tool setting data class object attribute value modification operation in the tool setting view corresponding to the front-end type, the tool setting view corresponding to the front-end type sends the change amount to the cloud CAD service, which is processed by the tool setting data change message processing class object corresponding to the front-end type to update the tool setting data class object of the corresponding tool; The specific tool sets the data class object attribute value according to the modified tool and draws the model.

7. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 6 is characterized in that: in, Between the front-end and the cloud CAD service, when the front-end type is the Web end, the Web end tool setting data change message processing class object serializes the change amount and sends it to the Web end tool setting view through the data channel, and updates the view; the Web end tool setting view serializes the change amount and sends it to the cloud CAD service through the data channel, which is processed by the Web end tool setting data change message processing class object, parses the change amount through deserialization, and updates the tool setting data class object; When the front-end type is desktop, the desktop tool setting data change message processing class object and the desktop tool setting view realize front-end and back-end data synchronization through in-process communication and memory sharing.

8. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to any one of claims 5 to 7, characterized in that: The tool sets the data class to inherit the observable object base class, which is the implementation class of the message interface and is used to monitor the changes in the attribute values ​​of its subclass objects. When an operation on one end of the front-end or cloud-based CAD service causes the attribute value of the subclass object to change, the observable object message is triggered to notify the other end, thereby realizing data synchronization between the front-end and cloud-based CAD services.

9. The CAD front-end and back-end interaction method based on the service message transmission mechanism according to claim 8 is characterized in that: The web or desktop tool setting data change message processing class relies on observable object messages to realize the transmission and synchronization of the changes in the attribute values ​​of the front-end and cloud CAD service tool setting data class objects.

10. A CAD front-end and back-end interaction system based on a service message transmission mechanism, used to execute the CAD front-end and back-end interaction method based on a service message transmission mechanism as described in any one of claims 1 to 9, characterized in that: The system comprises: The initialization module is used to start the process corresponding to the front-end type according to the front-end type when the system is initialized, including: loading all tools, registering public message processing class objects, starting the message manager and tool setting manager, registering the extended message processing class objects and tool setting views corresponding to the front-end type, and starting the tool setting view manager corresponding to the front-end type; The system operation module is used to respond to user operations, transmit and process messages between the front end and the cloud CAD service, and perform modeling operations.

Citation Information

Patent Citations

  • Rich client platform dynamic behavior device and rich client platform dynamic behavior method

    CN103631663A

  • Security protocol formal verification method using expanded UML model as framework

    CN105049420A

  • A message transmission implementation method based on a multi-cloud platform transmission condition

    CN109067911A

  • Cross-platform desktop application program development framework and method based on electron

    CN110275700A

  • Cloud CAD processing method and system, computer equipment and storage medium

    CN115665120A