A contract-based manufacturing process design method
By defining contracts and mapping rules for each operation, the complexity of object-oriented design and microservice interaction is solved, low-code development and code model traceability are achieved, and the development process of industrial edge applications is simplified.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2026-03-24
AI Technical Summary
Object-oriented design cannot use a unified approach to describe different processes in different industries. Converting the results of object-oriented process design into actual code still requires a significant amount of work. Interactions between microservices need to consider abnormal situations such as callee failure, overload, and message loss, which increases system complexity.
A contract-based manufacturing process design approach is adopted. By defining a contract for each operation, including preconditions, operation ontology, invariants, interfaces and postconditions, mapping rules are defined to generate executable code modules, and the code modules are connected according to the process flow to achieve low-code development.
It achieves a unified description of different processes, reduces software development workload, improves development efficiency, ensures the traceability of the code model, and simplifies the interaction logic between microservices.
Smart Images

Figure CN116339725B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial edge computing, and more particularly to a contract-based manufacturing process design method. Background Technology
[0002] With the rapid growth in the scale of Industrial Cyber-Physical Systems (iCPS), the computing and communication resources of industrial edge devices are also increasing significantly. Industrial edge computing refers to the integration of computing, communication, and storage resources to execute complex industrial edge applications. To develop and integrate these complex industrial edge applications, a more efficient software development paradigm is needed.
[0003] Model-Driven Engineering (MDE) is widely used in the software development process. Existing MDE design methods include object-oriented design and microservice architecture.
[0004] Object-oriented design is a concept that encapsulates programs with various independent yet interconnected objects, where an object is an instance of a class. Object-oriented design uses objects as the basic units of a program, encapsulating both the program and its data. Every object in object-oriented programming should be able to receive data, process data, and communicate data to other objects.
[0005] Microservices are an architectural and organizational approach to developing software that builds applications as independent components, with each application process running as a service. These services communicate through well-defined interfaces, are built around business functions, each perform a specific function, and are handled by small, independent teams.
[0006] Although object-oriented design and microservices have been widely adopted, some problems still exist in practical applications. For example, object-oriented design cannot use a unified method to describe different processes in different industries, and converting the results of object-oriented process design into actual code still requires a significant amount of work. Furthermore, the interaction between microservices needs to consider various abnormal situations such as failure of the callee, overload, and message loss, making the code logic more complex and increasing the complexity of the system.
[0007] Therefore, those skilled in the art are dedicated to developing a contract-based manufacturing process design method. Summary of the Invention
[0008] In view of the above-mentioned deficiencies of the prior art, the technical problem to be solved by the present invention is that the object-oriented design method cannot use a unified method to describe different processes in different industries, and the conversion from object-oriented process design results to actual code still requires a large amount of work.
[0009] To achieve the above objectives, this invention provides a contract-based manufacturing process design method, characterized in that the method, based on the high-level abstraction of the contract, enables low-code development of industrial edge applications. The method includes the following steps:
[0010] S101: Define a contract corresponding to each operation in the manufacturing process, and combine the contract with the body of the operation to form an operation based on the contract;
[0011] S103: Define the mapping rules from the operation to the executable code module;
[0012] S105: Generate the executable code module based on the mapping rules;
[0013] S107: According to the process flow, the output of the preceding code module and the input of the following code module are connected to form a complete executable process flow. The preceding code module is the code module corresponding to the preceding operation, and the following code module is the code module corresponding to the following operation.
[0014] Furthermore, the contract includes preconditions, operation entities, invariants, interfaces, and postconditions, wherein the preconditions and postconditions represent the interfaces through which the operations interact.
[0015] Furthermore, the preconditions specify the conditions that must be met before the operation is executed. The preconditions are checked before each operation is executed, and if the preconditions are not met, the operation is not executed.
[0016] Furthermore, the operation body is a specific operation instruction.
[0017] Furthermore, the invariant is a condition that must be guaranteed throughout the entire execution of the operation.
[0018] Furthermore, the interface is used to expose information to the outside world through the operation, and the interface is used for monitoring.
[0019] Furthermore, the postcondition is a condition that needs to be met when each operation ends, and is the result of the operation.
[0020] Furthermore, the method also provides an operation template based on the contract, which describes the operation in detail. The operation template includes an operation name, requirements, execution, invariants, interfaces, guarantees, and end operation name. The operation name is used to name the operation. The requirements include one or more of the preconditions. The execution includes the operation body. The invariants are one or more. The interfaces are one or more. The guarantees include one or more of the postconditions.
[0021] Furthermore, the method defines an operation syntax structure based on the contract, which uses the operation template to complete the design of each operation.
[0022] Further, in step S103, the mapping rule includes:
[0023] The preconditions are mapped to the input of the code module, and the preconditions are checked when the input is generated;
[0024] The operation ontology and the invariant are mapped to the internal algorithm and internal variables of the code module. If the precondition is met, the internal algorithm is executed.
[0025] The interface and the postcondition are mapped to the output of the code module. If the internal algorithm is executed, the corresponding output is generated and the postcondition is satisfied.
[0026] In a preferred embodiment of the present invention, the present invention has the following advantages over the prior art:
[0027] 1. This invention provides a contract-based process design paradigm, which defines a corresponding contract for each operation in the process flow, and combines the contract with the operation ontology to form a contract-based operation. This can uniformly describe different processes in discrete manufacturing and process industries, enabling process engineers without strong programming skills to develop industrial edge applications simply by defining contracts.
[0028] 2. This invention provides conversion rules from contracts to individual code modules, defining mapping rules from contract-based operations to executable code modules, reducing the workload in the software development phase, and ensuring the traceability of the code model.
[0029] The following will further explain the concept, specific structure, and technical effects of the present invention in conjunction with the accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Attached Figure Description
[0030] Figure 1This is a flowchart of a preferred embodiment of a contract-based process development method of the present invention;
[0031] Figure 2 This is a flowchart of a contract-based process development method according to a preferred embodiment of the present invention;
[0032] Figure 3 This is a preferred embodiment of the contract-based design abstraction level of the present invention;
[0033] Figure 4 This is a contract-based operation template according to a preferred embodiment of the present invention;
[0034] Figure 5 This is a preferred embodiment of the mapping rules from contract-based operations to executable code modules. Detailed Implementation
[0035] The following description, with reference to the accompanying drawings, illustrates several preferred embodiments of the present invention to make its technical content clearer and easier to understand. The present invention can be embodied in many different forms, and the scope of protection of the present invention is not limited to the embodiments mentioned herein.
[0036] In the accompanying drawings, components with the same structure are indicated by the same numerical designation, and components with similar structures or functions are indicated by similar numerical designations. The dimensions and thicknesses of each component shown in the drawings are arbitrary, and the present invention does not limit the dimensions and thicknesses of each component. To make the illustrations clearer, the thickness of some components has been appropriately exaggerated in the drawings.
[0037] like Figure 3 As shown in the figure, the present invention provides a contract-based manufacturing process design method. This method is based on the high-level abstraction of contracts, and the lower-level abstraction is object-oriented design and microservice architecture, which realizes low-code development of industrial edge applications. This allows process engineers without strong programming skills to develop industrial edge applications by simply defining contracts.
[0038] like Figures 1-2 As shown, an embodiment of the present invention provides a contract-based manufacturing process design method comprising the following steps:
[0039] S101: Define a contract for each operation in the manufacturing process and combine the contract with the operation ontology to form a contract-based operation.
[0040] Specifically, the contract includes preconditions, operation entities, invariants, interfaces, and postconditions. The preconditions and postconditions in the contract represent the interfaces through which operations interact.
[0041] Preconditions specify the conditions that must be met before an operation can be executed. Preconditions are checked before each operation is executed. If a precondition is not met, the operation will not be executed.
[0042] The operation entity is the specific operation command;
[0043] Invariants are conditions that must be guaranteed throughout the entire operation.
[0044] An interface is used to expose information to the outside world and is also used for monitoring.
[0045] Postconditions are conditions that must be met at the end of each operation, and are the result of the operation.
[0046] S103: Define the mapping rules from operations to executable code modules.
[0047] S105: Generate the executable code module based on the mapping rules;
[0048] S107: According to the process flow, the output of the preceding code module and the input of the following code module are connected to form a complete executable process flow. The preceding code module is the code module corresponding to the preceding operation, and the following code module is the code module corresponding to the following operation.
[0049] like Figure 4 As shown in the illustration, the contract-based manufacturing process design method provided in this embodiment of the invention also includes a contract-based operation template. This operation template provides a detailed description of each operation, including an operation name, requirements, execution, invariants, interfaces, guarantees, and a termination operation name. The operation name is used to name the operation; requirements include one or more preconditions; execution includes the operation body; invariants include one or more; interfaces include one or more; and guarantees include one or more postconditions. By defining a contract-based operation syntax structure, which uses the operation template, the design of each operation is completed.
[0050] like Figure 5 As shown, the mapping rules from operations to executable code modules include:
[0051] Map the preconditions to the input of the code module, and check whether the preconditions are met when the input is generated;
[0052] The operation ontology and invariants are mapped to the internal algorithms and internal variables of the code module. If the preconditions are met, the internal algorithm is executed.
[0053] The interface and postconditions are mapped to the output of the code module. If the internal algorithm is executed, the corresponding output is generated and the postconditions are satisfied.
[0054] This invention defines a corresponding contract for each operation in the process flow. Using this contract-based process design paradigm, different processes in discrete manufacturing and process industries can be uniformly described, enabling process engineers without strong programming skills to develop industrial edge applications simply by defining contracts. Simultaneously, this invention defines mapping rules from contract-based operations to executable code modules, reducing the workload in the software development phase and ensuring the traceability of the code model.
[0055] The present invention will now be described in detail with reference to preferred embodiments.
[0056] In practical industrial edge application development, object-oriented design cannot use a unified approach to describe different processes across industries. Converting object-oriented process design results into actual code still requires significant effort. Furthermore, in microservice-based application systems, interactions between microservices need to consider various exceptions such as caller failures, overloads, and message loss, making the code logic more complex and increasing system complexity. To address these issues, a preferred embodiment of this invention provides a contract-based industrial process development method, utilizing methods such as... Figure 3 This demonstrates a higher level of abstraction to enable low-code development of industrial edge applications.
[0057] like Figures 1-2 As shown in the preferred embodiment of the present invention, a contract-based industrial process development method includes the following overall process:
[0058] First, this invention defines a corresponding contract for each operation in the process flow, and combines the contract with the operation ontology to form a contract-based operation.
[0059] A contract consists of preconditions, operations, invariants, interfaces, and postconditions.
[0060] 1. Preconditions: Conditions that are checked before each operation is executed. If the preconditions are not met, the operation will not be executed.
[0061] 2. Operation Body: Specific operation instructions.
[0062] 3. Invariants: Conditions that must be guaranteed throughout the entire operation.
[0063] 4. Interface: The operation will expose some information to the outside through the interface, which is usually used for monitoring.
[0064] 5. Postconditions: The conditions that need to be met at the end of each operation, which can be regarded as the result of the operation.
[0065] In a contract, preconditions and postconditions represent the interfaces used by an operation to interact with other operations. They specify the conditions that must be met before the operation is executed and the conditions that must be met after the operation is executed, respectively. These are defined as follows: Figure 4 The syntax structure and operation template for contract-based operations shown can be used by process engineers with relevant industrial knowledge. Figure 4 The method of supplementing and completing each component is used to complete the design of each operation.
[0066] By employing a contract-based process design paradigm, this invention addresses the challenge of using a unified approach to describe diverse processes across different industries, which is insufficient for object-oriented design. It defines a corresponding contract for each operation in the process flow, including preconditions, invariants, interfaces, and postconditions, and combines the contract with the operation ontology to create a contract-based operation. Using this contract-based process design paradigm, different processes in discrete manufacturing and process industries can be uniformly described, enabling process engineers without strong programming skills to develop industrial edge applications simply by defining contracts.
[0067] Furthermore, this invention defines mapping rules from contract-based operations to executable code modules. In such cases... Figure 5 In the mapping rules shown:
[0068] 1. Map preconditions to the input of the code module, and check whether the preconditions are met when the input is generated;
[0069] 2. Map the operation ontology and invariants to the internal algorithms and internal variables of the code module. If the preconditions are met, execute the internal algorithm.
[0070] 3. Map the interface and postconditions to the output of the code module. If the internal algorithm is executed, the corresponding output will be generated, which means that the postconditions have been met.
[0071] By providing conversion rules from contracts to individual code modules, this invention addresses the significant workload required to translate object-oriented process design results into actual code. It defines mapping rules from contract-based operations to executable code modules: mapping preconditions to code module inputs; mapping operation ontology and invariants to code module internal algorithms and variables; and mapping interfaces and postconditions to code module outputs. These mapping rules reduce the workload during software development and ensure the traceability of the code model.
[0072] Finally, after generating the executable code module, the output of the code module corresponding to the preceding operation and the input of the code module corresponding to the following operation are connected according to the process flow designed by the process engineer, so as to obtain a complete executable process flow.
[0073] To address the challenges of microservice interactions, which require consideration of various anomalies such as callee failures, overloads, and message loss, resulting in more complex code logic and increased system complexity, this invention proposes a contract-based code module connection rule. Based on the process flow designed by process engineers, the output of the code module corresponding to the preceding operation and the input of the code module corresponding to the following operation are connected to obtain a complete and executable process flow. This method of automatically generating code by defining contracts improves the efficiency of industrial software development.
[0074] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A contract-based manufacturing process design method, characterized in that, The method, based on the high-level abstraction of the contract, enables low-code development of industrial edge applications. The method includes the following steps: S101: Define a contract corresponding to each operation in the manufacturing process, and combine the contract with the body of the operation to form an operation based on the contract; S103: Define the mapping rules from the operation to the executable code module; S105: Generate the executable code module based on the mapping rules; S107: According to the process flow, the output of the preceding code module and the input of the following code module are connected to form a complete executable process flow. The preceding code module is the code module corresponding to the preceding operation, and the following code module is the code module corresponding to the following operation. in, The contract includes preconditions, operation body, invariants, interfaces, and postconditions. In the contract, the preconditions and postconditions represent the interfaces through which the operations interact. In step S103, the mapping rule includes: The preconditions are mapped to the input of the code module, and the preconditions are checked when the input is generated; The operation ontology and the invariant are mapped to the internal algorithm and internal variables of the code module. If the precondition is met, the internal algorithm is executed. The interface and the postcondition are mapped to the output of the code module. If the internal algorithm is executed, the corresponding output is generated and the postcondition is satisfied. Using a contract-based process design paradigm, different processes in discrete manufacturing and process industries are uniformly described, and industrial edge applications are developed by simply defining contracts. Based on the contract-based code module connection rules, the output of the code module corresponding to the preceding operation and the input of the code module corresponding to the following operation are connected according to the process flow, so as to obtain a complete executable process flow. Code is automatically generated by defining contracts. The method also provides an operation template based on the contract. The operation template describes the operation in detail. The operation template includes an operation name, requirements, execution, invariants, interfaces, guarantees, and end operation name. The operation name is used to name the operation. The requirements include one or more of the preconditions. The execution includes the operation body. The invariants are one or more. The interfaces are one or more. The guarantees include one or more of the postconditions. The method defines an operation syntax structure based on the contract. The operation syntax structure uses the operation template to complete the design of each operation.
2. The method as described in claim 1, characterized in that, The preconditions specify the conditions that must be met before the operation is executed. The preconditions are checked before each operation is executed. If the preconditions are not met, the operation is not executed.
3. The method as described in claim 1, characterized in that, The operation entity is the specific operation instruction.
4. The method as described in claim 1, characterized in that, The invariant is a condition that must be guaranteed throughout the entire execution of the operation.
5. The method as described in claim 1, characterized in that, The interface is used to expose information to the outside world through the operation, and the interface is used for monitoring.
6. The method as described in claim 1, characterized in that, The postconditions are conditions that must be met when each operation ends, and are the result of the operation.
Citation Information
Patent Citations
Enterprise-level system generation method based on demand model
CN113655996A