A method, system, device, medium, and product for reading data from an external device

By reading important product data of external devices on demand in the first controller, the problem of slow access to external devices to obtain important product data is solved, and more efficient data acquisition is achieved, and the rate of starting the host is improved.

CN119376649BActive Publication Date: 2025-04-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411948526.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-29
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The rate of accessing the device configuration space of external devices to obtain important product data is slow, which affects the rate of the boot stage of the host.

Method used

By determining the identification information of the target important product data to be read in the first controller based on the important product data acquisition task, the target storage address of the target important product data in the important product data storage area of ​​the target device's equipment configuration space, and directly read the required target important product data, so as to realize on-demand reading.

Benefits of technology

The amount of data that reads important product data in a single time is reduced, the rate of obtaining important product data is improved, and the efficiency of starting the host is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376649B_ABST
    Figure CN119376649B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of server technology, and specifically discloses a method, system, device, medium, and product for reading data from an external device. In the related technology, when a controller on a host accesses a device configuration space of an external device to read important product data, the controller reads all the important product data locally each time it accesses, and then filters the required data. First, identification information of target important product data to be read is determined according to an important product data acquisition task, and a target storage address of the target important product data in an important product data storage area in the device configuration space of the target device is determined according to the identification information. Then, the required target important product data is read from the target storage address, thereby realizing on-demand reading, thereby reducing the amount of data read at a single time and improving the rate of acquiring important product data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a method, system, device, medium and product for reading data from an external device. Background Art

[0002] Vital Product Data (VPD) is information that uniquely defines items such as hardware, software, and microcode elements of a system. VPD provides information about various Field Replaceable Units (FRUs) for the system, including part numbers, serial numbers, and other details.

[0003] Important product data is usually stored in non-volatile memory, which can be accessed through a two-wire serial bus (Inter-Integrated Circuit, I2C) bus to obtain important product data. In the absence of a two-wire serial bus, if important product data of an external device of the host needs to be obtained, it is necessary to access the device configuration space of the external device to obtain it.

[0004] In actual use, it is found that the rate of accessing external devices to obtain their important product data is slow, which in turn affects the rate of the host's boot-up phase.

[0005] How to improve the rate of acquiring important product data by accessing the device configuration space of an external device is a technical problem that those skilled in the art need to solve. Summary of the invention

[0006] The object of the present invention is to provide a method, system, device, medium, and product for reading data from an external device, which are used to increase the rate of acquiring important product data by accessing the device configuration space of an external device.

[0007] In order to solve the above technical problems, the present invention provides a method for reading data from an external device, which is applied to a first controller and comprises:

[0008] Determine identification information of target important product data to be read according to the important product data acquisition task;

[0009] Determine, according to the identification information, a target storage address of the target important product data in an important product data storage area in a device configuration space of a target device;

[0010] Read the target important product data according to the target storage address;

[0011] The target device is an external device of the host where the first controller is located.

[0012] On the one hand, determining a target storage address of the target important product data in an important product data storage area in a device configuration space of a target device according to the identification information includes:

[0013] Determine the keyword of the target important product data according to the identification information;

[0014] Reading the keywords of all the important product data of the target device in the important product data storage area, and after matching the keywords of the target important product data therefrom, determining the corresponding key data partition as the target keyword data partition;

[0015] The data address of the target keyword data partition is used as the target storage address.

[0016] On the other hand, determining a target storage address of the target important product data in an important product data storage area in a device configuration space of a target device according to the identification information includes:

[0017] Determine a storage address range of the target important product data in the important product data storage area according to the identification information;

[0018] Determine the keyword of the target important product data according to the identification information;

[0019] After matching the keyword of the target important product data among the keywords corresponding to the storage address range, determining the corresponding key data partition as the target keyword data partition;

[0020] The data address of the target keyword data partition is used as the target storage address.

[0021] On the other hand, determining the storage address range of the target important product data in the important product data storage area according to the identification information includes:

[0022] Determining a target data type of the target important product data according to the identification information;

[0023] Acquire a data group of the target data type within a first address range of the important product data storage area;

[0024] Determining data read and write attributes of the target important product data according to the identification information;

[0025] Determine a second address range of the target important product data in the first address range according to the data read and write attribute;

[0026] The second address range is used as the storage address range.

[0027] On the other hand, reading the target important product data according to the target storage address includes:

[0028] The address offset of the important product data register of the target device is set according to the target storage address, so that after the target device writes the target important product data into the data bit of the important product data register, it reads the target important product data from the data bit.

[0029] On the other hand, reading the target important product data from the data bit includes:

[0030] If a first timeout period has elapsed after the address offset is set, reading the data of the data bit as the target important product data;

