CN117093354A - Script management method, device, equipment and readable storage medium - Google Patents

Script management method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN117093354A
CN117093354A CN202311353177.5A CN202311353177A CN117093354A CN 117093354 A CN117093354 A CN 117093354A CN 202311353177 A CN202311353177 A CN 202311353177A CN 117093354 A CN117093354 A CN 117093354A
Authority
CN
China
Prior art keywords
script
server
data
task
clients
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
CN202311353177.5A
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.)
Beijing Easy Yikang Information Technology Co ltd
Original Assignee
Beijing Easy Yikang 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 Beijing Easy Yikang Information Technology Co ltd filed Critical Beijing Easy Yikang Information Technology Co ltd
Priority to CN202311353177.5A priority Critical patent/CN117093354A/en
Publication of CN117093354A publication Critical patent/CN117093354A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The application provides a script management method, a device, equipment and a readable storage medium, wherein the method comprises the steps of receiving script data sent by a server side and storing the script data in a script folder; determining the type of the script task sent by the received server; when the script task type sent by the server is determined to be the instant task, executing the script data in the script folder in real time; and when the script task type sent by the received server side is determined to be the timing task, executing the script data in the script folder at fixed time. The method can achieve the effect of reasonably realizing script management.

Description

Script management method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of script management, and in particular, to a method, apparatus, device, and readable storage medium for script management.
Background
At present, in the mainstream script management schemes in the industry, most of the main node triggering execution modes are recommended, namely, on a server deployed by the main node, a script is issued to the server by the main node and triggered to execute the script, another flexible worse timing execution mode is needed to put the script into a corresponding machine in advance, and then each modification is needed to be modified one by one; and a similar cluster management tool uses a master node and client modes, the master node triggers each client to execute scripts, and if the master node has a problem, the scripts of all the clients cannot be executed.
However, when the above solution is used, the script cannot be updated dynamically, the function of the visualization module is lacking, the monitoring and the activity detection of the client are lacking, or the client lacks the capability of executing the script independently.
Therefore, how to reasonably realize script management is a technical problem to be solved.
Disclosure of Invention
The embodiment of the application aims to provide a script management method, and the technical scheme of the embodiment of the application can achieve the effect of reasonably realizing script management.
In a first aspect, an embodiment of the present application provides a method for managing a script, which is applied to a client, and includes receiving script data sent by a server, and storing the script data in a script folder; determining the type of the script task sent by the received server; when the script task type sent by the server is determined to be the instant task, executing the script data in the script folder in real time; and when the script task type sent by the received server side is determined to be the timing task, executing the script data in the script folder at fixed time.
In the embodiment of the application, the script task type sent by the server side can be automatically checked and received, when the script task type is an instant task, the script data in the script folder can be directly obtained and executed, and when the script task type is a timing task, the script data can be regularly executed through the timing task in the script folder, so that the scheme of script management of the client side and the server side can be realized, and the effect of reasonably realizing the script management can be achieved.
In some embodiments, before receiving the script data sent by the server and storing the script data in the script folder, the method further includes: starting a controller, a timer, an executor, a socket micro-terminal and a monitor; after the monitor is started, the controller, the timer, the executor and the un-started components in the socket micro-end are started again through the monitor.
In the embodiment of the application, a plurality of plug-ins of the client can be started to participate in script management together, and the survival state of the plug-ins can be ensured in a mode of multiple starting.
In some embodiments, before receiving the script data sent by the server and storing the script data in the script folder, the method further includes: and sending the registration information to the server through a listener of the client.
In the embodiment of the application, when the registration information is sent to the server, script data fed back by the server is received, and the registration information plays a role in information request.
In some embodiments, when determining that the script task type sent by the receiving server is a timing task, executing script data in a script folder at fixed time includes: when the script task type sent by the server is determined to be the timing task, scanning a script folder through a monitor to acquire the timing task; acquiring timing script trigger data information in a timing task through a timer of the client, and forwarding the timing script trigger data information to an executor of the client; the executor executes the script data and records the execution record of the script data.
In the embodiment of the application, when receiving the instruction of the timing execution script sent by the server, the timing task in the script folder can be scanned to automatically acquire the task of the timing execution script, so that the effect of timing execution of script data is achieved.
In some embodiments, when determining that the script task type sent by the receiving server is a timing task, executing script data in a script folder at fixed time includes: when the script task type sent by the server is determined to be the instant task, the socket micro-end forwards the instant script trigger data information to a controller of the client; the controller forwards the instant script trigger data information to an executor, and the executor executes the script data and records the execution record of the script data.
In the embodiment of the application, through the cooperation of a plurality of plug-ins in the client, when the instant execution task instruction sent by the client is obtained, the instant execution of script data can be realized.
In a second aspect, an embodiment of the present application provides a method for managing scripts, which is applied to a server, and includes receiving multiple registration information sent by multiple clients; and registering the plurality of clients according to the plurality of registration information, and respectively sending script data to the plurality of clients.
In the embodiment of the application, script data can be sent to a plurality of clients with registration information, so that the scheme of managing the scripts of the clients and the server can be realized, and the multi-process script execution of the clients can be realized.
In some embodiments, after registering the plurality of clients according to the plurality of registration information and respectively transmitting script data to the plurality of clients, the method further includes: the script task type is sent to one or more of the plurality of clients.
In the embodiment of the application, the script task type can be sent to one or more clients, so that the one or more clients execute script data immediately or regularly, and the effect of triggering technical instructions is achieved.
In some embodiments, registering a plurality of clients according to a plurality of registration information and respectively transmitting script data to the plurality of clients includes: storing a plurality of registration information through a cache database or a message queue; and acquiring a plurality of registration information from the cache database or the message queue in a multithreading mode, registering a plurality of clients and concurring script data to the clients.
In the embodiment of the application, script data can be sent to a plurality of clients by combining the cache database with the message queue, so as to realize the effect of executing the multi-process script.
In some embodiments, after registering the plurality of clients according to the plurality of registration information and respectively transmitting script data to the plurality of clients, the method further includes: and when part of the client-side sending registration information is not received within the preset time, sending out a client-side fault warning through the server-side.
In the embodiment of the application, when the client side does not receive the registration information, the method and the device can immediately alarm, thereby realizing the effect of rapid early warning.
In a third aspect, an embodiment of the present application provides an apparatus for script management, including:
the receiving module is used for receiving the script data sent by the server and storing the script data in a script folder;
the determining module is used for determining the type of the script task sent by the receiving server;
the instant execution module is used for executing the script data in the script folder in real time when the script task type sent by the server is determined to be the instant task;
and the timing execution module is used for executing the script data in the script folder at fixed time when the script task type sent by the received server side is determined to be the timing task.
Optionally, the apparatus further includes:
the starting module is used for starting the controller, the timer, the executor, the socket micro-end and the monitor before the receiving module receives the script data sent by the server end and stores the script data in the script folder;
After the monitor is started, the controller, the timer, the executor and the un-started components in the socket micro-end are started again through the monitor.
Optionally, the apparatus further includes:
and the sending module is used for sending the registration information to the server through a monitor of the client before the receiving module receives the script data sent by the server and stores the script data in the script folder.
Optionally, the second execution module is specifically configured to:
when the script task type sent by the server is determined to be the timing task, scanning a script folder through a monitor to acquire the timing task;
acquiring timing script trigger data information in a timing task through a timer of the client, and forwarding the timing script trigger data information to an executor of the client;
the executor executes the script data and records the execution record of the script data.
Optionally, the first execution module is specifically configured to:
when the script task type sent by the server is determined to be the instant task, the socket micro-end forwards the instant script trigger data information to a controller of the client;
the controller forwards the instant script trigger data information to an executor, and the executor executes the script data and records the execution record of the script data.
In a fourth aspect, an embodiment of the present application provides another apparatus for script management, including:
the receiving module is used for receiving a plurality of registration information sent by a plurality of clients;
and the sending module is used for registering a plurality of clients according to the plurality of registration information and respectively sending script data to the plurality of clients.
Optionally, the apparatus further includes:
and the second sending module is used for sending script task types to one or more clients in the plurality of clients after registering the plurality of clients according to the plurality of registration information and respectively sending script data to the plurality of clients.
Optionally, the sending module is specifically configured to:
storing a plurality of registration information through a cache database or a message queue;
and acquiring a plurality of registration information from the cache database or the message queue in a multithreading mode, registering a plurality of clients and concurring script data to the clients.
Optionally, the apparatus further includes:
and the warning module is used for sending out a client fault warning through the server when part of the client sending registration information is not received within the preset time after the sending module registers a plurality of clients according to the plurality of registration information and respectively sends script data to the plurality of clients.
In a fifth aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing computer readable instructions which, when executed by the processor, perform the steps of the method as provided in the first or second aspects above.
In a sixth aspect, an embodiment of the present application provides a readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method as provided in the first or second aspects above.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for script management according to an embodiment of the present application;
FIG. 2 is a flowchart of another method for script management according to an embodiment of the present application;
FIG. 3 is a system for script management according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of an apparatus for script management according to an embodiment of the present application;
FIG. 5 is a schematic block diagram of another apparatus for script management provided by an embodiment of the present application;
FIG. 6 is a schematic block diagram of a script management apparatus according to an embodiment of the present application;
fig. 7 is a schematic block diagram of another apparatus for script management according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Some of the terms involved in the embodiments of the present application will be described first to facilitate understanding by those skilled in the art.
Shell is commonly known as Shell (used to distinguish from core) and refers to software (command interpreter, command parser) that "provides an operation interface for the user". It is similar to command. Com and later cmd. Exe under DOS. It receives the user command and then invokes the corresponding application.
Python is a widely used interpreted, high-level and general-purpose programming language.
The method is applied to the scenario of script management, and the specific scenario is that the server side sends script data and script execution instructions to a plurality of clients, so that the script execution of multiple processes is realized, and a reasonable script management effect is achieved.
web (World Wide Web) is a global wide area network, also known as the world wide web, which is an HTTP-based, global, dynamically interactive, cross-platform distributed graphical information system. The network service is established on the Internet, a graphical and easily-accessible visual interface is provided for a browser to search and browse information on the Internet, and documents and hyperlinks organize information nodes on the Internet into a mutually-associated network structure.
At present, in the mainstream script management schemes in the industry, most of the main node triggering execution modes are recommended, namely, on a server deployed by the main node, a script is issued to the server by the main node and triggered to execute the script, another flexible worse timing execution mode is needed to put the script into a corresponding machine in advance, and then each modification is needed to be modified one by one; and a similar cluster management tool uses a master node and client modes, the master node triggers each client to execute scripts, and if the master node has a problem, the scripts of all the clients cannot be executed. However, when the above solution is used, the script cannot be updated dynamically, the function of the visualization module is lacking, the monitoring and the activity detection of the client are lacking, or the client lacks the capability of executing the script independently.
The method and the device have the advantages that script data sent by the server side are received, and the script data are stored in the script folder; determining the type of the script task sent by the received server; when the script task type sent by the server is determined to be the instant task, executing the script data in the script folder in real time; and when the script task type sent by the received server side is determined to be the timing task, executing the script data in the script folder at fixed time. The script task type sent by the server side can be automatically checked and received, script data in the script folder can be directly obtained and executed when the script task type is an instant task, and the script data can be regularly executed through the timing task in the script folder when the script task type is a timing task, so that the script management scheme of the client side and the server side can be realized, and meanwhile, the effect of reasonably realizing the script management can be achieved.
In the embodiment of the present application, the execution subject may be a script management device in a script management system, and in practical application, the script management device may be electronic devices such as a terminal device and a server, which is not limited herein.
The method of script management according to an embodiment of the present application is described in detail below with reference to fig. 1.
Referring to fig. 1, fig. 1 is a flowchart of a method for managing scripts provided in an embodiment of the present application, where the method for managing scripts shown in fig. 1 is applied to a client, and includes:
step 110: and receiving script data sent by the server side and storing the script data in a script folder.
The server may be a server. The script data may be any script, such as shell, python scripts, including executed scripts and corresponding timed tasks. The script folder is stored in the client and used for storing script data. The client is responsible for script execution (instant task/timed task), script timed task registration and deletion, component state monitoring and activity detection, restarting and receiving after component abnormality, and the like.
In some embodiments of the present application, before receiving the script data sent by the server, the method further includes: starting a controller, a timer, an executor, a socket micro-terminal and a monitor; after the monitor is started, the controller, the timer, the executor and the un-started components in the socket micro-end are started again through the monitor.
In the process, a plurality of plug-ins of the client can be started to participate in script management, and the survival state of the plug-ins can be ensured in a mode of multiple starting.
When the plug-in which is not started exists after the components which are not started in the controller (controller), the timer (timer), the executor (worker) and the socket micro-end (socket) are started again through the monitor (Listener), the indication of the plug-in which is not started can be displayed, and the user can start the plug-in manually.
In some embodiments of the present application, before receiving the script data sent by the server, the method further includes: and sending the registration information to the server through a listener of the client.
In the process, when the registration information is sent to the server, script data fed back by the server is received, and the registration information plays a role in information request.
The registration information includes information such as an address and an ID (user name) of the registration client. The registration information is used for requesting the server to send script data to the client. The client monitors all components by using a monitor, and reports the detection activity information and the client registration information to the server by the monitor, wherein the detection activity information indicates the survival state of the service detected by a technical means.
Step 120: and determining the type of the script task sent by the received server.
The script task type represents the type of a script trigger instruction and is used for indicating the client to execute the script data stored in the script folder in real time or at fixed time.
Step 130: and when the script task type sent by the received server side is determined to be the instant task, executing the script data in the script folder in real time.
In some embodiments of the present application, when determining that the script task type sent by the receiving server is a timing task, executing the script data in the script folder at fixed time includes: when the script task type sent by the server is determined to be the instant task, the socket micro-end forwards the instant script trigger data information to a controller of the client; the controller forwards the instant script trigger data information to an executor, and the executor executes the script data and records the execution record of the script data.
In the process, the instant execution of script data can be realized by matching a plurality of plug-ins in the client and acquiring the instant execution task instruction sent by the client. Step 140: and when the script task type sent by the received server side is determined to be the timing task, executing the script data in the script folder at fixed time.
In some embodiments of the present application, when determining that the script task type sent by the receiving server is a timing task, executing the script data in the script folder at fixed time includes: when the script task type sent by the server is determined to be the timing task, scanning a script folder through a monitor to acquire the timing task; acquiring timing script trigger data information in a timing task through a timer of the client, and forwarding the timing script trigger data information to an executor of the client; the executor executes the script data and records the execution record of the script data.
In the process, the method and the device can automatically acquire the task of the timing execution script by scanning the timing task in the script folder when receiving the instruction of the timing execution script sent by the server, and trigger the executor to immediately execute the script data, so that the effect of timely executing the script data is achieved.
In the process shown in fig. 1, the method and the device receive the script data sent by the server and store the script data in the script folder; determining the type of the script task sent by the received server; when the script task type sent by the server is determined to be the instant task, executing the script data in the script folder in real time; and when the script task type sent by the received server side is determined to be the timing task, executing the script data in the script folder at fixed time. The script task type sent by the server side can be automatically checked and received, script data in the script folder can be directly obtained and executed when the script task type is an instant task, and the script data can be regularly executed through the timing task in the script folder when the script task type is a timing task, so that the script management scheme of the client side and the server side can be realized, and meanwhile, the effect of reasonably realizing the script management can be achieved.
The method of script management according to an embodiment of the present application is described in detail below with reference to fig. 2.
Referring to fig. 2, fig. 2 is a flowchart of another method for managing scripts provided in an embodiment of the present application, where the method for managing scripts shown in fig. 2 is applied to a server, and includes:
step 210: and receiving a plurality of registration information sent by a plurality of clients.
The online state and script execution state of the client can be checked according to the registration information, and token (token) can be used for verifying the client.
Step 220: and registering the plurality of clients according to the plurality of registration information, and respectively sending script data to the plurality of clients.
In some embodiments of the present application, registering a plurality of clients according to a plurality of registration information and transmitting script data to the plurality of clients, respectively, includes: storing a plurality of registration information through a cache database or a message queue; and acquiring a plurality of registration information from the cache database or the message queue in a multithreading mode, registering a plurality of clients and concurring script data to the clients.
In the process, script data can be sent to a plurality of clients by combining the cache database with the message queue, so that the effect of executing the multi-process script is realized.
The server side comprises a cache database and a message queue, wherein the cache database and the message queue are used for storing the registration information sent by the client side, and script data can be sent to the client side according to the sequence of storing the registration information.
In some embodiments of the present application, after registering a plurality of clients according to a plurality of registration information and transmitting script data to the plurality of clients, respectively, the method further includes: and when part of the client-side sending registration information is not received within the preset time, sending out a client-side fault warning through the server-side.
In the process, when the client side does not receive the registration information, the method and the device can immediately alarm, and achieve the effect of rapid early warning.
The preset time can be set according to the requirements of users. The partial clients are partial clients among all clients.
In some embodiments of the present application, after registering a plurality of clients according to a plurality of registration information and transmitting script data to the plurality of clients, respectively, the method further includes: the script task type is sent to one or more of the plurality of clients.
In the process, the script task type can be sent to one or more clients, so that the one or more clients execute script data immediately or regularly, and the effect of triggering technical instructions is achieved.
The method of script management was described above with reference to fig. 1-2, and the system of script management is described below with reference to fig. 3.
Referring to fig. 3, fig. 3 is a system for script management according to the present application, including: client and server.
Clients include controllers (controllers), timers (timers), executors (workers), listeners (listens), and socket micro-terminals (socket micro-terminals). A script folder is also included.
The server side comprises a warning module, an optimizable display module and a data storage module.
Specifically, the operation modes of the client, the server and the internal component module are as follows:
after the monitor is started, scanning and monitoring the states of other components, restarting the components which are not started until all the components run normally, sending registration information to a server by the monitor, receiving the information by the server and finishing recording by a data storage module, issuing a new script which is successfully registered by the client by the server, analyzing data after the client receives the new script, storing the script into a script folder, and updating the script folder; the monitor continuously scans the script folder, according to the content of the script folder, the timer sends script data to the executor when the timer triggers the timing task, the executor executes the script after acquiring the script data, when the instant script triggers, the server side issues the instant script triggering data information to the socket micro-end, the micro-end forwards the instant script triggering data information and the script data to the controller, the controller sends the script data to the executor to trigger execution, the executor records script execution state logs before and after executing the script, the execution state of the execution script is uploaded to the server side by the monitor, the server side provides api (application program) interfaces for registration and information reporting for web application service, and the report information of hundreds of clients is corresponding to using a cache database or a message queue service. The concurrency capability of instruction issuing of the server side is improved by using multithreading. The server monitors the uploading condition of the registered clients at regular time, and the clients which do not report information for a long time are regarded as abnormal clients, and the relevant manager is warned by a warning module. The visual display module of the server side provides visual operations, including functions of issuing scripts, deleting scripts, recording client side records, recording script execution states and the like.
The method of script management was described above by fig. 1-2, and the apparatus of script management is described below in conjunction with fig. 4-7.
Referring to fig. 4, a schematic block diagram of an apparatus 400 for script management according to an embodiment of the present application is provided, where the apparatus 400 may be a module, a program segment, or a code on an electronic device. The apparatus 400 corresponds to the embodiment of the method of fig. 1 described above, and is capable of performing the steps involved in the embodiment of the method of fig. 1. The specific functions of the apparatus 400 will be described below, and detailed descriptions thereof will be omitted herein as appropriate to avoid redundancy.
Optionally, the apparatus 400 includes:
the receiving module 410 is configured to receive script data sent by the server, and store the script data in a script folder;
a determining module 420, configured to determine a type of a script task that is received and sent by the server;
the instant execution module 430 is configured to execute the script data in the script folder in real time when determining that the script task type sent by the server is an instant task;
and the timing execution module 440 is configured to execute the script data in the script folder at a timing when determining that the script task type sent by the receiving server is a timing task.
Optionally, the apparatus further includes:
The starting module is used for starting the controller, the timer, the executor, the socket micro-end and the monitor before the receiving module receives the script data sent by the server end and stores the script data in the script folder; after the monitor is started, the controller, the timer, the executor and the un-started components in the socket micro-end are started again through the monitor.
Optionally, the apparatus further includes:
and the sending module is used for sending the registration information to the server through a monitor of the client before the receiving module receives the script data sent by the server and stores the script data in the script folder.
Optionally, the second execution module is specifically configured to:
when the script task type sent by the server is determined to be the timing task, scanning a script folder through a monitor to acquire the timing task; acquiring timing script trigger data information in a timing task through a timer of the client, and forwarding the timing script trigger data information to an executor of the client; the executor executes the script data and records the execution record of the script data.
Optionally, the first execution module is specifically configured to:
when the script task type sent by the server is determined to be the instant task, the socket micro-end forwards the instant script trigger data information to a controller of the client; the controller forwards the instant script trigger data information to an executor, and the executor executes the script data and records the execution record of the script data.
Referring to fig. 5, a schematic block diagram of another apparatus 500 for script management provided in an embodiment of the present application, the apparatus 500 may be a module, a program segment, or a code on an electronic device. The apparatus 500 corresponds to the above-described embodiment of the method of fig. 2, and is capable of performing the steps involved in the embodiment of the method of fig. 2, and specific functions of the apparatus 500 may be referred to as the following description, and detailed descriptions thereof are omitted herein as appropriate to avoid redundancy.
Optionally, the apparatus 500 includes:
a receiving module 510, configured to receive a plurality of registration information sent by a plurality of clients;
the sending module 520 is configured to register a plurality of clients according to the plurality of registration information, and send script data to the plurality of clients, respectively.
Optionally, the apparatus further includes:
and the second sending module is used for sending instant script trigger data information to one or more clients in the plurality of clients after registering the plurality of clients according to the plurality of registration information and respectively sending script data to the plurality of clients.
Optionally, the sending module is specifically configured to:
storing a plurality of registration information through a cache database or a message queue; and acquiring a plurality of registration information from the cache database or the message queue in a multithreading mode, registering a plurality of clients and concurring script data to the clients.
Optionally, the apparatus further includes:
and the warning module is used for sending out a client fault warning through the server when part of the client sending registration information is not received within the preset time after the sending module registers a plurality of clients according to the plurality of registration information and respectively sends script data to the plurality of clients.
Referring to fig. 6, a schematic block diagram of an apparatus for script management according to an embodiment of the present application may include a memory 610 and a processor 620. Optionally, the apparatus may further include: a communication interface 630, and a communication bus 640. The apparatus corresponds to the embodiment of the method of fig. 1 described above, and is capable of performing the steps involved in the embodiment of the method of fig. 1, and specific functions of the apparatus may be found in the following description.
In particular, memory 610 is used to store computer readable instructions.
The processor 620, for processing the memory-stored readable instructions, is capable of performing the various steps in the method of fig. 1.
Communication interface 630 is used for signaling or data communication with other node devices. For example: for communication with a server or terminal, or with other device nodes, although embodiments of the application are not limited in this regard.
Communication bus 640 for implementing direct connection communication of the above components.
The communication interface 630 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The memory 610 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 610 may also optionally be at least one storage device located remotely from the aforementioned processor. The memory 610 has stored therein computer readable instructions which, when executed by the processor 620, perform the method process described above in fig. 1. Processor 620 may be used on apparatus 400 and to perform the functions of the present application. By way of example, the processor 620 described above may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and the embodiments of the application are not limited in this regard.
Referring to fig. 7, a schematic block diagram of another script management apparatus provided in an embodiment of the present application, the apparatus may include a memory 710 and a processor 720. Optionally, the apparatus may further include: a communication interface 730, and a communication bus 740. The apparatus corresponds to the above embodiment of the method of fig. 2, and can perform the steps involved in the embodiment of the method of fig. 2, and specific functions of the apparatus may be found in the following description.
In particular, the memory 710 is used to store computer readable instructions.
Processor 720, which processes the memory-stored readable instructions, is capable of performing various steps in the method of fig. 2.
Communication interface 730 for communicating signaling or data with other node devices. For example: for communication with a server or terminal, or with other device nodes, although embodiments of the application are not limited in this regard.
A communication bus 740 for implementing direct connection communication of the above-described components.
The communication interface 730 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The memory 710 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. Memory 710 may optionally also be at least one storage device located remotely from the aforementioned processor. The memory 710 has stored therein computer readable instructions which, when executed by the processor 720, perform the method process described above in fig. 2. Processor 720 may be used on apparatus 500 and to perform functions in the present application. By way of example, the processor 720 may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and embodiments of the application are not limited in this regard.
Embodiments of the present application also provide a readable storage medium, which when executed by a processor, performs a method process performed by an electronic device in the method embodiment shown in fig. 1 or fig. 2.
It will be clear to those skilled in the art that, for convenience and brevity of description, reference may be made to the corresponding procedure in the foregoing method for the specific working procedure of the apparatus described above, and this will not be repeated here.
In summary, the embodiments of the present application provide a method, an apparatus, an electronic device, and a readable storage medium for managing a script, where the method includes receiving script data sent by a server, and storing the script data in a script folder; determining the type of the script task sent by the received server; when the script task type sent by the server is determined to be the instant task, executing the script data in the script folder in real time; and when the script task type sent by the received server side is determined to be the timing task, executing the script data in the script folder at fixed time. The method can achieve the effect of reasonably realizing script management.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (13)

