feat: 全面代码更新 - ECharts 5.4.2 重构、新增量化分析模块、前端库升级

- 升级 ECharts 到 5.4.2,重构 lib/ 目录结构
- 新增 DataTables 2.x 和 FixedColumns 插件
- 新增 quant/ 宏观研究报告模块
- 重构图表页面:stock_trend、hkholdbycode 等采用 JS fetch API.doorcome.cn 模式
- 新增 CLAUDE.md 补充页面文档和新数据流说明
- 更新 inc/config.php TuShare API 配置
- 更新新闻联播分析模块 news/ 和相关研究报告 research/
- 新增 api_document/ 参考文档
- 清理 .gitignore,排除 uploads/xls/.mcp.json/ source maps 等非代码文件
- 所有 PHP 文件通过 php -l 语法检查

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 18:01:55 +08:00
co-authored by Claude Opus 4.7
parent f3f9d19da7
commit eedead0d41
228 changed files with 721924 additions and 15457 deletions
@@ -0,0 +1,313 @@
HailoRT Python API Reference
hailo_platform.pyhailort.hw_object
Hailo hardware API
class hailo_platform.pyhailort.hw_object.InferenceTargets[source]
Bases: object
Enum-like class with all inference targets supported by the HailoRT.
UNINITIALIZED = 'uninitialized'
UDP_CONTROLLER = 'udp'
PCIE_CONTROLLER = 'pcie'
exception hailo_platform.pyhailort.hw_object.HailoHWObjectException[source]
Bases: Exception
Raised in any error related to Hailo hardware.
class hailo_platform.pyhailort.hw_object.HailoHWObject[source]
Bases: object
Abstract Hailo hardware device representation (deprecated)
NAME = 'uninitialized'
IS_HARDWARE = True
__init__()[source]
Create the Hailo hardware object.
property name
The name of this target. Valid values are defined by InferenceTargets (deprecated)
Type
str
property is_hardware
Indicates this target runs on a physical hardware device. (deprecated)
Type
bool
property device_id
Getter for the device_id. :returns: A string ID of the device. BDF for PCIe devices, IP address for Ethernet devices, “Core” for core devices. :rtype: str
property sorted_output_layer_names
Getter for the property sorted_output_names (deprecated). :returns: Sorted list of the output layer names. :rtype: list of str
use_device(*args, **kwargs)[source]
A context manager that wraps the usage of the device. (deprecated)
get_output_device_layer_to_original_layer_map()[source]
Get a mapping between the device outputs to the layers names they represent (deprecated).
Returns
Keys are device output names and values are lists of layers names.
Return type
dict
get_original_layer_to_device_layer_map()[source]
Get a mapping between the layer names and the device outputs that contain them (deprecated).
Returns
Keys are the names of the layers and values are device outputs names.
Return type
dict
property device_input_layers
Get a list of the names of the devices inputs. (deprecated)
property device_output_layers
Get a list of the names of the devices outputs. (deprecated)
hef_loaded()[source]
Return True if this object has loaded the model HEF to the hardware device. (deprecated)
outputs_count()[source]
Return the amount of output tensors that are returned from the hardware device for every input image (deprecated).
property model_name
Get the name of the current model (deprecated).
Returns
Model name.
Return type
str
get_output_shapes()[source]
Get the model output shapes, as returned to the user (without any hardware padding) (deprecated).
Returns
Tuple of output shapes, sorted by the output names.
class hailo_platform.pyhailort.hw_object.HailoChipObject[source]
Bases: hailo_platform.pyhailort.hw_object.HailoHWObject
Hailo hardware device representation (deprecated)
__init__()[source]
Create the Hailo Chip hardware object.
property control
Returns the control object of this device, which implements the control API of the Hailo device. .. attention:: Use the low level control API with care.
Type
HailoControl
get_all_input_layers_dtype()[source]
Get the model inputs dtype (deprecated).
Returns
obj:numpy.dtype: where the key is model input_layer name, and the value is dtype as the device expect to get for this input.
Return type
dict of
get_input_vstream_infos(network_name=None)[source]
Get input vstreams information of a specific network group (deprecated).
Parameters
network_name (str, optional) The name of the network to access. In case not given, all the networks in the network group will be addressed.
Returns
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with all the information objects of all input vstreams
get_output_vstream_infos(network_name=None)[source]
Get output vstreams information of a specific network group (deprecated).
Parameters
network_name (str, optional) The name of the network to access. In case not given, all the networks in the network group will be addressed.
Returns
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with all the information objects of all output vstreams
get_all_vstream_infos(network_name=None)[source]
Get input and output vstreams information (deprecated).
Parameters
network_name (str, optional) The name of the network to access. In case not given, all the networks in the network group will be addressed.
Returns
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with all the information objects of all input and output vstreams
get_input_stream_infos(network_name=None)[source]
Get the input low-level streams information of a specific network group (deprecated).
Parameters
network_name (str, optional) The name of the network to access. In case not given, all the networks in the network group will be addressed.
Returns
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with information objects of all input low-level streams.
get_output_stream_infos(network_name=None)[source]
Get the output low-level streams information of a specific network group (deprecated).
Parameters
network_name (str, optional) The name of the network to access. In case not given, all the networks in the network group will be addressed.
Returns
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with information objects of all output low-level streams.
get_all_stream_infos(network_name=None)[source]
Get input and output streams information of a specific network group (deprecated).
Parameters
network_name (str, optional) The name of the network to access. In case not given, all the networks in the network group will be addressed.
Returns
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.StreamInfo: with all the information objects of all input and output streams
property loaded_network_groups
Getter for the property _loaded_network_groups. :returns: List of the the configured network groups loaded on the device. :rtype: list of ConfiguredNetwork
get_input_shape(name=None)[source]
Get the input shape (not padded) of a network (deprecated).
Parameters
name (str, optional) The name of the desired input. If a name is not provided, return the first input_dataflow shape.
Returns
Tuple of integers representing the input_shape.
get_index_from_name(name)[source]
Get the index in the output list from the name (deprecated).
Parameters
name (str) The name of the output.
Returns
The index of the layer name in the output list.
Return type
int
release()[source]
Release the allocated resources of the device. This function should be called when working with the device not as context-manager. Note: After calling this function, the device will not be usable.
class hailo_platform.pyhailort.hw_object.EthernetDevice(remote_ip, remote_control_port=22401)[source]
Bases: hailo_platform.pyhailort.hw_object.HailoChipObject
Represents any Hailo hardware device that supports UDP control and dataflow (deprecated)
NAME = 'udp'
__init__(remote_ip, remote_control_port=22401)[source]
Create the Hailo UDP hardware object.
Parameters
remote_ip (str) Device IP address.
remote_control_port (int, optional) UDP port to which the device listens for control. Defaults to 22401.
static scan_devices(interface_name, timeout_seconds=3)[source]
Scans for all eth devices on a specific network interface.
Parameters
interface_name (str) Interface to scan.
timeout_seconds (int, optional) timeout for scan operation. Defaults to 3.
Returns
IPs of scanned devices.
Return type
list of str
property remote_ip
Return the IP of the remote device (deprecated).
class hailo_platform.pyhailort.hw_object.PcieDevice(device_info=None)[source]
Bases: hailo_platform.pyhailort.hw_object.HailoChipObject
Hailo PCIe production device representation (deprecated)
NAME = 'pcie'
__init__(device_info=None)[source]
Create the Hailo PCIe hardware object.
Parameters
device_info (hailo_platform.pyhailort.pyhailort.PcieDeviceInfo, optional) Device info to create, call PcieDevice.scan_devices() to get list of all available devices.
static scan_devices()[source]
Scans for all pcie devices on the system (deprecated).
Returns
list of hailo_platform.pyhailort.pyhailort.PcieDeviceInfo
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,332 @@
hailo_platform.pyhailort.control_object
Control operations for the Hailo hardware device.
exception hailo_platform.pyhailort.control_object.ControlObjectException[source]
Bases: Exception
Raised on illegal ContolObject operation.
exception hailo_platform.pyhailort.control_object.FirmwareUpdateException[source]
Bases: Exception
class hailo_platform.pyhailort.control_object.HailoControl(device: hailo_platform.pyhailort._pyhailort.Device)[source]
Bases: hailo_platform.pyhailort.pyhailort.Control
Control object that sends control operations to a Hailo hardware device.
class hailo_platform.pyhailort.control_object.HcpControl(device: hailo_platform.pyhailort._pyhailort.Device)[source]
Bases: hailo_platform.pyhailort.control_object.HailoControl
Control object that uses the HCP protocol for controlling the device.
class hailo_platform.pyhailort.control_object.UdpHcpControl(remote_ip, device=None, remote_control_port=22401, retries=2, response_timeout_seconds=10.0, ignore_socket_errors=False)[source]
Bases: hailo_platform.pyhailort.control_object.HcpControl
Control object that uses a HCP over UDP controller interface.
__init__(remote_ip, device=None, remote_control_port=22401, retries=2, response_timeout_seconds=10.0, ignore_socket_errors=False)[source]
Initializes a new UdpControllerControl object.
Parameters
remote_ip (str) The IPv4 address of the remote Hailo device (X.X.X.X).
remote_control_port (int, optional) The port that the remote Hailo device listens on.
response_timeout_seconds (float, optional) Number of seconds to wait until a response is received.
ignore_socket_errors (bool, optional) Ignore socket error (might be usefull for debugging).
class hailo_platform.pyhailort.control_object.PcieHcpControl(device=None, device_info=None)[source]
Bases: hailo_platform.pyhailort.control_object.HcpControl
Control object that uses a HCP over PCIe controller interface.
__init__(device=None, device_info=None)[source]
Initializes a new HailoPcieController object.
hailo_platform.pyhailort.hailo_controller.i2c_slaves
hailo_platform.pyhailort.i2c_slaves.NO_I2C_SWITCH = 5
Variable which defines that the I2C slave is not behind a switch.
exception hailo_platform.pyhailort.i2c_slaves.I2CSlavesException[source]
Bases: Exception
class hailo_platform.pyhailort.i2c_slaves.I2CSlave(name, bus_index, slave_address, switch_number=5, register_address_size=1, endianness=<Endianness.LITTLE_ENDIAN: 1>, should_hold_bus=False)[source]
Bases: object
__init__(name, bus_index, slave_address, switch_number=5, register_address_size=1, endianness=<Endianness.LITTLE_ENDIAN: 1>, should_hold_bus=False)[source]
Initialize a class which describes an I2C slave.
Parameters
name (str) The name of the I2C slave.
bus_index (int) The bus number the I2C slave is connected to.
slave_address (int) The address of the I2C slave.
switch_number (int) The number of the switch the i2c salve is connected to.
register_address_size (int) Slave register address length (in bytes).
endianness (Endianness) The endianness of the slave.
should_hold_bus (bool) Should hold the bus during the read.
property name
Get the name of the I2C slave.
Returns
Name of the I2C slave.
Return type
str
property bus_index
Get bus index the I2C slave is connected to.
Returns
Index of the bus the I2C slave is connected to.
Return type
int
property slave_address
Get the address of the salve.
Returns
The address of the I2C slave.
Return type
int
property register_address_size
Get the slave register address length (in bytes). This number represents how many bytes are in the register address the slave can access.
Returns
Slave register address length.
Return type
int
Note
Pay attention to the slave endianness (Endianness).
property switch_number
Get the switch number the slave is connected to.
Returns
The number of the switch the I2C is behind.
Return type
int
Note
If NO_I2C_SWITCH is returned, it means the slave is not behind a switch.
property endianness
Get the slave endianness.
Returns
The slave endianness.
Return type
Endianness
property should_hold_bus
Returns a Boolean indicating if the bus will be held while reading from the slave.
Returns
True if the bus would be held, otherwise False.
Return type
bool
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_MIPI_AVDD
Class which represents the MIPI AVDD I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_USB_AVDD_IO
Class which represents the USB AVDD IO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_VDD_CORE
Class which represents the V_CORE slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_VDD_TOP
Class which represents the VDD TOP slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_MIPI_AVDD_H
Class which represents the MIPI AVDD_H I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_USB_AVDD_IO_HV
Class which represents the DVM USB AVDD IO HV slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_VDD_IO
Class which represents the DVM_VDDIO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_AVDD_H
Class which represents the DVM_AVDD_H slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_SDIO_VDD_IO
Class which represents the DVM_SDIO_VDDIO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_M_DOT_2_OVERCURREN_PROTECTION
Class which represents the DVM_SDIO_VDDIO slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_I2S_CODEC
Class which represents the I2S codec I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_I2C_TO_GPIO
Class which represents the I2C to gpio I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_SWITCH
Class which represents the I2C switch slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_TEMP_SENSOR_0
Class which represents the I2C TEMP_sensor_0 slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_TEMP_SENSOR_1
Class which represents the I2S TEMP_sensor_1 slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_EEPROM
Class which represents the EEPROM I2C slave.
hailo_platform.pyhailort.i2c_slaves.I2C_SLAVE_RASPICAM
Class which represents the raspicam I2C slave.
hailo_platform.pyhailort.i2c_slaves.set_i2c_switch(control_object, slave, slave_switch=None)[source]
Set the I2C switch in order to perform actions from the I2C slave.
Parameters
control_object (HcpControl) Control object which communicates with the Hailo chip.
slave (I2CSlave) Slave which the switch is set for.
slave_switch (I2CSlave) The I2C slave for the switch it self. Defaults to I2C_SLAVE_SWITCH.
hailo_platform.tools.udp_rate_limiter
Tool for limiting the packet sending rate via UDP. Needed to ensure the board will not get more traffic than it can handle, which would cause packet loss.
exception hailo_platform.tools.udp_rate_limiter.RateLimiterException[source]
Bases: Exception
A problem has occurred during the rate setting.
exception hailo_platform.tools.udp_rate_limiter.BadTCParamError[source]
Bases: Exception
One of shells tc command params is wrong.
exception hailo_platform.tools.udp_rate_limiter.BadTCCallError[source]
Bases: Exception
Shells tc command has failed.
class hailo_platform.tools.udp_rate_limiter.RateLimiterWrapper(configured_network_group, fps=1, fps_factor=1.0, remote_ip=None)[source]
Bases: object
UDPRateLimiter wrapper enabling with statements.
__init__(configured_network_group, fps=1, fps_factor=1.0, remote_ip=None)[source]
RateLimiterWrapper constructor.
Parameters
configured_network_group (ConfiguredNetwork) The target network_group.
fps (int) Frame rate.
fps_factor (float) Safety factor by which to multiply the calculated UDP rate.
remote_ip (str) Device IP address.
class hailo_platform.tools.udp_rate_limiter.UDPRateLimiter(remote_ip, port, rate_kbits_per_sec=0)[source]
Bases: object
Enables limiting or removing limits on UDP communication rate to a board.
__init__(remote_ip, port, rate_kbits_per_sec=0)[source]
set_rate_limit()[source]
reset_rate_limit()[source]
static calc_udp_rate(hef, network_group_name, fps, fps_factor=1, max_supported_kbps_rate=850000.0)[source]
Calculates the proper UDP rate according to an HEF.
Parameters
hef (str) Path to an HEF file containing the network_group.
network_group_name (str) Name of the network_group to configure rates for.
fps (int) Frame rate.
fps_factor (float, optional) Safety factor by which to multiply the calculated UDP rate.
max_supported_kbps_rate (int, optional) Max supported Kbits per second. Defaults to 850 Mbit/s (850,000 Kbit/s).
Returns
Maps between each input default dport to its calculated Rate in Kbits/sec.
Return type
dict