[0031] The first timeout period corresponds to the type of the target device.

[0032] On the other hand, reading the target important product data from the data bit includes:

[0033] Determine whether the write completion flag of the important product data register is the first flag;

[0034] If yes, the data of the data bit is read as the target important product data.

[0035] On the other hand, it also includes:

[0036] If the write completion flag is not the first flag, determining whether the current number of reads of the target important product data reaches a preset number of retries corresponding to the target device;

[0037] If yes, stop reading;

[0038] If not, jump to determine whether the write completion flag of the important product data register is the first flag.

[0039] On the other hand, reading the target important product data according to the target storage address includes:

[0040] Mapping the device configuration space to the system address space of the first controller;

[0041] A memory mapping read request is generated according to the target storage address to read the target important product data.

[0042] On the other hand, reading the target important product data according to the target storage address includes:

[0043] Determine the data input and output ports corresponding to the device configuration space;

[0044] The target storage address of the target device is accessed through the data input and output port to read the target important product data.

[0045] In order to solve the above technical problems, the present invention also provides a method for reading data from an external device, which is applied to an external device of a host, comprising:

[0046] receiving a request to read important product data from a first controller of the host;

[0047] Determine a target storage address according to the important product data read request;

[0048] sending target important product data from the target storage address to the first controller;

[0049] Among them, the target storage address is the address of the target important product data in the important product data storage area in the device configuration space of the external device determined by the first controller according to the identification information of the target important product data in the important product data acquisition task.

[0050] In order to solve the above technical problems, the present invention further provides a server, comprising a first controller and an external device;

[0051] Among them, the first controller is used to determine the identification information of the target important product data to be read according to the important product data acquisition task; determine the target storage address of the target important product data in the important product data storage area in the device configuration space of the external device according to the identification information; and read the target important product data according to the target storage address.

[0052] In order to solve the above technical problems, the present invention further provides an external device data reading device, comprising:

[0053] Memory for storing computer programs;

[0054] A processor is used to execute the computer program, and when the computer program is executed by the processor, the steps of the external device data reading method as described in any one of the above items are implemented.

[0055] In order to solve the above technical problems, the present invention also provides a non-volatile storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the external device data reading method as described in any one of the above items are implemented.

[0056] In order to solve the above technical problems, the present invention also provides a computer program product, including a computer program, which implements the steps of the external device data reading method as described in any one of the above when executed by a processor.

[0057] The external device data reading method provided by the present invention has the beneficial effect that when the controller on the host accesses the device configuration space of the external device to read important product data, it reads the full amount of important product data locally each time it accesses and then filters the required data. It first determines the identification information of the target important product data to be read according to the important product data acquisition task, determines the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device according to the identification information, and then reads the required target important product data at the target storage address, thereby realizing on-demand reading, thereby reducing the amount of data read at a single time and improving the rate of acquiring important product data.

[0058] The external device data reading system, device, non-volatile storage medium, and computer program product provided by the present invention have the above-mentioned beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 A flowchart of a method for reading data from an external device provided by an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of a connection relationship between a first controller and an external device provided in an embodiment of the present invention;

[0062] Figure 3 A schematic structural diagram of an external device data reading device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The core of the present invention is to provide a method, system, device, medium and product for reading data of an external device, which are used to increase the rate of acquiring important product data by accessing the device configuration space of the external device.

[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] To facilitate understanding of the technical solution provided by the embodiment of the present invention, some key terms used in the embodiment of the present invention are first explained here.

[0066] Vital Product Data (VPD) is information that uniquely defines items such as hardware, software, and microcode elements of a system. VPD provides the system with information about various Field Replaceable Units (FRUs), including part numbers, serial numbers, and other detailed information. It can uniquely identify the system's software and hardware, and can also store system microinstructions. VPD provides a mechanism for storing information such as device performance or faults. The performance parameters or fault information of the device can be filled back into VPD through software to facilitate device use or debugging.

[0067] Important product data is usually stored in non-volatile memory (such as Electrically Erasable Programmable read only memory, EEPROM). The system generally provides an integrated circuit bus, such as a two-wire serial bus (Inter-Integrated Circuit, I2C) bus to access the memory. In this case, the important product data can be obtained using the integrated circuit bus according to the device specification (spec).

[0068] If it is not possible to obtain the important product data through the integrated circuit bus, such as for some external devices, it is necessary to obtain its important product data from the device configuration space of the external device. For example, for an external device connected to the host through a high-speed Peripheral Component Interconnect Express (PCIe) bus or a Peripheral Component Interconnect (PCI) bus, the important product data can be obtained by finding the capability register structure of the important product data in the device configuration space of the external device and accessing the important product data register (VPD Capability) of the device configuration space.