1. A method for script management, applied to a client, comprising:
receiving script data sent by a server side, and storing the script data in a script folder;
determining the type of the script task which is received and sent by the server;
when the script task type sent by the server is determined to be the instant task, executing the script data in the script folder in an instant manner;
and when the script task type sent by the server is determined to be a timing task, executing the script data in the script folder at fixed time.
2. The method of claim 1, wherein prior to receiving the script data sent by the server and storing the script data in a script folder, the method further comprises:
starting a controller, a timer, an executor, a socket micro-terminal and a monitor;
and after the monitor is started, restarting the components which are not started in the controller, the timer, the executor and the socket micro-end through the monitor.
3. The method of claim 2, wherein before receiving the script data sent by the server and storing the script data in a script folder, the method further comprises:
And sending registration information to the server through the monitor of the client.
4. The method according to claim 3, wherein the executing the script data in the script folder at regular time when determining that the script task type transmitted by the server is a regular task is received, includes:
when the script task type sent by the server is determined to be a timing task, scanning the script folder through the monitor to acquire the timing task;
acquiring timing script trigger data information in the timing task through a timer of the client, and forwarding the timing script trigger data information to the executor of the client;
the executor executes the script data and records the execution record of the script data.
5. The method of claim 4, wherein executing the script data in the script folder immediately upon determining that the script task type sent by the server is an immediate task, comprises:
when the script task type sent by the server is determined to be an instant task, the socket micro-terminal forwards instant script trigger data information sent by the server to the controller of the client;
And the controller forwards the time script trigger data information to the executor, and the executor executes the script data and records the execution record of the script data.
6. The script management method is characterized by being applied to a server and comprising the following steps:
receiving a plurality of registration information sent by a plurality of clients;
and registering the plurality of clients according to the plurality of registration information, and respectively sending script data to the plurality of clients.
7. The method according to claim 6, wherein after the plurality of clients are registered based on the plurality of registration information and script data is transmitted to the plurality of clients, respectively, the method further comprises:
and sending the script task type to one or more clients in the plurality of clients.
8. The method of claim 7, wherein registering the plurality of clients based on the plurality of registration information and transmitting script data to the plurality of clients, respectively, comprises:
storing the plurality of registration information through a cache database or a message queue;
and acquiring the plurality of registration information from the cache database or the message queue in a multithreading mode, registering the plurality of clients and concurrence the script data to the plurality of clients.
9. The method according to any one of claims 6 to 8, wherein after the registering the plurality of clients based on the plurality of registration information and transmitting script data to the plurality of clients, respectively, the method further comprises:
and when part of the client-side sending registration information is not received within the preset time, sending out a client-side fault warning through the server-side.
10. An apparatus for script management, comprising:
the receiving module is used for receiving script data sent by the server side and storing the script data in a script folder;
the determining module is used for determining the type of the script task which is sent by the server;
the instant execution module is used for executing the script data in the script folder in real time when the script task type sent by the server is determined to be the instant task;
and the timing execution module is used for executing the script data in the script folder at fixed time when the script task type sent by the server side is determined to be the timing task.
11. An apparatus for script management, comprising:
the receiving module is used for receiving a plurality of registration information sent by a plurality of clients;
And the sending module is used for registering the plurality of clients according to the plurality of registration information and respectively sending script data to the plurality of clients.
12. An electronic device, comprising:
a memory and a processor, the memory storing computer readable instructions that, when executed by the processor, perform the steps of the method of any of claims 1-5 or 6-9.
13. A computer-readable storage medium, comprising:
computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-5 or 6-9.
CN202311353177.5A 2023-10-19 2023-10-19 Script management method, device, equipment and readable storage medium Pending CN117093354A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311353177.5A CN117093354A (en) 2023-10-19 2023-10-19 Script management method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311353177.5A CN117093354A (en) 2023-10-19 2023-10-19 Script management method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117093354A true CN117093354A (en) 2023-11-21

