Factory Microservice System, Method, Device, and Storage Medium
By adopting a hierarchical service cluster architecture in the IT system of manufacturing enterprises, the problem of complexity of distributed transactions after the introduction of the microservice architecture is solved, and the consistency of distributed transactions and system reliability is improved.
Patent Information
- Application Number
- CN202110665661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-16
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-06-16
AI Technical Summary
When introducing the Internet's microservice architecture into the IT systems of manufacturing companies, frequent inter-service interactions lead to the complexity of distributed transactions.
The hierarchical service cluster architecture is adopted, including web layer cluster, gateway layer cluster and service layer cluster. Login information is verified through the web layer, the gateway layer verifies access permission information, the service layer cluster matches and provides target services to ensure the consistency of distributed transactions.
Through the hierarchical service cluster architecture, the problem of complexity of distributed transactions is solved, the consistency of distributed transactions is ensured, and the reliability of the system is improved.
Smart Images

Figure CN115484303B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a factory microservices system, method, device, and storage medium. Background Art
[0002] The Internet Technology (IT) systems adopted by traditional manufacturing enterprises are usually single-machine microcomputer systems, which have the characteristics of automatically, rapidly, and accurately processing information. However, during the production and manufacturing process, when the single-machine microcomputer system is applied, all background functions run in the same Java Virtual Machine (JVM). This leads to the situation that once the JVM fails, all background functions cannot operate normally, affecting the normal operation of the factory.
[0003] To improve this defect of the single-machine microcomputer system, the microservices architecture of the Internet can be introduced into the IT system of manufacturing enterprises. However, due to the interlocking nature of the production and manufacturing process in manufacturing enterprises, that is, the correlation between each step of operation is relatively strong, while the microservices architecture of the Internet has the characteristics of single responsibility and high cohesion. When introducing the microservices architecture of the Internet into the IT system of manufacturing enterprises, it is easy to cause the problem of complex distributed transactions due to frequent interactions between services. Summary of the Invention
[0004] This application provides a factory microservices system, method, device, and storage medium, aiming to solve the problem that when the microservices architecture of the Internet is introduced into the IT system of manufacturing enterprises, complex distributed transactions are caused due to frequent interactions between services.
[0005] In a first aspect, this application provides a factory microservices system, including a hierarchical service cluster, and the hierarchical service cluster includes a web layer cluster, a gateway layer cluster, and a service layer cluster;
[0006] The web layer cluster is used to obtain a target request initiated by a target user, where the target request carries login information and target service information, and verify the login information. If the verification is passed, the target service information is sent to the gateway layer cluster;
[0007] The gateway layer cluster is used to parse the target service information to obtain a target interface and access permission information, where the target interface is the application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface, and verify the access permission information. If the verification is passed, the target interface is forwarded to the service layer cluster;
[0008] The service layer cluster is used to match and provide the target service according to the target interface.
[0009] In a possible implementation manner of the present application, the service layer cluster includes a business service cluster, and the business service cluster includes multiple business services. Among them, the multiple business services include associated equipment inspection services, fault management services, or maintenance management services. Moreover, each business service respectively includes multiple associated sub-services, and the target service is one of the multiple business services.
[0010] In a possible implementation manner of the present application, the service layer cluster further includes a basic service cluster, and the basic service cluster includes multiple basic services. Among them, the multiple basic services include login services, email services, or internationalization services, and the target service is one of the multiple basic services.
[0011] In a possible implementation manner of the present application, the layered service cluster further includes a storage layer cluster, and the storage layer cluster is a database cluster. The storage layer cluster is used to store the service data of the service layer cluster.
[0012] In a possible implementation manner of the present application, the web page layer cluster is further used to store the login permissions corresponding to the login information.
[0013] In a second aspect, the present application further provides a factory microservice method, which is applied to the factory microservice system in the first aspect. The method includes:
[0014] Invoking the web page layer cluster to obtain a target request initiated by a target user, where the target request carries login information and target service information;
[0015] Invoking the web page layer cluster to verify the login information. If the verification passes, then invoking the gateway layer cluster to parse the target service information to obtain a target interface and access permission information, where the target interface is the application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface;
[0016] Invoking the gateway layer cluster to check the access permission information. If the check passes, then returning the target interface to the target user;
[0017] Invoking the service layer cluster to provide the target service for the target user according to the target interface.
[0018] In a possible implementation manner of the present application, invoking the web page layer cluster to verify the login information includes:
[0019] Invoking the web page layer cluster to check whether the login information is empty information. If the login information is empty information, then returning the login page to the target user;
[0020] Otherwise, invoking the web page layer cluster to verify whether the login information is correct. If the login information is incorrect, then returning the login page to the target user;
[0021] If the login information is correct, the verification passes.
[0022] In a possible implementation manner of the present application, after the login information verification passes, the method further includes:
[0023] Invoking the web layer cluster to store the login permissions corresponding to the login information, and returning the login permissions to the target user.
[0024] In a third aspect, the present application further provides a factory microservice device, which includes any one or more of a web layer cluster, a gateway layer cluster, and a service layer cluster. The factory microservice device includes:
[0025] One or more processors;
[0026] A memory; and
[0027] One or more applications, where one or more applications are stored in the memory and are configured to be executed by the processor to implement the factory microservice method in the second aspect.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is loaded by the processor to execute the steps in the factory microservice method in the second aspect.
[0029] 1. In the present application, the hierarchical service clusters of the factory microservice system include a web layer cluster, a gateway layer cluster, and a service layer cluster. The above three clusters each perform their own functions and have the advantages of fault isolation and high availability of the microservice architecture. By verifying the login information through the web layer cluster, verifying the access permission information through the gateway layer cluster, and matching and providing the target service through the service layer cluster, the target user can access the target service to execute the business functions in the factory production and manufacturing process. By providing the target service through the service layer cluster, it can solve the problem that when introducing the microservice architecture of the Internet into the IT system of manufacturing enterprises in the prior art, due to frequent interactions between services, the distributed transaction becomes complicated, ensuring the consistency of the distributed transaction and improving the reliability of the system.
[0030] 2. In the present application, the service layer cluster includes a business service cluster, and various business services in the business service cluster may include associated equipment inspection services, fault management services, or maintenance management services, etc. And each business service also includes a plurality of associated sub-services respectively. That is, in the present application, putting strongly related multiple sub-services into the same business service can reduce the calls between business services and further ensure the consistency of the distributed transaction.
[0031] 3. In this application, the service layer cluster further includes a basic service cluster. Since the basic services are highly independent, in this application, the basic services are separated from the business services, which enables users to access the basic services more conveniently and also facilitates the invocation of the basic services by other systems outside the factory microservice system, improving the convenience of the system and avoiding duplicate development.
[0032] 4. In this application, the layered service cluster further includes a storage layer cluster, and the storage layer cluster is a database cluster. Different from the microservice architecture that divides independent data repositories according to services, the factory microservice system of this application does not split the database according to services, but the entire service layer cluster shares the same storage layer cluster, which can ensure the consistency of system data, reduce the difficulty of data integration, facilitate data storage management and maintenance, and reduce the cost of data storage management and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] To more clearly illustrate the technical solutions in this application, the following will briefly introduce the drawings required for the description of this application. Obviously, the drawings in the following description are only some embodiments of this application. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0034] Figure 1 is a schematic structural diagram of a factory microservice system provided in an embodiment of this application;
[0035] Figure 2 is another schematic structural diagram of a factory microservice system provided in an embodiment of this application;
[0036] Figure 3 is a schematic flowchart of a factory microservice method provided in an embodiment of this application;
[0037] Figure 4 is a schematic flowchart of verifying login information in an embodiment of this application;
[0038] Figure 5 is a schematic structural diagram of a factory microservice device provided in an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] The following will clearly and completely describe the technical solutions in this application with reference to the drawings in this application. Obviously, the described embodiments are only some embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of this application.
[0040] In the description of the present application, it should be understood that the orientation or positional relationships indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present application. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically defined.
[0041] In the present application, the term "exemplary" is used to mean "serving as an example, illustration, or explanation". Any embodiment described as "exemplary" in the present application is not necessarily to be construed as more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the present application. In the following description, details are set forth for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the present application can be practiced without these specific details. In other instances, well-known structures and processes are not described in detail to avoid unnecessary details from obscuring the description of the present application. Therefore, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed in the present application.
[0042] The present application provides a factory microservice system, method, device, and storage medium, which will be described in detail below respectively.
[0043] Please refer to Figure 1 , Figure 1 FIG. 13 is a schematic structural diagram of a factory microservice system provided by an embodiment of the present application. The factory microservice system may include a layered service cluster 100 and a client 200. Among them, the layered service cluster 100 is communicatively connected to the client 200. The layered service cluster 100 may include a web layer cluster 101, a gateway layer cluster 102, and a service layer cluster 103. And the web layer cluster 101 is communicatively connected to the gateway layer cluster 102, and the gateway layer cluster 102 is communicatively connected to the service layer cluster 103.
[0044] In an embodiment of the present application, the hierarchical service cluster 100 is mainly used to obtain a target request initiated by a target user, where the target request carries login information and target service information; verify the login information, and if the verification is passed, parse the target service information to obtain a target interface and access permission information, where the target interface is an application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface; verify the access permission information, and if the verification is passed, return the target interface to the target user to provide the target service for the target user through the target interface.
[0045] In an embodiment of the present application, the hierarchical service cluster 100 can be attached to a server, and the attached server can be an independent server, or a server network or server cluster composed of servers. For example, the server to which the hierarchical service cluster 100 is attached in the present application includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing.
[0046] In an embodiment of the present application, network communication can be achieved between the hierarchical service cluster 100 and the client 200 through any communication method, including but not limited to mobile communication based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP / IP protocol suite (TCP / IP) and User Datagram Protocol (UDP). The client 200 can request to access the service in the hierarchical service cluster 100 through the above communication methods.
[0047] In an embodiment of the present application, the above client 200 can be a general computer device or a dedicated computer device. In a specific implementation, the client 200 can be a handheld computer, a personal digital assistant (PDA), a tablet computer, a mobile phone terminal, or other devices with communication functions, etc. The present application does not limit the type of the above client 200.
[0048] In the embodiment of the present application, the web layer cluster 101 can be used to obtain a target request initiated by a target user. The target request may carry login information and target service information. The web layer cluster 101 can verify the login information. If the verification is passed, the target service information is sent to the gateway layer cluster 102. Specifically, the target user can request to access the service in the service layer cluster 103 through the client 200. For example, the target user initiates a target request through the browser of a personal computer (PC), or can also initiate a target request through the mobile client downloaded on the mobile phone terminal.
[0049] Since the target user wants to access the target service provided by the factory microservice system, after receiving the target request, the web layer cluster 101 can first identify the identity of the target user to determine whether the target user is a registered legal user of the factory microservice system. Therefore, in the embodiment of the present application, the target request may carry login information, and the login information can be used by the web layer cluster 101 to verify whether the target user is a registered legal user of the factory microservice system; and since the target service that the target user wants to access is provided by the factory microservice system and there can be multiple services provided by the factory microservice system, in the embodiment of the present application, the target request may also carry target service information, and the type of the target service that the target user wants to access can be identified through the target service information. When the web layer cluster 101 verifies the login information and the login information carried in the target request passes the verification, that is, it is confirmed that the target user who initiates the target request is a registered legal user of the factory microservice system. At this time, the web layer cluster 101 can send the target service information to the gateway layer cluster 102.
[0050] In the embodiment of the present application, the gateway layer cluster 102 can be used to parse the target service information to obtain the target interface and access permission information. Among them, the target interface is the application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface. Then, the access permission information is verified. If the verification passes, the target interface is forwarded to the service layer cluster 103. Specifically, since there are many production processes in manufacturing enterprises, there are various different positions, and each position also has different levels. Therefore, the gateway layer cluster 102 can verify the access permission of the target user to the target service, and judge whether the target service can be accessed according to the position and level of the target user. In the embodiment of the present application, the target service information may carry the access permission information of the target user to the target service. Therefore, in the embodiment of the present application, after receiving the target service information sent by the web layer cluster 101, the gateway layer cluster 102 can first parse the target service information to obtain the access permission information carried in the target service information, so as to verify the access permission of the target user for the target service according to the access permission information. If the verification passes, it is confirmed that the target user has the access permission to access the target service. At this time, the gateway layer cluster 102 can forward the target interface corresponding to the target service to the service layer cluster 103. And the target interface is the application program interface of the target service. Therefore, the target user can call the target service through the target interface.
[0051] In the embodiment of the present application, the service layer cluster 103 can be used to match and provide the target service according to the target interface. Specifically, in the present application, the service layer cluster 103 may include various different types of services, and the target service may be any one of the various services. After the gateway layer cluster 102 forwards the target interface corresponding to the target service to the service layer cluster 103, the service layer cluster 103 can find the target service that matches it according to the target interface, so as to provide the target service to the target user through the target interface.
[0052] In the embodiments of the present application, the hierarchical service cluster 100 of the factory microservice system includes a web layer cluster 101, a gateway layer cluster 102, and a service layer cluster 103. The above three clusters each perform their own functions and have the advantages of fault isolation and high availability of the microservice architecture. By verifying the login information through the web layer cluster 101, verifying the access permission information through the gateway layer cluster 102, and matching and providing the target service through the service layer cluster 103, the target user can access the target service to execute the business functions in the factory production and manufacturing process. By providing the target service through the service layer cluster 103, it can solve the problem that when introducing the microservice architecture of the Internet into the IT system of manufacturing enterprises in the prior art, due to frequent interactions between services, the distributed transaction becomes complicated, ensuring the consistency of the distributed transaction and improving the reliability of the system.
[0053] It should be noted that Figure 1 The structural schematic diagram of the factory microservice system shown is only an example. The factory microservice system and scenarios described in the present application are to more clearly illustrate the technical solutions of the present application and do not constitute a limitation on the technical solutions provided by the present application. Those of ordinary skill in the art know that with the evolution of the factory microservice system and the emergence of new business scenarios, the technical solutions provided by the present application are equally applicable to similar technical problems.
[0054] As Figure 2 shown, it is another structural schematic diagram of the factory microservice system provided in the embodiments of the present application. In some embodiments of the present application, the target user can access the target service through the browser or mobile terminal of the user terminal 200. The web layer cluster 101 can be a World Wide Web (Web) layer cluster, and this Web layer cluster can be used to provide Web static services. In the present application, Web static services can be constructed by existing language description methods for building Web page content, such as HTML5, Cascading Style Sheets level 3 technology CSS3, and images Images.
[0055] The target user can initiate an access request by accessing the Web static service. The Web static service responds to the target request. First, it verifies the login information carried in the target request. If the login information is empty, that is, the target user has not logged in to the factory microservice system yet, it can jump to the login page to instruct the target user to perform a login operation. If the login information is not empty, but it is verified that the login information is incorrect, that is, the login information carried in the target request is inconsistent with the login information stored internally in the factory microservice system, it can also jump to the login page to instruct the target user to log in again. If the login information is not empty and the login information verification passes, the Web static service can send the target service information carried in the target request to the gateway layer cluster 102. Specifically, the Web static service and the gateway layer cluster 102 can interact through the JSON data format in the existing JavaScript Object Notation, that is, the Web static service converts the target service information into the JSON data exchange format and forwards it to the gateway layer cluster 102.
[0056] In some embodiments of the present application, the web layer cluster 101 is further configured to store the login permissions corresponding to the login information. Specifically, as Figure 2 shown, in the embodiments of the present application, after the Web static service responds to the target request and the login information verification passes, the Web static service can store the login permissions corresponding to the login information, and can also return the login permissions to the user terminal 200, so that when the target user accesses the Web static service or the target service again through the user terminal 200 next time, the login permissions can be carried, avoiding logging in again, which can improve the convenience of the user and optimize the user experience.
[0057] In some embodiments of the present application, the gateway layer cluster 102 can be an Application Programming Interface (API) service gateway. The target service information sent by the Web static service to the API service gateway can carry access permission information. The API service gateway verifies the access permission information. If the verification fails, the failure result can be fed back to the user terminal 200 through the Web static service. If the verification passes, the target interface can be forwarded to the service layer cluster 103 through routing. The Web static service can access the service layer cluster 103 through the API service gateway to initialize the page of the Web static service and execute the business functions related to the target service, that is, the service layer cluster 103 can provide API services for the Web static service through the API service gateway, and the API service is the target service corresponding to the target interface.
[0058] Please continue to refer to Figure 2, in some embodiments of the present application, the service layer cluster 103 may include a business service cluster, and the business service cluster may include multiple business services. Among them, each of the multiple business services may separately include multiple sub-services that are related to each other in terms of data. The target service may be one of the multiple business services. Specifically, in the embodiments of the present application, the service layer cluster 103 may divide business services according to business function modules, and put multiple strongly related sub-services with high relevance into the same business service, which can reduce the calls between business services and further ensure the consistency of distributed transactions. For example, taking the equipment preventive maintenance system of a manufacturing enterprise as an example, the business service cluster may include multiple business services such as equipment inspection business service, intelligent inspection business service, maintenance management business service, missing management business service, fault management business service, and component management business service. Among them, taking the fault management business service as an example, the fault management business service may include strongly related sub-services such as fault discovery business, fault troubleshooting business, and fault diagnosis business. In the embodiments of the present application, the Business Process Execute Language (BPEL) can be used to execute the methods in the Service layer of Java inside the business service, reducing the code coupling inside the business service and improving the code reuse rate; and the automatic code generation function of the Mybatis-Plus enhancement toolkit is used to implement the addition, deletion, modification, and query of a single table without developers writing code manually for BPEL to call; in the embodiments of the present application, the joint query function can load Structured Query Language (SQL) statements from data to the cache for developers to use, improving the convenience of the system.
[0059] In addition, the service layer cluster 103 may further include a basic service cluster, and the basic service cluster may include multiple basic services. The target service may also be one of the multiple basic services. Specifically, as Figure 2 shown, the basic service cluster may include basic services such as personnel information, login service, internationalization, email service, process approval, and SQL service. Since the independence of these basic services is relatively strong, in the present application, the basic services are separated from the business services, which can make it more convenient for users to access the basic services, and is also beneficial for other systems outside the factory microservice system to call the basic services, improving the convenience of the system and avoiding repeated development; in the present application, public code can also be stored through a public module for each business service and each basic service to introduce and use, further improving the code reuse rate.
[0060] Please continue to refer to Figure 2, in some embodiments of the present application, the hierarchical service cluster 100 may further include a storage layer cluster 104, and the storage layer cluster 104 is a database cluster DB Cluster. The storage layer cluster 104 can be used to store the service data of the service layer cluster 103. To ensure the robustness of the factory microservice system, in this embodiment, the database cluster DBCluster may include no less than two databases DB to store the service data through the databases DB, such as Figure 2 As shown, in this embodiment, the database cluster DB Cluster includes 4 databases, namely database DB1, database DB2, database DB3, and database DB4. It should be noted that the 4 databases here are only an example, and the number of databases in the database cluster DB Cluster can be selected according to the specific application scenario, and no specific limitation is made here. Different from the microservice architecture that divides independent data repositories according to services, the factory microservice system of the present application does not split the database according to services, but the entire service layer cluster 103 shares the same storage layer cluster 104, which can ensure the consistency of system data, reduce the difficulty of data integration, facilitate data storage management and maintenance, and reduce the cost of data storage management and maintenance.
[0061] Based on the above factory microservice system, an embodiment of the present application further provides a factory microservice method. The factory microservice method is applied to the factory microservice system, and the factory microservice method includes: calling the web layer cluster to obtain a target request initiated by a target user, where the target request carries login information and target service information; calling the web layer cluster to verify the login information, and if the verification is passed, calling the gateway layer cluster to parse the target service information to obtain a target interface and access permission information, where the target interface is the application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface; calling the gateway layer cluster to verify the access permission information, and if the verification is passed, returning the target interface to the target user; calling the service layer cluster to provide the target service for the target user according to the target interface.
[0062] Such as Figure 3 As shown, it is a schematic flow diagram of the factory microservice method provided in an embodiment of the present application. It should be noted that although the logical order is shown in the flow schematic diagram, in some cases, the steps shown or described may be executed in a different order than here. The factory microservice method is applied to the factory microservice system, and the factory microservice method may include:
[0063] S301. Call the web layer cluster to obtain a target request initiated by a target user, where the target request carries login information and target service information.
[0064] In the embodiments of the present application, the target request can be obtained passively or actively. For example, passive acquisition can be that the target user directly initiates a target request through the browser of a personal computer (PC), or directly initiates a target request through the mobile client downloaded on the mobile phone terminal. At this time, the hierarchical service cluster can obtain the target request; while active acquisition can be that the target request initiated by the target user is temporarily stored in the memory, and the web layer cluster in the hierarchical service cluster can judge whether there is an unprocessed target request in it by regularly accessing the memory. If there is an unprocessed target request, the web layer cluster actively obtains the target request. The login information carried by the target request can be the login account and login password of the target user, and the target service information can be the relevant information of the target service that the target user wants to access.
[0065] For example, when the target user registers in the factory microservice system, it sets its user name, that is, the login account, as user1, and the corresponding login password as code1. And the target service that it wants to access this time is S1, and its corresponding target service information is TY1. Then the target request can be expressed as G1((user1, code1), (TY1)).
[0066] S302. Invoke the web layer cluster to verify the login information. If the verification passes, then invoke the gateway layer cluster to parse the target service information to obtain the target interface and access permission information. Among them, the target interface is the application program interface corresponding to the target service that the target user wants to access, and the access permission information is the access permission information of the target user for the target interface.
[0067] Since the target user wants to access the target service provided by the factory microservice system, therefore, after receiving the target request, the identity of the target user can be recognized first to determine whether the target user is a registered and legal user of the factory microservice system. When the login information verification passes, that is, it is confirmed that the target user who initiates the target request is a registered and legal user of the factory microservice system. At this time, the target service information can be parsed to obtain the target interface and access permission information; in addition, after the login information verification passes, the gateway layer cluster can also store the login permission corresponding to the login information and return the login permission to the target user for the next login use.
[0068] For example, the target request is G1((user1, code1), (TY1)), where user1 represents the login account, code1 represents the login password, and TY1 represents the target service information. The login password corresponding to the login account user1 recorded in the factory microservice system is xxx. Therefore, after receiving the target request, when the web layer cluster verifies the login information, it can search for the login password xxx that matches the login account user1 in the factory microservice system based on the login account user1 carried in the target request, and then match the login password xxx with code1 bit by bit. If xxx is exactly the same as code1, it indicates that the login password is correct, that is, the verification passes; otherwise, the verification fails.
[0069] Since there are many production processes in manufacturing enterprises, there are various different positions, and each position also has different levels. Therefore, it is possible to verify the access permission of the target user to the target service, and determine whether the target service can be accessed based on the position and level of the target user. Therefore, in the embodiment of the present application, the target service information may carry the access permission information of the target user to the target service. By parsing the target service information, the access permission information carried in the target service information can be obtained. For example, after the login information is verified, the target service information TY1 can be parsed to obtain the target interface (such as "T1") and the access permission information (such as "C1").
[0070] S303. Call the gateway layer cluster to verify the access permission information. If the verification passes, return the target interface to the target user.
[0071] S304. Call the service layer cluster to provide the target service for the target user according to the target interface.
[0072] In the embodiment of the present application, after parsing the target service information, the access permission information carried in the target service information is obtained, so as to verify the access permission of the target user to the target service according to the access permission information. If the verification passes, it is confirmed that the target user has the access permission to access the target service. At this time, the target interface corresponding to the target service can be returned to the target user. The target interface is the application program interface of the target service, so as to provide the target service for the target user through the target interface.
[0073] For example, in the factory microservices system, the access privilege level corresponding to the logged-in account user1 is L2. The services that can be accessed corresponding to this access privilege level L2 are services S1 to S5. After obtaining the target interface (such as "T1") and access privilege information (such as "C1"), first, the access privilege information C1 can be verified to determine whether the target service S1 corresponding to the target interface T1 is among the services that can be accessed corresponding to the access privilege level L2 of the logged-in account user1. Since the services that can be accessed corresponding to the access privilege level L2 are services S1 to S5, therefore, the target service S1 corresponding to the target interface T1 is among the services that can be accessed corresponding to the access privilege level L2 of the logged-in account user1, that is, the verification passes. Then, the target interface T1 can be returned to the target user to provide the target service S1 to the target user through the target interface T1.
[0074] In the embodiments of the present application, the factory microservices system has the advantages of fault isolation and high availability of the microservices architecture, and can solve the problem that when the microservices architecture of the Internet is introduced into the IT system of a manufacturing enterprise in the prior art, due to frequent interactions between services, the distributed transaction becomes complicated, ensuring the consistency of the distributed transaction and improving the reliability of the system.
[0075] As Figure 4 shown, it is a schematic flowchart of verifying login information in the embodiments of the present application. In some embodiments of the present application, calling the web layer cluster to verify the login information may further include:
[0076] S401. Call the web layer cluster to check whether the login information is empty. If the login information is empty, return the login page to the target user;
[0077] S402. Otherwise, call the web layer cluster to verify whether the login information is correct. If the login information is incorrect, return the login page to the target user;
[0078] If the login information is correct, the verification passes.
[0079] In the embodiments of the present application, the reason for the failure of login information verification may be that the user has not logged in, or the login information carried in the target request is incorrect. For example, the login account and login password do not match, etc. Therefore, when verifying the login information, first, it is possible to check whether the login information is empty. If the login information is empty, that is, the target user has not logged in to the factory microservice system, the system can jump to the login page to prompt the target user to perform a login operation. If the login information is not empty and the login information is inconsistent with the login information stored internally in the factory microservice system, that is, the login information is incorrect, the system can also jump to the login page to prompt the target user to log in again. If the login information is not empty and the login information is consistent with the login information stored internally in the factory microservice system, then the login information is correct, that is, the verification is passed.
[0080] For example, user1 represents the login account in the login information of the target request, and code1 represents the login password. The login password corresponding to the login account user1 recorded in the factory microservice system is xxx. Therefore, after receiving the target request and verifying the login information, first, it is possible to check whether the login information is empty, that is, whether the login account user1 and the login password code1 are not filled in. If one or both of the login account user1 and the login password code1 are empty, it means that the login information is empty, and the login page is returned to the target user. If both the login account user1 and the login password code1 are filled in, it is further verified whether the login password code1 is consistent with the login password xxx corresponding to the login account user1 recorded in the factory microservice system. If they are not consistent, it indicates that the login password is incorrect. At this time, the login page can also be returned to the target user. If the login password code1 is consistent with xxx, it indicates that the login password is correct, that is, the login information is correct. After the verification is passed, the web layer cluster can be called to store the login account user1 and the login password code1 to store the login permissions corresponding to the login information, and the login permissions can also be returned to the target user for use in the next login.
[0081] To better implement the factory microservice method of the present application, based on the factory microservice method, the present application also provides a factory microservice device, which may include any one or more of a web layer cluster, a gateway layer cluster, and a service layer cluster. The factory microservice device includes:
[0082] One or more processors 501;
[0083] A memory 502; and
[0084] One or more applications, where the one or more applications are stored in the memory 502 and configured to execute the steps in the factory microservice method of any one of the embodiments of the above factory microservice system by the processor 501.
[0085] As Figure 5 shown, it shows a schematic structural diagram of an embodiment of the factory microservice device involved in the present application. Specifically:
[0086] The device may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, an input unit 504, and other components. Those skilled in the art can understand that Figure 5 the device structure shown in
[0087] does not constitute a limitation on the device, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Among them:
[0088] The processor 501 is the control center of the device, connecting various parts of the entire device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, it executes various functions of the device and processes data, thereby monitoring the device as a whole. Optionally, the processor 501 may include one or more processing cores; the processor 501 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 501 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 501.
[0088] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0089] The device further includes a power supply 503 for powering each component. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 503 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0090] The device may also include an input unit 504 and an output unit 505. The input unit 504 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0091] Although not shown, the device may also include a display unit, etc., which will not be elaborated here. Specifically in this application, the processor 501 in the device will load the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 will run the application programs stored in the memory 502 to implement various functions as follows:
[0092] Call the web layer cluster to obtain the target request initiated by the target user, where the target request carries login information and target service information;
[0093] Call the web layer cluster to verify the login information. If the verification passes, call the gateway layer cluster to parse the target service information to obtain the target interface and access permission information, where the target interface is the application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface;
[0094] Call the gateway layer cluster to verify the access permission information. If the verification passes, return the target interface to the target user;
[0095] The service layer cluster is called to provide target services to target users according to the target interface.
[0096] A person skilled in the art will appreciate that all or part of the steps in the various methods described above may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0097] To this end, the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any factory microservice method provided in the present application. For example, the computer program loaded by the processor can execute the following steps:
[0098] Calling the web page layer cluster to obtain a target request initiated by a target user, wherein the target request carries login information and target service information;
[0099] Call the web page layer cluster to verify the login information. If the verification is successful, call the gateway layer cluster to parse the target service information to obtain the target interface and access permission information, where the target interface is the application program interface corresponding to the target service that the target user wants to access, and the access permission information is the access permission information of the target user for the target interface;
[0100] Call the gateway layer cluster to verify the access permission information. If the verification passes, return the target interface to the target user.
[0101] The service layer cluster is called to provide target services to target users according to the target interface.
[0102] Due to the instructions stored in the computer-readable storage medium, the present application can be executed. Figures 3 to 4 Corresponding to the steps in the factory microservice method in any embodiment, therefore, the present application can be implemented as follows Figures 3 to 4 For the beneficial effects that can be achieved by the factory microservice method in any embodiment, please refer to the previous description in detail and will not be repeated here.
[0103] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0104] In specific implementation, each of the above units or structures can be implemented as an independent entity, or can be arbitrarily combined and implemented as the same or several entities. For the specific implementation of each of the above units or structures, reference can be made to the previous embodiments, which will not be elaborated here.
[0105] The above has introduced in detail a factory microservice system, method, device and storage medium provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The above description is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A factory microservice system, characterized in that, The system includes a hierarchical service cluster, and the hierarchical service cluster includes a web layer cluster, a gateway layer cluster, and a service layer cluster; The web layer cluster is used to obtain a target request initiated by a target user. The target request carries login information and target service information, and verifies the login information. If the verification is passed, the target service information is sent to the gateway layer cluster; The gateway layer cluster is used to parse the target service information to obtain a target interface and access permission information. The target interface is an application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface, and verifies the access permission information. If the verification is passed, the target interface is forwarded to the service layer cluster; The service layer cluster is used to match and provide the target service according to the target interface; The service layer cluster includes a business service cluster, and the business service cluster includes multiple business services. The multiple business services in the business service cluster include multiple sub-services that are associated with each other in terms of data; The service layer cluster further includes a basic service cluster, and the basic services are separated from the business services; The hierarchical service cluster further includes a storage layer cluster, and the entire service layer cluster shares the same storage layer cluster.
2. The system according to claim 1, wherein The multiple business services include associated equipment inspection services, fault management services, or maintenance management services. Moreover, each business service respectively includes multiple associated sub-services, and the target service is one of the multiple business services.
3. The system according to claim 2, wherein The basic service cluster includes multiple basic services. Among them, the multiple basic services include login services, email services, or internationalization services, and the target service is one of the multiple basic services.
4. The system according to claim 1, wherein The storage layer cluster is a database cluster, and the storage layer cluster is used to store the service data of the service layer cluster.
5. The system according to claim 1, wherein The web layer cluster is further used to store the login permissions corresponding to the login information.
6. A factory microservices method, characterized in that, Applied to the factory microservice system according to any one of claims 1-5, the method includes: Invoking the web layer cluster to obtain a target request initiated by a target user. The target request carries login information and target service information; Invoking the web layer cluster to verify the login information. If the verification is passed, invoking the gateway layer cluster to parse the target service information to obtain a target interface and access permission information. The target interface is an application program interface corresponding to the target service to be accessed by the target user, and the access permission information is the access permission information of the target user for the target interface; Invoking the gateway layer cluster to verify the access permission information. If the verification is passed, returning the target interface to the target user; Invoking the service layer cluster to provide the target service for the target user according to the target interface; The service layer cluster includes a business service cluster, and the business service cluster includes multiple business services. The multiple business services in the business service cluster include multiple sub-services that are associated with each other in terms of data; The service layer cluster further includes a basic service cluster, which is separated from the business services; The hierarchical service cluster further includes a storage layer cluster, and the entire service layer cluster shares the same storage layer cluster.
7. The method according to claim 6, characterized in that, The invoked web page layer cluster verifies the login information, including: Invoking the web page layer cluster to check whether the login information is empty. If the login information is empty, return the login page to the target user; Otherwise, invoke the web page layer cluster to verify whether the login information is correct. If the login information is incorrect, return the login page to the target user; If the login information is correct, the verification passes.
8. The method according to claim 6, characterized in that, After the login information verification passes, the method further includes: Invoking the web page layer cluster to store the login permissions corresponding to the login information and return the login permissions to the target user.
9. A factory microservice device, characterized in that, The factory microservice device includes any one or more of a web page layer cluster, a gateway layer cluster, and a service layer cluster. The factory microservice device includes: One or more processors; A memory; and One or more applications, where the one or more applications are stored in the memory and configured to be executed by the processor to implement the factory microservice method according to any one of claims 6 to 8.
10. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is loaded by the processor to execute the steps in the factory microservice method according to any one of claims 6 to 8.
Citation Information
Patent Citations
The method is applied to access client authentication system of micro-service architecture
CN112564916A