[0069] In actual applications, it is found that when using the second method mentioned above to obtain important product data of external devices, a longer reading time is required, which causes the basic input / output system (BIOS) to obtain important product data during the server startup phase. This takes a long time, affecting the boot rate, and the operating system (OS) to obtain important product data during the server operation process. This takes a long time, affecting task execution.

[0070] In order to improve the rate of acquiring important product data by accessing the device configuration space of an external device, the external device data reading scheme provided by the present invention improves the controller on the host in the related technology. When accessing the device configuration space of the external device to read important product data, the controller reads the full amount of important product data locally each time and then filters the required data. The identification information of the target important product data to be read is first determined according to the important product data acquisition task, and the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device is determined according to the identification information. Then, the required target important product data is read at the target storage address, thereby realizing on-demand reading, thereby reducing the amount of data read at a single time and improving the rate of acquiring important product data.

[0071] Based on the above architecture, the external device data reading method provided by the embodiment of the present invention is described below with reference to the accompanying drawings.

[0072] Figure 1 The present invention provides a flowchart of a method for reading data from an external device.

[0073] like Figure 1 As shown, the external device data reading method provided by the embodiment of the present invention, applied to the first controller, includes:

[0074] S101: determining identification information of target important product data to be read according to an important product data acquisition task;

[0075] S102: Determine, according to the identification information, a target storage address of the target important product data in an important product data storage area in a device configuration space of the target device;

[0076] S103: Read target important product data according to the target storage address;

[0077] The target device is an external device of the host where the first controller is located.

[0078] In a specific implementation, the first controller may be a firmware controller of a basic input / output system (BIOS), or a system controller (such as a central processing unit (CPU)) where an operating system (OS) is located.

[0079] In the embodiments of the present invention, the host may refer to a server host, which is a core device that provides computing resources, storage resources, and network services, while the peripherals are auxiliary devices connected to the server host to expand the functions of the server or improve its performance. The following are some common types of peripherals:

[0080] Storage devices: such as Hard Disk Drive (HDD), Solid State Disk (SSD), Network Attached Storage (NAS), Storage Area Network (SAN), etc.

[0081] Input / output devices: such as keyboard, mouse, monitor, printer, scanner, etc.

[0082] Network equipment: such as routers, switches, network interface cards (NICs), modems, etc.

[0083] Expansion cards: such as Graphics Processing Unit (GPU), Digital Signal Processor (DSP), sound card, network card, etc.

[0084] Power supply equipment: such as Uninterruptible Power Supply (UPS), etc.

[0085] Cooling equipment: such as fans, liquid cooling systems, etc., used to maintain the appropriate operating temperature of the server.

[0086] External connection devices: such as external array controller, external disk array (Redundant Arrays of Independent Disks, RAID) card, etc.

[0087] In the embodiment of the present invention, the first controller and the external device may be connected via a first bus, and the first bus may be a high-speed Peripheral Component Interconnect Express (PCIe) bus or a Peripheral Component Interconnect (PCI) bus.

[0088] In some application scenarios of the embodiments of the present invention, when the first controller is a firmware controller of a basic input / output system, the important product data acquisition task may include: a first device identification and marking task, a system configuration and initialization task, a first fault diagnosis task, a first device configuration task, a data backup task or one of its subtasks, and may also include other tasks.

[0089] Among them, the first device recognition and identification task is that the basic input and output system uniquely identifies the external device according to the part number, serial number and other information in the important product data to realize the asset management, tracking and replacement of the external device.

[0090] The system configuration and initialization tasks are to initialize the configuration of external devices and start the server according to the important product data of external devices during the power-on process of the basic input and output system of the server.

[0091] The first fault diagnosis task is for the basic input and output system to uniquely identify the external device according to the part number, serial number and other information in the important product data, so as to realize the asset management, tracking and replacement of the external device.

[0092] The first device configuration task is to optimize the device configuration of the basic input and output system according to the device performance parameters in the important product data to improve the overall performance of the system.

[0093] The data backup task is to back up important product data of external devices to the local computer for the basic input and output system to improve the efficiency of obtaining important product data next time and prevent the subsequent server startup failure due to communication problems with external devices.

[0094] In some optional application scenarios, after obtaining the important product data of the external device, the basic input and output system can also pass the important product data to the baseboard management controller (Baseboard Management Controller, BMC), and then the baseboard management controller can display the important product data of the external device on the web interface of the baseboard management controller.

[0095] In other application scenarios of the embodiments of the present invention, when the first controller is the system controller of the operating system, the important product data acquisition task may include: a second device identification and identification task, a system management task, a second fault diagnosis task, a second device configuration task, a security detection task, a remote management task or one of its subtasks, and may also include other tasks.

