Data acquisition method and device and target equipment

By determining the first device instance in the target device and directly correlating it, the problem of low data acquisition efficiency in the prior art is solved, and a simplified data acquisition process and improved efficiency are achieved.

CN119728748APending Publication Date: 2025-03-28SUGON INFORMATION IND +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411730886.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, data acquisition efficiency is low, and additional configuration of network file systems or public Internet file system servers is required, and the data acquisition process is complex.

Method used

By receiving the data acquisition request sent by the source device, establish a connection, and determine at least one first device instance in the target device to obtain the target file, directly associated with the first device in the target device, thereby obtaining the data and avoiding additional configuration of the network file system or public Internet file system server.

Benefits of technology

It simplifies the process of data acquisition, improves the efficiency of data acquisition, reduces operation and maintenance costs, and improves the flexibility of data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728748A_ABST
    Figure CN119728748A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data acquisition method and device and target equipment. The method is applied to target equipment and comprises the steps that a data acquisition request sent by source equipment is received, and the data acquisition request comprises at least one file identifier; establishing connection with the source equipment according to the data acquisition request; according to the data acquisition request, at least one first equipment instance is determined in the target equipment, and the first equipment instance is used for indicating corresponding block equipment in the target equipment and structural information of the block equipment in the target equipment; and according to the at least one file identifier and the at least one first device instance, obtaining at least one target file in the target device, and sending the at least one target file to the source device. And the data acquisition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a data acquisition method, apparatus, and target device. Background Art

[0002] Users can use the virtual media (vMedia) in the terminal device to install the operating system in the server, perform data transmission with the server, and perform other operations.

[0003] In actual application, users can enter their account and password in the application of the terminal device to log in to the Web user interface, or start a KVM session to mount virtual media. After the mounting is completed, files and data that occupy a large amount of memory in the server can be obtained. In the above process, virtual media mounting requires additional configuration of the Network File System (NFS) server, or mounting through the Common Internet File System (CIFS) server. Before obtaining data, network configuration or server settings are required, resulting in low efficiency in data acquisition. Summary of the invention

[0004] The embodiments of the present application provide a data acquisition method, apparatus and target device to solve the problem of low efficiency of data acquisition.

[0005] In a first aspect, an embodiment of the present application provides a data acquisition method, which is applied to a target device, and the method includes:

[0006] Receiving a data acquisition request sent by a source device, wherein the data acquisition request includes at least one file identifier;

[0007] Establishing a connection with the source device according to the data acquisition request;

[0008] Determine, according to the data acquisition request, at least one first device instance in the target device, where the first device instance is used to indicate a corresponding block device in the target device and structural information of the block device in the target device;

[0009] According to the at least one file identifier and the at least one first device instance, at least one target file is acquired in the target device, and the at least one target file is sent to the source device.

[0010] In the embodiment of the present application, after the source device establishes a connection with the target device, it can directly associate with at least one first device in the target device to obtain data. This avoids the need to configure a network file system or public Internet file system server when obtaining data from the target device. This simplifies the process of data acquisition and improves the efficiency of data acquisition.

[0011] In a possible implementation manner, the data acquisition request further includes a data acquisition method; and determining at least one first device instance in the target device according to the data processing request includes:

[0012] Acquire a preset acquisition method and at least one device instance to be selected from the target device;

[0013] Performing matching processing on the preset acquisition method and the data acquisition method to obtain a matching result;

[0014] If the matching result is a successful match, a block device corresponding to each to-be-selected device instance is determined, and the at least one first device instance is determined according to the block device corresponding to each to-be-selected device instance and the at least one file identifier.

[0015] In the embodiment of the present application, after the source device establishes a connection with the target device, at least one first device instance in the target device can be associated with the source device. In this way, the source device can directly obtain at least one file in the block device corresponding to the first device instance, thereby improving the efficiency of data acquisition.

[0016] In a possible implementation, determining the at least one first device instance according to the block device corresponding to each to-be-selected device instance and the at least one file identifier includes:

[0017] For any device instance to be selected, if the block device corresponding to the device instance to be selected stores the target file corresponding to the at least one file identifier, the device instance to be selected is determined as the first device instance.

[0018] In the embodiment of the present application, the target file is obtained in the corresponding block device through the file identifier, thereby avoiding the situation of file acquisition errors and improving the accuracy of file acquisition.

[0019] In a possible implementation, acquiring the at least one target file in the target device according to the at least one file identifier and the at least one first device instance includes:

[0020] Determine a block device corresponding to each first device instance;

[0021] For any file identifier, determine a target device instance in the at least one first device instance according to the file identifier;

[0022] In the target device, determining a block device corresponding to the target device instance;

[0023] According to the file identifier, the target file is obtained in the block device.

