Hardware capability acquisition method and device, equipment and medium
By generating a capability profile matching the target device and finding hardware capabilities in it, the problems of low efficiency in hardware capability acquisition and high computing power requirements in the prior art are solved, and automatic acquisition and efficiency improvement of hardware capability are achieved.
Patent Information
- Application Number
- CN202510121736.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-23
AI Technical Summary
The existing technology cannot realize the automatic acquisition of hardware capabilities, resulting in low efficiency in acquisition of hardware capabilities and high computing power requirements for hardware capabilities acquisition operations.
By responding to user operations, a capability configuration file matching the target device is generated, and a hardware capability matching the target hardware is found in the file, and hardware capability results are generated and displayed.
The automatic acquisition of hardware capabilities related to the target device is achieved, the efficiency of hardware capabilities acquisition is improved, and the computing power requirement for hardware capabilities acquisition operations is reduced.
Smart Images

Figure CN120029688A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a method, device, equipment and medium for obtaining hardware capabilities. Background Art
[0002] In the current field of intelligent devices, OpenHarmony, as an emerging operating system, has broad application prospects. However, during the development of its Setting application, with the continuous emergence of various devices, their hardware configurations and capabilities show diverse characteristics. Due to the unevenness of these hardware capabilities, when developers are developing the OpenHarmony Setting application, they have to make fine adaptations one by one for the unique hardware capabilities of each specific device. This way of adapting to each device brings many adverse effects. First, it greatly expands the development workload, and developers need to spend a lot of time and energy researching and adapting various different hardware combinations. Second, it leads to a sharp increase in the code complexity during the development process. The adaptation codes for different devices are intertwined, greatly reducing the readability and maintainability of the code. Moreover, due to the lack of generality, once the hardware is updated or changed, a large-scale modification of the entire adaptation code is required, further increasing the maintenance cost.
[0003] In the prior art, in terms of obtaining hardware capabilities for other similar operating systems, although there have been some attempts and explorations, there are generally problems such as inconsistent interface standards, immature and imperfect solutions, and poor adaptability. Some operating systems provide overly complex interfaces, making it difficult for developers to quickly get started and effectively utilize them; some solutions lack flexibility and scalability when facing new types of hardware; and some have significant differences between different versions, resulting in prominent compatibility problems.
[0004] In summary, the prior art cannot achieve automatic acquisition of hardware capabilities, and there are problems of low efficiency in obtaining hardware capabilities and high computing power requirements for hardware capability acquisition operations during the process of obtaining hardware capabilities. Summary of the Invention
[0005] The present invention provides a method, device, equipment and medium for obtaining hardware capabilities, which can solve the problems that the prior art cannot achieve automatic acquisition of hardware capabilities, and there are low efficiency in obtaining hardware capabilities and high computing power requirements for hardware capability acquisition operations during the process of obtaining hardware capabilities.
[0006] In a first aspect, an embodiment of the present invention provides a method for obtaining hardware capabilities, the method comprising:
[0007] In response to a user's operation of generating a capability profile for a target device, obtaining a capability profile matching the target device, wherein the target device is composed of hardware connected via a hardware connection bus;
[0008] In response to a user's operation to obtain capabilities of a target hardware, searching the capability configuration file for a target hardware capability that matches the target hardware;
[0009] A hardware capability result matching the target hardware is generated and displayed according to the target hardware capability.
[0010] In a second aspect, an embodiment of the present invention provides a device for acquiring hardware capabilities, the device comprising:
[0011] a configuration file generating module, configured to obtain a capability configuration file matching the target device in response to a user's capability configuration file generating operation for the target device, wherein the target device is composed of hardware connected through hardware connection buses;
[0012] A capability search module, configured to search the capability configuration file for a target hardware capability that matches the target hardware in response to a user's capability acquisition operation for the target hardware;
[0013] The result display module is used to generate and display hardware capability results matching the target hardware according to the target hardware capability.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for acquiring hardware capabilities described in any embodiment of the present invention.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a method for acquiring hardware capabilities described in any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention obtains a capability profile matching the target device in response to a user's capability profile generation operation for the target device, then searches for target hardware capabilities matching the target hardware in the capability profile in response to a user's capability acquisition operation for the target hardware, and finally generates and displays hardware capability results matching the target hardware for the target hardware capabilities. This solves the problem that the prior art cannot achieve automatic acquisition of hardware capabilities, and that the acquisition efficiency of hardware capabilities is low and the computing power requirement of the hardware capability acquisition operation is high during the hardware capability acquisition process. This achieves the acquisition of hardware capabilities of hardware related to the target device, improves the hardware capability acquisition efficiency, and reduces the computing power requirement of the hardware capability acquisition operation.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0022] Figure 1 is a flowchart of a method for acquiring hardware capabilities provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flowchart of a method for acquiring hardware capabilities provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a structural diagram of a device for acquiring hardware capabilities provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a structural schematic diagram of an electronic device for implementing a method for acquiring hardware capabilities according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, any variation of the terms "including" and "having" is intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a method for acquiring hardware capabilities provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of acquiring hardware capabilities of hardware. The method can be executed by a hardware capability acquisition device. The hardware capability acquisition device can be implemented in the form of hardware and / or software. The hardware capability acquisition device can be configured in a terminal or server with a hardware capability acquisition function.
[0030] like Figure 1 As shown, the method includes:
[0031] S110 . In response to a user's operation of generating a capability profile for a target device, a capability profile matching the target device is obtained.
[0032] The target device is composed of various hardware connected through a hardware connection bus.
[0033] The capability configuration file is used to store association information between various hardware identifiers and corresponding hardware capability options and capability identifiers.
[0034] Furthermore, the hardware connection bus is a key channel connecting various hardware components in the device. Common hardware connection buses include PCI (Peripheral Component Interconnect) bus, USB (Universal Serial Bus) bus, etc. For example, in a computer device, the graphics card may be connected to the motherboard through the PCI bus, while external devices such as the mouse and keyboard are usually connected to the system through the USB bus. The target device is composed of various hardware connected through different hardware connection buses. These hardware cover various components such as processors, memory, storage devices, network adapters, etc., which work together to achieve the overall performance of the target device.
[0035] S120 . In response to a user's operation to obtain capabilities of a target hardware, searching the capability configuration file for target hardware capabilities that match the target hardware.
[0036] Among them, in response to the user's capability acquisition operation for the target hardware, the target hardware capability matching the target hardware is searched in the capability configuration file, including: obtaining the hardware identification of the target hardware; obtaining each hardware capability option matching the hardware identification and the hardware capability identification matching each hardware capability option in the capability configuration table; generating the target hardware capability based on each hardware capability option and the hardware capability identification matching each hardware capability option.
[0037] Specifically, when the user performs a capability acquisition operation on the target hardware, the system applying this method will quickly locate the previously generated capability configuration file. In this process, obtaining the hardware identification of the target hardware is the key first step. For example, if the target hardware is a graphics card, the system will accurately extract the hardware identification information such as the manufacturer code and product model number obtained during the hardware scanning phase. Then, the system will perform an accurate search in the capability configuration table. It should be noted that for the hardware identification of the graphics card, multiple matching hardware capability options may be found in the capability configuration table, such as whether the DirectX12 graphics API (Application Programming Interface) is supported, whether it has hardware video encoding capabilities, etc., as well as the hardware capability identification corresponding to each capability option, such as "1" for support, "0" for non-support, "2" for pending detection, etc. Based on these hardware capability options and capability identifications obtained from the capability configuration table, the system will generate a detailed description of the target hardware capability according to specific algorithms and logic.
[0038] Those skilled in the art should understand that the method of generating a detailed description based on the obtained information is a mature prior art and will not be described in detail in this embodiment.
[0039] S130: Generate and display hardware capability results matching the target hardware according to the target hardware capability.
[0040] Specifically, generating and displaying a hardware capability result that matches the target hardware for the target hardware capability includes: in the target hardware capability, aggregating hardware capability options that are identified as supported to obtain a first display result; in the target hardware capability, aggregating hardware capability options that are identified as to be detected to obtain a second display result; and generating and displaying a hardware capability result that matches the target hardware based on the first display result and the second display result.
[0041] Exemplarily, in the target hardware capabilities, the system applying this method will summarize and organize the hardware capability options marked as supported by the hardware capabilities to form a first display result. For example, for a graphics card, if it supports DirectX12 and hardware video encoding capabilities, these capability options will be aggregated into the first display result. At the same time, for hardware capability options marked as to be tested, separate aggregation will also be performed to form a second display result. For example, some new graphics processing technologies may require further testing and confirmation under the current detection conditions, and these capability options will be classified into the second display result. Based on these two results, the system will generate a comprehensive hardware capability result that matches the target hardware, and display it on the user interface in an intuitive manner, which may be presented to the user in the form of a chart, list or text report, so that the user can clearly understand the capability status of the target hardware.
[0042] The technical solution of the embodiment of the present invention obtains a capability profile matching the target device in response to a user's capability profile generation operation for the target device, then searches for target hardware capabilities matching the target hardware in the capability profile in response to a user's capability acquisition operation for the target hardware, and finally generates and displays hardware capability results matching the target hardware for the target hardware capabilities, thereby achieving the acquisition of hardware capabilities of hardware related to the target device, improving the efficiency of hardware capability acquisition, and reducing the computing power requirement of the hardware capability acquisition operation.
[0043] Embodiment 2
[0044] Figure 2 A flowchart of a method for acquiring hardware capabilities provided in Embodiment 2 of the present invention. This embodiment is refined based on the above-mentioned embodiment. In this embodiment, specifically, a method for searching for target hardware capabilities matching the target hardware in the capability configuration file in response to a user's capability acquisition operation for the target hardware is refined.
[0045] like Figure 2 As shown, the method includes:
[0046] S210: Traverse the hardware connection bus in the target device through a preset scanning script to obtain the hardware identification and hardware attribute information of each hardware.
[0047] The hardware attribute information includes hardware capability information matching the hardware.
[0048] Specifically, in this embodiment, the preset scanning script is a pre-written program, which has special logic and algorithms for detecting and extracting information from various hardware connection buses in the system. When the scanning script is started, it will visit these different types of hardware connection buses in sequence according to a predetermined order; illustratively, the preset scanning script can be set to dmidecode or HardwareLister and other open source scripts that can be used to list relevant information of system hardware according to the hardware connection bus according to actual implementation needs. This embodiment does not limit the specific type of scanning script.
[0049] In a specific implementation scenario of this embodiment, taking a typical laptop as an example, its internal processor, graphics card, network card and other hardware may be connected through a PCI bus. When the preset scanning script is run, the script will detect the hardware on the bus according to the electrical characteristics and communication protocol of the PCI bus. For the network card hardware, the scanning script first obtains its hardware identification. Usually, the hardware identification of the network card includes the manufacturer ID and device ID. At the same time, the script will detect its hardware attribute information, that is, hardware capabilities, such as whether it supports the latest Wi-Fi6 standard (802.11ax). If supported, it means that the hardware capability attributes of the network card include Wi-Fi; whether it supports Bluetooth function, if it supports Bluetooth 5.0 or higher, if supported, it means that the hardware capability attributes of the network card include Bluetooth.
[0050] In actual system development, the scanning script will use the system's device driver and the interface provided by the operating system to access the hardware connection bus. For example, in the Windows operating system, the scanning script can call the API provided by the Windows Device Manager to obtain information about PCI devices; in the Linux system, the output results of tools such as the lspci command (for PCI devices) and the lsusb command (for USB devices) may be used and parsed to obtain the required hardware identification and hardware attribute information.
[0051] S220: Fill in a preset capability configuration table according to each hardware attribute information to obtain a capability configuration file matching the target device.
[0052] The capability configuration table includes: a hardware identifier of each hardware and at least one hardware capability option matching the hardware capability.
[0053] Specifically, a preset capability configuration table is filled in according to each hardware attribute information to obtain a capability configuration file matching the target device, including: obtaining each hardware capability option that matches each hardware respectively through the hardware identifier of each hardware; searching the hardware attribute information of the hardware for whether the hardware capability information that matches the hardware capability option exists; if it exists and is supported, the hardware capability identifier that matches the hardware capability option is determined to be allowed and filled in; if it exists and needs to be detected, the hardware capability identifier that matches the hardware capability option is determined to be to be detected and filled in; if it exists and is not supported, the hardware capability identifier that matches the hardware capability option is determined to be not allowed and filled in; if it does not exist, the hardware capability identifier that matches the hardware capability option is determined to be not allowed and filled in.
[0054] Exemplarily, taking a network card as an example, its hardware capability options may include whether it supports Wi-Fi connection in the 5G frequency band, whether it has Bluetooth function, whether it supports network wake-up, etc. After obtaining the hardware attribute information of the network card, the preset capability configuration table is filled in. For example, for a wireless network card with a hardware identification of "XX-001", the system will locate the corresponding record row in the preset capability configuration table based on its hardware identification. Next, the system will check whether there is content matching each hardware capability option in the hardware attribute information of the wireless network card. Assuming that one of the hardware capability options is "support 5G Wi-Fi", if the hardware attribute information of the wireless network card clearly indicates that it supports 5G Wi-Fi, then the hardware capability identifier that matches the hardware capability option will be determined as "allowed" and filled in the capability configuration table; if the hardware attribute information shows that further testing is required to determine whether 5G Wi-Fi is supported, such as the 5G Wi-Fi signal strength and stability of the network card in a specific environment, the corresponding hardware capability identifier will be determined as "pending detection" and filled in; if the hardware attribute information clearly indicates that 5G Wi-Fi is not supported, then it will be filled in as "not allowed". If there is no information related to a hardware capability option in the hardware attribute information, it will also be determined as "not allowed".
[0055] Optionally, after filling in a preset capability configuration table according to each hardware attribute information to obtain a capability configuration file matching the target device, it also includes: in response to a user's editing operation, modifying the capability configuration table; wherein the modification operation includes: modifying the determination result of the hardware capability option, and adding a determination strategy for the hardware capability option determined to be to be detected.
[0056] Based on the above steps, taking the previous wireless network card as an example, if the user finds that although it was determined not to support 5G Wi-Fi during the initial detection, it may support after replacing the driver or updating the hardware firmware. At this time, the user can initiate an editing operation through the editing interface provided by the system to modify the determination result of "not allowed" to "allowed". For the hardware capability options determined to be pending detection, the user can also add determination policies. For example, for the pending detection hardware capability option of "support Bluetooth Low Energy (BLE)", the user can add a determination policy, that is, automatically perform a detection every period of time (such as 1 hour), or perform a detection when the device is connected to a specific Bluetooth device. Through these determination policies, the actual capabilities of the hardware can be more accurately determined, thereby improving the capability configuration table and the capability configuration file to ensure that they can always accurately reflect the hardware capability status of the target device.
[0057] Optionally, the modification operation may further include: adding a hardware capability option and a hardware capability identifier matching the hardware capability option for the target hardware, and adding new hardware and content related to the hardware capabilities of the hardware for the target device in the capability configuration file.
[0058] Exemplarily, when it comes to adding a hardware capability option and a matching hardware capability identifier for the target hardware, taking the microcontroller in an intelligent Internet of Things device as an example. With the development of technology and the expansion of application scenarios, it may be necessary to add new hardware capability options for it, such as the function of "supporting SparkLink technology". At this time, this hardware capability option will be newly added to the capability configuration table, and an initial hardware capability identifier, such as "allowed", will be set for it, which means that the hardware capabilities of the microcontroller include SparkLink. In terms of adding new hardware and content related to the hardware capabilities of the hardware for the target device in the capability configuration file, assume that a dedicated image processing acceleration card needs to be newly added to an industrial control computer. First, the basic hardware identifier of this new hardware, including key information such as its manufacturer and model, will be recorded in the capability configuration file. Then, for its hardware capabilities, hardware capability options such as "acceleration card" will be detailedly recorded, and corresponding hardware capability identifiers will be assigned to each option according to its technical specification manual. Such dynamic modification and expansion operations of the capability configuration table and the capability configuration file can greatly improve the adaptability and functionality of the hardware capability acquisition method described in this embodiment in different application scenarios, providing strong support for the continuous upgrade and optimization of the target device and the target hardware.
[0059] S230. In response to the user's operation of acquiring the capabilities of the target hardware, search for the target hardware capabilities matching the target hardware in the capability configuration file.
[0060] S240: Generate and display hardware capability results matching the target hardware according to the target hardware capability.
[0061] Optionally, based on the above steps, the hardware capability result may include, in addition to the first display result and the second display result, a determination strategy matching the second display result, so that the user or the target device may further determine the hardware capability included in the second display result according to the determination strategy.
[0062] It should be noted that in this embodiment, since there can be multiple detection methods for each hardware, which can be continuously supplemented according to the hardware characteristics, this embodiment does not limit the content of the judgment strategy, which can be set by the developer according to the actual usage scenario.
[0063] The technical solution of the embodiment of the present invention traverses the hardware connection bus in the target device through a preset scanning script to obtain the hardware identification and hardware attribute information of each hardware, and fills in the preset capability configuration table according to the hardware attribute information to obtain a capability configuration file matching the target device. Then, in response to the user's capability acquisition operation for the target hardware, the target hardware capability matching the target hardware is searched in the capability configuration file, and finally, a hardware capability result matching the target hardware is generated and displayed for the target hardware capability, thereby realizing the acquisition of the hardware capability of the hardware related to the target device, improving the efficiency of hardware capability acquisition, and reducing the computing power requirement of the hardware capability acquisition operation.
[0064] Embodiment 3
[0065] Figure 3 A schematic diagram of the structure of a device for acquiring hardware capabilities provided in Embodiment 3 of the present invention.
[0066] like Figure 3 As shown, the device comprises:
[0067] A configuration file generating module 310 is used to obtain a capability configuration file matching the target device in response to a user's capability configuration file generating operation for the target device, wherein the target device is composed of hardware connected through hardware connection buses;
[0068] A capability search module 320 is used to search the capability configuration file for target hardware capabilities that match the target hardware in response to a user's capability acquisition operation for the target hardware;
[0069] The result display module 330 is used to generate and display hardware capability results matching the target hardware according to the target hardware capability.
[0070] The technical solution of the embodiment of the present invention obtains a capability profile matching the target device in response to a user's capability profile generation operation for the target device, then searches for target hardware capabilities matching the target hardware in the capability profile in response to a user's capability acquisition operation for the target hardware, and finally generates and displays hardware capability results matching the target hardware for the target hardware capabilities, thereby achieving the acquisition of hardware capabilities of hardware related to the target device, improving the efficiency of hardware capability acquisition, and reducing the computing power requirement of the hardware capability acquisition operation.
[0071] Based on the above embodiment, the configuration file generating module 310 includes:
[0072] A bus traversal unit, used to traverse the hardware connection bus in the target device through a preset scanning script to obtain the hardware identification and hardware attribute information of each hardware, wherein the hardware attribute information includes each hardware capability information matching the hardware;
[0073] The configuration table filling unit is used to fill in the preset capability configuration table according to each hardware attribute information to obtain a capability configuration file matching the target device.
[0074] Based on the above embodiment, the configuration table filling unit includes:
[0075] An option acquisition unit, used to acquire hardware capability options respectively matching each hardware through the hardware identification of each hardware;
[0076] An information searching unit, configured to search the hardware attribute information of the hardware for hardware capability information matching the hardware capability option;
[0077] A first determination unit, configured to determine that a hardware capability identifier matching the hardware capability option is allowed and fill in the identifier if it exists and is supported;
[0078] A second determination unit, configured to determine the hardware capability identifier matching the hardware capability option as to be detected and fill in the identifier if the hardware capability identifier exists and needs to be detected;
[0079] A third determination unit, configured to determine that the hardware capability identifier matching the hardware capability option is not allowed and fill in the hardware capability identifier if it exists and is not supported;
[0080] The fourth determination unit is configured to determine that the hardware capability identifier matching the hardware capability option is not allowed and fill in the identifier if it does not exist.
[0081] Based on the above embodiment, the capability search module 320 includes:
[0082] An identification acquisition unit, used to acquire a hardware identification of the target hardware;
[0083] A capability identification acquisition unit, used to acquire, in the capability configuration table, each hardware capability option that matches the hardware identification and a hardware capability identification that matches each hardware capability option;
[0084] The hardware capability generating unit is used to generate target hardware capabilities based on each hardware capability option and the hardware capability identifiers respectively matching each hardware capability option.
[0085] Based on the above embodiment, the result display module 330 includes:
[0086] A first result acquisition unit, configured to aggregate hardware capability options identified as supported by the hardware capability in the target hardware capability to obtain a first display result;
[0087] A second result acquisition unit, configured to aggregate hardware capability options identified as to-be-detected hardware capability options in the target hardware capability to obtain a second display result;
[0088] A result generating unit is used to generate and display a hardware capability result matching the target hardware based on the first display result and the second display result.
[0089] On the basis of the above embodiment, the configuration table filling unit is also used to: fill in the preset capability configuration table according to each hardware attribute information, and after obtaining the capability configuration file matching the target device, modify the capability configuration table in response to the user's editing operation; wherein the modification operation includes: modifying the determination result of the hardware capability option, and adding a determination strategy for the hardware capability option determined to be to be detected.
[0090] A device for acquiring hardware capabilities provided in an embodiment of the present invention can execute a method for acquiring hardware capabilities provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0091] Embodiment 4
[0092] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0093] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0094] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0095] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for acquiring hardware capabilities.
[0096] Accordingly, the method comprises:
[0097] In response to a user's operation of generating a capability profile for a target device, obtaining a capability profile matching the target device, wherein the target device is composed of hardware connected via a hardware connection bus;
[0098] In response to a user's operation to obtain capabilities of a target hardware, searching the capability configuration file for a target hardware capability that matches the target hardware;
[0099] A hardware capability result matching the target hardware is generated and displayed according to the target hardware capability.
[0100] In some embodiments, a method for acquiring hardware capabilities may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for acquiring hardware capabilities described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a method for acquiring hardware capabilities in any other appropriate manner (e.g., by means of firmware).
[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0102] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0103] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0104] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0105] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0106] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
Claims
1. A method for acquiring hardware capabilities, characterized in that: include: In response to a user's operation of generating a capability profile for a target device, obtaining a capability profile matching the target device, wherein the target device is composed of hardware connected via a hardware connection bus; In response to a user's operation to obtain capabilities of a target hardware, searching the capability configuration file for a target hardware capability that matches the target hardware; A hardware capability result matching the target hardware is generated and displayed according to the target hardware capability.
2. The method according to claim 1, characterized in that In response to a user's operation of generating a capability profile for a target device, obtaining a capability profile matching the target device includes: Traversing the hardware connection bus in the target device through a preset scanning script to obtain the hardware identification and hardware attribute information of each hardware, wherein the hardware attribute information includes each hardware capability information matching the hardware; The preset capability configuration table is filled in according to each hardware attribute information to obtain a capability configuration file matching the target device.
3. The method according to claim 2, characterized in that The capability configuration table includes: a hardware identifier of each hardware and at least one hardware capability option matching the hardware capability.
4. The method according to any one of claims 2 to 3, characterized in that: Fill in the preset capability configuration table according to the hardware attribute information to obtain a capability configuration file matching the target device, including: Obtaining hardware capability options that match each hardware through the hardware identifier of each hardware; Searching the hardware attribute information of the hardware to see whether hardware capability information matching the hardware capability option exists; If it exists and is supported, the hardware capability flag matching the hardware capability option is determined to be allowed and filled in; If it exists and needs to be detected, the hardware capability identifier matching the hardware capability option is determined to be to be detected and filled in; If it exists and is not supported, the hardware capability identifier matching the hardware capability option is determined to be not allowed and filled in; If it does not exist, the hardware capability identifier matching the hardware capability option is determined to be not allowed and is filled in.
5. The method according to claim 1, characterized in that In response to a user's operation of acquiring capabilities of target hardware, searching the capability configuration file for target hardware capabilities that match the target hardware includes: Obtaining a hardware identifier of the target hardware; Acquire, in the capability configuration table, each hardware capability option that matches the hardware identifier and a hardware capability identifier that matches each hardware capability option; The target hardware capability is generated based on the hardware capability options and the hardware capability identifiers respectively matching the hardware capability options.
6. The method according to any one of claims 1 to 4, characterized in that: Generating and displaying hardware capability results matching the target hardware according to the target hardware capability, including: In the target hardware capability, aggregating the hardware capability options that are identified as supported by the hardware capability to obtain a first display result; In the target hardware capabilities, the hardware capabilities identified as hardware capability options to be detected are aggregated to obtain a second display result; A hardware capability result matching the target hardware is generated based on the first display result and the second display result and displayed.
7. The method according to claim 2, characterized in that After filling in the preset capability configuration table according to the hardware attribute information to obtain the capability configuration file matching the target device, the method further includes: In response to an editing operation by a user, modifying the capability configuration table; The modification operation includes: modifying the determination result of the hardware capability option, and adding a determination strategy for the hardware capability option determined to be to be detected.
8. A device for acquiring hardware capabilities, characterized in that: include: a configuration file generating module, configured to obtain a capability configuration file matching the target device in response to a user's capability configuration file generating operation for the target device, wherein the target device is composed of hardware connected through hardware connection buses; A capability search module, configured to search the capability configuration file for a target hardware capability that matches the target hardware in response to a user's capability acquisition operation for the target hardware; The result display module is used to generate and display hardware capability results matching the target hardware according to the target hardware capability.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for acquiring hardware capabilities according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a method for acquiring hardware capabilities according to any one of claims 1 to 7 when executed.