[0096] Among them, the second device recognition and identification task is that the operating system uniquely identifies the external device according to the part number, serial number and other information in the important product data to achieve asset management, tracking and replacement of the external device.

[0097] The system management task is for the operating system to fill the performance parameters or fault information of the external device into the important product data through software, so as to use the important product data to store the device performance information or fault information, so that the system administrator can monitor the status and performance of the external device.

[0098] The second fault diagnosis task is for the operating system to diagnose the fault of the external device based on the information in the important product data so as to determine the specific component that needs to be replaced.

[0099] The second device configuration task is for the operating system to optimize the device configuration according to the device performance parameters in the important product data to improve the overall performance of the system.

[0100] The security detection task is for the operating system to detect whether external devices meet specific security and compliance standards based on important product data, especially in environments where the source and history of the device need to be tracked.

[0101] The remote management task is for the operating system to provide necessary hardware information based on the important product data of its external devices when remotely managing the server, so as to improve the efficiency and accuracy of remote operations.

[0102] It can be seen that in different application scenarios and different important product data acquisition tasks, the types of important product data to be acquired may be different. After observation, it is found that most important product data acquisition tasks do not need to acquire all the important product data of the external device. For example, in some network cards, the valid data in the important product data is generally 200~300 bytes, and the important product data actually required to be acquired by the basic input and output system or the operating system is a part of this part of the valid data. In the related art, when the basic input and output system or the operating system accesses the device configuration space of the external device to acquire the important product data, it first requests that all the important product data of the external device be read locally, and then filters out the important product data actually needed, which results in a waste of time for reading unnecessary important product data. Therefore, in an embodiment of the present invention, the full amount of reading is changed to on-demand reading. When it is necessary to read the important product data, the first controller first determines the identification information of the target important product data to be read according to the important product data acquisition task, and then determines the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device according to the identification information.

[0103] According to the device configuration, the important product data of the external device has its specific storage structure. Therefore, after the first controller determines the target important product data that actually needs to be read, it can determine the target important product data according to the storage structure of the important product data of the external device and determine the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device.

[0104] After determining the target storage address of the target important product data, the first controller can actually read the target important product data according to the communication connection with the target device.

[0105] In some optional implementations of the embodiments of the present invention, the target important product data is read according to the target storage address in S103, which may include: setting the address offset of the important product data register of the target device according to the target storage address, so that the target device writes the target important product data into the data bit of the important product data register, and then reads the target important product data from the data bit. In an external device connected by a high-speed peripheral component interconnect bus / peripheral component interconnect bus, there are many function registers in its device configuration space, storing different types of data, and when the basic input and output system or operating system accesses the device configuration space of such an external device, that is, by writing the target storage address of the target important product data to be read into the address offset of the important product data register, the target device writes the data of the corresponding address into the data bit of the important product data register after identifying the address offset. Then, the basic input and output system or operating system can read the target important product data from the data bit of the important product data register. The important product data register usually writes four bytes of data at a time, and the target device uses the method of cyclically reading data from the target storage address and writing it into the data bit of the important product data register to complete the transmission of all target important data, and the first controller cyclically reads data from the data bit of the important product data register until all the target important data are read.

[0106] In an embodiment of the present invention, the first controller may read the important product data from the device configuration space of the target device by means of data input and output (I / O) or memory address mapping (MMIO). In some optional implementations of the embodiment of the present invention, reading the target important product data according to the target storage address in S103 may include: mapping the device configuration space to the system address space of the first controller; generating a memory mapping read request according to the target storage address to read the target important product data.

[0107] In some other optional implementations of the embodiments of the present invention, reading the target important product data according to the target storage address in S103 may also include: determining the data input and output ports corresponding to the device configuration space; accessing the target storage address of the target device through the data input and output ports to read the target important product data.

[0108] The external device data reading method provided by the embodiment of the present invention improves the related technology in that when the controller on the host accesses the device configuration space of the external device to read important product data, the controller reads the full amount of important product data locally each time the access is made and then the required data is filtered. The identification information of the target important product data to be read is first determined according to the important product data acquisition task, and the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device is determined according to the identification information. Then, the required target important product data is read at the target storage address, thereby realizing on-demand reading, thereby reducing the amount of data read at a single time and improving the rate of acquiring important product data.

[0109] On the basis of the above-mentioned embodiment, the embodiment of the present invention further illustrates the step of determining the target storage address of the target important product data.

[0110] In some optional implementations of the embodiments of the present invention, determining the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device according to the identification information in S102 may include: determining the keyword of the target important product data according to the identification information; reading the keywords of all important product data of the target device in the important product data storage area, and after matching the keywords of the target important product data, determining the corresponding key data partition as the target keyword data partition; and using the data address of the target keyword data partition as the target storage address.