[0024] In the embodiment of the present application, the preset command can obtain multiple files, shorten the batch deployment cycle, and reduce the operation and maintenance cost. And according to the file identifier, the target file is obtained in the block device corresponding to the target device instance, avoiding the situation of file acquisition errors and improving the flexibility of data acquisition.

[0025] In a possible implementation, establishing a connection with a source device according to the data acquisition request includes:

[0026] Get the preset interface and preset connection identifier;

[0027] Receiving, through the preset interface, a connection request sent by the source device, wherein the connection request is generated according to the data acquisition request;

[0028] Generate connection information according to the connection request and the preset connection identifier, wherein the connection information at least includes a user identifier, a user Internet protocol IP, a user type, a connection time, and a connection identifier;

[0029] A connection is established with the source device according to the connection request and the connection information.

[0030] In the embodiment of the present application, the target device can establish a connection with the source device through the media service, and after the connection is established, the media service of the target device is no longer responsible for specific data transmission, but only for session management with the source device. The operation process of data acquisition is simplified.

[0031] In a possible implementation manner, after establishing a connection with the source device according to the connection request and the connection information, the method further includes:

[0032] According to the connection information, the source device and at least one of the target devices are associated with each other through the device driver of the block device, so that the source device is connected to the at least one of the target devices.

[0033] In the embodiment of the present application, after the source device is connected to at least one selected device instance in the target device, data forwarding by the Web Server is not required, which reduces the intermediate links of data processing and directly transmits data from the target device to the source device, thereby improving the efficiency of data acquisition.

[0034] In a second aspect, an embodiment of the present application provides a data acquisition device, the device comprising:

[0035] A receiving module, configured to receive a data acquisition request sent by a source device, wherein the data acquisition request includes at least one file identifier;

[0036] A connection module, configured to establish a connection with the source device according to the data acquisition request;

[0037] A determination module, configured to determine at least one first device instance in a target device according to the data acquisition request, wherein the first device instance is used to indicate a corresponding block device in the target device and structural information of the block device in the target device;

[0038] The acquisition module is used to acquire at least one target file in the target device according to the at least one file identifier and the at least one first device instance, and send the at least one target file to the source device.

[0039] In a possible implementation manner, the determining module is specifically configured to:

[0040] Acquire a preset acquisition method and at least one device instance to be selected from the target device;

[0041] Performing matching processing on the preset acquisition method and the data acquisition method to obtain a matching result;

[0042] If the matching result is a successful match, a block device corresponding to each to-be-selected device instance is determined, and the at least one first device instance is determined according to the block device corresponding to each to-be-selected device instance and the at least one file identifier.

[0043] In a possible implementation manner, the determining module is specifically configured to:

[0044] For any device instance to be selected, if the block device corresponding to the device instance to be selected stores the target file corresponding to the at least one file identifier, the device instance to be selected is determined as the first device instance.

[0045] In a possible implementation manner, the acquisition module is specifically used to:

[0046] Determine a block device corresponding to each first device instance;

[0047] For any file identifier, determine a target device instance in the at least one first device instance according to the file identifier;

[0048] In the target device, determining a block device corresponding to the target device instance;

[0049] According to the file identifier, the target file is obtained in the block device.

[0050] In a possible implementation manner, the connection module is specifically used to:

[0051] Get the preset interface and preset connection identifier;

[0052] Receiving, through the preset interface, a connection request sent by the source device, wherein the connection request is generated according to the data acquisition request;

[0053] Generate connection information according to the connection request and the preset connection identifier, wherein the connection information at least includes a user identifier, a user Internet protocol IP, a user type, a connection time, and a connection identifier;

[0054] A connection is established with the source device according to the connection request and the connection information.

[0055] In a possible implementation, the device further includes a processing module.

[0056] Wherein, the processing module is used for:

[0057] According to the connection information, the source device and at least one of the target devices are associated with each other through the device driver of the block device, so that the source device is connected to the at least one of the target devices.

[0058] In a third aspect, an embodiment of the present application provides a target device, including:

[0059] at least one processor; and

[0060] a memory communicatively connected to the at least one processor; wherein,

[0061] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method described in the first aspect.

[0062] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any one of the methods in the first aspect.

[0063] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any method in the first aspect when executed by a processor.

[0064] The data acquisition method, device and target device provided by the embodiments of the present application, after the target device receives the data acquisition request sent by the source device, it establishes a connection with the source device according to the data acquisition request and determines at least one first device instance in the target device. According to the at least one first device instance, at least one target file is obtained in the target device. In the above process, after the source device establishes a connection with the target device, it can directly associate with at least one first device in the target device to obtain data. This avoids the situation where additional configuration of a network file system or a public Internet file system server is required when obtaining data from the target device. The process of data acquisition is simplified and the efficiency of data acquisition is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0066] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0067] Figure 2 A flowchart of a data acquisition method provided in an embodiment of the present application;

