CN115964142A - Application service management method, device and storage medium - Google Patents

Application service management method, device and storage medium Download PDF

Info

Publication number
CN115964142A
CN115964142A CN202211564306.0A CN202211564306A CN115964142A CN 115964142 A CN115964142 A CN 115964142A CN 202211564306 A CN202211564306 A CN 202211564306A CN 115964142 A CN115964142 A CN 115964142A
Authority
CN
China
Prior art keywords
server
task
thread
task set
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211564306.0A
Other languages
Chinese (zh)
Inventor
李育杰
李忠海
陈�峰
邬志刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yuhang Intelligent Information Technology Co ltd
Original Assignee
Shenzhen Yuhang Intelligent Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yuhang Intelligent Information Technology Co ltd filed Critical Shenzhen Yuhang Intelligent Information Technology Co ltd
Priority to CN202211564306.0A priority Critical patent/CN115964142A/en
Publication of CN115964142A publication Critical patent/CN115964142A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Hardware Redundancy (AREA)

Abstract

The application discloses a management method, equipment and a storage medium of application service, which relate to the technical field of computers and are applied to a server, wherein the method comprises the following steps: acquiring a first task set to be executed through a preset first main thread, and deploying the first task set in a server; after the first task set is deployed, starting a preset first thread and a preset second thread through a main thread; maintaining the running state of each task in the first task set through the first thread so as to stop the first task when the first task is detected to be abnormally run and restart the first task when the first task is recovered; and maintaining the network state of the server through the second thread so as to stop executing the first task set when the network state of the server is abnormal and restart the first task set when the server is recovered. By the method, the failed server or the task with abnormal operation can be restarted in a short time so as to reduce the influence of the server failure or the task with abnormal operation on a user.

Description