[0111] In the important product data storage area of ​​the device configuration space of the external device, the important product data is usually stored in the form of keyword data partitions. In a keyword data partition, the important product data actually stored in the partition and its corresponding keyword are included. For example, if the keyword is the product number (PN), the important product data is the actual product number of the external device. The first controller can first read the keyword (Keyword) in each keyword data partition, determine the target keyword data partition that matches the keyword corresponding to the identification information of the target important product data, and then determine the data address according to the storage structure of the keyword data partition, and use it as the target storage address of the target important product data.

[0112] Among them, reading the keywords of each keyword data partition can be to read the important product data keyword list in the device configuration space of the target device, from which the keywords and storage order of all important product data of the target device can be determined, and then the target keyword data partition can be determined.

[0113] Although the above method can realize on-demand reading, it is necessary to traverse all keywords, or to read the keyword list locally in advance and maintain the storage order of each keyword data partition. In order to further improve the speed of reading target important data, in other optional implementations of the embodiments of the present invention, the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device is determined according to the identification information, and it can also include: determining the storage address range of the target important product data in the important product data storage area according to the identification information; determining the keyword of the target important product data according to the identification information; after matching the keyword of the target important product data in the keyword corresponding to the storage address range, determining the corresponding key data partition as the target keyword data partition; using the data address of the target keyword data partition as the target storage address.

[0114] As described in the above embodiments of the present invention, the important product data of the external device has a specific storage structure. For example, after all the important product data are classified, the important product data of the same type are stored together, and the important product data of different types are stored in a specific order.

[0115] In some optional implementations, important product data is divided into two data types: Small Resource Data Type and Large Resource Data Type. In the device configuration space, a resource data type tag for important product data can be found, which records a keyword list of all important data types of the external device. For example, the tag may include: Large Resource Data Type-Identifier String, Large Resource Data Type-VPD-R List containing one or more VPD keywords, Large Resource Data Type-VPD-W List containing one or more VPD keywords, Small Resource Data Type-End Tag. Among them, the VPD-R list is used to store keywords of read-only important product data of external devices (such as product number PN of external devices, engineering change level EC, system structure layout information FG, address LC, manufacturer ID (MN), etc.). The VPD-W list is used to store keywords of readable / writable important product data of external devices (such as vendor-specific information Vx, system-specific information Yx, asset tag identifier YA, remaining read / write area RW, etc.).

[0116] In a keyword data partition, data is usually stored in the order of keyword, data length, and data.

[0117] Therefore, when determining the target storage address, you can first determine the storage address range of the target important product data in the important product data storage area based on the important product data storage structure of the target device to narrow the query range, and then use the keyword of the target important product data determined according to the identification information to search for the target keyword data partition that matches the keyword in each keyword data partition in the storage address range, and then use the data address of the target keyword data partition as the target storage address, so that you only need to query a small number of keywords to determine the target storage address.

[0118] In some optional implementations of the embodiments of the present invention, determining the storage address range of target important product data in the important product data storage area based on identification information may include: determining the target data type of the target important product data based on the identification information; obtaining a first address range of a data group of the target data type in the important product data storage area; and using the first address range as the storage address range.

[0119] In some other optional implementations of the embodiments of the present invention, determining the storage address range of target important product data in the important product data storage area based on identification information may also include: determining the target data type of the target important product data based on the identification information; obtaining a data group of the target data type in a first address range in the important product data storage area; determining the data read and write properties of the target important product data based on the identification information; determining the second address range of the target important product data in the first address range based on the data read and write properties; and using the second address range as the storage address range.

[0120] Based on the above embodiment, the embodiment of the present invention further illustrates the steps of reading target important product data.

[0121] In the above embodiment, it is recorded that reading the target important product data according to the target storage address in S103 may include: setting the address offset of the important product data register of the target device according to the target storage address, so that after the target device writes the target important product data into the data bit of the important product data register, it reads the target important product data from the data bit.

[0122] Compared with the related art, the embodiment of the present invention changes the method of reading the full amount of important product data from the device configuration space of the external device to the local and then filtering it to on-demand reading, and realizes on-demand reading after the address configuration of the important product data register of the target device is changed accordingly. However, in the actual use of the server, it is found that the important product data sometimes obtained by the basic input and output system or operating system is garbled or cannot be obtained. By observing the structure of the important product data register, it can be found that it includes several parts: important product data address registration information, next function register pointer, function register ID, and important product data registration information. The important product data address registration information includes a write completion flag and an important product data address. The design of the basic input and output system or operating system reading important product data in the related art is as follows:

