Heterogeneous device control methods, devices, systems, heterogeneous devices and storage media

By using a preset configuration table to convert commands and responses into a unified format across heterogeneous devices, the problem of unified control of heterogeneous devices is solved, and the management efficiency of the devices is improved.

CN115408330BActive Publication Date: 2026-04-17JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2022-08-25
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In distributed clusters, it is difficult for management devices to uniformly control commands and responses from heterogeneous devices, leading to management and control difficulties.

Method used

The system uses a preset configuration table to convert unified commands for management devices into local commands for heterogeneous devices, and converts local responses from heterogeneous devices into a unified response format. The preset configuration table records the mapping relationship between unified commands, local commands, and responses.

Benefits of technology

It enables unified processing of heterogeneous devices, reduces the difficulty of managing and controlling devices, and improves the management and control efficiency of distributed clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408330B_ABST
    Figure CN115408330B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, system, heterogeneous device, and storage medium for controlling heterogeneous devices, relating to the field of distributed clusters. The method is applied to heterogeneous devices and includes: when a unified command is received from a management device, determining a local command and a unified response template corresponding to the unified command according to a preset configuration table; executing the local command to obtain a local response, and writing the local response into the unified response template to obtain a unified response according to the mapping relationship between the fields in the local response and the unified response template specified in the preset configuration table; and sending the unified response to the management device. The unified command of the management device can be converted into a local command of the heterogeneous device through the preset configuration table, and the local response generated by the heterogeneous device can be converted into a unified response format based on the preset mapping relationship, so that the management device can determine the execution status of the unified command by each heterogeneous device, thereby effectively reducing the difficulty of the management device in controlling heterogeneous devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed clusters, and in particular to a method, apparatus, system, heterogeneous device control method, and computer-readable storage medium. Background Technology

[0002] Distributed clusters typically consist of management devices and service devices that provide business functions. The management devices control the service devices to enable them to perform corresponding operations. However, with the continuous development of computer technology, the variety of operating systems and hardware configurations has increased significantly. This has led to service devices in distributed clusters potentially being heterogeneous devices, possessing different operating systems or hardware configurations. Consequently, the commands for the same operation may differ across these heterogeneous devices, posing challenges to the management devices' control over the service devices. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, system, heterogeneous device control system, and computer-readable storage medium that can unify the local commands and local response content of various heterogeneous devices, thereby effectively reducing the difficulty of management equipment in controlling heterogeneous devices.

[0004] To address the aforementioned technical problems, this invention provides a heterogeneous device control method, applied to heterogeneous devices, the method comprising:

[0005] When a unified command is received from a management device, the local command and unified response template corresponding to the unified command are determined according to a preset configuration table.

[0006] The local command is executed to obtain a local response. Based on the mapping relationship between the local response and each field in the unified response template as specified in the preset configuration table, the local response is written into the unified response template to obtain a unified response.

[0007] The unified response is sent to the management device.

[0008] Optionally, determining the local command corresponding to the unified command based on the preset configuration table includes:

[0009] Get the device information corresponding to this machine;

[0010] Search the preset configuration table for the local command that corresponds to the unified command and the device information.

[0011] Optionally, the step of writing the local response into the unified response template to obtain a unified response according to the mapping relationship between the local response and the fields in the unified response template as specified in the preset configuration table includes:

[0012] Search the preset configuration table for the mapping relationship corresponding to the device information;

[0013] The local response is written into the unified response template according to the mapping relationship to obtain a unified response.

[0014] Optionally, before receiving the unified command sent by the management device, the following steps are also included:

[0015] Retrieve local device information, all local commands, and the local responses corresponding to the local commands;

[0016] The device information, the local command, and the local response are sent to the management device, so that the management device can construct the preset configuration table using the device information, local command, and local response of each heterogeneous device, and return the preset configuration table to each heterogeneous device.

[0017] Deploy the preset configuration table, and after deployment, execute the steps of receiving unified commands sent by the management device.