Application service management method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, a device, and a storage medium for managing an application service.
Background
Microsoft Windows service allows users to create executable applications that can run for long periods of time in their own Windows sessions. These services can be automatically started when the computer is started, can be paused and restarted and do not display any user interface; this service is very suitable for use on a server or whenever it is necessary to run functions for a long time in order not to affect other users working on the same computer. At present, windows service is widely applied to SCADA (Supervisory Control And Data Acquisition) software, and the number of devices in one SCADA project is dozens, and the number of devices is thousands. In the SCADA project, windows service is responsible for processing complex business and has business communication with other modules, and especially plays an important supporting role for an interface module (UI) interacting with a user, and needs to operate continuously and stably for a long time. However, due to factors such as a design defect (e.g., an implicit BUG) and a working environment (e.g., restarting after power failure recovery of a server), a program may die, and if the program cannot be restarted in time, a large influence may be exerted on the whole software system, for example, a module interacting with a user is influenced, so that user experience is poor.
Disclosure of Invention
The present application is directed to solving at least one of the problems in the prior art. Therefore, the application provides a management method, equipment and a storage medium of an application service, when the server or the task runs abnormally, the server or the task can be restarted in a short time so as to reduce the influence of the server fault or the task running abnormity on a user.
In a first aspect, an embodiment of the present application provides a method for managing an application service, where the method is applied to a server, and includes:
acquiring a first task set to be executed through a preset first main thread, and deploying the first task set in the server;
after the first task set is deployed, starting a preset first thread and a preset second thread through the main thread;
maintaining the running state of each task in the first task set through the first thread, so as to stop the first task when the first task is detected to be abnormally run and restart the first task when the first task is recovered;
and maintaining the network state of the server through the second thread so as to stop executing the first task set when the network state of the server is abnormal and restart the first task set when the server is recovered.
According to one or more technical schemes provided in the embodiment of the application, the method at least has the following beneficial effects that a first task set to be executed is obtained through a preset first main thread, and the first task set is deployed in a server; after the first task set is deployed, starting a preset first thread and a preset second thread through a main thread; maintaining the running state of each task in the first task set through the first thread so as to stop the first task when the first task is detected to be abnormal in running and restart the first task when the first task is recovered; and maintaining the network state of the server through the second thread so as to stop executing the first task set when the network state of the server is abnormal and restart the first task set when the server is recovered. By the method, the Windows server and the tasks running in the server are defended while the Windows server runs, the running state of each task and the network state of the server can be detected in time, and when the server or the tasks run abnormally, the server or the tasks can be restarted in a short time so as to reduce the influence of server failure or task running abnormity on a user.
According to some embodiments of the first aspect of the present application, the obtaining a first task set to be executed by a preset first main thread and deploying the first task set in a server includes:
inquiring a first task set to be executed through a preset first main thread, and putting the first task set into an LIST cache;
respectively acquiring configuration information of each task in the first task set from the LIST cache;
reading a file corresponding to the configuration information, and copying the file to a preset position;
creating a Windows task through a preset program;
and starting the Windows tasks according to the configuration information so as to deploy the first task set in a server.
According to some embodiments of the first aspect of the present application, the maintaining, by the first thread, the operating state of each task in the first task set includes:
querying a first task set to be loaded through a preset first thread, and putting the first task set into an LIST cache;
respectively acquiring configuration information of each task in the first task set from the LIST cache;
judging whether the running state of the server is abnormal or not according to the configuration information of each task;
and restarting the server when the running state of the server is abnormal.
According to some embodiments of the first aspect of the present application, the performing, by the second thread, maintenance processing on the network state of the server includes:
and detecting that the server generates a crash window through the second thread, judging that the running state of the server is abnormal, and restarting the server.
According to some embodiments of the first aspect of the present application, a network state obtained by the maintenance processing is obtained;
and when the network state is network recovery, setting the state of the server to be online, and setting the service state of the first task set to be waiting for returning.
In a second aspect, an embodiment of the present application provides a method for managing an application service, where the method is applied to a configuration center, and the configuration center is in communication connection with multiple servers; the management method of the application service comprises the following steps:
acquiring a preset configuration list;
selecting a first task set to be executed corresponding to each server from a configuration list according to the states of a plurality of servers, so that the servers obtain the first task set to be executed through a preset first main thread and deploy the first task set in the servers; after the first task set is deployed, starting a preset first thread and a preset second thread through the main thread; and maintaining the running state of each task in the first task set through the first thread, and maintaining the network state of the server through the second thread.
According to some embodiments of the second aspect of the present application, the method for managing application services further comprises:
for each server, when the network state of the server is detected to be an online state, the service state of a second task set in the server is set to be operated in a different place; wherein the second set of tasks is deployed by the configuration center from other servers;
for each server, when the network state of the server is detected to be an online state, when the server receives a command to wait for migration, and a second task set corresponding to the command to wait for migration runs in the server in different places, stopping running of the second task set in the server, and executing the work of migration on the second task set;
and for each server, when the network state of the server is detected to be network recovery, sending a command of waiting for backover to the migrated second task set, restarting the server after the service state of the second task set is changed to be backover, and setting the service state of the second task set to be normal operation.
According to some embodiments of the second aspect of the present application, the method for managing application services further comprises:
creating a service information object of the server through a preset second main thread, and starting a task allocation timer thread of a task scheduler;
judging whether each server has faults and is not processed or not through the task allocation timer thread;
and when the server which has the fault and is not processed exists, setting the service state of the server which has the fault and is not processed to be waiting for migration.
According to the third aspect of the application service management device, it includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor when executing the computer program implementing:
a method of managing an application service as described in the first aspect above;
alternatively, the first and second liquid crystal display panels may be,
the method for managing an application service according to the second aspect.
A computer-readable storage medium according to an embodiment of the fourth aspect of the present application, the computer-readable storage medium storing computer-executable instructions for:
executing the method for managing application services of the first aspect;
alternatively, the first and second electrodes may be,
the management method of the application service according to the second aspect is performed.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The accompanying drawings are included to provide a further understanding of the claimed subject matter and are incorporated in and constitute a part of this specification, illustrate embodiments of the subject matter and together with the description serve to explain the principles of the subject matter and not limit the claimed subject matter.
Fig. 1 is a flowchart illustrating a management method for application services according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a Windows service deployment provided in an embodiment of the present application;
fig. 3 is a schematic diagram of data acquisition service state switching provided in an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an operation flow of a service daemon provided in an embodiment of the present application;
fig. 5 is a flowchart illustrating a management method for application services according to another embodiment of the present application;
fig. 6 is a flowchart illustrating a management method for application services according to another embodiment of the present application;
fig. 7 is a flowchart illustrating a management method for application services according to another embodiment of the present application;
fig. 8 is a flowchart illustrating a management method for application services according to another embodiment of the present application;
fig. 9 is a flowchart illustrating a management method for application services according to another embodiment of the present application;
FIG. 10 is a flowchart illustrating a method for managing application services according to another embodiment of the present application;
fig. 11 is a flowchart illustrating a management method for application services according to another embodiment of the present application;
fig. 12 is an interaction diagram of a task scheduler and a daemon, according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, as well as in the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Microsoft Windows service allows users to create executable applications that can run for long periods of time in their own Windows sessions. These services can be automatically started when the computer is started, can be paused and restarted and do not display any user interface; this service is well suited for use on a server or whenever a long run of functionality is required in order not to affect other users working on the same computer. At present, windows service is widely applied to SCADA (Supervisory Control And Data Acquisition And monitoring system) software, and the number of devices in one SCADA project is dozens, and more, thousands of SCADA projects are provided. In the SCADA project, windows service is responsible for processing complex business and has business communication with other modules, and especially plays an important supporting role for an interface module (UI) interacting with a user, and needs to operate continuously and stably for a long time. However, due to factors such as a design defect (e.g., an implicit BUG) and a working environment (e.g., restarting after power failure recovery of a server), a program may die, and if the program cannot be restarted in time, a large influence may be exerted on the whole software system, for example, a module interacting with a user is influenced, so that user experience is poor.
Based on the above situation, embodiments of the present application provide a management method, device and storage medium for an application service, which can restart a server or a task in a short time when an abnormal situation occurs in the server, so as to reduce the influence of a server failure or a task operation abnormality on a user.
The embodiments of the present application will be further explained with reference to the drawings.
An embodiment of the first aspect of the present application specifically provides a management method for an application service, which is applied to a server, as shown in fig. 1. The management method of the application service includes but is not limited to the following steps:
step S100, acquiring a first task set to be executed through a preset first main thread, and deploying the first task set in a server;
step S200, after the first task set is deployed, starting a preset first thread and a preset second thread through a main thread;
step S300, performing maintenance processing on the running state of each task in the first task set through the first thread so as to stop the first task when the first task is detected to be abnormal in running and restart the first task when the first task is recovered;
step S400, performing maintenance processing on the network state of the server through the second thread, so as to stop executing the first task set when the network state of the server is abnormal and restart the first task set when the server is recovered.
By the method, the Windows server and the tasks running in the server are defended while the Windows server runs, the running state of each task and the network state of the server can be detected in time, and when the server or the tasks run abnormally, the server or the tasks can be restarted in a short time so as to reduce the influence of server faults or task running abnormity on users.
It should be noted that the first main thread, the first thread, and the second thread all belong to threads of a service daemon, the first main thread is a timer, the first main thread runs once at each preset detection time interval corresponding to the main thread, the first thread is a Windows service thread monitoring thread, and the second thread is a server online status monitoring thread.
In the present embodiment, the first task set represents a plurality of data acquisition services in the server, and the tasks represent the data acquisition services. In other embodiments, the first task set may also be other types of tasks, and is not limited to the embodiment of the present application.
It should be noted that, for each preset first detection time interval, the running state of the server is detected through the first thread of the service daemon; and for each preset second detection time interval, detecting the network state of the server in the host machine through a second thread of the service daemon. The first detection time interval and the second detection time interval may be set to 5 seconds or 10 seconds, respectively, or may be set to other time intervals, and the embodiment of the present application is not limited herein.
It should be noted that, when the server is restarted, the service daemon can automatically start, and the service daemon starts the first main thread, and the first main thread loads the server and starts the first thread and the second thread. In this embodiment, the management method of the application service is applied to the SCADA system based on the Windows service, the server includes a data acquisition service program and a data acquisition service, the service DAEMON is a centralized data acquisition service DAEMON, the service DAEMON is also called DIMS _ DAEMON program, and the running state of the server specifically indicates the running state of the data acquisition service. The service daemon can install, start and stop the data acquisition service program on the host according to the configuration of the SCADA system; the service daemon can monitor the running state of the server in real time, and the server which is found to be crashed restarts the server immediately.
In step S400, when the network state of the server is abnormal, the first task set is stopped from being executed, and the first task set is migrated to another server that normally operates; when the network state of the server is recovered to be normal, the migrated first task set is migrated back to the original server to run. That is, after one server goes offline/down, the data collection service running on the server is migrated to other servers running normally. When the fault server is repaired to be on-line, the data acquisition service which is migrated away can be migrated back.
It should be noted that, the SCADA is called super Control And Data Acquisition, and is translated into a Data Acquisition And monitoring Control system; DIMS is called a Dispatching Intelligent Management System and is translated into Dispatching Intelligent Management; a DLL, a library that contains code and data that can be used by multiple programs simultaneously, is known as a Dynamic link library.
It should be noted that, the application service DAEMON for Windows service DIMS _ DAEMON is also deployed as Windows service. The SCADA system based on Windows service deployment is used for collecting equipment data, and a unified operation framework, a unified development framework, an automatic deployment function, application guard and hardware disaster recovery are respectively deployed for managing data collection tasks of the SCADA system. Wherein, the unified operation framework: developing a DIMS _ SERVER program as an operation process of the SCADA system, wherein the program is developed based on Windows service, runs a program developed by a user, is issued into a DLL, is dynamically loaded into the DIMS _ SERVER service and runs; a unified development framework: the framework defines an interface for transmitting the operation parameters and sharing the general functions, and the development framework can unify the development mode, simplify the development process and save the development manpower; automatic deployment: the project usually needs to deploy a plurality of Windows services for data acquisition, and manual deployment is time-consuming and labor-consuming, so that an automatic deployment function is provided; application guard: because a lot of second-opening workloads exist in the project, the Windows service is possibly crashed due to insufficient skills and experiences of developers, and application daemon of the Windows service is introduced for the reason; hardware disaster recovery: the customers of the SCADA products can require hardware disaster tolerance, so that when the hardware is down, the application based on the Windows service can be automatically migrated to other normally-operated servers to be operated.
Referring to fig. 4 to 5, it can be understood that step S100 includes, but is not limited to, the following steps:
step S110, inquiring a first task set to be executed through a preset first main thread, and putting the first task set into a LIST cache;
step S120, respectively acquiring configuration information of each task in the first task set in the LIST cache;
step S130, reading a file corresponding to the configuration information, and copying the file to a preset position;
step S140, establishing a Windows task through a preset program;
and step S150, starting Windows tasks according to the configuration information so as to deploy the first task set in the server.
Specifically, referring to fig. 2 and 4, the operation flow of the main thread is as follows: firstly, inquiring data acquisition services needing to be loaded by a host machine from a database through a main thread, putting the data acquisition services into an LIST cache, and setting the data acquisition services to be deployed by the host machine in a configuration center; secondly, acquiring configuration information of a data acquisition service from the LIST cache, and assuming that the name of the data acquisition service is X; thirdly, copying a DIMS _ RELEASE folder, and renaming the folder to be a data acquisition service name X; step four, establishing a Windows service by using an X/DIMS. Exe file, and setting the service name as X; fifthly, starting X data acquisition service; sixthly, updating the service state of the X data acquisition service to a configuration center to be one of normal operation, remote operation, migration waiting and completion of migration, wherein the remote operation refers to the fact that a task scheduling program is distributed from other data acquisition servers; step seven, taking the configuration information of the next data acquisition service from the LIST cache, if the acquisition is successful, jumping to the step three by the service daemon, and if not, operating to the step eight; eighthly, checking whether the first thread is started or not, and if so, not repeatedly starting; and step nine, checking whether the second thread is started or not, and if so, not repeating the starting.
Referring to fig. 4 and fig. 6, it can be understood that the maintenance processing on the operation state of each task in the first task set by the first thread in step S300 includes, but is not limited to, the following steps:
step S310, a first task set to be executed is inquired through a preset first thread and is put into a LIST cache;
step S320, respectively obtaining the configuration information of each task in the first task set in the LIST cache;
step S330, judging whether the running state of the server is abnormal or not according to the configuration information of each task;
step S340, when the running state of the server is abnormal, the server is restarted.
It should be noted that, referring to fig. 4, the running state of the data acquisition service deployed in the host is monitored in real time by the first thread. Specifically, the running process of the first thread is as follows: firstly, inquiring data acquisition services required to be operated by a local computer from a database, and putting the data acquisition services into an LIST cache; secondly, acquiring configuration information of a data acquisition service from the LIST cache, and assuming that the name of the data acquisition service is X; thirdly, checking the running state of the Windows service X, and restarting the data acquisition service if the running state of the Windows service X is broken down; step four, the configuration information of the next data acquisition service is taken out from the LIST cache, if the taking-out is successful, the step three is executed, otherwise, the step five is executed; fifth, the first line Cheng Shuimian detects a second time interval.
Referring to fig. 7, it can be understood that the maintaining process of the network state of the server by the second thread in step S400 includes, but is not limited to, the following steps:
step S410, detecting that the server generates a crash window through the second thread, determining that the running state of the server is abnormal, and restarting the server.
Specifically, whether a crash window is generated in the server is detected, if the crash window is generated, it is determined that the server is abnormal in operation, the first thread needs to clean a crash site, timely close the crash window, and close the server.
Referring to fig. 4 and 8, it can be understood that the management method of the application service further includes, but is not limited to, the following steps:
step S401, obtaining a network state obtained by maintenance processing;
and step S402, when the network state is network recovery, setting the state of the server to be online, and setting the service state of the first task set to be waiting for returning.
It should be noted that, when the network state is the state unchanged, no operation is performed, where the state unchanged refers to that the network state of the server is continuously in the offline state or continuously in the online state, and when the network state is the state unchanged, no operation is performed, and the network detection of the server is performed again after the second detection time interval of sleep; stopping executing the data acquisition service in the server when the network state is network interruption, and stopping executing the data acquisition service in the server through a DIMS _ DAEMON program when the network state is network interruption is judged; and if the network is judged to be recovered, updating the servers corresponding to the data acquisition service to be online through a DIMS _ DAEMON program, updating all data acquisition service states to be waiting for migration, finishing the migration about 10 seconds after the waiting for the migration, and updating the service states of the data acquisition service to be normal operation.
In a second aspect, an embodiment of the present application further provides a management method for an application service, and with reference to fig. 9, the management method is applied to a configuration center, where the configuration center is in communication connection with a plurality of servers; the management method of the application service includes but is not limited to the following steps:
step S500, acquiring a preset configuration list;
step S600, selecting a first task set to be executed corresponding to each server from a configuration list according to the states of a plurality of servers, so that the servers obtain the first task set to be executed through a preset first main thread and deploy the first task set in the servers; after the first task set is deployed, starting a preset first thread and a preset second thread through a main thread; and maintaining the running state of each task in the first task set through the first thread, and maintaining the network state of the server through the second thread.
It should be noted that, in step S400, when the network state of the server is abnormal, the execution of the first task set is stopped, and the first task set is migrated to another server that normally operates; when the network state of the server is recovered to be normal, the migrated first task set is migrated back to the original server to run.
By the method, the Windows server runs, the servers and the tasks running in the servers are protected, the running state of each task and the network state of each server can be detected in time, and when the servers or the tasks are abnormal, the servers or the tasks can be restarted in a short time so as to reduce the influence of server faults or task abnormity on users.
Referring to fig. 10, it can be understood that the management method of the application service further includes, but is not limited to, the following steps:
step S610, for each server, when the network state of the server is detected to be an online state, the service state of a second task set in the server is set to be operated in different places; wherein the second task set is deployed from other servers by the configuration center;
step S620, for each server, when the network state of the server is detected to be an online state, when the server receives a command waiting for the migration and a second task set corresponding to the command waiting for the migration runs in the server in a different place, stopping the second task set from running in the server, and executing the migration work on the second task set;
step S630, for each server, when it is detected that the network state of the server is network restoration, sending a command to wait for migration to the migrated second task set, and after the service state of the second task set becomes completion of migration, restarting the server, and setting the service state of the second task set to normal operation.
The second task set in the present embodiment represents a plurality of data collection services that the configuration center has deployed from other servers by using the task scheduler. In other embodiments, the second task set may also be other types of tasks, and is not limited to the embodiment of the present application.
Referring to fig. 12, a DIMS _ DAEMON centralized acquisition service DAEMON serving as a service DAEMON is deployed on a digital acquisition server, and steps S610 to S630 are performed in a high availability state.
For example, in step S611, if the server is a normal server, that is, the server is in an online state, it is detected whether there is a data acquisition service allocated to the server, if so, the allocated data acquisition service is executed, and the service state of the data acquisition service is set to run in a different place, and the scheduling operation in step S611 is executed by the Sn Daemon TIMER1 thread in fig. 10; step S621, if the server is a fault server, namely the server is in an off-line state, checking whether the current server network is recovered, if so, sending a command of waiting for the return, and executing the scheduling work of the step S621 by an Sn Daemon TIMER3 thread; step S631, if the server is a normal server, and receives a command to wait for migration, and the data acquisition service to be migrated runs in the server in a different place, executing migration work, stopping running of the data acquisition service on the server, and changing the service state of the data acquisition service to completion of migration, wherein the scheduling work of step S631 is executed by a Sn Daemon TIMER2 thread; step 640, if the server is a fault server, when the server is on-line again, setting the service state of the data acquisition service which is migrated away as waiting for migration, starting the data acquisition service at the server after the service state of the data acquisition service is changed into completion of migration, and changing the service state of the data acquisition service into normal operation.
It should be noted that the high availability of the TA system means that the TA system ensures that the TA system does not affect the stable operation and external service of the cluster under the condition that any one server is down or actively stopped; in this embodiment, high availability refers to maintaining the service state of the data acquisition service. Daemon represents a Daemon thread.
It should be noted that the task scheduler in this embodiment is a DIMS _ TA task scheduler, and the DIMS _ TA task scheduler is used for executing migration and return of data acquisition services. Detecting the current service state of the data acquisition service through a service daemon, and when the service state is normal operation, not operating by a task scheduling program; when the service state is in the operation in different places, the task scheduling program judges whether the original server corresponding to the data acquisition service sends a command of waiting for migration or not, if so, the task scheduling program executes the work of migration, stops the operation of the data acquisition service on the current server, and sets the service state of the data acquisition service as the completion of migration; and when the service state is waiting for migration, the data acquisition service is transferred to other servers for operation through the task scheduling program, and the service state of the data acquisition service is set to be operated in different places.
In T2_ s3, the judgment condition for judging whether the data acquisition server is failed and unprocessed is as follows: the state of the data acquisition server is online, but a ping command cannot be normally conducted, the time is not updated, and if the data acquisition server is judged to be in fault and not processed, a task migration instruction is triggered, and the state of the server is set to be in waiting for migration; and the task scheduling program is used for scheduling the tasks.
It should be noted that the service state of the server specifically indicates the service state of the data acquisition service, and the service daemon can execute migration and return of the data acquisition service according to the allocation of the DIMS _ TA task scheduler.
Referring to fig. 4 and 11, it can be understood that the management method of the application service further includes, but is not limited to, the following steps:
step S601, creating a service information object of the server through a preset second main thread, and starting a task allocation timer thread of a task scheduling program;
step S602, through task allocation timer thread, judging whether each server has a fault and is not processed;
in step S603, if there is a failed and unprocessed server, the service state of the failed and unprocessed server is set to wait for migration.
It should be noted that task scheduling refers to migrating data collection services corresponding to a service daemon to other servers when hardware of a server is down; the service guardian guards the operation of each data acquisition server in the current server; a plurality of tasks can be mounted in each service daemon, each task is a thread and runs in the Windows service.
After the service state of the server is set to wait for migration, the task scheduling program allocates a task to the server, and updates the data acquisition service corresponding to the server in the server from an online state to an offline state.
Illustratively, referring to fig. 12, TES denotes the DIMS _ TA task scheduler, TES main thread denotes the second main thread of the task scheduler, TES TIMER1 denotes the task allocation TIMER thread of the task scheduler, high availability is monitored and initiated by the DIMS _ TA task scheduler, and the DIMS _ TA task scheduler performs the following in detail: firstly, the main thread flow of TES is as follows: t1_ s1, establishing a servInfo object of the data acquisition server; t1_ s2, starting a TES TIMER1 TIMER. The TES TIMER1 TIMER execution flow is as follows: t2_ s1, fetching and updating servInfo object content from DB; t2_ s2, traversing the servInfo and executing the following processing on each member; t2_ s3, judging whether the data acquisition server fails and is not processed; t2_ s4: if the data acquisition server is judged to be failed and unprocessed, triggering a task migration instruction, and setting the service state of the data acquisition service in the data acquisition server to wait for migration; and task allocation is carried out; and T2_ s5, changing the state of the data acquisition server to be offline. The TES TIMER1 is executed once at each preset third detection time interval, where the third detection time interval in this embodiment is 10 seconds; DB is an abbreviation for datebase, translated as a database file; servInfo denotes service information object information, and Timer is a Timer tool used to execute a specified task in a thread plan.
For example, referring to fig. 3, fig. 3 is a service state switching diagram of digital data acquisition service in a server, when a task scheduler finds that a host a is offline, the service state of the digital data acquisition service in the host a is set to wait for migration, the digital data acquisition service in the host a is migrated to a host B through a second thread of the host B, and the service state of the digital data acquisition service is updated to be operated in different places after the migration is completed; after the host A is on-line again, a waiting and back-migrating instruction is sent out through a second thread of the host A, the back migration is completed through a first thread of the host B, and the state of the data acquisition service is set to be back-migrated and completed; and restarting the data acquisition service by the main thread of the host A, and updating the service state of the data acquisition service to be normal operation.
In addition, an embodiment of a third aspect of the present application further provides a management device for an application service, where the management device for an application service includes: a memory, a processor, and a computer program stored on the memory and executable on the processor.
The processor and memory may be connected by a bus or other means.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the management method of the application service of the above-described first aspect embodiment are stored in a memory, and when executed by a processor, perform the management method of the application service of the above-described embodiment, for example, perform the above-described method steps S100 to S400 in fig. 1, method steps S110 to S150 in fig. 5, method steps S310 to S340 in fig. 6, method step S410 in fig. 7, and method steps S401 to S402 in fig. 8.
The non-transitory software programs and instructions required to implement the management method of the application service of the above-described second aspect embodiment are stored in a memory, and when executed by a processor, perform the management method of the application service of the above-described embodiment, for example, performing the above-described method steps S500 to S600 in fig. 9, method steps S610 to S630 in fig. 10, and method steps S601 to 603 in fig. 11.
The above described embodiments of the device are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may fall into one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Furthermore, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, which are executed by a processor or a controller, for example, by a processor in the above device embodiment, and may enable the above processor to perform the method for managing application services in the above first and second aspect embodiments, for example, perform the above-described method steps S100 to S400 in fig. 1, method steps S110 to S150 in fig. 5, method steps S310 to S340 in fig. 6, method step S410 in fig. 7, method steps S401 to S402 in fig. 8, method steps S500 to S600 in fig. 9, method steps S610 to S630 in fig. 10, and method steps S601 to 603 in fig. 11.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as is well known to those skilled in the art.
While the preferred embodiments of the present invention have been described, the present invention is not limited to the above embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and such equivalent modifications or substitutions are to be included within the scope of the present invention defined by the claims.