[0123] The basic input and output system or operating system writes the address of the important product data storage area to be accessed at the important product data address, and writes the write completion flag bit to 0;

[0124] After the four bytes of data are transferred to the important product data register, the hardware mechanism will write the write completion flag from 0 to 1, indicating that the data has been written and the data can now be read from the important product data register;

[0125] The addresses of the important product data to be read are accumulated, and the above reading process is repeated until all the data in the important product data storage area is read.

[0126] After testing, it was found that in the relevant technology, when the basic input and output system or operating system reads the important product data, it reads it by setting a timeout period. For example, the timeout period of the basic input and output system is usually 3 milliseconds (ms). After this time, regardless of whether the data is written in the important product data register, the basic input and output system or operating system will read the data from the data bits of the important product data register, resulting in some external devices with a slower processing speed. The data in the important product data register cannot be written within the timeout period, resulting in failure to obtain the important product data.

[0127] In this regard, in some optional implementations of the embodiments of the present invention, reading the target important product data from the data bit may include: if the first timeout period has passed after the address offset is set, then reading the data of the data bit as the target important product data; wherein the first timeout period corresponds to the type of the target device. That is, different first timeout periods may be set for different external devices to adapt to the processing rate of the external device. It is understandable that the first timeout period is negatively correlated with the processing rate, and a shorter first timeout period may be set for external devices with a higher processing rate.

[0128] The external device data reading method provided by the embodiment of the present invention may further include: determining a first timeout period corresponding to the external device according to the type of the external device and the historical test data of the external device. By combining actual tests, a first timeout period that is more suitable for the external device can be determined. The external device data reading method provided by the embodiment of the present invention may further include: adjusting the first timeout period according to the number of failures in reading important product data from the external device. When the number of failures is 0, the first timeout period may be appropriately reduced; when the number of failures is not 0, the first timeout period may be increased, and the increase is positively correlated with the number of failures.

[0129] In some other optional implementations of the embodiments of the present invention, reading the target important product data from the data bit may further include: determining whether the write completion flag bit of the important product data register is the first flag; if so, reading the data of the data bit as the target important product data. That is, the first controller may determine whether to read the data of the data bit according to the write completion flag bit of the important product data register, rather than reading the data regardless of whether the important product data register is ready.

[0130] Furthermore, the external device data reading method provided by the embodiment of the present invention may also include, if the write completion flag is not the first flag, determining whether the current number of reads of the target important product data reaches the preset number of retries corresponding to the target device; if yes, stopping reading; if not, jumping to determine whether the write completion flag of the important product data register is the first flag. By adding a reset mechanism, the success rate of reading important product data can be improved. Different retries can be set for different external devices to adapt to the processing rate of the external device. It can be understood that the number of retries is positively correlated with the processing rate, and fewer retries can be set for external devices with higher processing rates.

[0131] The external device data reading method provided in the embodiment of the present invention may further include: determining the number of retries corresponding to the external device according to the type of the external device and the historical test data of the external device. By combining actual tests, a number of retries that is more suitable for the external device can be determined. The external device data reading method provided in the embodiment of the present invention may further include: adjusting the number of retries according to the number of failures in reading important product data from the external device. When the number of failures is 0, the number of retries can be appropriately reduced; when the number of failures is not 0, the number of retries can be increased, and the increase is positively correlated with the number of failures.

[0132] The external device applied to the host, the external device data reading method provided by the embodiment of the present invention may also include:

[0133] receiving a request from a first controller of a host to read important product data;

[0134] Determine the target storage address according to the important product data read request;

[0135] sending target important product data from a target storage address to a first controller;

[0136] The target storage address is the address of the target important product data in the important product data storage area in the device configuration space of the external device determined by the first controller according to the identification information of the target important product data in the important product data acquisition task.

[0137] The specific implementation of the external device data reading method provided in the embodiment of the present invention may refer to the description of the external device data reading method applied to the first controller.

[0138] It should be noted that in the embodiments of the external device data reading method of the present invention, some of the steps or features can be ignored or not executed. The hardware or software functional modules divided for the convenience of description are not the only implementation form of the external device data reading method provided in the embodiments of the present invention.

[0139] The above describes in detail various embodiments corresponding to the external device data reading method. On this basis, the present invention also discloses a server, an external device data reading apparatus, a device, a non-volatile storage medium and a computer program product corresponding to the above method.

[0140] Figure 2 A schematic diagram of the connection relationship between a first controller and an external device provided in an embodiment of the present invention.