[0018] Optionally, obtaining all local commands of the local machine and the corresponding local responses includes:

[0019] The relevant code files of the operating system and hardware control are scanned to find code segments containing specified keywords corresponding to the device information;

[0020] When the code segment is found, the target command invoked by the code segment is determined, and the response content corresponding to the target command is scanned;

[0021] Set the target command to the local command, and set the response content to the local response.

[0022] Optionally, obtaining all local commands of the local machine and the corresponding local responses includes:

[0023] Obtain a preset command table, and search for the local command and the local response in the preset command table according to the device information.

[0024] The present invention also provides a heterogeneous device control apparatus, applied to heterogeneous devices, the apparatus comprising:

[0025] The local command determination module is used to determine the local command and unified response template corresponding to the unified command according to a preset configuration table when a unified command is received from a management device.

[0026] The unified response integration module is used to execute the local command to obtain the local response, and write the local response into the unified response template to obtain the unified response according to the mapping relationship between the local response and each field in the unified response template as specified in the preset configuration table.

[0027] The response sending module is used to send the unified response to the management device.

[0028] The present invention also provides a heterogeneous device control system, the system comprising: a management device and heterogeneous devices, wherein,

[0029] The management device is used to send unified commands to one or more of the heterogeneous devices and receive unified responses returned by the heterogeneous devices.

[0030] The heterogeneous device is used to execute the heterogeneous device control method described above.

[0031] The present invention also provides a heterogeneous device, comprising:

[0032] Memory, used to store computer programs;

[0033] A processor is used to implement the heterogeneous device control method as described above when executing the computer program.

[0034] The present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the heterogeneous device control method described above.

[0035] This invention provides a heterogeneous device control method applied to heterogeneous devices. The method includes: when receiving a unified command sent by a management device, determining a local command and a unified response template corresponding to the unified command according to a preset configuration table; executing the local command to obtain a local response, and writing the local response into the unified response template to obtain a unified response according to the mapping relationship between the local response and the fields in the unified response template as specified in the preset configuration table; and sending the unified response to the management device.

[0036] As can be seen, in this invention, when a heterogeneous device receives a unified command sent by a management device, it can determine the local command and unified response template corresponding to the unified command according to a preset configuration table. The unified command represents a certain type of operation, and the preset configuration table records the mapping relationship between the unified command and the local commands of the heterogeneous devices. In other words, the unified command of the management device can be converted into a local command of the heterogeneous device through the preset configuration table, so that the management device can control various heterogeneous devices through the unified command. Subsequently, the heterogeneous device can execute the local command to obtain a local response, and write the local response into the unified response template according to the mapping relationship between the local response and the fields in the unified response template specified in the preset configuration table to obtain a unified response. In other words, in addition to converting commands, this invention can also convert the local responses generated by heterogeneous devices into a unified response format based on the preset mapping relationship, so that the management device can determine the execution status of the unified command by each heterogeneous device. This can significantly reduce the difficulty of the management device in controlling heterogeneous business devices and improve the management efficiency of the distributed cluster. This invention also provides a heterogeneous device control method, apparatus, system, heterogeneous device, and computer-readable storage medium, which have the above-mentioned beneficial effects. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0038] Figure 1 A flowchart of a heterogeneous device control method provided in an embodiment of the present invention;

[0039] Figure 2 This is a structural block diagram of a heterogeneous device control device provided in an embodiment of the present invention;

[0040] Figure 3 This is a structural block diagram of a heterogeneous device control system provided in an embodiment of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] With the continuous development of computer technology, the types of operating systems and hardware configurations are increasing, leading to the emergence of heterogeneous devices in distributed clusters. These devices typically have different operating systems or hardware configurations, and the commands executed by these different systems and hardware for processing the same type of operation may differ, as may the responses produced. In other words, to control multiple heterogeneous devices to perform the same type of operation, the management device may need to issue multiple different commands simultaneously and process the different types of response information returned by these devices. This obviously poses a challenge to the unified management and control of heterogeneous devices. Therefore, this invention provides a heterogeneous device control method that can unify the processing of local commands and responses from various heterogeneous devices, effectively reducing the difficulty of management and control of heterogeneous devices. Please refer to [reference needed]. Figure 1 , Figure 1 This is a flowchart of a heterogeneous device control method provided in an embodiment of the present invention. The method is applied to heterogeneous devices and may include:

