An automated constructing method of cloud manufacturing service is provided for a distributed system including a virtual machine and a service manager. The method includes: obtaining a library package which is locally built, analyzing the library package to obtain key information, and generating a library information file; automatically generating a project source code file according to the library information file, and generating a web service package according to the project source code file; and deploying, by the service manager, the web service package on the virtual machine.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for automatically constructing cloud manufacturing services for a distributed system comprising a service manager, wherein the method comprises: obtaining a library package which is locally built, analyzing the library package to obtain key information, and generating a library information file according to the key information; automatically generating a project source code file according to the library information file, and generating a web service package according to the project source code file; and deploying the web service package, by the service manager, the web service package on a cyber-physical agent (CPA) which is connected to a tool machine, wherein the distributed system further comprises a service information database having a list comprising a name of the CPA, an internet protocol (IP) address, an operating system (OS) type, a package type, and a service status list, and the step of deploying the web service package on the CPA comprises: sending a request for the IP address and the name of the CPA to the service information database; receiving the IP address and the name of the CPA from the service information database to obtain a received IP address and a received name of the CPA; composing a first Uniform Resource Locator (URL) according to the received IP address, the received name of the CPA, and the name of the library package in the service interface information file; sending a deploying request and the web service package through the first URL; deploying, by the service manager, the web service package on the CPA; and updating, by the service manager, the service information database.
2. The method of claim 1 , wherein the library package comprises at least one package comprising at least one class, and the at least one class comprises at least one function, wherein the key information comprises a name of the library package, a name of the at least one package, a name of the at least one class, a name of the at least one function, and an output parameter type and an input parameter type of the at least one function.
3. The method of claim 2 , wherein the library information file complies with a general data format having a nest structure, and the method further comprises: providing content of the library information file on a user interface for a user to select the at least one package, the at least one class, and the at least one method to obtain a selected package, a selected class, a selected function; and generating a service interface information file according to the selected package, the selected class, and the selected function, wherein the service interface information file complies with the general data format.
4. The method of claim 3 , wherein the service interface information file records: a library package array comprising at least one first element, wherein each of the at least one first element comprises: the name of the library package; an application program interface (API) type; and a package array comprising at least one second element, wherein each of the at least one second element comprises: a name of the selected package; and a class array comprising at least one third element, wherein each of the at least one third element comprises: a name of the selected the class; and a method array comprising at least one fourth element, wherein each of the at least one fourth element comprises a name, the output parameter type, and the input parameter type of the selected the function.
5. The method of claim 4 , wherein the step of automatically generating the project source code file comprises: obtaining a project source code template having a plurality of annotations; obtaining a code lookup table comprising columns of annotated key word, tag, code generation format; and with respect to each of the annotations in the project source code template, searching a corresponding annotated key word in the code lookup table, obtaining at least one string from the service interface information file according to a corresponding tag, and insert the at least one string into corresponding code generation format to generate a piece of code, and replacing the corresponding annotation with the piece of code.
6. The method of claim 5 , wherein the annotations comprises a package import annotation, and the method further comprises: with respect to the package import annotation, obtaining a package name and a class name from the service interface information file; and deleting a filename extension of the class name to obtain the at least one string.
7. The method of claim 5 , wherein the annotations comprises a HyperText Transfer Protocol (HTTP) type annotation, and the method further comprises: with respect to the HTTP type annotation, determining whether the selected method has an input parameter; and if the selected method has the input parameter, setting a HTTP verb as “POST”, or otherwise setting the HTTP verb as “GET”.
8. The method of claim 1 , further comprising: sending a request for a service list to the service information database; receiving the service list and the name of the CAP from the service information database; selecting a service to undeploy; composing a second URL according to the name of the CPA, the IP address, and a name of the service to undeploy; sending a request to the service manager through the second URL; undeploying, by the service manager, the service to undeploy; and updating, by the service manager, the service information database.
9. A cloud manufacturing system, comprising: a distributed system comprising a service manager and a manufacturing service constructor; a tool machine; and a cyber-physical agent (CPA) connected to the tool machine, wherein the manufacturing service constructor obtains a library package which is locally built, analyzes the library package to obtain key information, and generates a library information file according to the key information, wherein the manufacturing service constructor automatically generates a project source code file according to the library information file, and generates a web service package according to the project source code file, wherein the distributed system further comprises a service information database having a list comprising a name of the CPA, an internet protocol (IP) address, an operating system (OS) type, a package type, and a service status list, wherein the manufacturing service constructor sends a request for the IP address and the name of the CPA to the service information database, wherein the manufacturing service constructor receives the IP address and the name of the CPA from the service information database to obtain a received IP address and a received name of the CPA, wherein the manufacturing service constructor composes a first Uniform Resource Locator (URL) according to the received IP address, the received name of the CPA, and the name of the library package in the service interface information file, wherein the manufacturing service constructor sends a deploying request and the web service package through the first URL, wherein the service manager deploys the web service package on the CPA, and updates the service information database.
10. The cloud manufacturing system of claim 9 , wherein the library package comprises at least one package comprising at least one class, and the at least one class comprises at least one function, wherein the key information comprises a name of the library package, a name of the at least one package, a name of the at least one class, a name of the at least one function, and an output parameter type and an input parameter type of the at least one function.
11. The cloud manufacturing system of claim 10 , wherein the library information file complies with a general data format having a nest structure, wherein the manufacturing service constructor performs steps of: providing content of the library information file on a user interface for a user to select the at least one package, the at least one class, and the at least one method to obtain a selected package, a selected class, a selected function; and generating a service interface information file according to the selected package, the selected class, and the selected function, wherein the service interface information file complies with the general data format.
12. The cloud manufacturing system of claim 11 , wherein the service interface information file records: a library package array comprising at least one first element, wherein each of the at least one first element comprises: the name of the library package; an application program interface (API) type; and a package array comprising at least one second element, wherein each of the at least one second element comprises: a name of the selected package; and a class array comprising at least one third element, wherein each of the at least one third element comprises: a name of the selected the class; and a method array comprising at least one fourth element, wherein each of the at least one fourth element comprises a name, the output parameter type, and the input parameter type of the selected the function.
13. The cloud manufacturing system of claim 12 , wherein the manufacturing service constructor performs steps of: obtaining a project source code template having a plurality of annotations; obtaining a code lookup table comprising columns of annotated key word, tag, code generation format; and with respect to each of the annotations in the project source code template, searching a corresponding annotated key word in the code lookup table, obtaining at least one string from the service interface information file according to a corresponding tag, and insert the at least one string into corresponding code generation format to generate a piece of code, and replacing the corresponding annotation with the piece of code.
14. The cloud manufacturing system of claim 13 , wherein the annotations comprise a package import annotation and the manufacturing service constructor performs steps of: with respect to the package import annotation, obtaining a package name and a class name from the service interface information file; and deleting a filename extension of the class name to obtain the at least one string.
15. The cloud manufacturing system of claim 13 , wherein the annotations comprises a HyperText Transfer Protocol (HTTP) type annotation, and the manufacturing service constructor performs steps of: with respect to the HTTP type annotation, determining whether the selected method has an input parameter; and if the selected method has the input parameter, setting a HTTP verb as “POST”, or otherwise setting the HTTP verb as “GET”.
16. The cloud manufacturing system of claim 9 , wherein the manufacturing service constructor sends a request for a service list to the service information database, wherein the manufacturing service constructor receives the service list and the name of the CAP from the service information database, wherein the manufacturing service constructor selects a service to undeploy, wherein the manufacturing service constructor composes a second URL according to the name of the CPA, the IP address, and a name of the service to undeploy, wherein the manufacturing service constructor sends a request to the service manager through the second URL, wherein the service manager undeploys the service to undeploy and updates the service information database.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
March 22, 2018
April 14, 2020
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.