A discovery method, apparatus, device and storage medium for industrial applications
By adding a registration service to the container orchestration configuration file and utilizing the MQQT bus and discovery service, the code modification problem of registration and discovery in industrial application platforms was solved, enabling comprehensive awareness and stability assessment of applications and reducing the impact on the original system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BINZHOU WEIQIAO NATIONAL SCIENCE & TECHNOLOGY ADVANCED TECHNOLOGY RESEARCH INSTITUTE
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies require modification of the original code and cannot provide a comprehensive understanding of the application's operational status during the microservice registration and discovery process on industrial application platforms, making it difficult to fully manage applications on the platform.
By adding a registration service to the container orchestration configuration file, and utilizing the MQQT bus and discovery service, industrial applications can achieve registration heartbeat and operational status maintenance, including monitoring online duration, thus avoiding interference with the original system.
It provides quantitative indicators of application stability, reduces the impact on the original system, enables comprehensive perception and management of applications, and supports platform stability assessment.
Smart Images

Figure CN122173200A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of industrial internet and microservice architecture technology, and in particular to a method, apparatus, device and storage medium for discovering industrial applications. Background Technology
[0002] With the development of the Industrial Internet, industrial application platforms are integrating more and more microservices. In the process of providing applications to users based on microservices, application registration and discovery are usually involved. Although traditional microservice registration and discovery technology is mature, it still has some limitations in actual operation.
[0003] In existing technologies, the registration process typically requires access to a traditional registration center. However, this requires modifying the code of existing industrial applications, such as adding configurations. In the industrial sector, there are often many legacy systems or third-party purchased software, which can affect the normal operation of the original system. When performing service discovery, it can only determine whether the application service is available, but cannot achieve historical statistics on the running status, making it difficult for users to have a comprehensive understanding of the applications on the platform. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for discovering industrial applications, enabling comprehensive awareness of applications even when no existing applications exist.
[0005] According to a first aspect of the present invention, a method for discovering industrial applications is provided, applied to an industrial application platform, wherein the industrial application platform includes a Message Queuing Telemetry Transport (MQQT) bus and a discovery service, the method comprising: Add a registration service to the container orchestration configuration file corresponding to each industrial application, wherein the registration service shares the lifecycle with the matched industrial application; When the industrial application starts up, it periodically sends a registration heartbeat to the MQQT bus through the matching registration service; The system receives registration heartbeats on the MQQT bus through a discovery service and maintains the operating status of each industrial application based on the registration heartbeats in the database, wherein the operating status includes online duration.
[0006] According to another aspect of the present invention, a detection device for industrial applications is provided, the device comprising: The registration service adds a service to the container orchestration configuration file corresponding to each industrial application, wherein the registration service shares the lifecycle with the matched industrial application. The registration heartbeat publishing module is used to periodically publish a registration heartbeat to the MQQT bus through the matching registration service when the industrial application starts. The application discovery module is used to receive registration heartbeats on the MQQT bus through the discovery service, and maintain the operating status of each industrial application based on the registration heartbeats in the database, wherein the operating status includes online duration.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: one or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the present invention.
[0008] According to another aspect of the present invention, a storage medium for computer-executable instructions is provided, on which a computer program is stored, which, when executed by a processor, implements the method as described in any of the embodiments of the present invention.
[0009] The technical solution of this invention adds the registration service to the container orchestration configuration file using container orchestration features, without affecting the containers of the original services contained in the container configuration file, thus reducing the impact on the original application system; and based on the database, it determines the operating status of each industrial application and the online duration in the online state according to the registration heartbeat, thereby providing quantitative indicators of application stability and providing comprehensive data support for platform maintenance and application evaluation.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of a discovery method for industrial applications provided according to Embodiment 1 of the present invention; Figure 2 This is a flowchart of another molecular dynamics simulation method provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the structure of a molecular dynamics simulation device provided in Embodiment 3 of the present invention; Figure 4This is a structural block diagram of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or terminal device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or terminal devices.
[0015] Example 1 Figure 1 This is a flowchart of an industrial application discovery method provided in Embodiment 1 of the present invention. This embodiment is applicable to the discovery of industrial applications. The method can be executed by an industrial application discovery device, which can be implemented in hardware and / or software, and can be integrated into an electronic device with data processing capabilities. Figure 1 As shown, the method includes: S101, add a registration service to the container orchestration configuration file corresponding to each industrial application.
[0016] Optionally, a registration service is added to the container orchestration configuration file corresponding to each industrial application. This includes: determining the service group supporting the industrial application on the platform for each industrial application, and obtaining the container orchestration configuration file corresponding to the service group from the local machine. The service group includes multiple services, and the container orchestration configuration file includes the orchestration information of the container group associated with the service group. The target container associated with the registration service to be added is determined, and the orchestration information of the target container is added to the container orchestration configuration file. The original orchestration information in the container orchestration configuration file is not affected by the newly added orchestration information. When the container orchestration configuration file is determined to be updated, the registration service is determined to be added successfully.
[0017] This embodiment primarily applies to industrial application platforms, which include a Message Queuing Telemetry Transport (MQQT) bus and a discovery service. The platform comprises multiple services, which can be combined according to user-specified methods to create service groups. Each service supports a specific industrial application. For example, service group a, consisting of services 1, 2, and 3, supports industrial application fault diagnosis; service group b, consisting of services 4 and 5, supports industrial application anomaly detection. This embodiment is merely illustrative and does not limit the specific types of industrial applications supported by each service group. Since each service corresponds to a container (e.g., service 1 corresponds to container D1, service 2 to container D2, and service 3 to container D3), each service group corresponds to a container group composed of multiple containers. For example, service group a corresponds to container group D {containers D1, D2, and D3}. Each container group corresponds to a container orchestration configuration file; for example, container group D corresponds to container orchestration configuration file doc1. The container orchestration configuration file includes the orchestration information of the container groups associated with the service group.
[0018] In this embodiment, to achieve zero-code access to the original industrial applications, a service group supporting the industrial applications is determined on the platform for each industrial application. The container orchestration configuration file corresponding to the service group is then obtained locally; that is, the container orchestration configuration file corresponding to the industrial application. In this embodiment, a lightweight registration service is added to the container orchestration configuration file of each industrial application. The target container associated with the registration service to be added is determined, and the orchestration information of the target container is added to the container orchestration configuration file. Taking industrial application fault diagnosis as an example, when a registration service is added for this industrial application, a container D6 corresponding to the registration service is created, and the orchestration information of container D6 is added to the container orchestration configuration file doc1. The orchestration information of container D6 does not affect the original orchestration information of containers D1, D2, and D3 in the file. When it is confirmed that the container orchestration configuration file doc1 has been updated, the registration service for industrial application fault diagnosis is considered successfully added. Of course, this embodiment only uses adding a registration service for industrial application fault diagnosis as an example. The method for adding registration services for other industrial applications is roughly the same, and will not be elaborated further in this embodiment.
[0019] It should be noted that in this embodiment, the registration service and the industrial application are defined in the same container orchestration configuration file, allowing the registration service and the matched industrial application to share a lifecycle. Therefore, the registration service and the matched industrial application have a symbiotic relationship. Thus, when the container group starts, the registration service starts, which is considered as the industrial application being online. When the container group stops, the registration service stops accordingly, thereby linking the state of the industrial application with the online state of the registration service. Furthermore, this embodiment will not cause any intrusion or interference to the original industrial application's system.
[0020] S102, when the industrial application starts, periodically sends a registration heartbeat to the MQQT bus through a matching registration service.
[0021] Optionally, when an industrial application starts, it periodically publishes a registration heartbeat to the MQQT bus through a matching registration service. This includes: when each industrial application determines that it has received a container group startup instruction, it will synchronously start the registration service matched with the industrial application at the same time as the container group starts; the registration service in the startup state periodically generates a registration heartbeat according to a pre-set configuration file and publishes the registration heartbeat to the MQQT bus. The registration heartbeat includes the application name, application type, application front-end access entry, application subscribed business topic, and timestamp.
[0022] Specifically, in this embodiment, each newly added registration service for an industrial application has a pre-configured configuration file. Therefore, when an industrial application receives a container group startup command, since the application and the registration service are interdependent and share a lifecycle, the registration service matching the industrial application will be started simultaneously with the industrial application startup via the container group. For example, when the industrial application fault diagnosis is started, its matching registration service will also be started simultaneously. The registration service mainly implements the registration of industrial application fault diagnosis on the platform. The registration service in the startup state will periodically generate a registration heartbeat according to the corresponding configuration file. Unlike traditional heartbeats that only contain IP:Port, the registration heartbeat in this embodiment is published to the MQQT bus in the form of a signaling payload. Specifically, it can be defined as follows: ={AppName, AppType, Frontend URL, Topic, Timestamp} where AppName represents the application name; AppType represents the application type, such as industry application, connector, general service, general tool, or for platform category display; Frontend URL represents the application's front-end web access point, allowing direct redirection from the platform portal; Topic represents the business topic subscribed to by the application; and Timestamp represents the timestamp for sending the heartbeat. Of course, this implementation is merely illustrative and does not limit the specific content and format of the registered heartbeat.
[0023] S103 receives the registration heartbeat on the MQQT bus through the discovery service and maintains the operating status of each industrial application based on the registration heartbeat in the database.
[0024] Optionally, the operating status of each industrial application is maintained based on the database according to the registered heartbeats, including: the discovery service creates a hash table in the database for each industrial application based on the registered heartbeats, wherein the hash table includes a composite primary key and a timestamp to identify the industrial application, and the composite primary key consists of the application name, application type and application front-end access entry; the operating status of the industrial application is determined for the hash table corresponding to each industrial application, and the operating status is added to the hash table, wherein the timestamps are sorted in the hash table according to the order of receiving the registered heartbeats.
[0025] Optionally, the running status of an industrial application is determined for the hash table corresponding to each industrial application, including: obtaining the first and last timestamps from the hash table for each industrial application, calculating the time difference between the current time and the last timestamp, determining whether the time difference is less than a preset threshold, if so, determining that the industrial application is online, and determining the online duration based on the difference between the last timestamp and the first timestamp; otherwise, determining that the industrial application is offline.
[0026] Specifically, the industrial application platform also includes a discovery service. The discovery service subscribes to specific topics on the MQQT bus. Since each industrial application corresponds to a business topic, and when an industrial application starts up and publishes a registration heartbeat to the MQQT bus, the registration heartbeat includes the business topic subscribed to by the application. Therefore, the discovery service can promptly discover the industrial application corresponding to the subscribed topic based on the received registration heartbeat. At the same time, it can maintain the running status of the industrial application based on the registration heartbeat in the database. The running status includes online time.
[0027] Specifically, when the service detects that the industrial application corresponding to the subscribed topic is online based on the registration heartbeat, it will create a hash table for each industrial application in the Redis database based on the registration heartbeat. The extracted application name (AppName), application type (AppType), and application frontend URL are used as a composite primary key to uniquely identify an industrial application instance. A hash table is maintained for each instance (i.e., the industrial application) in the Redis database, recording the timestamps of received registration heartbeats. These timestamps are sorted in the hash table according to the order in which the registration heartbeats were received. For example... This indicates the time when the first registration heartbeat of the specified industrial application was received, i.e., the online time. This indicates the time when the last registered heartbeat of the specified industrial application was received, i.e., the last active time. CurrentTime represents the current time. Therefore, for each industrial application, the first timestamp T is obtained from the hash table. first And the last timestamp The time difference between the current time and the last timestamp, D = CurrentTime - Tlast, is calculated. If this time difference is greater than a preset threshold, it indicates that the industrial application's last active time is far from the current time, thus confirming that the industrial application is offline. The preset threshold can be 2 minutes. This implementation uses a longer preset threshold to avoid frequent false alarms due to network fluctuations or container restarts, making it suitable for industrial network environments. However, this implementation is only an example and does not limit the specific duration of the preset threshold. If the time difference is less than the preset threshold, it indicates that the industrial application is still online, and the online duration is determined based on the difference between the last timestamp and the first timestamp. When the running status of the industrial application is obtained, it is added to a hash table, and for online status, the online duration is also added.
[0028] Optionally, the method further includes: performing a specified number of checks on the hash table for each industrial application; generating an application attack alarm when it is determined that the industrial application is online in each check and the online duration is less than a specified duration; and playing the application attack alarm in a specified manner, wherein the specified manner includes voice broadcasting or image display.
[0029] It should be noted that this embodiment also performs periodic checks on the hash tables of each industrial application. If it is determined that the application is online in each of the specified number of checks, such as 5 checks, but the online time is less than the specified time, it indicates that there may be a counterfeit industrial application attacking the platform to increase the platform's processing pressure. In this case, an application attack alarm will be generated and played in a specified manner. The specified manner includes voice broadcast or image display. Of course, this embodiment is only an example and does not limit the specific display method of the application attack alarm. As long as it can serve as a reminder to the user, it is within the scope of protection of this application.
[0030] The technical solution of this invention adds the registration service to the container orchestration configuration file using container orchestration features, without affecting the containers of the original services contained in the container configuration file, thus reducing the impact on the original application system; and based on the database, it determines the operating status of each industrial application and the online duration in the online state according to the registration heartbeat, thereby providing quantitative indicators of application stability and providing comprehensive data support for platform maintenance and application evaluation.
[0031] Example 2 Figure 2 This is a flowchart of another industrial application discovery method provided by an embodiment of the present invention. Based on the above embodiment, after maintaining the operating status of each industrial application according to the registered heartbeat based on the database, this embodiment further includes: creating tags for each industrial application on the front end, and further visually displaying the operating status of the industrial application through the tags; establishing a binding relationship between the tags and the application front end access entry for each industrial application; when a trigger command for a target tag is received, visually displaying the target application corresponding to the target tag on a webpage through the bound application front end access entry, such as... Figure 2 As shown, the method includes: S201, add a registration service to the container orchestration configuration file corresponding to each industrial application.
[0032] Optionally, a registration service is added to the container orchestration configuration file corresponding to each industrial application. This includes: determining the service group supporting the industrial application on the platform for each industrial application, and obtaining the container orchestration configuration file corresponding to the service group from the local machine. The service group includes multiple services, and the container orchestration configuration file includes the orchestration information of the container group associated with the service group. The target container associated with the registration service to be added is determined, and the orchestration information of the target container is added to the container orchestration configuration file. The original orchestration information in the container orchestration configuration file is not affected by the newly added orchestration information. When the container orchestration configuration file is determined to be updated, the registration service is determined to be added successfully.
[0033] S202, when an industrial application starts up, periodically sends a registration heartbeat to the MQQT bus through a matching registration service.
[0034] Optionally, when an industrial application starts, it periodically publishes a registration heartbeat to the MQQT bus through a matching registration service. This includes: when each industrial application determines that it has received a container group startup instruction, it will synchronously start the registration service matched with the industrial application at the same time as the container group starts; the registration service in the startup state periodically generates a registration heartbeat according to a pre-set configuration file and publishes the registration heartbeat to the MQQT bus. The registration heartbeat includes the application name, application type, application front-end access entry, application subscribed business topic, and timestamp.
[0035] S203 receives the registration heartbeat on the MQQT bus through the discovery service and maintains the operating status of each industrial application based on the registration heartbeat in the database.
[0036] Optionally, the operating status of each industrial application is maintained based on the database according to the registered heartbeats, including: the discovery service creates a hash table in the database for each industrial application based on the registered heartbeats, wherein the hash table includes a composite primary key and a timestamp to identify the industrial application, and the composite primary key consists of the application name, application type and application front-end access entry; the operating status of the industrial application is determined for the hash table corresponding to each industrial application, and the operating status is added to the hash table, wherein the timestamps are sorted in the hash table according to the order of receiving the registered heartbeats.
[0037] Optionally, the running status of an industrial application is determined for the hash table corresponding to each industrial application, including: obtaining the first and last timestamps from the hash table for each industrial application, calculating the time difference between the current time and the last timestamp, determining whether the time difference is less than a preset threshold, if so, determining that the industrial application is online, and determining the online duration based on the difference between the last timestamp and the first timestamp; otherwise, determining that the industrial application is offline.
[0038] Optionally, the method further includes: performing a specified number of checks on the hash table for each industrial application; generating an application attack alarm when it is determined that the industrial application is online in each check and the online duration is less than a specified duration; and playing the application attack alarm in a specified manner, wherein the specified manner includes voice broadcasting or image display.
[0039] S204 creates tag cards on the front end for various industrial applications and uses these tag cards to visualize the operational status of the industrial applications.
[0040] Specifically, in this implementation, tags will be created on the front end for each industrial application, and the running status of each industrial application will be added to the corresponding tag. This will make it easier for users to view the online / offline status of each industrial application, so as to have a comprehensive understanding of the running status of industrial applications on the platform. This will enable unified management of industrial applications on the platform based on their running status, thereby improving the management efficiency of applications.
[0041] S205 establishes a binding relationship between the tag card and the application front-end access portal for each industrial application. When a trigger command is received for the target tag card, the target application corresponding to the target tag card is displayed in webpage visualization through the bound application front-end access portal.
[0042] Specifically, in this embodiment, the front-end access entry of each industrial application can be obtained based on the registration heartbeat. Therefore, a binding relationship between the tag card and the application front-end access entry will be established for each industrial application. When a trigger command for the target tag card is received on the front-end interface, such as a click operation, the webpage of the target application will be switched through the bound application front-end access entry to visualize the webpage of the target application.
[0043] The main technical effects of this implementation are as follows: First, a more comprehensive business perspective. Compared to Eureka / Consul, which only focuses on backend connectivity, this application incorporates the frontend URL and application type into the core registration elements. In addition to online status, it can also uniformly manage key information of the industrial platform such as application type and frontend access address. This allows the industrial internet platform to directly build a visual navigation menu based on the registration information, achieving backend registration followed by frontend visibility. Second, completely zero intrusion. Utilizing the orchestration features of Docker Compose, a companion container sends heartbeats on behalf of the main application. For older, closed-source industrial software, it can be integrated into the platform's monitoring system without modifying a single line of code. Third, a balance between lightweight and real-time performance. It eliminates the need for a complex registry center, uses the MQTT protocol as the bus, has extremely low bandwidth consumption, and is suitable for deployment at the industrial edge. At the same time, it effectively avoids false alarms caused by network fluctuations while ensuring real-time performance. Fourth, multi-dimensional operational data support. The built-in online duration calculation logic provides platform administrators with quantitative indicators of application stability, providing data support for platform operation and maintenance and application evaluation. This is a business layer function that general registry centers do not possess.
[0044] The technical solution of this invention adds the registration service to the container orchestration configuration file using container orchestration features, without affecting the containers of the original services contained in the container configuration file, thus reducing the impact on the original application system; and based on the database, it determines the operating status of each industrial application and the online duration in the online state according to the registration heartbeat, thereby providing quantitative indicators of application stability and providing comprehensive data support for platform maintenance and application evaluation.
[0045] Example 3 Figure 3 This is a schematic diagram of a detection device for industrial applications provided in an embodiment of the present invention. Figure 3 As shown, the device includes: a registration service addition module 310, a registration heartbeat release module 320, and an application discovery module 330.
[0046] The registration service adds module 310, which is used to add the registration service to the container orchestration configuration file corresponding to each industrial application. The registration service shares the lifecycle with the matched industrial application. The registration heartbeat publishing module 320 is used to periodically publish a registration heartbeat to the MQQT bus through a matching registration service when the industrial application starts. The application discovery module 330 is used to receive the registration heartbeat on the MQQT bus through the discovery service, and maintain the operating status of each industrial application based on the database according to the registration heartbeat, wherein the operating status includes the online duration.
[0047] Optionally, the registration service adds a module to determine the service group that supports industrial applications on the platform for each industrial application, and obtain the container orchestration configuration file corresponding to the service group from the local machine. The service group includes multiple services, and the container orchestration configuration file includes the orchestration information of the container group associated with the service group. Identify the target container associated with the registration service to be added, and add the orchestration information of the target container to the container orchestration configuration file. The original orchestration information in the container orchestration configuration file is not affected by the newly added orchestration information. Once the container orchestration configuration file update is complete, the registration service is considered successfully added.
[0048] Optionally, a registration heartbeat publishing module is used to synchronously start the registration service matched with the industrial application when the container group starts, based on the determination that a container group start command has been received for each industrial application. The registration service in the startup state periodically generates registration heartbeats according to the pre-set configuration file and publishes the registration heartbeats to the MQQT bus. The registration heartbeats include the application name, application type, application front-end access entry, application subscription business theme and timestamp.
[0049] Optionally, the application discovery module is used to discover that the service creates a hash table in the database for each industrial application based on the registered heartbeat. The hash table includes a composite primary key and a timestamp to identify the industrial application. The composite primary key consists of the application name, application type and application front-end access entry. The operating status of each industrial application is determined by the hash table corresponding to each industrial application, and the operating status is added to the hash table. The timestamps are sorted in the hash table according to the order in which the registered heartbeats are received.
[0050] Optionally, the application discovery module is also used to retrieve the first and last timestamps from the hash table for each industrial application, and calculate the time difference between the current time and the last timestamp. If the time difference is less than a preset threshold, the industrial application is determined to be online, and the online duration is determined based on the difference between the last timestamp and the first timestamp. Otherwise, the industrial application is determined to be offline.
[0051] Optionally, the device also includes an alarm module, which is used to perform a specified number of checks on the hash table for each industrial application. When it is determined that the industrial application is online in each check and the online time is less than a specified time, an application attack alarm is generated. Application attack alerts will be played in a specified manner, which may include voice broadcast or image display.
[0052] Optionally, the device also includes a visualization module for creating tag cards for each industrial application at the front end and visually displaying the operating status of the industrial application through the tag cards. Establish a binding relationship between tags and application front-end access points for each industrial application; When a trigger command is received for a target tag, the target application corresponding to the target tag is displayed on a webpage through the bound application front-end access point.
[0053] The industrial application discovery device provided in this embodiment of the invention can execute the industrial application discovery method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0054] Example 4 Figure 4A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0055] The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.
[0056] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0057] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other electronic devices through computer networks such as the Internet and / or various telecommunications networks.
[0058] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as discovery methods for industrial applications.
[0059] That is, a registration service is added to the container orchestration configuration file corresponding to each industrial application, wherein the registration service shares the lifecycle with the matched industrial application; When an industrial application starts up, it periodically sends a registration heartbeat to the MQQT bus through a matching registration service. The system receives registration heartbeats from the MQQT bus through a discovery service and maintains the operating status of each industrial application based on the database according to the registration heartbeats. The operating status includes online duration.
[0060] In some embodiments, the industrial application discovery method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the industrial application discovery method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the industrial application discovery method by any other suitable means (e.g., by means of firmware).
[0061] Various embodiments of the apparatuses and techniques described above herein can be implemented in digital electronic circuit devices, integrated circuit devices, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), device-on-a-chip (SoC) devices, complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable device including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage device, at least one input device, and at least one output device, and transmitting data and instructions to the storage device, the at least one input device, and the at least one output device.
[0062] Computer programs used to implement the discovery method for industrial applications of this invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other business-uninterrupted data migration device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0063] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution apparatus, device, or electronic device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage electronics, magnetic storage electronics, or any suitable combination thereof.
[0064] To provide interaction with a user, the devices and techniques described herein can be implemented on an electronic device having: a display device (e.g., a touchscreen) for displaying information to the user; and buttons through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0065] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0066] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for discovering industrial applications, characterized in that, Applied to an industrial application platform, wherein the industrial application platform includes a message queue telemetry transport (MQQT) bus and a discovery service, the method includes: Add a registration service to the container orchestration configuration file corresponding to each industrial application, wherein the registration service shares the lifecycle with the matched industrial application; When the industrial application starts up, it periodically sends a registration heartbeat to the MQQT bus through the matching registration service; The system receives registration heartbeats on the MQQT bus through a discovery service and maintains the operating status of each industrial application based on the registration heartbeats in the database, wherein the operating status includes online duration.
2. The method according to claim 1, characterized in that, The addition of a registration service to the container orchestration configuration file corresponding to each industrial application includes: For each industrial application, a service group supporting the industrial application is determined on the platform, and the container orchestration configuration file corresponding to the service group is obtained from the local machine. The service group includes multiple services, and the container orchestration configuration file includes the orchestration information of the container group associated with the service group. Identify the target container associated with the registration service to be added, and add the orchestration information of the target container to the container orchestration configuration file, wherein the original orchestration information in the container orchestration configuration file is not affected by the newly added orchestration information; Once the container orchestration configuration file update is complete, the registration service is considered successfully added.
3. The method according to claim 1, characterized in that, The step of periodically sending a registration heartbeat to the MQQT bus through the matching registration service when the industrial application starts includes: When a container group start command is received for each industrial application, the registration service matched with the industrial application will be started simultaneously with the start of the container group. The registration service in the startup state periodically generates registration heartbeats according to a pre-set configuration file and publishes the registration heartbeats to the MQQT bus. The registration heartbeats include the application name, application type, application front-end access entry, application subscription business theme and timestamp.
4. The method according to claim 3, characterized in that, The process of maintaining the operational status of each industrial application based on the registered heartbeats using a database includes: The discovery service creates a hash table in the database for each industrial application based on the registered heartbeat. The hash table includes a composite primary key and a timestamp to identify the industrial application. The composite primary key consists of the application name, application type, and application front-end access entry. The operating status of an industrial application is determined by a hash table corresponding to each industrial application, and the operating status is added to the hash table. The timestamps in the hash table are sorted according to the order in which the registered heartbeats are received.
5. The method according to claim 4, characterized in that, The determination of the operating status of an industrial application using a hash table corresponding to each industrial application includes: For each of the aforementioned industrial applications, the first and last timestamps are retrieved from the hash table, and the time difference between the current time and the last timestamp is calculated. If the time difference is less than a preset threshold, the industrial application is determined to be online, and the online duration is determined based on the difference between the last timestamp and the first timestamp; otherwise, the industrial application is determined to be offline.
6. The method according to claim 4, characterized in that, The method further includes: For each of the aforementioned industrial applications, the hash table is tested a specified number of times. When it is determined that the industrial application is online in each test and the online time is less than a specified time, an application attack alarm is generated. The application attack alert will be played in a specified manner, wherein the specified manner includes voice broadcast or image display.
7. The method according to claim 3, characterized in that, After maintaining the operating status of each industrial application based on the registered heartbeat according to the database, the method further includes: For each industrial application, a tag card is created at the front end, and the operating status of the industrial application is visualized through the tag card; Establish a binding relationship between the tag card and the application front-end access point for each industrial application; When a trigger command is received for a target tag, the target application corresponding to the target tag is displayed on a webpage through the bound application front-end access point.
8. A detection device for industrial applications, characterized in that, The device includes: A registration service module is added to add registration services to the container orchestration configuration files corresponding to each industrial application, wherein the registration service shares the lifecycle with the matched industrial application; The registration heartbeat publishing module is used to periodically publish a registration heartbeat to the MQQT bus through the matching registration service when the industrial application starts. The application discovery module is used to receive registration heartbeats on the MQQT bus through the discovery service, and maintain the operating status of each industrial application based on the registration heartbeats in the database, wherein the operating status includes online duration.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A storage medium for computer-executable instructions, wherein a computer program is stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.