[0043] S101. When a unified command is received from the management device, the local command and unified response template corresponding to the unified command are determined according to the preset configuration table.

[0044] In this embodiment of the invention, each heterogeneous device is equipped with a preset configuration table. This configuration table is primarily used to store the mapping relationship between unified commands in the management device and local commands on the heterogeneous devices. Thus, when the management device issues a unified command to a heterogeneous device, the heterogeneous device can determine and execute the local command according to the preset mapping relationship, achieving the effect of unified control of multiple heterogeneous devices by the management device using a single command. Furthermore, the preset configuration table is also used to store a unified response template corresponding to the unified command, which stores the local response content corresponding to the local command. In other words, this embodiment of the invention can also perform format conversion on the local commands generated by each heterogeneous device to ensure that the management device can receive uniformly formatted response content, enabling it to determine the execution status of the unified command by each heterogeneous device.

[0045] It should be noted that local commands are control commands preset by the operating system and hardware in the heterogeneous device, and local responses are the corresponding response content preset by the operating system and hardware in the heterogeneous device. Unified commands and unified response templates, however, can be arbitrarily set, as long as they can control the heterogeneous device through the aforementioned mapping relationship and cover the various local responses generated by the heterogeneous device. Furthermore, a unified command can correspond to multiple local commands; that is, when a heterogeneous device receives a unified command, it can execute a set of corresponding local commands. In addition to indicating the type of operation to be performed by the heterogeneous device, the unified command can also contain parameter information that the heterogeneous device must use when executing local commands, and can be set according to actual application requirements.

[0046] Furthermore, it should be noted that the embodiments of the present invention do not limit the setting method of the mapping relationship between unified commands and local commands. For example, the mapping relationship can be related to specific heterogeneous devices, that is, one set of mapping relationships can be set for each heterogeneous device; of course, the mapping relationship can also be related to device configuration (such as operating system, hardware configuration), that is, one set of mapping relationships can be set for each device configuration. Considering that setting one set of mapping relationships for each heterogeneous device is relatively cumbersome, and that the main reason for the differences between local commands of different heterogeneous devices is the difference in device configuration, that is, the relationship between the above mapping relationship and device configuration is closer, this application can set one set of corresponding mapping relationships for one set of device configuration. Furthermore, the preset configuration table deployed by each heterogeneous device can be the same configuration table. When performing relevant queries, each heterogeneous device can query the unified command and the local command corresponding to the device information in the preset configuration table according to its own corresponding device information.

[0047] In one possible scenario, determining the local command corresponding to the unified command based on a preset configuration table may include:

[0048] Step 11: Obtain the device information corresponding to this machine;

[0049] Step 12: Find the local command corresponding to the unified command and device information in the preset configuration table.

[0050] It should be noted that the embodiments of the present invention are not limited to specific device information, such as operating system type, operating system version, hardware information, etc., which can be set according to actual application requirements.

[0051] S102. Execute the local command to obtain the local response, and write the local response into the unified response template according to the mapping relationship between the local response and the fields in the unified response template as specified in the preset configuration table to obtain the unified response.

[0052] It is understandable that due to differences in device configuration and the local commands to be executed, the local responses generated by heterogeneous devices may also differ. For example, for the same type of attribute, the attribute fields corresponding to different local responses may be different. This can easily increase the difficulty of managing and controlling the devices. Therefore, this embodiment of the invention also sets a mapping relationship between local responses and fields in a unified response template in a preset configuration table. This allows local responses to be converted to a unified format for management and control. It is also understood that the mapping relationship between local responses and fields in the unified response template can correspond to the device configuration; that is, one set of device configurations sets a corresponding mapping relationship. Heterogeneous devices can also query based on their own device information when using the above mapping relationship.

