Method, device, equipment and storage medium for equipment managementTechnical Field
The present invention relates to internet technologies, and in particular, to a method, an apparatus, a device, and a storage medium for device management.
Background
With the development of economy and the improvement of the living standard of people, more and more equipment are needed to complete economic transactions, and centralized management of the equipment is urgently needed to improve the processing efficiency of the economic transactions.
At present, management of a plurality of devices is usually management by regions, when a device in a certain region fails, the device in other regions cannot be used for processing, and a standby device is required to be specially prepared for the occurrence of an accident. However, the standby equipment in the prior art not only affects the economy, but also cannot realize the unified management of the equipment, and when various transaction tasks are processed, the problem that the fault condition cannot be solved in time exists, and the processing efficiency of the tasks is low.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for equipment management, which are used for realizing unified management on the equipment and achieving the effect of timely processing tasks on faulty equipment.
In a first aspect, an embodiment of the present invention provides a device management method, which is executed by a server, and includes:
if any equipment is detected to be out of order, determining the task quantity of other equipment; the other equipment and the equipment belong to the same data center or different data centers;
according to the existing task quantity of the other equipment, target equipment to be synchronized is selected from the other equipment;
determining system version information of the target equipment according to the system version information of the equipment;
and synchronizing the task data in the device to the target device for instructing the target device to execute the task of the device based on the determined system version information.
Optionally, the selecting, according to the existing task amount of the other devices, a target device to be synchronized from the other devices includes:
sequencing the other equipment according to the existing task quantity of the other equipment;
and selecting other equipment with less task quantity as the target equipment to be synchronized according to the sequencing result of the other equipment.
Optionally, the determining the system version information of the target device according to the system version information of the device includes:
if the system version information of the equipment is higher than the system version information of the target equipment, controlling the target equipment to be upgraded to the system version of the equipment so as to obtain new system version information of the target equipment;
and if the system version information of the equipment is equal to or lower than the system version information of the target equipment, controlling the target equipment to keep the original system version.
Optionally, the method further includes:
distributing tasks of the same data center to at least two devices of the data center according to the average task amount;
and if the task processing time on any one device in the same data center is detected to be overtime, determining that the device fails.
Optionally, the method further includes:
and sending a state inquiry request to any equipment, and determining that the equipment fails if the equipment does not receive a response.
In a second aspect, an embodiment of the present invention further provides an apparatus for device management, where the apparatus is configured on a server, and the apparatus includes:
the task quantity determining module is used for determining the existing task quantity of other equipment if any equipment is detected to be out of order; the other equipment and the equipment belong to the same data center or different data centers;
the target equipment selection module is used for selecting target equipment to be synchronized from the other equipment according to the existing task amount of the other equipment;
the system version information determining module is used for determining the system version information of the target equipment according to the system version information of the equipment;
and the task execution module is used for synchronizing the task data in the equipment to the target equipment and instructing the target equipment to execute the task of the equipment based on the determined system version information.
Optionally, the target device selection module is specifically configured to:
sequencing the other equipment according to the existing task quantity of the other equipment;
and selecting other equipment with less task quantity as the target equipment to be synchronized according to the sequencing result of the other equipment.
Optionally, the system version information determining module is specifically configured to:
if the system version information of the equipment is higher than the system version information of the target equipment, controlling the target equipment to be upgraded to the system version of the equipment so as to obtain new system version information of the target equipment;
and if the system version information of the equipment is equal to or lower than the system version information of the target equipment, controlling the target equipment to keep the original system version.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the device management method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute a device management method according to any embodiment of the present invention when executed by a computer processor.
According to the embodiment of the invention, when a certain device fails, the target device is selected to process the task of the device according to the task quantity of other devices, and data interaction can be performed between the devices across regions; and updating the version of the target equipment to match the version of the target equipment with the version of the fault equipment. By distributing the tasks in the fault equipment to the equipment with low pressure and updating the equipment into the version matched with the tasks, the unified management of the equipment is realized, the effect of timely processing the tasks on the fault equipment is realized, and the processing efficiency is improved.
Drawings
Fig. 1 is a flowchart illustrating a device management method according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a device management method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a device management apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart illustrating a device management method according to an embodiment of the present invention, where the method is applicable to data interaction between devices in different regions, and the method can be executed by a device management apparatus. As shown in fig. 1, the method specifically includes the following steps:
step 110, if any equipment is detected to be out of order, determining the existing task quantity of other equipment; wherein the other equipment and the equipment belong to the same data center or different data centers.
Wherein the state of the device is detected by the server. Optionally, the server sends a status query request to any device, and if no response from any device is received, it is determined that the device fails. Specifically, the failure of the device may be a hardware failure or a software failure, the server may send a status inquiry request to the device at regular time, and if the server receives a response made by the device to the status inquiry request, it is determined that the device is normal; and if the server does not receive the response of the equipment, determining that the equipment fails. The device may also actively send a status to the server at regular time, and if the server does not receive the status of the device at a certain time, the server sends a status inquiry request to the device to confirm the status of the device, and if the device cannot respond to the status inquiry request, it is determined that the device has a failure. If it is determined that a certain device fails, the server sends a task quantity inquiry request to other devices, and determines the task quantity of the other devices currently.
Each device has its own data center, and the areas of different data centers may be different. If a device in a certain area fails, other devices may be devices in the same area or in a different area than the failed device. The fault can be a fault of any equipment in a certain region or a fault of equipment in the whole region, and if the fault of any equipment in a certain region occurs, the task quantity of other equipment in the region and the task quantity of equipment in other regions are determined; and if the equipment in the whole region fails, determining the task amount of the equipment in other regions. For example, there are A, B, C areas, each area has three devices, and if an AP (wireless access point) of a single device in area a fails, it determines A, B, C task amount of eight remaining devices; if the whole database cluster in the area A fails, the task amount of six devices in two places is determined B, C.
And step 120, selecting target equipment to be synchronized from other equipment according to the existing task amount of the other equipment.
The server sends task quantity inquiry requests to other equipment, receives the task quantities of the other equipment, and selects proper equipment as target equipment to receive the tasks of the fault equipment according to the current task quantities of the other equipment.
Optionally, sorting other devices according to the existing task amount of other devices; and according to the sequencing results of other devices, selecting other devices with less task quantity as target devices to be synchronized.
Specifically, after determining the task amount currently possessed by other devices, the server ranks the other devices according to the task amount, and selects the other devices with the small task amount as target devices to perform synchronous update of the system version information of the faulty device, with the small task amount as priority. For example, the first device in the area a fails, and the second device in the area B has the least current task amount, so that the second device in the area B is determined as the target device. When each device works normally, the system version information may not be updated at the same time, if any device updates, the database of other device synchronously stores the updated system version information of the device, and the system version information may include device authentication data, card identification data or key data.
Step 130, determining the system version information of the target device according to the system version information of the device.
When a certain device fails, the server acquires the system version information of the device, acquires the system version information of the target device after the target device is determined, and compares the system version information of the device with the system version information of the target device.
Optionally, if the system version information of the device is higher than the system version information of the target device, controlling the target device to upgrade to the system version of the device to obtain new system version information of the target device; and if the system version information of the equipment is equal to or lower than the system version information of the target equipment, controlling the target equipment to keep the original system version.
Specifically, after comparing the system version information of the faulty device and the system version information of the target device, the server informs the target device of the comparison result, and determines the system version information of the target device when processing the task of the faulty device according to the comparison result. If the system version information of the fault equipment is higher than that of the target equipment, the target equipment cannot process the task of the fault equipment according to the current system version, the target equipment calls data matched with the system version information of the fault equipment from the system version information synchronized with the database, and the target equipment is upgraded to the system version consistent with the fault equipment; if the system version information of the faulty equipment is equal to or lower than the system version information of the target equipment, and the current version of the target equipment can process the task on the faulty equipment, the target equipment is kept in the original system version without calling the system version information in the database.
Step 140, synchronizing the task data in the device to the target device for instructing the target device to execute the task of the device based on the determined system version information.
If the system version information of the target device can process the task of the failed device, the server switches an IP (Internet Protocol) address of an area where the task to be sent is located to an IP address of an area where the target device is located, sends the task of the failed device to the target device, and the target device processes the task.
According to the technical scheme of the embodiment, when the fault equipment is detected, the task amount of other equipment is determined, the task of the fault equipment is distributed to other equipment with a small task amount, the other equipment can synchronize the data of the fault equipment, the other equipment is matched with the system version information of the fault equipment, the areas where the other equipment and the fault equipment are located can be different, the problem that standby equipment needs to be set in each area is solved, the different equipment is disaster recovery, the equipment in each area can be updated in real time, cross-area equipment management is achieved, and the processing efficiency of the task in the fault is improved.
Example two
Fig. 2 is a flowchart illustrating a device management method according to a second embodiment of the present invention, and the present embodiment is further optimized based on the above embodiments, and the method can be executed by a device management apparatus. As shown in fig. 2, the method specifically includes the following steps:
and step 210, distributing the tasks of the same data center to at least two devices of the data center according to the average task amount.
The average task amount of each device is preset, the average task amounts of the devices of different data centers can be the same or different, each data center can correspond to a region, and the task received by each device can exceed the average task amount and is within the upper limit threshold of the task amount. For example, there are A, B, C three areas, each area has three devices, the average task size of the device in area a is 330, and the upper threshold is the average task size plus 50; the average task amount of the equipment in the area B is 100, and the upper limit threshold is the sum of the average task amount and 10; the average task size of the equipment in area C is 475, and the upper threshold is the average task size plus 20. If the task processing speed of a certain device is high and the task amount of the device is less than that of other devices, the task can be continuously distributed to the device.
Step 220, if any equipment is detected to be out of order, determining the existing task quantity of other equipment; wherein the other equipment and the equipment belong to the same data center or different data centers.
The equipment failure may be a hardware failure or a software failure of a single equipment, or a failure of all the equipments in the whole area, and if any one of the equipments fails, the task amount of the other equipments in all the areas is determined.
Optionally, if it is detected that the task processing time on any device in the same data center is overtime, it is determined that the device is faulty.
Specifically, after the data center distributes the task to the device where the data center is located, if the processing time of the current task on a certain device is overtime, and the device cannot normally complete the processing of the current task, it is determined that the device fails, and then the task amount of other devices is determined, and the other devices are selected as target devices to complete the processing of the task.
And step 230, selecting target equipment to be synchronized from other equipment according to the existing task amount of the other equipment.
The server receives the task quantities of other devices, sequences the other devices, preferentially selects the other devices with the small task quantities to process the tasks of the fault device, acquires the system version information of the other devices with the minimum task quantities if the task quantities of at least two other devices are the minimum, selects the device matched with the system version information of the fault device as a target device, and randomly selects one device from the other devices with the minimum task quantities as the target device if the other devices matched with the system version information of the fault device do not exist.
Step 240, determining the system version information of the target device according to the system version information of the device.
Step 250, synchronizing the task data in the device to the target device for instructing the target device to execute the task of the device based on the determined system version information.
The embodiment of the invention avoids the situation that the task amount of a certain device is too large and other devices are in an idle state by evenly distributing the task amount of the device, can send the task to other devices for processing in time when the task processing of the certain device is overtime, and can select the most matched target device according to the task amount and the system version information. The pressure of each device is reduced, the disaster recovery of different devices is realized, and the task processing efficiency is improved.
EXAMPLE III
Fig. 3 is a block diagram of a device management apparatus according to a third embodiment of the present invention, which is capable of executing a device management method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 3, the apparatus specifically includes:
a taskamount determining module 301, configured to determine, if it is detected that any device fails, an existing task amount of another device; wherein, the other equipment and the equipment belong to the same data center or different data centers;
a targetdevice selection module 302, configured to select a target device to be synchronized from other devices according to an existing task amount of the other devices;
a system versioninformation determining module 303, configured to determine system version information of the target device according to the system version information of the device;
and thetask execution module 304 is used for synchronizing the task data in the device to the target device and instructing the target device to execute the task of the device based on the determined system version information.
Optionally, the targetdevice selecting module 302 is specifically configured to:
sequencing other equipment according to the existing task amount of the other equipment;
and according to the sequencing results of other devices, selecting other devices with less task quantity as target devices to be synchronized.
Optionally, the system versioninformation determining module 303 is specifically configured to:
if the system version information of the equipment is higher than that of the target equipment, controlling the target equipment to be upgraded to the system version of the equipment so as to obtain new system version information of the target equipment;
and if the system version information of the equipment is equal to or lower than the system version information of the target equipment, controlling the target equipment to keep the original system version.
Optionally, the apparatus further comprises:
the task distribution module is used for distributing tasks of the same data center to at least two devices of the data center according to the average task amount;
and if the task processing time on any one device in the same data center is detected to be overtime, determining that the device fails.
Optionally, the apparatus further comprises:
and the fault determining module is used for sending a state inquiry request to any equipment, and determining that the equipment has faults if the equipment does not receive a response of the equipment.
According to the embodiment of the invention, the server detects that a certain device fails, the task amount of other normal devices is determined, the device with less task amount is selected as the target device, the system version information of the target device is determined, the task of the failed device is sent to the target device for processing, the area where the target device is located is not limited, and a spare device is not required to be specially arranged for each area, so that the cost is saved, and the task processing efficiency is improved.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 400 suitable for use in implementing embodiments of the present invention. The computer device 400 shown in fig. 4 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present invention.
As shown in fig. 4, computer device 400 is in the form of a general purpose computing device. The components of computer device 400 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 400 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 400 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The computer device 400 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The computer device 400 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the computer device 400, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 400 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Moreover, computer device 400 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 412. As shown, network adapter 412 communicates with the other modules of computer device 400 over bus 403. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by running the program stored in the system memory 402, for example, to implement the device management method provided by the embodiment of the present invention, including:
if any equipment is detected to be out of order, determining the task quantity of other equipment; wherein, the other equipment and the equipment belong to the same data center or different data centers;
selecting target equipment to be synchronized from other equipment according to the existing task amount of the other equipment;
determining system version information of the target equipment according to the system version information of the equipment;
and synchronizing the task data in the device to the target device for instructing the target device to execute the task of the device based on the determined system version information.
EXAMPLE five
The fifth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for managing devices according to the fifth embodiment of the present invention is implemented, where the method includes:
if any equipment is detected to be out of order, determining the task quantity of other equipment; wherein, the other equipment and the equipment belong to the same data center or different data centers;
selecting target equipment to be synchronized from other equipment according to the existing task amount of the other equipment;
determining system version information of the target equipment according to the system version information of the equipment;
and synchronizing the task data in the device to the target device for instructing the target device to execute the task of the device based on the determined system version information.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.