[0068] Figure 3 A schematic diagram of a process for obtaining a data acquisition request provided in an embodiment of the present application;

[0069] Figure 4 A schematic diagram of a data acquisition method provided in an embodiment of the present application;

[0070] Figure 5 A flowchart of another data acquisition method provided in an embodiment of the present application;

[0071] Figure 6 A schematic diagram of the data acquisition process provided in the embodiment of the present application;

[0072] Figure 7 A schematic diagram of the structure of a data acquisition device provided in an embodiment of the present application;

[0073] Figure 8 A schematic diagram of the structure of another data acquisition device provided in an embodiment of the present application;

[0074] Fig. 9 A schematic diagram of the structure of the target device provided in an embodiment of the present application.

[0075] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0076] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0077] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0078] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0079] For ease of understanding, below, combined Figure 1 , the application scenarios to which the embodiments of the present application are applicable are described.

[0080] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , including a terminal device 101 and a server 102. The terminal device 101 may be a mobile phone, a tablet computer, a computer, etc., and a virtual media is set in the terminal device 101. The terminal device 101 can obtain files from the server 102 through the virtual media. And through the files, the operating system and patches are installed in the server 102.

[0081] In actual application, users can enter their account and password in the application of the terminal device to log in to the Web user interface, or start a KVM session to mount virtual media. After the mounting is completed, files and data that occupy a large amount of memory in the server can be obtained. In the above process, virtual media mounting requires additional configuration of NFS, or mounting through a CIFS server. Before obtaining data, network configuration or server settings are required, resulting in low efficiency in data acquisition.

[0082] In an embodiment of the present application, after the server (target device) receives a data acquisition request sent by a terminal device (source device), it establishes a connection with the source device according to the data acquisition request and determines at least one first device instance in the target device. At least one target file is acquired in the target device according to the at least one first device instance. In the above process, after the source device establishes a connection with the target device, it can directly associate with at least one first device in the target device to acquire data. This avoids the situation where an NFS server or CIFS server needs to be additionally configured when acquiring data from the target device. The process of data acquisition is simplified and the efficiency of data acquisition is improved.

[0083] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0084] Figure 2 A flowchart of a data acquisition method provided in an embodiment of the present application. Figure 2 , the method may include:

[0085] S201: Receive a data acquisition request sent by a source device.

[0086] The execution subject of the embodiment of the present application can be a target device, or a data acquisition device set in the target device. The data acquisition device can be implemented by software, or by a combination of software and hardware. The target device can be a server. The source device can be a terminal device, and the terminal device can be a mobile phone, a tablet computer, a computer, etc.

[0087] The data acquisition request includes at least one file identifier.

[0088] The user can enter a preset command in the page provided by the source device. The source device displays an operation page in response to the preset command. The user can enter at least one file identifier in the operation page. The source device generates a data acquisition request in response to the user's input selection operation and sends the data acquisition request to the target device.

[0089] After installing the application on the source device, the user can enter the preset command and data acquisition request through the application. For example, the application can be the client tool VMCLI. The client tool VMCLI supports Windows / Linux environments and is released with the version. You can install the client tool VMCLI by logging in to Web->BMC Settings->Media Redirection Settings->Media Client->Download VMCLI Tool. As an independent mounting tool, the client tool VMCLI no longer depends on any process or service. Users can download it through the firmware version release package or the specified page.

[0090] Optionally, after determining the file identifier, the user may also determine the configuration information for data acquisition through the operation page. The configuration information at least includes the data acquisition method.

[0091] Next, combine Figure 3 , the process of generating a data acquisition request by a source device is described. Figure 3 A schematic diagram of the process of obtaining a data acquisition request provided in an embodiment of the present application. Figure 3 , including interface 301 and interface 302. Interface 301 and interface 302 may be pages provided by the source device. The source device may be a terminal device, and an application is set in the source device. Referring to interface 301, the user enters a preset command in the main page of the source device. The terminal device displays an operation page in response to the user's input operation. The operation page includes a drop-down selection menu corresponding to the file identifier, a drop-down selection menu corresponding to the configuration information, and a text input box.

[0092] Referring to interface 302, the user determines that at least one file identifier includes file A1, file A2, and file A3 in the drop-down selection menu corresponding to the file identifier, determines that the configuration information is configuration information A in the drop-down selection menu corresponding to the configuration information, and clicks the confirmation icon. The source device generates a data acquisition request in response to the user's input selection operation, and sends the data acquisition request to the target device. The target device receives the data acquisition request sent by the source device, which includes at least one file identifier and configuration information.

[0093] vMedia mounting can be achieved through CMD commands to obtain target files without logging into the Web UI (Website User Interface, WebUI) or starting a KVM session, which simplifies the operation process and lowers the usage threshold.