[0053] In one possible scenario, based on the mapping relationship between the local response and the fields in the unified response template as specified in the preset configuration table, the local response is written into the unified response template to obtain the unified response. This may include:

[0054] Step 21: Find the mapping relationship corresponding to the device information in the preset configuration table;

[0055] Step 22: Write the local response into the unified response template according to the mapping relationship to obtain the unified response.

[0056] S103. Send the unified response to the management device.

[0057] The following section describes the heterogeneous device control method using specific examples. In one possible scenario, for OSD (Object Storage Device) initialization operations, the management device can mark the operation using the `init osd` command (i.e., a unified command). During OSD initialization, the management device can issue `init osd` commands and disk parameter information to each heterogeneous device, enabling the latter to execute the corresponding operations. Since the actual local commands corresponding to OSD initialization operations differ across heterogeneous devices due to different operating systems, disks, and hardware configurations, a mapping relationship between device configurations, unified commands, and local commands needs to be maintained in the preset configuration table of each heterogeneous device. This allows heterogeneous devices to query their own configurations to match the correct local OSD initialization command. Specifically, when a heterogeneous device receives the `init osd` command from the management device, it first queries its own operating system type and version, then queries the hard drive type, and combines the operating system, hard drive, and other configuration information to obtain the command that actually needs to be executed to initialize the OSD.

[0058] After the command execution is complete, the heterogeneous devices need to parse the command execution results and return them to the management device. At this point, due to differences in the configurations and commands executed by the various heterogeneous nodes, the field names representing the same attributes in the returned results may differ. Therefore, it is necessary to perform a unified mapping on the fields in the command execution results (i.e., the local response), mapping attributes of the same type in the results returned by different commands to a unified field. For example, for OSD number information, the OSD number field name returned by node 1 is OSD_NUM, and the field name returned by node 2 is OSD_SEQ. To facilitate unified processing by the master node, the OSD number can be uniformly mapped to OSD_ID, and this mapping relationship can be saved in a preset configuration table.

[0059] Based on the above embodiments, in this invention, when a heterogeneous device receives a unified command sent by a management device, it can determine the local command and unified response template corresponding to the unified command according to a preset configuration table. The unified command represents a certain type of operation, and the preset configuration table records the mapping relationship between the unified command and the local commands of the heterogeneous device. In other words, the unified command of the management device can be converted into a local command of the heterogeneous device through the preset configuration table, so that the management device can control various heterogeneous devices through the unified command. Subsequently, the heterogeneous device can execute the local command to obtain a local response, and write the local response into the unified response template according to the mapping relationship between the local response and the fields in the unified response template specified in the preset configuration table to obtain a unified response. In other words, in addition to converting commands, this invention can also convert the local response generated by the heterogeneous device into a unified response format based on the preset mapping relationship, so that the management device can determine the execution status of the unified command by each heterogeneous device. This can significantly reduce the difficulty of the management device in controlling heterogeneous business devices and improve the management efficiency of the distributed cluster.

[0060] Based on the above embodiments, the setting method of the preset configuration table will be described in detail below. In one possible case, before receiving the unified command sent by the management device, the following may also be included:

[0061] S201. Obtain local device information, all local commands, and local responses corresponding to the local commands;

[0062] It should be noted that the embodiments of the present invention do not limit the specific method by which heterogeneous devices obtain local commands and local responses. For example, since commands corresponding to various operating systems and commands corresponding to various hardware can be provided by the manufacturer, heterogeneous devices can query the corresponding local commands and local responses in the preset command table provided by the manufacturer based on their own device information.

[0063] In one possible scenario, retrieving all local commands and their corresponding local responses can include:

[0064] Step 31: Obtain the preset command table, and search for local commands and local responses in the preset command table according to the device information.