[0141] like Figure 2 As shown, the server provided by an embodiment of the present invention may include a first controller 201 and an external device 202; wherein the first controller 201 is used to determine identification information of target important product data to be read according to an important product data acquisition task; determine a target storage address of the target important product data in an important product data storage area in a device configuration space of the external device 202 according to the identification information; and read the target important product data according to the target storage address.

[0142] like Figure 2 As shown, in the server provided by an embodiment of the present invention, the first controller 201 writes the target storage address into the address offset of the important product data register of the external device 202. After the external device 202 writes the target important product data into the data bit of the important product data register, the first controller 201 reads the data from the data bit as the target important product data.

[0143] Since the embodiments of the server part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the server part, which will not be repeated here.

[0144] Applied to the first controller, the external device data reading device provided by the embodiment of the present invention includes:

[0145] An identification determination unit, used to determine identification information of target important product data to be read according to the important product data acquisition task;

[0146] A first address determination unit, configured to determine, according to the identification information, a target storage address of the target important product data in an important product data storage area in a device configuration space of a target device;

[0147] A data reading unit, used for reading target important product data according to a target storage address;

[0148] The target device is an external device of the host where the first controller is located.

[0149] The external device applied to the host, the external device data reading device provided by the embodiment of the present invention may also include:

[0150] A receiving unit, configured to receive a request from a host computer to read important product data from a first controller;

[0151] a second address determination unit, determining a target storage address according to an important product data read request;

[0152] A sending unit, used for sending target important product data from a target storage address to the first controller;

[0153] The target storage address is the address of the target important product data in the important product data storage area in the device configuration space of the target device determined by the first controller according to the identification information of the target important product data in the important product data acquisition task.

[0154] It should be noted that in each implementation of the external device data reading device provided by the embodiment of the present invention, the division of units is only a logical functional division, and other division methods can be adopted. The connection method between different units can be electrical, mechanical or other connection methods. The separated units can be located in the same physical location or distributed on multiple network nodes. Each unit can be implemented in the form of hardware or in the form of a software functional unit. That is, part or all of the units provided by the embodiment of the present invention can be selected according to actual needs and the corresponding connection method or integration method can be adopted to achieve the purpose of the embodiment of the present invention.

[0155] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0156] Figure 3 A schematic structural diagram of an external device data reading device provided by an embodiment of the present invention.

[0157] like Figure 3 As shown, the external device data reading device provided in an embodiment of the present invention includes: a memory 310, used to store a computer program 311; a processor 320, used to execute the computer program 311, and when the computer program 311 is executed by the processor 320, the steps of the external device data reading method provided in any one of the above embodiments are implemented.

[0158] Among them, the processor 320 may include one or more processing cores, such as a 3-core processor, an 8-core processor, etc. The processor 320 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 320 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 320 may be integrated with a graphics processing unit (GPU), and the image processor is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 320 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0159] The memory 310 may include one or more non-volatile storage media, which may be non-transitory. The memory 310 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 310 is at least used to store the following computer program 311, wherein the computer program 311, after being loaded and executed by the processor 320, can implement the relevant steps in the external device data reading method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 310 may also include an operating system 312 and data 313, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 312 may be Windows or other types of operating systems. Data 313 may include, but is not limited to, the data involved in the above method.

[0160] In some embodiments, the external device data reading device may further include a display screen 330 , a power supply 340 , a communication interface 350 , an input / output interface 360 ​​, a sensor 370 , and a communication bus 380 .

[0161] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the external device data reading device, and may include more or less components than those shown in the figure.

[0162] The external device data reading device provided in the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the steps of the external device data reading method provided in the above embodiment, and the effect is the same as above.

[0163] An embodiment of the present invention provides a non-volatile storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the external device data reading method provided in any one of the above embodiments can be implemented.

[0164] The non-volatile storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0165] For the introduction of the non-volatile storage medium provided in the embodiment of the present invention, please refer to the above method embodiment, and the effect thereof is the same as the external device data reading method provided in the embodiment of the present invention, and the present invention will not elaborate on it here.

[0166] An embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the external device data reading method provided in any one of the above embodiments.

[0167] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the above method embodiment, and the effect thereof is the same as the external device data reading method provided by the embodiment of the present invention, and the present invention will not elaborate on it here.

[0168] The above is a detailed introduction to an external device data reading method, device, equipment and non-volatile storage medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can refer to each other. For the devices, equipment, non-volatile storage media and computer program products disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can refer to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