[0094] S202: Establish a connection with a source device according to a data acquisition request.

[0095] A connection can be established with a source device according to a data acquisition request in the following manner: obtaining a preset interface and a preset connection identifier; receiving a connection request sent by a source device through the preset interface, the connection request being generated according to the data acquisition request; generating connection information according to the connection request and the preset connection identifier, the connection information including at least a user identifier, a user Internet Protocol IP, a user type, a connection time, and a connection identifier; and establishing a connection with the source device according to the connection request and the connection information.

[0096] The target device can establish a connection with the source device through the media service. After the connection is established, the media service of the target device is no longer responsible for specific data transmission, but only for session management with the source device, which simplifies the operation process of data acquisition.

[0097] The preset interface may be a default interface or a preconfigured interface. This application does not impose any restrictions. The preset connection identifier may be an initialized socket. The preset interface and the preset connection identifier may be set in advance, and the preset interface and the preset connection identifier may be stored in a preset storage space of the target device.

[0098] For example, when the source device sends a data acquisition request, it also sends a connection request. The media service of the target device obtains a preset connection identifier and a preset interface, and receives the connection request sent by the source device through the preset interface. After the media service of the target device receives the connection request, the connection information generated according to the connection request and the preset connection identifier can be specifically shown in Table 1:

[0099] Table 1

[0100]

[0101] The media service of the target device establishes a connection with the source device according to the connection request and the connection information shown in Table 1. The media service of the target device stores and manages the connection information shown in Table 1.

[0102] After the source device establishes a connection with the target device, the device driver of the block device performs association processing on the source device and at least one of the target devices according to the connection information, so that the source device is connected to at least one of the target devices.

[0103] In this way, there is no need for data forwarding by the Web Server, which reduces the intermediate links of data processing and directly transmits data from the target device to the source device, thereby improving the efficiency of data acquisition.

[0104] S203: Determine at least one first device instance in the target device according to the data acquisition request.

[0105] The first device instance is used to indicate the corresponding block device in the target device and the structural information of the block device in the target device. The data acquisition request also includes a data acquisition method.

[0106] At least one first device instance can be determined in the target device according to the data acquisition request in the following manner: determining a block device corresponding to each first device instance; obtaining a preset acquisition method and at least one device instance to be selected in the target device; matching the preset acquisition method and the data acquisition method to obtain a matching result; if the matching result is a successful match, determining a block device corresponding to each device instance to be selected, and determining at least one first device instance according to the block device corresponding to each device instance to be selected and at least one file identifier.

[0107] After the source device establishes a connection with the target device, at least one first device instance in the target device can be associated with the source device. In this way, the source device can directly obtain at least one file in the block device corresponding to the first device instance, thereby improving the efficiency of data acquisition.

[0108] The corresponding block device and the storage location and directory of the block device in the target device can be determined in the target device through the first device instance. The block device can be a device that stores data in the target device. The block device can be a hard disk drive, a solid state drive, an optical disk, etc.

[0109] The preset acquisition method may be a direct acquisition method. The preset acquisition method may be set in advance and stored in the preset storage space of the target device. Compared with the data acquisition method of virtual media in the prior art, the direct acquisition method realizes data transmission between the application and the baseboard management controller driver (BMC Driver) of the target device, without the need for a web server (Web Server) to do intermediate forwarding, thereby improving the performance of vMedia.

[0110] The data acquisition method can be determined based on the configuration information input by the user and the corresponding identification information when sending the request.

[0111] For example, the preset data acquisition method acquired by the target device is a direct acquisition method, and the at least one selected device instance acquired includes device instance A1, device instance B1, and device instance C1. The target device determines that the data acquisition method is a direct acquisition method based on the configuration information A shown in the above example. The target device matches the preset acquisition method and the data acquisition method, and obtains a matching result of successful matching. Therefore, the target device determines the block device corresponding to each selected instance and at least one file identifier shown in the above example, and determines that the first device instance includes device instance A1.

[0112] S204: Acquire at least one target file in the target device according to at least one file identifier and at least one first device instance, and send the at least one target file to the source device.

[0113] For example, according to the above example, it is determined that at least one file identifier includes file A1, file A2, and file A3, and it is determined that the first device instance includes device instance A1. The target device can obtain file A1, file A2, and file A3 in block device A1 corresponding to instance A1, and send file A1, file A2, and file A3 to the source device.

[0114] Next, combine Figure 4 , the data acquisition method is explained. Figure 4 A schematic diagram of a data acquisition method provided in an embodiment of the present application. Figure 4 , including a source device 401 and a target device 402. The source device 401 may be a terminal device, and a CLIENT tool is provided in the source device 401. The target device 402 may be a server. The target device 402 includes a baseboard management controller and a host. The baseboard management controller includes virtual media, a Universal Serial Bus (USB) framework, and a block device service, and the USB framework may be a USB Gadget. The host includes a USB device, and at least one file is stored in the USB device. The baseboard management controller of the target device 402 and the host establish a connection via USB. In this way, the virtual media of the target device 402 can obtain at least one file in the USB device via the USB connection. The file format of the at least one file may be ISO / IMG.