[0065] Of course, when the manufacturer's preset command list is unavailable, heterogeneous devices can also obtain the aforementioned local commands and responses through code scanning. This avoids the inefficiencies and low accuracy caused by manually compiling local commands and responses. Specifically, heterogeneous devices can scan the relevant operating system and hardware control code to find code segments containing execution keywords corresponding to device information. Taking commands that distinguish operating systems as an example, keywords such as centOS / kylin / redhat can be identified in the code, where centOS, kylin, and redhat correspond to various operating systems. After discovering the aforementioned code segments, heterogeneous devices can further determine the target command called by the code segment and the corresponding response content. Subsequently, since the code segment calling the target command is associated with the operating system category and hardware category, the target command is the different command executed by heterogeneous devices with different configurations when facing the same operation. Therefore, the target command and its corresponding response content can be set as local commands and local responses.

[0066] In one possible scenario, retrieving all local commands and their corresponding local responses can include:

[0067] Step 41: Scan the relevant code files of the operating system and hardware control to find code segments containing specified keywords corresponding to device information;

[0068] Step 42: When a code segment is found, determine the target command called by the code segment and scan the response content corresponding to the target command;

[0069] Step 43: Set the target command to a local command and the response content to a local response.

[0070] S202. Send device information, local commands and local responses to the management device so that the management device can construct a preset configuration table using the device information, local commands and local responses of each heterogeneous device, and return the preset configuration table to each heterogeneous device.

[0071] In other words, all heterogeneous devices will have the same preset configuration table.

[0072] S203. Deploy the preset configuration table and, after deployment, execute the steps to receive unified commands sent by the management device.

[0073] The following describes the heterogeneous device control apparatus, system, heterogeneous device, and computer-readable storage medium provided in the embodiments of the present invention. The heterogeneous device control apparatus, system, heterogeneous device, and computer-readable storage medium described below can be referred to in correspondence with the heterogeneous device control method described above.

[0074] Please refer to Figure 2 , Figure 2 This is a structural block diagram of a heterogeneous device control device provided in an embodiment of the present invention. The device is applied to heterogeneous devices and may include:

[0075] The local command determination module 201 is used to determine the local command and unified response template corresponding to the unified command according to the preset configuration table when a unified command is received from the management device.

[0076] The unified response integration module 202 is used to execute local commands to obtain local responses, and write the local responses into the unified response template to obtain unified responses according to the mapping relationship between the local responses and the fields in the unified response template as specified in the preset configuration table.

[0077] The response sending module 203 is used to send a unified response to the management device.

[0078] Optionally, the local command determination module 201 may include:

[0079] The device information acquisition submodule is used to acquire the device information corresponding to this machine;

[0080] The first search submodule is used to search for local commands that correspond to unified commands and device information in the preset configuration table.

[0081] Optionally, the unified response integration module 202 may include:

[0082] The second lookup submodule is used to find the mapping relationship corresponding to the device information in the preset configuration table;

[0083] The integration submodule is used to write local responses into a unified response template to obtain a unified response based on the mapping relationship.

[0084] Optionally, the device may further include:

[0085] The acquisition module is used to acquire local device information, all local commands, and the local responses corresponding to the local commands.

[0086] The information sending module is used to send device information, local commands and local responses to the management device, so that the management device can use the device information, local commands and local responses of each heterogeneous device to construct a preset configuration table and return the preset configuration table to each heterogeneous device.

[0087] The deployment module is used to deploy the preset configuration table and, after deployment, execute the steps of receiving unified commands sent by the management device.

[0088] Optionally, the acquisition module may include:

[0089] The first scanning submodule is used to scan the relevant code files of the operating system and hardware control in order to find code segments containing specified keywords corresponding to device information.

[0090] The second scanning submodule is used to determine the target command called by the code segment when a code segment is found, and to scan the response content corresponding to the target command.

[0091] The settings submodule is used to set the target command as a local command and the response content as a local response.