[0169] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants 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 statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for reading data from an external device, characterized in that: Applied to the first controller, comprising: Determine identification information of target important product data to be read according to the important product data acquisition task; Determine, according to the identification information, a target storage address of the target important product data in an important product data storage area in a device configuration space of a target device; Read the target important product data according to the target storage address; Wherein, the target device is an external device of the host where the first controller is located; Determining the target storage address of the target important product data in the important product data storage area in the device configuration space of the target device according to the identification information, including: determining the storage address range of the target important product data in the important product data storage area according to the identification information; determining the keyword of the target important product data according to the identification information; after matching the keyword of the target important product data in the keywords corresponding to the storage address range, determining the corresponding key data partition as the target keyword data partition; and taking the data address of the target keyword data partition as the target storage address; Reading the target important product data according to the target storage address includes: setting the address offset of the important product data register of the target device according to the target storage address, so that the target device determines the target important product data according to the address offset, writes the target important product data into the data bit of the important product data register, and then reads the target important product data from the data bit.

2. The method for reading data from an external device according to claim 1, characterized in that: Determining the storage address range of the target important product data in the important product data storage area according to the identification information includes: Determining a target data type of the target important product data according to the identification information; Acquire a data group of the target data type within a first address range of the important product data storage area; Determining data read and write attributes of the target important product data according to the identification information; Determine a second address range of the target important product data in the first address range according to the data read and write attribute; The second address range is used as the storage address range.

3. The external device data reading method according to claim 1, characterized in that: Reading the target important product data from the data bit includes: If a first timeout period has elapsed after the address offset is set, reading the data of the data bit as the target important product data; The first timeout period corresponds to the type of the target device.

4. The external device data reading method according to claim 1, characterized in that: Reading the target important product data from the data bit includes: Determine whether the write completion flag of the important product data register is the first flag; If yes, the data of the data bit is read as the target important product data.

5. The method for reading data from an external device according to claim 4, characterized in that: Also includes: If the write completion flag is not the first flag, determining whether the current number of reads of the target important product data reaches a preset number of retries corresponding to the target device; If yes, stop reading; If not, jump to determine whether the write completion flag of the important product data register is the first flag.

6. The method for reading data from an external device according to claim 1, characterized in that: Reading the target important product data according to the target storage address includes: Mapping the device configuration space to the system address space of the first controller; A memory mapping read request is generated according to the target storage address to read the target important product data.

7. The method for reading data from an external device according to claim 1, characterized in that: Reading the target important product data according to the target storage address includes: Determine the data input and output ports corresponding to the device configuration space; The target storage address of the target device is accessed through the data input and output port to read the target important product data.

8. A method for reading data from an external device, characterized in that: External devices for host computers include: receiving a request to read important product data from a first controller of the host; Determine a target storage address according to the important product data read request; sending target important product data from the target storage address to the first controller; The target storage address is the address of the target important product data in the important product data storage area in the device configuration space of the external device determined by the first controller according to the identification information of the target important product data after the first controller determines the identification information of the target important product data in the important product data acquisition task; The first controller determines the target storage address according to the identification information, including: determining the storage address range of the target important product data in the important product data storage area according to the identification information; determining the keyword of the target important product data according to the identification information; after matching the keyword of the target important product data in the keywords corresponding to the storage address range, determining the corresponding key data partition as the target keyword data partition; and using the data address of the target keyword data partition as the target storage address; Determining a target storage address according to the important product data read request includes: the external device determines the target storage address of the target important product data according to an address offset set by the first controller in an important product data register of the external device; Sending target important product data from the target storage address to the first controller includes: the external device reads the target important product data from the target storage address and writes the target important product data into the data bit of the important product data register, so that the first controller reads the target important product data from the data bit.

9. A server, characterized in that: including a first controller and an external device; Wherein, the first controller is used to determine identification information of target important product data to be read according to the important product data acquisition task; determine a target storage address of the target important product data in the important product data storage area in the device configuration space of the external device according to the identification information; and read the target important product data according to the target storage address; Determining the target storage address of the target important product data in the important product data storage area in the device configuration space of the external device according to the identification information includes: determining the storage address range of the target important product data in the important product data storage area according to the identification information; determining the keyword of the target important product data according to the identification information; after matching the keyword of the target important product data in the keywords corresponding to the storage address range, determining the corresponding key data partition as the target keyword data partition; and using the data address of the target keyword data partition as the target storage address; Reading the target important product data according to the target storage address includes: setting the address offset of the important product data register of the external device according to the target storage address, so that the external device determines the target important product data according to the address offset, writes the target important product data into the data bit of the important product data register, and then reads the target important product data from the data bit.

10. An external device data reading device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program, and when the computer program is executed by the processor, the steps of the external device data reading method as claimed in any one of claims 1 to 8 are implemented.

11. A non-volatile storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the external device data reading method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the external device data reading method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Data access method and device, electronic equipment and storage medium

    CN117807136A

  • Enhanced VPD (Vital Product Data) structure

    US20040025089A1