[0115] After the VMCLI tool of the source device 401 obtains the data acquisition request, it sends the data acquisition request to the target device 402. According to the data acquisition request sent by the source device, the target device virtual media establishes a connection with the source device 402 through a socket. The VMCLI tool of the source device 401 can directly map the device instance to the underlying NBD block device. In this way, when the source device 401 obtains at least one file in the target device 402, it does not need the data forwarding of the Web Server, reduces the intermediate links of data processing, and directly transfers the data from the target device 402 to the source device 401. At the same time, the VMCLI tool is not coupled with any other BMC process or service, avoiding the failure of vMedia mounting due to abnormal disconnection of the KVM client, improving the stability of the vMedia function, and ensuring its independence and convenience.

[0116] The data acquisition method provided in the embodiment of the present application receives a data acquisition request sent by a source device. According to the data acquisition request, a connection is established with the source device. According to the data acquisition request, at least one first device instance is determined in the target device. According to at least one file identifier and at least one first device instance, at least one target file is acquired in the target device, and at least one target file is sent to the source device. In the above process, after the source device establishes a connection with the target device, it can be directly associated with at least one first device in the target device to acquire data. This avoids the situation where an NFS server or a CIFS server needs to be additionally configured when acquiring data from the target device. The process of data acquisition is simplified and the efficiency of data acquisition is improved.

[0117] Based on any of the above embodiments, Figure 5 , the detailed process of data acquisition is explained.

[0118] Figure 5 This is a flow chart of another data acquisition method provided in an embodiment of the present application. Figure 5 , the method comprising:

[0119] S501: Receive a data acquisition request sent by a source device.

[0120] It should be noted that the execution process of S501 can refer to S201 and will not be repeated here.

[0121] S502: Establish a connection with a source device according to a data acquisition request.

[0122] After the media service of the target device is started, the Socket is initialized, the service is created and the preset interface is listened. After the target device receives the connection request sent by the source device, it creates a session management thread Sessionthread(), generates connection information and manages the connection information in a unified manner. The target device creates the runVirtualMedia() thread, which is responsible for processing the configuration of remote / local media. For example, the mount operation of the remote media connection NFS / CIFS Server, etc. The target device creates the ctrl_thread() thread to perform relevant configuration of the block device.

[0123] For example, the target device receives a data acquisition request sent by the source device including at least one file identifier, and the at least one file identifier is file B1, file B2, and file B3. The media service of the target device obtains the preset connection identifier as the initialized Socket socket, obtains the preset interface as interface 1, and receives the connection request sent by the source device through the preset interface. After the media service of the target device accepts the connection request, it generates connection information A according to the connection request and the preset connection identifier, and uniformly manages the connection information A through the session management thread. The target device creates the runVirtualMedia() thread, which is responsible for processing the configuration of remote / local media. The target device creates the ctrl_thread() thread to perform relevant configuration of the block device.

[0124] After the target device is connected to the source device, the device driver of the block device performs association processing on at least one of the source device and the target device according to the connection information. In this way, each of the source device's device instances can be connected to the target device.

[0125] S503: Obtain a preset acquisition method and at least one device instance to be selected from the target device.

[0126] For example, the target device obtains the preset acquisition mode as the direct acquisition mode, and obtains at least one device instance to be selected including device instance A2, device instance B2, device instance B3 and device instance B4.

[0127] S504: Perform matching processing on the preset acquisition method and the data acquisition method to obtain a matching result.

[0128] The matching result can be a successful match or a failed match.

[0129] For example, according to the above example, the target device receives the preset acquisition mode as the direct acquisition mode, and the target device determines that the data acquisition mode input by the user is the direct acquisition mode. The preset acquisition mode and the data acquisition mode are matched, and the matching result is a successful match.

[0130] S505: If the matching result is successful, determine the block device corresponding to each device instance to be selected.

[0131] When the target device is performing relevant configuration of the block device, if it is determined that the matching result is successful, the Socket file is passed as a parameter to the block device driver through a system call to associate it with the internal NBD device instance.

[0132] S506: Determine at least one first device instance according to the block device and at least one file identifier corresponding to each device instance to be selected.

[0133] For any device instance to be selected, if a block device corresponding to the device instance to be selected stores at least one target file corresponding to the file identifier, the device instance to be selected is determined as the first device instance.

[0134] The target file is obtained from the corresponding block device through the file identifier, thereby avoiding the situation of file acquisition errors and improving the accuracy of file acquisition.