Claims (10)

1. A management method of application services is applied to a server and comprises the following steps:
acquiring a first task set to be executed through a preset first main thread, and deploying the first task set in the server;
after the first task set is deployed, starting a preset first thread and a preset second thread through the main thread;
maintaining the running state of each task in the first task set through the first thread so as to stop the first task when the first task is detected to run abnormally and restart the first task when the first task is recovered;
and maintaining the network state of the server through the second thread so as to stop executing the first task set when the network state of the server is abnormal and restart the first task set when the server is recovered.
2. The method for managing application services according to claim 1, wherein the acquiring a first task set to be executed through a preset first main thread and deploying the first task set in a server includes:
inquiring a first task set to be executed through a preset first main thread, and putting the first task set into an LIST cache;
respectively acquiring configuration information of each task in the first task set in the LIST cache;
reading a file corresponding to the configuration information, and copying the file to a preset position;
establishing a Windows task through a preset program;
and starting the Windows tasks according to the configuration information so as to deploy the first task set in a server.
3. The method for managing application services according to claim 1, wherein the maintaining, by the first thread, the running state of each task in the first task set includes:
inquiring a first task set to be loaded through a preset first thread, and putting the first task set into a LIST cache;
respectively acquiring configuration information of each task in the first task set from the LIST cache;
judging whether the running state of the server is abnormal or not according to the configuration information of each task;
and restarting the server when the running state of the server is abnormal.
4. The method for managing the application service according to claim 3, wherein the performing, by the second thread, maintenance processing on the network state of the server includes:
and detecting that the server generates a crash window through the second thread, judging that the running state of the server is abnormal, and restarting the server.
5. The method for managing application services according to claim 1, characterized in that it further comprises:
acquiring the network state obtained by the maintenance processing;
and when the network state is network recovery, setting the state of the server to be online, and setting the service state of the first task set to wait for backtracking.
6. The management method of the application service is characterized by being applied to a configuration center, wherein the configuration center is in communication connection with a plurality of servers; the management method of the application service comprises the following steps:
acquiring a preset configuration list;
selecting a first task set to be executed corresponding to each server from a configuration list according to the states of a plurality of servers, so that the servers obtain the first task set to be executed through a preset first main thread, and deploying the first task set in the servers; after the first task set is deployed, starting a preset first thread and a preset second thread through the main thread; and maintaining the running state of each task in the first task set through the first thread, and maintaining the network state of the server through the second thread.
7. The management method of application services according to claim 6, characterized in that it further comprises:
for each server, when the network state of the server is detected to be an online state, the service state of a second task set in the server is set to be operated in a different place; wherein the second set of tasks is deployed by the configuration center from other servers;
for each server, when the network state of the server is detected to be an online state, when the server receives a command of waiting for migration and a second task set corresponding to the command of waiting for migration runs in the server in a different place, stopping running of the second task set in the server, and executing the work of migration back on the second task set;
and for each server, when the network state of the server is detected to be network recovery, sending a command of waiting for backover to the migrated second task set, restarting the server after the service state of the second task set is changed to be backover, and setting the service state of the second task set to be normal operation.
8. The method for managing application services of claim 1, further comprising:
creating a service information object of the server through a preset second main thread, and starting a task allocation timer thread of a task scheduler;
judging whether each server has faults and is not processed or not through the task allocation timer thread;
and when the server which has the fault and is not processed exists, setting the service state of the server which has the fault and is not processed to wait for migration.
9. A management device for an application service, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor when executing the computer program implementing:
a management method of an application service according to any one of claims 1 to 5;
alternatively, the first and second electrodes may be,
a method of managing an application service as claimed in any one of claims 6 to 8.
10. A computer-readable storage medium characterized by: the computer-readable storage medium stores computer-executable instructions for:
a management method of executing an application service according to any one of claims 1 to 5;
alternatively, the first and second electrodes may be,
a management method of executing an application service according to any one of claims 6 to 8.
CN202211564306.0A 2022-12-07 2022-12-07 Application service management method, device and storage medium Pending CN115964142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211564306.0A CN115964142A (en) 2022-12-07 2022-12-07 Application service management method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211564306.0A CN115964142A (en) 2022-12-07 2022-12-07 Application service management method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115964142A true CN115964142A (en) 2023-04-14