Family

ID=88775500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311353177.5A Pending CN117093354A (en) 2023-10-19 2023-10-19 Script management method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117093354A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979096A (en) * 2022-05-19 2022-08-30 浪潮软件集团有限公司 Domestic CPU and Os script task batch issuing platform and method
CN115473810A (en) * 2022-09-01 2022-12-13 珠海金山数字网络科技有限公司 Double-end synchronous script hot updating method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979096A (en) * 2022-05-19 2022-08-30 浪潮软件集团有限公司 Domestic CPU and Os script task batch issuing platform and method
CN115473810A (en) * 2022-09-01 2022-12-13 珠海金山数字网络科技有限公司 Double-end synchronous script hot updating method and device

Similar Documents

Publication Publication Date Title
US10348809B2 (en) Naming of distributed business transactions
US10152382B2 (en) Method and system for monitoring virtual machine cluster
US20190294481A1 (en) Endpoint process state collector
WO2013139196A1 (en) Auxiliary diagnosis method, device and system for virtual machine failure
US20020049801A1 (en) Remote tracing of data processing nodes in an asynchronous messaging network
CN112506915A (en) Application data management system, processing method and device and server
CN109586989B (en) State checking method, device and cluster system
CN111339118A (en) Kubernetes-based resource change history recording method and device
CN107885634B (en) Method and device for processing abnormal information in monitoring
JP2007199956A (en) Logging information management method and logging information management system
CN108228417B (en) Internet of vehicles log processing method and device
CN112783618A (en) Task scheduling monitoring system, computer equipment and storage medium
CN117093354A (en) Script management method, device, equipment and readable storage medium
CN115660610B (en) Decentralized cooperative office system and method
EP2924581B1 (en) Method, server and agent for monitoring user interaction patterns
EP3099012A1 (en) A method for determining a topology of a computer cloud at an event date
JP5477057B2 (en) Log management method, log management program, and log management apparatus
CN114416560A (en) Program crash analysis aggregation method and system
CN115168137A (en) Monitoring method and system for timing task, computer equipment and storage medium
CN110011845B (en) Log collection method and system
US20120239656A1 (en) Information processing apparatus, message classifying method and non-transitory medium
CN108984285B (en) Data collision flow analysis method and device, storage medium and terminal
CN113761015B (en) Log processing method, device, system and storage medium
CN106790168B (en) Communication preprocessing method, client and server
CN115604135B (en) Service monitoring method and device

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