I had this problem in the past with two identical USB-Serial devices. In the end we solved it long term by replacing them with a four-port USB-Serial device which was the only USB-Serial device in the system, making it simpler to find and detect the individual serial ports regardless of where the four-port USB was connected.
However:
Empirical Approach
You may be able to do it with a bit of empirical observation, if you can physically identify and maintain the USB port it is connected to, and if the USB subsystems don't change (say, thanks to other PCI cards or USB hubs being removed/added, BIOS update, etc. - its a big 'if', I know...) and if you only have one system you care about...
The command lsusb -t
will give you a tree of USB devices and ports. You can use this to find your device(s). Pick one then remove it and plug it into a different USB ports to confirm you have the device you want. Label it, and label the physical port you want to use it with, and make a note of the Bus, Port, Device, address etc. at that point in time. Provided the PCI bus doesn't change, etc., then that USB bus, device, port should remain the one corresponding to that USB-serial device.
Example output:
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/5p, 480M
|__ Port 3: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 1: Dev 7, If 0, Class=vend., Driver=pl2303, 12M
In this case, the chain Bus 02, Port 3 Dev1 --> Port 1 Dev 7
You might then be able to use that information in a udev rule to discriminate the specific USB-serial device, something along the lines of:
ATTRS{devpath}=="3.1",ATTRS{idVendor}=="0557", ATTRPICS{idProduct}=="2008"
Here, 3.1
corresponds to the bottom Port 3, Port 1
Here is an example not plugged into a hub:
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
|__ Port 1: Dev 2, If 0, Class=vend., Driver=pl2303, 12M
and
ATTRS{devpath}=="1",ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008"
Ignore the Dev number, it changes each time you plug in.
Obviously, replace the productId, etc. with yours...