[0092] Optionally, the acquisition module may include:

[0093] The third search submodule is used to obtain a preset command table and search for local commands and local responses in the preset command table based on device information.

[0094] Please refer to Figure 3 , Figure 3 This is a structural block diagram of a heterogeneous device control system provided in an embodiment of the present invention. The system includes: a management device and heterogeneous devices, wherein...

[0095] Management device 301 is used to send unified commands to one or more heterogeneous devices 302 and receive unified responses returned by the heterogeneous devices;

[0096] Heterogeneous device 302 is used to execute the following when it receives a unified command from management device 301: determine the local command and unified response template corresponding to the unified command according to the preset configuration table; execute the local command to obtain a local response; and write the local response into the unified response template to obtain a unified response according to the mapping relationship between the fields in the local response and the unified response template specified in the preset configuration table; and send the unified response to management device 301.

[0097] It should be noted that the embodiments of the present invention do not limit the number of heterogeneous devices that a single management device can control; there can be one or more, and the number can be set according to actual application requirements.

[0098] Alternatively, heterogeneous device 302 can also be used for:

[0099] Get the device information corresponding to this machine;

[0100] Search the preset configuration table for the local command that corresponds to the unified command and device information.

[0101] Alternatively, heterogeneous device 302 can also be used for:

[0102] Find the mapping relationship between the unified command and device information in the preset configuration table;

[0103] The local response is written into the unified response template based on the mapping relationship to obtain the unified response.

[0104] Alternatively, heterogeneous device 302 can also be used for:

[0105] Retrieve local device information, all local commands, and the local responses corresponding to the local commands;

[0106] Send device information, local commands, and local responses to management device 301;

[0107] Receive and deploy the preset configuration table returned by the management device 301, and execute the steps of receiving the unified command sent by the management device 301 after deployment is completed;

[0108] Management device 301 can also be used for:

[0109] A preset configuration table is constructed using the device information, local commands, and local responses of each heterogeneous device 302, and the preset configuration table is returned to each heterogeneous device 302.

[0110] Alternatively, heterogeneous device 302 can also be used for:

[0111] The code files related to the operating system and hardware control are scanned to find code segments containing specified keywords that correspond to device information.

[0112] When a code segment is found, the target command called by the code segment is determined, and the response content corresponding to the target command is scanned;

[0113] Set the target command to a local command and the response content to a local response.

[0114] Alternatively, heterogeneous device 302 can also be used for:

[0115] Retrieve the preset command table and search for local commands and local responses in the preset command table based on the device information.

[0116] This invention also provides a heterogeneous device, comprising:

[0117] Memory, used to store computer programs;

[0118] A processor is used to implement the steps of the heterogeneous device control method described above when executing a computer program.

[0119] Since the embodiments of the heterogeneous device part correspond to the embodiments of the heterogeneous device control method part, please refer to the description of the embodiments of the heterogeneous device control method part for the embodiments of the heterogeneous device part, and they will not be repeated here.

[0120] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the heterogeneous device control method described in any of the above embodiments.

[0121] Since the embodiments of the computer-readable storage medium portion correspond to the embodiments of the heterogeneous device control method portion, the embodiments of the storage medium portion are described in the description of the embodiments of the heterogeneous device control method portion, and will not be repeated here.

[0122] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0123] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0124] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0125] The foregoing has provided a detailed description of a heterogeneous device control method, apparatus, system, heterogeneous device, and computer-readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A heterogeneous device control method, characterized by, Applied to heterogeneous devices, the method includes: Retrieve local device information, all local commands, and the local responses corresponding to the local commands; The device information, the local command, and the local response are sent to the management device, so that the management device can construct a preset configuration table using the device information, local command, and local response of each heterogeneous device, and return the preset configuration table to each heterogeneous device. Deploy the preset configuration table; When a unified command is received from a management device, the local command and unified response template corresponding to the unified command are determined according to a preset configuration table; one unified command corresponds to multiple local commands, and the preset configuration table deployed by each heterogeneous device is the same configuration table; The local command is executed to obtain a local response. Based on the mapping relationship between the local response and each field in the unified response template as specified in the preset configuration table, the local response is written into the unified response template to obtain a unified response. The unified response is sent to the management device; The step of determining the local command corresponding to the unified command according to the preset configuration table includes: Get the device information corresponding to this machine; Search the preset configuration table for the local command that corresponds to the unified command and the device information; The step of writing the local response into the unified response template to obtain a unified response according to the mapping relationship between the local response and the fields in the unified response template as specified in the preset configuration table includes: Search the preset configuration table for the mapping relationship corresponding to the device information; The local response is written into the unified response template according to the mapping relationship to obtain a unified response; The process of obtaining all local commands and their corresponding local responses includes: The relevant code files of the operating system and hardware control are scanned to find code segments containing specified keywords corresponding to the device information; When the code segment is found, the target command invoked by the code segment is determined, and the response content corresponding to the target command is scanned; Set the target command to the local command, and set the response content to the local response; Obtain a preset command table, and search for the local command and the local response in the preset command table according to the device information; the preset command table is provided by the manufacturer and includes commands corresponding to various operating systems and various types of hardware provided by the manufacturer.

2. A heterogeneous device control apparatus, characterized by, Applied to heterogeneous devices, the device includes: The acquisition module is used to acquire local device information, all local commands, and the local responses corresponding to the local commands. The information sending module is used to send the device information, the local command and the local response to the management device, so that the management device can construct a preset configuration table using the device information, local command and local response of each heterogeneous device, and return the preset configuration table to each heterogeneous device. The deployment module is used to deploy the preset configuration table; The local command determination module is used to determine the local command and unified response template corresponding to the unified command according to the preset configuration table when a unified command is received from the management device; one unified command corresponds to multiple local commands, and the preset configuration table deployed by each heterogeneous device is the same configuration table; The unified response integration module is used to execute the local command to obtain the local response, and write the local response into the unified response template to obtain the unified response according to the mapping relationship between the local response and each field in the unified response template as specified in the preset configuration table. A response sending module is used to send the unified response to the management device; The local command determination module includes: The device information acquisition submodule is used to acquire the device information corresponding to this machine; The first search submodule is used to search the preset configuration table for the local command corresponding to the unified command and the device information; The unified response integration module includes: The second lookup submodule is used to look up the mapping relationship corresponding to the device information in the preset configuration table; An integration submodule is used to write the local response into the unified response template according to the mapping relationship to obtain a unified response; The acquisition module includes: The first scanning submodule is used to scan the relevant code files of the operating system and hardware control in order to find code segments containing specified keywords corresponding to the device information; The second scanning submodule is used to determine the target command called by the code segment when the code segment is found, and to scan the response content corresponding to the target command; The configuration submodule is used to set the target command as the local command and the response content as the local response; The third search submodule is used to obtain a preset command table and search for the local command and the local response in the preset command table according to the device information; the preset command table is provided by the manufacturer and includes commands corresponding to various operating systems and various hardware provided by the manufacturer.

3. A heterogeneous device control system, characterized by, The system includes: management equipment and heterogeneous equipment, wherein... The management device is used to construct a preset configuration table using the device information, local commands, and local responses of each heterogeneous device, and return the preset configuration table to each heterogeneous device; send a unified command to one or more of the heterogeneous devices, and receive a unified response returned by the heterogeneous devices; The heterogeneous device is used to execute the heterogeneous device control method as described in claim 1.

4. A heterogeneous device, characterized by include: Memory, used to store computer programs; A processor is configured to implement the heterogeneous device control method as described in claim 1 when executing the computer program.

5. A computer readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the heterogeneous device control method as described in claim 1.

Citation Information

Patent Citations

  • Data processing method and device of heterogeneous terminal, electronic equipment and storage medium

    CN111737527A