[0135] For example, according to the above example, the matching result is determined to be a successful match. According to the above example, device instance A2, device instance B2, device instance B3 and device instance B4 are determined. The target device determines that the block device corresponding to each candidate device instance can be specifically shown in Table 2:

[0136] Table 2

[0137]

[0138] The target device determines that the files stored in each block device shown in Table 2 may be specifically as shown in Table 3:

[0139] Table 3

[0140]

[0141] According to the above examples, it is determined that at least one file identifier includes file B1, file B2, and file B3. For device instance A2, the target device determines that the device A2 corresponding to device instance A2 does not store the target file corresponding to at least one file identifier, and then determines that device instance A2 is not the first device instance. For device instance B2, the target device determines that the device B2 corresponding to device instance B2 stores the target file corresponding to file B2, and then determines device instance B2 as the first device instance. For device instance B3, the target device determines that the device B3 corresponding to device instance B3 stores the target files corresponding to file B1 and file B3, and then determines device instance B3 as the first device instance. For device instance B4, the target device determines that the device B4 corresponding to device instance B4 does not store the target file corresponding to at least one file identifier, and then determines that device instance B4 is not the first device instance. In summary, the target device determines that at least one first device instance includes device instance B2 and device instance B3.

[0142] If the matching result is a match failure, the target device may obtain at least one target file through a first acquisition method. The first acquisition method is an acquisition method that can be supported by both the source device and the target device. Alternatively, a prompt message is generated and sent to the source device. The prompt message is used to indicate that the data cannot be obtained through the preset acquisition method at present.

[0143] S507: Determine the block device corresponding to each first device instance.

[0144] For example, according to the above example, it is determined that at least one first device instance includes device instance B2 and device instance B3. Therefore, it can be determined that the block device corresponding to device instance B2 can be device B2, and the block device corresponding to device instance B3 can be device B3.

[0145] S508: For any file identifier, determine a target device instance in at least one first device instance according to the file identifier.

[0146] For example, for the file B1 shown in the above example, in device instance B2 and device instance B3, the target device instance corresponding to file B1 is determined to be device instance B3. For the file B2 shown in the above example, in device instance B2 and device instance B3, the target device instance corresponding to file B2 is determined to be device instance B2. For the file B3 shown in the above example, in device instance B2 and device instance B3, the target device instance corresponding to file B3 is determined to be device instance B3.

[0147] S509: In the target device, determine the block device corresponding to the target device instance.

[0148] For example, according to the above example, for file B1, the target device instance is determined to be device instance B3, and the block device corresponding to device instance B3 is determined to be device B3. For file B2, the target device instance is determined to be device instance B2, and the block device corresponding to device instance B2 is determined to be device B2. For file B3, the target device instance is determined to be device instance B3, and the block device corresponding to device instance B3 is determined to be device B3.

[0149] S510: Obtain a target file in a block device according to the file identifier.

[0150] For example, according to the above example, the target device obtains file B2 from block device B2, and obtains files B1 and B3 from block device B3.

[0151] S510: Send at least one target file to a source device.

[0152] For example, according to the above example, it is determined that at least one target file includes file B1, file B2 and file B3. The target device sends file B1, file B2 and file B3 to the source device.

[0153] It should be noted that the data acquisition method provided in the embodiment of the present application allows the user to perform vMedia mounting operations on multiple target devices simultaneously through a single preset command or script, which greatly shortens the batch deployment cycle and reduces operation and maintenance costs.

[0154] The data acquisition method provided in the embodiment of the present application receives a data acquisition request sent by a source device. According to the data acquisition request, a connection is established with the source device. A preset acquisition method and at least one device instance to be selected in the target device are obtained. The preset acquisition method and the data acquisition method are matched to obtain a matching result. If the matching result is a successful match, the block device corresponding to each device instance to be selected is determined. According to the block device corresponding to each device instance to be selected and at least one file identifier, at least one first device instance is determined. The block device corresponding to each first device instance is determined. For any target file, the target device instance is determined in at least one first device instance according to the file identifier. According to the target device instance, the target file is obtained in the target device to obtain at least one target file. At least one target file is sent to the source device. In the above process, after the source device establishes a connection with the target device, it can be directly associated with at least one first device in the target device to obtain data. It is avoided that when obtaining data from the target device, it is necessary to configure an NFS server or a CIFS server additionally. The process of data acquisition is simplified and the efficiency of data acquisition is improved. In addition, the application has good flexibility and scalability, and can be customized and expanded according to actual needs to meet application needs in different scenarios.

[0155] Based on any of the above embodiments, Figure 6 , the process of data acquisition is illustrated with examples.

