Embedded system and method for controlling electronic devices using the embedded system

An embedded system acquires hardware device information of an electronic device via a universal serial bus (USB) port, sets parameter information for each hardware device of the electronic device, and generates a control file recording one or more control commands that are generated according to the parameter information. The control file is sent to the electronic device by the embedded system via the USB port, and executed by the electronic device, to control one or more hardware device of the electronic device according to the one or more commands.

BACKGROUND

1. Technical Field

Embodiments of the present disclosure relate to systems and methods for controlling electronic devices, and more particularly, to an embedded system and a method for controlling electronic devices using the embedded system.

2. Description of related art

An operating system (OS), such as WINDOWS or LINUX, allows users to install desired third-party programs, so that design engineers may develop and install device drivers in the OS to control other electronic devices. However, a more enclosed OS prohibits the installation of any third-party programs, so that device drivers cannot be installed in the enclosed OS to control electronic devices.

DETAILED DESCRIPTION

The disclosure, including the accompanying drawings in which like references indicate similar elements, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.

FIG. 1is a block diagram of one embodiment of function modules of an embedded system10. The embedded system10includes a storage device11, a processor12, a control unit13, and one or more universal serial bus (USB) ports14(only one shown). In one embodiment, the embedded system10is connected to one or more electronic devices20via the one or more USB ports14. The control unit13generates a control file that lists control commands to be used in an electronic device20to control hardware devices of the electronic device20, and sends the control file to the electronic device20via the USB port14. The electronic device20receives the control file, analyzes and retrieves the control commands, and executes the control commands to control the hardware devices.

In one embodiment, the control unit13includes a reading module131, a setting module132, a generation module133, and a sending module134. The modules131-134may comprise computerized code in the form of one or more programs that are stored in the storage device11. The computerized code includes instructions that are executed by the processor12to provide the below described functions of the modules131-134.

The reading module131is operable to read hardware device information of the electronic device20via the USB port14, and generate a hardware control interface30displaying the hardware device information. In one embodiment, the hardware device information may include names of one or more hardware devices of the electronic device20, and performance parameters of each hardware device. For example, the electronic device20may includes hardware devices such as a fan, a power supply, a video card, and so on. The performance parameters of the fan may include a fan power state and a fan speed.

The setting module132is operable to set parameter information for the one or more hardware devices of the electronic device10via the hardware control interface30. For example, as shown inFIG. 3, the hardware control interface30displays performance parameters of the fan, such as the fan power state and the fan speed. The setting module132may set the fan power state to be “on” or “off”. If the fan power state is set to be “on”, the setting module132may further set the fan speed to at a “first level”, a “second level”, or a “third level”. The setting module132may set parameter information for all hardware devices at the same time, or only set parameter information for one hardware device at one time.

The generation module133is operable to generate a control command for the control of each hardware device according to the parameter information, and generate a control file that lists one or more control commands. For example, if the setting module132only sets parameter information for the fan, as shown inFIG. 3, the generation module133may generate a control file titled “Fan.txt” which comprises commands of setting the fan power state to be “on” and setting the fan speed at the “second level”.

The sending module134is operable to send the control file to the electronic device20via the USB port14.

In one embodiment, the electronic device20may include a storage device21, a processor22, an execution unit23, and a USB port24. The execution unit23includes a receiving module231, an analyzing module232, an execution module233, and a deletion module234. The modules231-234may comprise computerized code in the form of one or more programs that are stored in the storage device21. The computerized code includes instructions that are executed by the processor22to provide the below described functions of the modules231-234.

The receiving module231is operable to receive the control file sent from the embedded system10via the USB port24.

The analyzing module232is operable to analyze the control file to obtain each control command and a hardware device associated with the control command. For example, the analyzing module232analyzes the control file “Fan.txt” to retrieve the control commands to switch the fan as “on” and set the fan speed at the “second level”.

The execution module233is operable to execute the control command to control the associated hardware device. For example, the execution module233executes the control command to switch the fan on and switch the fan speed at the second level.

The deletion module234is operable to delete the control file after all control commands in the control file have been executed. For example, the deletion module234may delete the control file “Fan.txt”.

FIG. 3is a flowchart of one embodiment of a method for controlling the electronic device20using the embedded system10. Depending on the embodiment, additional blocks may be added, others removed, and the ordering of the blocks may be changed.

In block S201, the reading module131reads hardware device information of an electronic device20via a USB port14, and generates a hardware control interface30displaying the hardware device information. As mentioned above, the hardware device information may include names of one or more hardware devices of the electronic device20, and performance parameters of each hardware device. For example, the electronic device20may includes hardware devices such as a fan, a power supply, a video card, and so on. The performance parameters of the fan may include a fan power state and a fan speed.

In block S202, the setting module132sets parameter information for the one or more hardware devices of the electronic device10via the hardware control interface30. For example, as shown inFIG. 3, the hardware control interface30displays performance parameters of the fan, such as the fan power state and the fan speed. Then, the setting module132sets the fan power state to be “on”, and sets the fan speed to at a “second level”.

In block S203, the generation module133generates a control command for the control of each hardware device according to the parameter information, and generates a control file that lists one or more control commands. For example, as shown inFIG. 3, the generation module133generates a control file named as “Fan.txt” which records the control command to switch the fan on and set speed to at the “second level”.

In block S204, the sending module134sends the control file from the embedded system10to the electronic device20via the USB port14.

In block S205, the receiving module231receives the control file sent from the embedded system10via the USB port24, and stores the control file into the storage device21.

In block S206, the analyzing module232analyzes the control file to obtain each control command and a hardware device associated with the control command. For example, the analyzing module232analyzes the control file “Fan.txt” to obtain the control commands to switch the fan “on” and set speed to at the “second level”.

In block S207, the execution module233executes the control command. For example, the execution module233executes the control command to switch the fan on and set the fan speed at the “second level”.

In block S208, the deletion module234deletes the control file from the storage device21after all control commands in the control file have been executed. For example, the deletion module234may delete the control file “Fan.txt”.