Family

ID=87360852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211564306.0A Pending CN115964142A (en) 2022-12-07 2022-12-07 Application service management method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115964142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667363A (en) * 2024-02-01 2024-03-08 深圳市极限网络科技有限公司 Message processing method, message processing device and storage medium for virtual robot

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667363A (en) * 2024-02-01 2024-03-08 深圳市极限网络科技有限公司 Message processing method, message processing device and storage medium for virtual robot
CN117667363B (en) * 2024-02-01 2024-05-14 深圳市极限网络科技有限公司 Message processing method, message processing device and storage medium for virtual robot

Similar Documents

Publication Publication Date Title
CN110798375B (en) Monitoring method, system and terminal equipment for enhancing high availability of container cluster
US8156490B2 (en) Dynamic migration of virtual machine computer programs upon satisfaction of conditions
CN105229613A (en) Coordinate the fault recovery in distributed system
US20140059199A1 (en) Transaction-level health monitoring of online services
CN111506391B (en) Container deployment method and device
CN109144789B (en) Method, device and system for restarting OSD
US20230266956A1 (en) Method and apparatus for processing mirror images of ai platform
US7657734B2 (en) Methods and apparatus for automatically multi-booting a computer system
US7373542B2 (en) Automatic startup of a cluster system after occurrence of a recoverable error
CN115562911B (en) Virtual machine data backup method, device, system, electronic equipment and storage medium
CN113312153A (en) Cluster deployment method and device, electronic equipment and storage medium
CN113726553A (en) Node fault recovery method and device, electronic equipment and readable storage medium
CN115964142A (en) Application service management method, device and storage medium
CN114942859A (en) Method, device, equipment, medium and program product for processing node failure
US8448014B2 (en) Self-healing failover using a repository and dependency management system
CN105959145A (en) Method and system for parallel management server of high availability cluster
WO2013066341A1 (en) Fault processing in a system
CN113778607A (en) Method and device for realizing high availability of virtual machine, cloud management platform and storage medium
CN111897626A (en) Cloud computing scene-oriented virtual machine high-reliability system and implementation method
CN104866380A (en) Method and device for processing state transition of cluster management system
CN112269693B (en) Node self-coordination method, device and computer readable storage medium
CN110287066B (en) Server partition migration method and related device
CN116991710B (en) Automatic test method and system, electronic equipment and storage medium thereof
CN109412888B (en) Virtual switch monitoring method and device
CN107102887B (en) The dispositions method and device of the management platform of distributed block storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination