CN113342492A - Task instruction issuing method, device, system, electronic equipment and medium - Google Patents

Task instruction issuing method, device, system, electronic equipment and medium Download PDF

Info

Publication number
CN113342492A
CN113342492A CN202110639173.8A CN202110639173A CN113342492A CN 113342492 A CN113342492 A CN 113342492A CN 202110639173 A CN202110639173 A CN 202110639173A CN 113342492 A CN113342492 A CN 113342492A
Authority
CN
China
Prior art keywords
information
zookeeper
equipment
target
task instruction
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
CN202110639173.8A
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.)
Hangzhou Yaowang Network Technology Co ltd
Original Assignee
Hangzhou Yaowang Network 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 Hangzhou Yaowang Network Technology Co ltd filed Critical Hangzhou Yaowang Network Technology Co ltd
Priority to CN202110639173.8A priority Critical patent/CN113342492A/en
Publication of CN113342492A publication Critical patent/CN113342492A/en
Pending legal-status Critical Current

Links

Images

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
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • 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/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application discloses a method, a device, a system, an electronic device and a medium for issuing task instructions, wherein the method comprises the following steps: establishing websocket communication with each device in the device cluster, and storing information of each device in the device cluster to a zookeeper; when a calling request of the equipment is received, matching target equipment meeting the preset screening condition in the information of each piece of equipment stored by the zookeeper according to the preset screening condition corresponding to the calling request; and transmitting the task instruction corresponding to the calling request to the target equipment by utilizing websocket communication. The method does not need to search IP addresses to establish connection and then carry out communication, can acquire the information of each device in real time, and improves the efficiency of device scheduling.

Description

Task instruction issuing method, device, system, electronic equipment and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a system, an electronic device, and a medium for issuing a task instruction.
Background
In general, a server wants to access a client, needs to know its IP address, and then communicates with it. However, when there are many clients, it is inefficient to pre-allocate each IP address and search for a desired target IP address; secondly, in this way, the server cannot acquire the state and device information of each device in real time, and cannot determine available devices, so that the calling real-time performance of the client device is poor, and the efficiency is low.
Disclosure of Invention
The application aims to provide a task instruction issuing method, a task instruction issuing device, a task instruction issuing system, an electronic device and a task instruction issuing medium, communication is carried out after IP addresses do not need to be searched and connection is established, information of each device can be obtained in real time, and efficiency of device scheduling is improved. The specific scheme is as follows:
in a first aspect, the present application discloses a method for issuing a task instruction, including:
establishing websocket communication with each device in the device cluster, and storing information of each device in the device cluster to a zookeeper;
when a call request of equipment is received, matching target equipment meeting the preset screening condition in the information of each piece of equipment stored by the zookeeper according to the preset screening condition corresponding to the call request;
and issuing the task instruction corresponding to the calling request to the target equipment by utilizing the websocket communication.
Optionally, after storing the information of each device in the device cluster to the zookeeper, the method further includes:
synchronizing the information of each device stored in the zookeeper to a local memory;
correspondingly, when a call request of a device is received, according to a preset screening condition corresponding to the call request, matching a target device meeting the preset screening condition in the information of each device stored in the zookeeper includes:
when a call request of the equipment is received, matching target equipment meeting the preset screening condition in the information of each equipment stored in the local memory according to the preset screening condition corresponding to the call request.
Optionally, the matching, according to a preset screening condition corresponding to the call request, of the target device that meets the preset screening condition in the information of each device stored in the local memory includes:
when the preset screening condition includes a target cluster type, a target device tag and availability information, searching for a device which satisfies the target cluster type, the target device tag and the availability information from the information of each device stored in the local memory, and taking the device which satisfies the target cluster type, the target device tag and the availability information as the target device.
Optionally, after storing the information of each device in the device cluster to the zookeeper, the method further includes:
monitoring whether the information of each device stored by the zookeeper changes or not;
and if the information of the changed equipment exists in the zookeeper, updating the information of the corresponding equipment in the local memory.
Optionally, the storing information of each device in the device cluster to the zookeeper includes:
storing the device information, the state information and the heartbeat time of each device in the device cluster to the zookeeper, and taking the device information, the state information and the heartbeat time as the information.
In a second aspect, the present application discloses a task instruction issuing device, which is applied to a server and includes:
the storage module is used for establishing websocket communication with each device in the device cluster and storing information of each device in the device cluster to the zookeeper;
the searching module is used for matching target equipment meeting preset screening conditions in the information of each piece of equipment stored by the zookeeper according to the preset screening conditions corresponding to the calling request when the calling request of the equipment is received;
and the issuing module is used for issuing the task instruction corresponding to the calling request to the target equipment by utilizing the websocket communication.
In a third aspect, the present application discloses a task instruction issuing system, including:
each device in the device cluster is used for establishing websocket communication with the server;
the server is used for executing the steps of the task instruction issuing method.
Optionally, the zookeeper is deployed in another server.
In a fourth aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the task instruction issuing method when the computer program is executed.
In a fifth aspect, the present application discloses a medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the above task instruction issuing method.
The application provides a task instruction issuing method, which comprises the following steps: establishing websocket communication with each device in the device cluster, and storing information of each device in the device cluster to a zookeeper; when a call request of equipment is received, matching target equipment meeting the preset screening condition in the information of each piece of equipment stored by the zookeeper according to the preset screening condition corresponding to the call request; and issuing the task instruction corresponding to the calling request to the target equipment by utilizing the websocket communication.
Therefore, the server and each device in the device cluster can directly establish persistent connection due to one-time establishment of the websocket communication, and communication is performed after the connection is established without searching an IP address; according to the method and the device, the zookeeper is used for storing the information of each device in the device cluster, the information of each device can be obtained in real time, the defects that in the related technology, communication is needed after IP connection is built, the server cannot obtain the information of each device in real time, and available devices cannot be determined are overcome, the information of each device can be obtained in real time, and the device scheduling efficiency is improved. The application also provides a task instruction issuing device, a task instruction issuing system, electronic equipment and a medium, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a task instruction issuing method according to an embodiment of the present application;
FIG. 2 is a block diagram of an embodiment of the present application;
fig. 3 is a schematic structural diagram of a task instruction issuing device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Generally, a server wants to access a client, needs to know its IP address, and then communicates with it. When there are many clients, it is very inefficient to set many IP addresses in advance; secondly, the state information or other information of the device at the current time cannot be known, and the required device cannot be dynamically acquired or whether the device is available or not cannot be judged. Based on the above technical problem, this embodiment provides a method for issuing a task instruction, which can obtain information of each device in real time, and improve efficiency of device scheduling, specifically referring to fig. 1, where fig. 1 is a flowchart of the method for issuing a task instruction provided in this embodiment of the present application, and specifically includes:
s101, establishing websocket communication with each device in the device cluster, and storing information of each device in the device cluster to a zookeeper.
The execution subject of the embodiment of the application is the server. The number of the device clusters is not limited in this embodiment, and the device clusters may include 1 device cluster or 2 device clusters, and may be set according to actual requirements. Meanwhile, the number of the devices in the device cluster is not limited in this embodiment, and may be determined according to actual situations. In this embodiment, websocket communication (which is a protocol for performing full-duplex communication on a single TCP connection) is established between the server and each device in the device cluster, and it can be understood that a persistent connection is established after one-time websocket communication handshake connection is performed between the server and each device, and communication is performed after an operation that an IP connection needs to be established in the related art is not required, so that efficiency of device scheduling can be improved. The embodiment does not limit the specific content of the information of each device, and may include device information, state information of the device, and heartbeat time of the device. In the embodiment, the zookeeper component is used for storing the information of each device, that is, each node of the zookeeper is used for storing the information of each device, it can be understood that the zookeeper is a distributed application program coordination service which is a distributed type and opens a source code, the information of each device can be obtained in real time, when the information of each device changes, the information can be detected in time and pushed to a server, and the real-time performance of device scheduling can be improved. The server where the zookeeper is located is not limited in this embodiment, and may be the same server as the service logic function, that is, the zookeeper is located in the server of the execution main body in this embodiment, or may be located in another server. Optionally, to improve usability, zookeeper may be deployed on other servers in this embodiment.
The present embodiment does not limit the operation of storing the information of each device in the device cluster to zookeeper. In a specific embodiment, in order to improve the information acquisition efficiency and save communication resources, after storing the information of each device in the device cluster to the zookeeper, this embodiment may further include:
synchronizing the information of each device stored in the zookeeper to a local memory;
correspondingly, when a call request of a device is received, according to a preset screening condition corresponding to the call request, matching a target device meeting the preset screening condition in information of each device stored in the zookeeper may include:
when a call request of the equipment is received, matching target equipment meeting preset screening conditions in the information of each equipment stored in the local memory according to the preset screening conditions corresponding to the call request.
In this embodiment, after information of each device in the device cluster is stored in the zookeeper, the information of each device stored in the zookeeper is synchronized to the local memory, and when the information of the corresponding device is needed, the information of the corresponding device is directly searched in the local memory, and the information of the corresponding device in the zookeeper is acquired without performing communication transmission, so that the information acquisition efficiency can be improved, and communication resources can be saved. Correspondingly, when a call request of the device is received, the target device meeting the preset screening condition can be matched in the information of each device stored in the local memory according to the preset screening condition corresponding to the call request.
Further, in order to update the information of the device that changes in the local memory in time, after the information of each device in the device cluster is stored to the zookeeper, the method may further include:
monitoring whether information of each device stored by the zookeeper changes or not;
and if the information of the changed equipment exists in the zookeeper, updating the information of the corresponding equipment in the local memory.
In this embodiment, by monitoring information of each device stored in the zookeeper, that is, by monitoring whether path data of each node changes, when the path data changes, information of the device that changes is updated. The embodiment does not limit the specific content of the changed device, and may be that the device cluster to which the device belongs is changed, that the version of the device is changed, or that other changed content is available. That is, in this embodiment, the server can monitor the change condition of the information of each device stored by the zookeeper in real time, and update the information of the device that has changed in the local memory in time.
The embodiment does not limit the specific content of the information of the device, and may include device information, state information of the device, heartbeat time of the device, and the above content. In a specific embodiment, storing information of each device in the device cluster to the zookeeper may include:
and storing the device information, the state information and the heartbeat time of each device in the device cluster to a zookeeper, and taking the device information, the state information and the heartbeat time as information.
The information of the device in this embodiment includes device information, state information, and heartbeat time at the same time, and the device information, the state information, and the heartbeat time of each device are stored in the zookeeper. The present embodiment does not limit the specific content of the device information, and may include a device cluster type and a device tag. It can be understood that the cluster type is classified according to specific service requirements, for example, the cluster type of the service may be; the device tag may be information such as the version of the device. The device state refers to a state of whether the device is occupied in executing a task, and may be an idle state or an occupied state. The heartbeat time is understood as an interval time, that is, a signal value is sent to the server by the device every time a heartbeat time elapses, so as to represent that the device is not in failure in normal operation.
S102, when a call request of the equipment is received, matching target equipment meeting preset screening conditions in the information of each piece of equipment stored by the zookeeper according to the preset screening conditions corresponding to the call request.
The present embodiment does not limit the specific content of the preset screening condition, and can be set according to the specific service requirement. For example, the preset filtering condition may be a specified device cluster, a specified device tag, or current availability or status information of the device. The present embodiment also does not limit the number of target devices, and may be used as a target device as long as a preset screening condition is satisfied. In a specific embodiment, matching, according to a preset filtering condition corresponding to the invocation request, a target device that meets the preset filtering condition in information of each device stored in the local memory may include:
when the preset screening condition comprises a target cluster type, a target device label and availability information, searching for a device which meets the target cluster type, the target device label and the availability information in the information of each device stored in the local memory, and taking the device which meets the target cluster type, the target device label and the availability information as a target device.
In this embodiment, when the preset screening condition includes a target cluster type, a target device tag, and availability information, a device that simultaneously satisfies the target cluster type, the target device tag, and the availability information is searched for in the information of each device stored in the local memory, and a device that simultaneously satisfies the target cluster type, the target device tag, and the availability information is used as the target device. In this embodiment, the searching order is not limited, and the device meeting the target cluster type may be searched first, then the device meeting the target device label is searched in the devices meeting the target cluster type, and then the device meeting the availability information is searched in the devices meeting the target device label as the target device; the target device may be searched according to other sequences or according to three conditions, and then the device that satisfies the three conditions is determined as the target device, which may be specifically set according to the service requirement.
S103, a task instruction corresponding to the calling request is issued to the target device through websocket communication.
The embodiment does not limit the specific content of the task instruction, and can be set according to actual requirements. That is, in this embodiment, the task instruction corresponding to the call request is issued to the target device by using websocket communication. It can be understood that the websocket communication only needs one connection, namely permanent communication, and real-time communication can be realized without connection (such as IP connection in the related art). The communication efficiency and the real-time performance of task execution are improved.
Based on the technical scheme, the server establishes the websocket communication with each device in the device cluster, and due to one establishment of the websocket communication, persistent connection can be directly established between the server and each device without searching an IP address to establish connection and then performing communication; according to the method and the device, the zookeeper is used for storing the information of each device in the device cluster, the information of each device can be acquired in real time, and the device scheduling efficiency is improved.
The following is a specific example provided by the present application. The goal is to have a business need to test app functionality on a device (which may be a cell phone device) on a large scale. Under the distributed condition, batch equipment can be controlled in real time through a server (such as a computer) to issue task instructions; the system has the advantages that information such as equipment cluster types, equipment labels and equipment states can be distinguished, equipment under certain rule conditions can be dynamically obtained in real time, and different task instructions can be issued to different equipment; when the number of the devices is needed to be increased in the service, the system can realize dynamic capacity expansion without human intervention.
First, the device needs to establish communication with the server. Simple communication may establish an http connection, but this approach requires exposing all the client's IP ports and maintaining them for the server to obtain. Therefore, the long-chain connection between the client side, namely the equipment, and the server side is realized by establishing the websocket communication in the embodiment of the application, only one handshake is performed after the websocket communication is established, and the communication can be performed all the time in the connection. Meanwhile, in consideration of the real-time performance of equipment information (cluster type and equipment label) and equipment state maintenance and distributed service, the zookeeper is selected as the registration middleware of the equipment, and the connected equipment can store the equipment information and other contents in the zookeeper node. When the content of the node changes, the server is informed in time, and the server can acquire equipment information, state information and the like in real time. When a new device is added, the new device can be automatically connected with the server side and register information in the zookeeper, so that dynamic capacity expansion is achieved. And secondly, the server can acquire the equipment information and the state information in real time, and can select target equipment to issue a task instruction under a certain rule condition, namely a preset screening condition, so that all service requirements are met.
Fig. 2 is a schematic diagram of a frame of an embodiment provided in this embodiment. The method comprises the following specific steps:
s1, the client device actively initiates a long-link communication (or called websocket communication) with the websocket of the server, only one device is labeled in fig. 2, and practically all the accessed devices initiate a connection.
And S2, after the Websocket communication is established, the reporting module of the server side synchronizes the state information of the equipment to the zookeeper.
S3, when the zookeeper node data change, namely the node storage device information changes, the zookeeper pushes the change data to the server; and a monitoring module of the server side can automatically monitor the change of the data of the corresponding node in the zookeeper, and then converts the acquired information of the equipment into system local data to be stored in a local memory. In a distributed environment, all servers will receive the callback content of zookeeper.
S4, when the user initiates a device call request, the server may dynamically filter the required target device according to a certain rule, i.e. a preset filtering condition, in the local memory of the system.
And S5, the server side issues a task instruction through the websocket communication established between the server side and the target equipment screened in the S4.
Based on the technical scheme, the state information and the equipment information of the equipment can be found in real time through a centralized server, the task instruction is sent through the state information and the equipment information of the equipment, and the system is not influenced when the equipment is transversely expanded. The communication with batch equipment is supported, the equipment information can be automatically acquired in real time, the communication is carried out through the websocket, and the scheduling instantaneity and efficiency are greatly improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a task instruction issuing device according to an embodiment of the present application, where the task instruction issuing device described below and the task instruction issuing method described above are referred to in a corresponding manner, and the task instruction issuing device described below and the task instruction issuing method described above are all disposed in the same device, and the task instruction issuing device includes:
in some specific embodiments, the method specifically includes:
the storage module 301 is configured to establish websocket communication with each device in the device cluster, and store information of each device in the device cluster to a zookeeper;
the searching module 302 is configured to, when a call request of a device is received, match a target device that meets a preset screening condition in information of each device stored in the zookeeper according to the preset screening condition corresponding to the call request;
and the issuing module 303 is configured to issue the task instruction corresponding to the call request to the target device by using websocket communication.
In some specific embodiments, the method further comprises:
the synchronization module is used for synchronizing the information of each device stored in the zookeeper to a local memory;
accordingly, the lookup module 302 includes:
and the matching unit is used for matching target equipment meeting the preset screening conditions in the information of each piece of equipment stored in the local memory according to the preset screening conditions corresponding to the calling request when the calling request of the equipment is received.
In some specific embodiments, the matching unit includes:
and the searching subunit is configured to search, when the preset screening condition includes a target cluster type, a target device tag, and availability information, a device that satisfies the target cluster type, the target device tag, and the availability information from information of each device stored in the local memory, and use a device that satisfies the target cluster type, the target device tag, and the availability information at the same time as the target device.
In some specific embodiments, the method further comprises:
the monitoring module is used for monitoring whether the information of each device stored by the zookeeper changes;
and the updating module is used for updating the information of the corresponding equipment in the local memory if the information of the changed equipment exists in the zookeeper.
In some specific embodiments, the storage module 301 includes:
and the storage unit is used for storing the device information, the state information and the heartbeat time of each device in the device cluster to the zookeeper and taking the device information, the state information and the heartbeat time as information.
Since the embodiment of the task instruction issuing device portion corresponds to the embodiment of the task instruction issuing method portion, for the embodiment of the task instruction issuing device portion, reference is made to the description of the embodiment of the task instruction issuing method portion, and details are not described here for the moment.
The application also discloses a task instruction issuing system, which comprises:
each device in the device cluster is used for establishing websocket communication with the server;
and the server is used for executing the steps of the task instruction issuing method.
In some particular embodiments, zookeeper is deployed to other servers.
Since the embodiment of the task instruction issuing system portion corresponds to the embodiment of the task instruction issuing method portion, for the embodiment of the task instruction issuing system portion, reference is made to the description of the embodiment of the task instruction issuing method portion, and details are not described here for the moment.
In the following, an electronic device provided in the embodiments of the present application is introduced, and the electronic device described below and the task instruction issuing method described above may be referred to correspondingly.
The application also discloses an electronic device, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the task instruction issuing method when executing the computer program.
Since the embodiment of the electronic device portion corresponds to the embodiment of the task instruction issuing method portion, please refer to the description of the embodiment of the task instruction issuing method portion for the embodiment of the electronic device portion, which is not described herein again.
In the following, a medium provided in the embodiments of the present application is introduced, and the medium described below and the task instruction issuing method described above may be referred to correspondingly.
The application also discloses a medium, wherein a computer program is stored on the medium, and the computer program realizes the steps of the task instruction issuing method when being executed by the processor.
Since the embodiment of the media part corresponds to the embodiment of the task instruction issuing method part, please refer to the description of the embodiment of the task instruction issuing method part for the embodiment of the media part, which is not described herein again.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method, the device, the system, the electronic device and the medium for issuing the task instruction provided by the application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A task instruction issuing method is applied to a server and comprises the following steps:
establishing websocket communication with each device in the device cluster, and storing information of each device in the device cluster to a zookeeper;
when a call request of equipment is received, matching target equipment meeting the preset screening condition in the information of each piece of equipment stored by the zookeeper according to the preset screening condition corresponding to the call request;
and issuing the task instruction corresponding to the calling request to the target equipment by utilizing the websocket communication.
2. The task instruction issuing method according to claim 1, wherein after storing information of each device in the device cluster to zookeeper, the method further comprises:
synchronizing the information of each device stored in the zookeeper to a local memory;
correspondingly, when a call request of a device is received, according to a preset screening condition corresponding to the call request, matching a target device meeting the preset screening condition in the information of each device stored in the zookeeper includes:
when a call request of the equipment is received, matching target equipment meeting the preset screening condition in the information of each equipment stored in the local memory according to the preset screening condition corresponding to the call request.
3. The method according to claim 2, wherein the step of matching, according to a preset screening condition corresponding to the call request, the target device that satisfies the preset screening condition among the information of each device stored in the local memory includes:
when the preset screening condition includes a target cluster type, a target device tag and availability information, searching for a device which satisfies the target cluster type, the target device tag and the availability information from the information of each device stored in the local memory, and taking the device which satisfies the target cluster type, the target device tag and the availability information as the target device.
4. The task instruction issuing method according to claim 2, wherein after storing information of each device in the device cluster to zookeeper, the method further comprises:
monitoring whether the information of each device stored by the zookeeper changes or not;
and if the information of the changed equipment exists in the zookeeper, updating the information of the corresponding equipment in the local memory.
5. The task instruction issuing method according to claim 1, wherein the storing information of each device in the device cluster to zookeeper includes:
storing the device information, the state information and the heartbeat time of each device in the device cluster to the zookeeper, and taking the device information, the state information and the heartbeat time as the information.
6. A task instruction issuing device is characterized by being applied to a server and comprising:
the storage module is used for establishing websocket communication with each device in the device cluster and storing information of each device in the device cluster to the zookeeper;
the searching module is used for matching target equipment meeting preset screening conditions in the information of each piece of equipment stored by the zookeeper according to the preset screening conditions corresponding to the calling request when the calling request of the equipment is received;
and the issuing module is used for issuing the task instruction corresponding to the calling request to the target equipment by utilizing the websocket communication.
7. A task instruction issuing system is characterized by comprising:
each device in the device cluster is used for establishing websocket communication with the server;
the server is used for executing the steps of the task instruction issuing method according to any one of claims 1 to 5.
8. A task instruction issuing system according to claim 7, wherein the zookeeper is deployed to another server.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the task instruction issuing method according to any one of claims 1 to 5 when executing the computer program.
10. A medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of a method for issuing task instructions according to any one of claims 1 to 5.
CN202110639173.8A 2021-06-08 2021-06-08 Task instruction issuing method, device, system, electronic equipment and medium Pending CN113342492A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110639173.8A CN113342492A (en) 2021-06-08 2021-06-08 Task instruction issuing method, device, system, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110639173.8A CN113342492A (en) 2021-06-08 2021-06-08 Task instruction issuing method, device, system, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN113342492A true CN113342492A (en) 2021-09-03

Family

ID=77475540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110639173.8A Pending CN113342492A (en) 2021-06-08 2021-06-08 Task instruction issuing method, device, system, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113342492A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712457A (en) * 2018-04-03 2018-10-26 苏宁易购集团股份有限公司 Back-end server dynamic load method of adjustment and device based on Nginx reverse proxys
CN109815248A (en) * 2019-01-15 2019-05-28 科大国创软件股份有限公司 A kind of distributed structure/architecture data consistency method based on Zookeeper
CN109831473A (en) * 2017-11-23 2019-05-31 菜鸟智能物流控股有限公司 Logistics service providing method and equipment
US10346188B1 (en) * 2014-06-13 2019-07-09 Veritas Technologies Llc Booting virtual machine instances in a distributed data processing architecture
CN110597664A (en) * 2019-09-17 2019-12-20 深信服科技股份有限公司 High-availability cluster resource deployment method, device and related components
US20200213387A1 (en) * 2019-01-02 2020-07-02 Citrix Systems, Inc. Bidirectional Communication Clusters
CN112118266A (en) * 2020-09-24 2020-12-22 焦点科技股份有限公司 Distributed state synchronization method based on cooperation of HTTP and WebSocket
CN112416581A (en) * 2020-11-13 2021-02-26 五八同城信息技术有限公司 Distributed calling system for timed tasks

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10346188B1 (en) * 2014-06-13 2019-07-09 Veritas Technologies Llc Booting virtual machine instances in a distributed data processing architecture
CN109831473A (en) * 2017-11-23 2019-05-31 菜鸟智能物流控股有限公司 Logistics service providing method and equipment
CN108712457A (en) * 2018-04-03 2018-10-26 苏宁易购集团股份有限公司 Back-end server dynamic load method of adjustment and device based on Nginx reverse proxys
US20200213387A1 (en) * 2019-01-02 2020-07-02 Citrix Systems, Inc. Bidirectional Communication Clusters
CN109815248A (en) * 2019-01-15 2019-05-28 科大国创软件股份有限公司 A kind of distributed structure/architecture data consistency method based on Zookeeper
CN110597664A (en) * 2019-09-17 2019-12-20 深信服科技股份有限公司 High-availability cluster resource deployment method, device and related components
CN112118266A (en) * 2020-09-24 2020-12-22 焦点科技股份有限公司 Distributed state synchronization method based on cooperation of HTTP and WebSocket
CN112416581A (en) * 2020-11-13 2021-02-26 五八同城信息技术有限公司 Distributed calling system for timed tasks

Similar Documents

Publication Publication Date Title
CN108696374B (en) Method and device for updating client configuration
CN113783922A (en) Load balancing method, system and device
US10069941B2 (en) Scalable event-based notifications
CN107172214B (en) Service node discovery method and device with load balancing function
CN108712457A (en) Back-end server dynamic load method of adjustment and device based on Nginx reverse proxys
US10027752B2 (en) Distributed server election with imperfect clock synchronization
CN114328618A (en) Cache data synchronization method, device, equipment and storage medium
CN111884844A (en) Message service access method and device based on zookeeper
US10498617B1 (en) System, method, and computer program for highly available and scalable application monitoring
CN116800825A (en) Calling method, device, equipment and medium based on micro-service splitting
CN114338769B (en) Access request processing method and device
CN113079098B (en) Method, device, equipment and computer readable medium for updating route
CN113342492A (en) Task instruction issuing method, device, system, electronic equipment and medium
CN116647552A (en) Service processing method and system in heterogeneous micro-service cluster, terminal and storage medium
CN113918436A (en) Log processing method and device
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN112702441B (en) Container-based access data processing method, device, system and storage medium
CN112073322B (en) Discovery method and device of network tester
CN114461424A (en) Inter-unit service discovery method, device and system under unitized deployment architecture
CN114785861A (en) Service request forwarding system, method, computer equipment and storage medium
CN114327823A (en) Method, system, terminal and storage medium for calling resources of micro-service cluster
CN114697339A (en) Load balancing method and device under centralized architecture
CN112181610A (en) Task processing system
CN113296968A (en) Address list updating method, device, medium and electronic equipment
EP3304865B1 (en) Systems and methods for server failover and load balancing

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