[0156] Figure 6 This is a schematic diagram of the data acquisition process provided in the embodiment of the present application. Figure 6 , including a source device 601 and a target device 602. The source device 601 may be a terminal device, and a CLIENT tool is provided in the source device 601. The target device 602 may be a server. The target device 602 is provided with a virtual media and a block device, and at least one file is stored in the block device. The at least one file may be an executable file. After the target device 602 is powered on, the block device and related drivers such as USB are loaded, and the virtual media is started.

[0157] The user can enter a preset command in the page provided by the source device 601. In response to the preset command, the source device 601 displays the operation page of the CLIENT tool. The user can enter at least one file identifier in the operation page of the CLIENT tool. The source device 601 generates a data acquisition request in response to the user's input selection operation. The source device 601 sends a data acquisition request to the target device 602, and the data acquisition request includes the file C1.

[0158] The target device 602 obtains a preset interface and a preset connection identifier, and receives a connection request sent by the source device 601 through the preset interface. After receiving the connection request, the virtual media of the target device 601 generates connection information according to the connection request and the preset connection identifier. The virtual media of the target device 601 establishes a connection with the source device 601 according to the connection request and the connection information. The virtual media of the target device 602 stores and manages the connection information. According to the connection information, the target device 602 associates at least one of the target devices to be selected in the source device 601 and the target device 602 through the device driver of the block device, so that the source device is connected to at least one of the target devices to be selected.

[0159] The virtual media of the target device 602 obtains the preset acquisition mode as the direct acquisition mode, and obtains at least one of the candidate device instances in the target device 602, including the device instance C1, the device instance C2, and the device instance C3. The virtual media of the target device 602 determines that the data acquisition mode input by the user is the direct acquisition mode. The virtual media of the target device 602 matches the preset acquisition mode and the data acquisition mode, and obtains a matching result of successful matching. The virtual media of the target device 602 determines that the block device corresponding to each candidate device instance and at least one file stored in the block device can be specifically shown in Table 4:

[0160] Table 4

[0161]

[0162] The virtual media of the target device 602 determines that the device C1 corresponding to the device instance C1 stores the target file corresponding to the file C1, and determines the device instance C1 as the first device instance. The virtual media of the target device 602 determines that the block device corresponding to the device instance C1 is the device C1, and obtains the file C1 in the device C1. The virtual media of the target device 602 sends the file C1 to the source device 601.

[0163] The data acquisition process provided by the embodiment of the present application receives a data acquisition request sent by a source device. According to the data acquisition request, a connection is established with the source device. A preset acquisition method and at least one device instance to be selected in the target device are obtained. The preset acquisition method and the data acquisition method are matched to obtain a matching result. If the matching result is a successful match, the block device corresponding to each device instance to be selected is determined. According to the block device corresponding to each device instance to be selected and at least one file identifier, at least one first device instance is determined. The block device corresponding to each first device instance is determined. For any target file, according to the file identifier, the target device instance is determined in at least one first device instance. According to the target device instance, the target file is obtained in the target device to obtain at least one target file. At least one target file is sent to the source device. In the above process, after the source device establishes a connection with the target device, it can be directly associated with at least one first device in the target device to obtain data. It is avoided that when obtaining data from the target device, it is necessary to configure an NFS server or a CIFS server additionally. The process of data acquisition is simplified and the efficiency of data acquisition is improved. In addition, the application has good flexibility and scalability, and can be customized and expanded according to actual needs to meet application needs in different scenarios.

[0164] Figure 7 This is a schematic diagram of the structure of a data acquisition device provided in an embodiment of the present application. Figure 7 , the data acquisition device 10 may include:

[0165] A receiving module 11, configured to receive a data acquisition request sent by a source device, wherein the data acquisition request includes at least one file identifier;

[0166] A connection module 12, configured to establish a connection with the source device according to the data acquisition request;

[0167] A determination module 13, configured to determine at least one first device instance in a target device according to the data acquisition request, wherein the first device instance is used to indicate a corresponding block device in the target device and structural information of the block device in the target device;

[0168] The acquisition module 14 is configured to acquire at least one target file in the target device according to the at least one file identifier and the at least one first device instance, and send the at least one target file to the source device.

[0169] In a possible implementation manner, the determining module 13 is specifically configured to:

[0170] Acquire a preset acquisition method and at least one device instance to be selected from the target device;

[0171] Performing matching processing on the preset acquisition method and the data acquisition method to obtain a matching result;

[0172] If the matching result is a successful match, a block device corresponding to each to-be-selected device instance is determined, and the at least one first device instance is determined according to the block device corresponding to each to-be-selected device instance and the at least one file identifier.

[0173] In a possible implementation manner, the determining module 13 is specifically configured to:

[0174] For any device instance to be selected, if the block device corresponding to the device instance to be selected stores the target file corresponding to the at least one file identifier, the device instance to be selected is determined as the first device instance.

[0175] In a possible implementation manner, the acquisition module 14 is specifically configured to:

[0176] Determine a block device corresponding to each first device instance;

[0177] For any file identifier, determine a target device instance in the at least one first device instance according to the file identifier;

[0178] In the target device, determining a block device corresponding to the target device instance;

[0179] According to the file identifier, the target file is obtained in the block device.

[0180] In a possible implementation manner, the connection module 12 is specifically used for:

[0181] Get the preset interface and preset connection identifier;

[0182] Receiving, through the preset interface, a connection request sent by the source device, wherein the connection request is generated according to the data acquisition request;

[0183] Generate connection information according to the connection request and the preset connection identifier, wherein the connection information at least includes a user identifier, a user Internet protocol IP, a user type, a connection time, and a connection identifier;

[0184] A connection is established with the source device according to the connection request and the connection information.

[0185] The data acquisition device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0186] Figure 8 A schematic diagram of the structure of another data acquisition device provided in an embodiment of the present application. Figure 7 Based on the examples shown, see Figure 8 The data acquisition device 10 also includes a processing module 15.

[0187] Wherein, the processing module 15 is used for:

[0188] According to the connection information, the source device and at least one of the target devices are associated with each other through the device driver of the block device, so that the source device is connected to the at least one of the target devices.

[0189] The data acquisition device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0190] Fig. 9 This is a schematic diagram of the structure of the target device provided in the embodiment of the present application. Fig. 9 The target device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.

[0191] The memory 21 is used to store program instructions;

[0192] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the target device 20 to execute the method shown in the above method embodiment.

[0193] The target device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0194] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above method.

[0195] The embodiment of the present application may also provide a computer program product, including a computer program, which can implement the above method when executed by a processor.

[0196] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The above-mentioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the above-mentioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.

[0197] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0198] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0199] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0200] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0201] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A data acquisition method, characterized in that: Applied to a target device, the method comprises: Receiving a data acquisition request sent by a source device, wherein the data acquisition request includes at least one file identifier; Establishing a connection with the source device according to the data acquisition request; Determine, according to the data acquisition request, at least one first device instance in the target device, where the first device instance is used to indicate a corresponding block device in the target device and structural information of the block device in the target device; According to the at least one file identifier and the at least one first device instance, at least one target file is acquired in the target device, and the at least one target file is sent to the source device.

2. The method according to claim 1, characterized in that The data acquisition request also includes a data acquisition method; and determining at least one first device instance in the target device according to the data processing request, including: Acquire a preset acquisition method and at least one device instance to be selected from the target device; Performing matching processing on the preset acquisition method and the data acquisition method to obtain a matching result; If the matching result is a successful match, a block device corresponding to each to-be-selected device instance is determined, and the at least one first device instance is determined according to the block device corresponding to each to-be-selected device instance and the at least one file identifier.

3. The method according to claim 2, characterized in that Determining the at least one first device instance according to the block device corresponding to each to-be-selected device instance and the at least one file identifier includes: For any device instance to be selected, if the block device corresponding to the device instance to be selected stores the target file corresponding to the at least one file identifier, the device instance to be selected is determined as the first device instance.

4. The method according to any one of claims 1 to 3, characterized in that: Acquiring the at least one target file in the target device according to the at least one file identifier and the at least one first device instance includes: Determine a block device corresponding to each first device instance; For any file identifier, determine a target device instance in the at least one first device instance according to the file identifier; In the target device, determining a block device corresponding to the target device instance; According to the file identifier, the target file is obtained in the block device.

5. The method according to any one of claims 1 to 4, characterized in that: Establishing a connection with a source device according to the data acquisition request includes: Get the preset interface and preset connection identifier; Receiving, through the preset interface, a connection request sent by the source device, wherein the connection request is generated according to the data acquisition request; Generate connection information according to the connection request and the preset connection identifier, wherein the connection information at least includes a user identifier, a user Internet protocol IP, a user type, a connection time, and a connection identifier; A connection is established with the source device according to the connection request and the connection information.

6. The method according to claim 5, characterized in that After establishing a connection with the source device according to the connection request and the connection information, the method further includes: According to the connection information, the source device and at least one of the target devices are associated with each other through the device driver of the block device, so that the source device is connected to the at least one of the target devices.

7. A data acquisition device, characterized in that: The device comprises: A receiving module, configured to receive a data acquisition request sent by a source device, wherein the data acquisition request includes at least one file identifier; A connection module, configured to establish a connection with the source device according to the data acquisition request; A determination module, configured to determine at least one first device instance in a target device according to the data acquisition request, wherein the first device instance is used to indicate a corresponding block device in the target device and structural information of the block device in the target device; The acquisition module is used to acquire at least one target file in the target device according to the at least one file identifier and the at least one first device instance, and send the at least one target file to the source device.

8. A target device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to make a computer execute the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.