CN116627859A - Method and device for fixing equipment port on hot plug bus and electronic equipment - Google Patents

Method and device for fixing equipment port on hot plug bus and electronic equipment Download PDF

Info

Publication number
CN116627859A
CN116627859A CN202310445674.1A CN202310445674A CN116627859A CN 116627859 A CN116627859 A CN 116627859A CN 202310445674 A CN202310445674 A CN 202310445674A CN 116627859 A CN116627859 A CN 116627859A
Authority
CN
China
Prior art keywords
port
configuration file
mapping
equipment
port configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310445674.1A
Other languages
Chinese (zh)
Inventor
张佩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Guanghetong Wireless Communication Co ltd
Original Assignee
Xi'an Guanghetong Wireless Communication Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Guanghetong Wireless Communication Co ltd filed Critical Xi'an Guanghetong Wireless Communication Co ltd
Priority to CN202310445674.1A priority Critical patent/CN116627859A/en
Publication of CN116627859A publication Critical patent/CN116627859A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method and a device for fixing equipment ports on a hot plug bus and electronic equipment. The method comprises the following steps: determining a second device corresponding to a binding event occurring at a target port of the first device; acquiring a port configuration file of a first device; searching a mapping relation of the second equipment in the port configuration file; and mapping the virtual port to the second device according to the mapping relation of the second device. The application solves the technical problem that the hot plug bus serial port descriptor changes.

Description

Method and device for fixing equipment port on hot plug bus and electronic equipment
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for fixing a device port on a hot plug bus, and an electronic device.
Background
In the existing embedded devices, more devices are fixed to be connected on a hot plug bus. For example, on a USB bus, there are a cellular module and a GNSS module, and the USB module of these devices is not fixed, and the naming rule of the serial devices is naming according to the device plug-in sequence, the first inserted serial device is named as/dev/ttyUSB 0, the second is named as/dev/ttyUSB 1, and so on. Therefore, on the hot plug bus, the device fixedly connected with the hot plug bus is not plugged in or pulled out from the device in a narrow sense, but after the device is randomly restarted, the serial device name also changes, for example, when a multi-cellular module or a GNSS module is connected with the device, the serial device name between the cellular modules or the GNSS modules also changes due to the random restarting; on the existing embedded equipment, under the condition that an application program does not release an equipment descriptor, a cellular module or a GNSS module is restarted randomly, and then the serial equipment name is changed.
Disclosure of Invention
The embodiment of the application provides a method and a device for fixing equipment ports on a hot-plug bus and electronic equipment, which are used for at least solving the technical problem that a serial port descriptor of the hot-plug bus is changed.
According to an aspect of the embodiment of the present application, there is provided a method for fixing a device port on a hot-plug bus, including: determining a second device corresponding to a binding event occurring at a target port of the first device; acquiring a port configuration file of the first device; searching the mapping relation of the second equipment in the port configuration file; and mapping virtual ports to the second equipment according to the mapping relation of the second equipment.
According to another aspect of the embodiments of the present application, there is provided a device port fixing apparatus on a hot-plug bus, including: the determining module is used for determining a second device corresponding to the binding event occurring at the target port of the first device; the acquisition module is used for acquiring the port configuration file of the first equipment; the searching module is used for searching the mapping relation of the second equipment in the port configuration file; and the mapping module is used for mapping the virtual port to the second equipment according to the mapping relation of the second equipment.
As an alternative example, the above apparatus further includes: and the processing module is used for waiting for importing the port configuration file under the condition that the port configuration file is not acquired after determining that the second device corresponding to the binding event occurs at the target port of the first device.
As an alternative example, the above apparatus further includes: the creation module is used for creating the mapping relation of the second device according to all the mapping relations in the port configuration file under the condition that the mapping relation of the second device is not found in the port configuration file after the port configuration file of the first device is obtained; and the adding module is used for adding the mapping relation of the second equipment to the port configuration file.
As an alternative example, the creation module includes: an obtaining unit, configured to obtain a serial port descriptor of each mapping relationship in the port configuration file; a first determining unit, configured to determine a serial port descriptor of the second device according to the serial port descriptor and a naming rule of each mapping relationship in the port configuration file; and the creation unit is used for creating the mapping relation of the second equipment according to the serial port descriptor of the second equipment.
As an alternative example, the mapping module includes: a second determining unit, configured to determine a serial descriptor of the second device according to a mapping relationship of the second device; and the mapping unit is used for hard mapping the virtual port to the second equipment according to the serial port descriptor.
As an alternative example, the above apparatus further includes: and the first updating module is used for updating the port configuration file under the condition that the port configuration file modification is detected after the port configuration file of the first device is acquired.
As an alternative example, the above apparatus further includes: and the second updating module is used for updating the mapping relation of the second equipment in the port configuration file under the condition that the mapping relation modification of the second equipment is detected after the virtual port is mapped to the second equipment according to the mapping relation of the second equipment.
According to yet another aspect of the embodiments of the present application, there is also provided a storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the above method for fixing a device port on a hot plug bus.
According to yet another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, and a processor, where the memory stores a computer program, and the processor is configured to execute the method for fixing a device port on a hot plug bus according to the above-mentioned computer program.
In the embodiment of the application, the second device corresponding to the binding event generated by the target port of the first device is determined; acquiring a port configuration file of the first device; searching the mapping relation of the second equipment in the port configuration file; according to the method for mapping virtual ports of the second device according to the mapping relation of the second device, the port bus state change is monitored, and corresponding serial port descriptor mapping is carried out on the port access node according to the mapping relation in the port configuration file, so that the purpose that the hot-plug bus serial port descriptor is fixed is achieved, and the technical problem that the hot-plug bus serial port descriptor changes is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of an alternative method for securing device ports on a hot-swappable bus according to embodiments of the present application;
FIG. 2 is a diagram of an alternative implementation flow of a method for securing device ports on a hot-plug bus, in accordance with an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative hot plug bus fixed equipment port arrangement in accordance with an embodiment of the present application;
fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of an embodiment of the present application, there is provided a method for fixing a device port on a hot-plug bus, optionally, as shown in fig. 1, the method includes:
s102, determining a second device corresponding to a binding event occurring at a target port of the first device;
s104, acquiring a port configuration file of the first equipment;
s106, searching a mapping relation of the second equipment in the port configuration file;
s108, mapping the virtual port to the second device according to the mapping relation of the second device.
Optionally, in this embodiment, the first device may be an embedded device, and the second device may be a device such as a mobile phone, a tablet computer, or a usb disk. The application is mainly realized by NETLINK (a special type socket), and is specially used for asynchronous communication between kernel space and user space. And creating socket connection through a standard socket mechanism to acquire uevent events broadcasted by the kernel, and analyzing the uevent events.
Alternatively, in this embodiment, as shown in fig. 2, the fork goes out a new process to individually complete the mapping work of the serial port descriptor. When the port bus state change is monitored, the ODMDEV_MGR process is started, and an exit signal is registered. Starting to read the port configuration file, and entering the next flow when the port configuration file exists; when the exit signal occurs, the current program is exited. When the port configuration file exists, checking whether the port configuration file is complete, namely searching whether the mapping relation of the second equipment exists in the port configuration file, and if so, registering a netlink event according to the mapping relation of the second equipment, analyzing the file and initializing the port mapping.
Optionally, in this embodiment, the port bus state change is monitored, and the corresponding serial port descriptor mapping is performed on the port access node according to the mapping relationship in the port configuration file, so that the purpose that the hot-plug bus serial port descriptor is fixed is achieved, and the technical problem that the hot-plug bus serial port descriptor changes is solved.
As an optional example, after determining that the target port of the first device generates the second device corresponding to the binding event, the method further includes:
and waiting for importing the port configuration file under the condition that the port configuration file is not acquired.
Optionally, in this embodiment, if the port configuration file does not exist, a non-blocking wait for file update event is entered and a wait for exit signal flow is performed.
As an optional example, after obtaining the port configuration file of the first device, the method further includes:
under the condition that the mapping relation of the second equipment is not found in the port configuration file, creating the mapping relation of the second equipment according to all the mapping relations in the port configuration file;
and adding the mapping relation of the second equipment to the port configuration file.
Optionally, in this embodiment, if the mapping relationship of the second device is not found in the port configuration file, all the mapping relationships in the port configuration file are obtained, the mapping relationship of the second device is created and stored in the port configuration file, then the port configuration file is started and read, and the corresponding serial port descriptor mapping is performed according to the created mapping relationship.
As an optional example, creating the mapping relationship of the second device according to all the mapping relationships in the port configuration file includes:
acquiring a serial port descriptor of each mapping relation in the port configuration file;
determining a serial port descriptor of the second device according to the serial port descriptor and naming rules of each mapping relation in the port configuration file;
and creating a mapping relation of the second equipment according to the serial port descriptor of the second equipment.
Alternatively, in this embodiment, a serial port descriptor of each mapping relationship in the port configuration file is obtained, for example, when device 1 maps to/dev/ttyUSB 0, device 2 maps to/dev/ttyUSB 1, device 3 maps to/dev/ttyUSB 2, a mapping relationship of the second device may be created to map the second device to/dev/ttyUSB 3 according to a serial port descriptor naming sequence in the mapping relationship, and a mapping relationship of the second device may be created to map device 1 to/dev/ttyUSB 0, device 2 maps to/dev/ttyUSB 2, device 3 maps to/dev/ttyUSB 3 in the case that each mapping relationship in the port configuration file maps to device 1 to/dev/ttyUSB 0, device 2 maps to/dev/ttyUSB 3, or the second device maps to/dev/ttyUSB 4.
As an optional example, mapping the virtual port to the second device according to the mapping relationship of the second device includes:
determining a serial descriptor of the second device according to the mapping relation of the second device;
and hard mapping the virtual port to the second device according to the serial port descriptor.
Optionally, in this embodiment, after the mapping relationship of the second device is read in the port configuration file, a serial port descriptor in the mapping relationship of the second device is obtained, and corresponding serial port descriptor mapping is performed.
As an optional example, after obtaining the port configuration file of the first device, the method further includes:
in the event that a port profile modification is detected, the port profile is updated.
Optionally, in this embodiment, during the signal and event monitoring process, if the exit signal occurs, the program is exited, and if the file modification event occurs, the modified port configuration file is obtained for updating.
As an optional example, after mapping the virtual port to the second device according to the mapping relationship of the second device, the method further includes:
and under the condition that the modification of the mapping relation of the second equipment is detected, updating the mapping relation of the second equipment in the port configuration file.
Optionally, in this embodiment, during the signal and event monitoring process, if a file modification event occurs in a mapping relationship of a second device in the port configuration file, the modified mapping relationship of the second device is obtained to update the mapping relationship of the second device in the port configuration file.
Optionally, in this embodiment, the method is based on the form of programming the C code, and provides a solution to the phenomenon that the serial port of the slave device is not fixed on the hot plug bus of the embedded platform, so that the effects of general use, real-time update and dynamic adaptation are achieved by adopting a plug-in without a third party and a modularized design idea. The method has the advantages of supporting universality, not depending on any third-party plug-in, being capable of transplanting a plurality of embedded operating systems, avoiding multiple development and reducing the labor cost in project maintenance. The configuration updating is dynamically detected, the port configuration file updating event is actively detected, and after the port configuration file is modified, a user can automatically trigger the configuration updating flow.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
According to another aspect of the embodiment of the present application, there is further provided a device port fixing apparatus on a hot-plug bus, as shown in fig. 3, including:
a determining module 302, configured to determine a second device corresponding to a binding event occurring at a target port of the first device;
an obtaining module 304, configured to obtain a port configuration file of the first device;
a searching module 306, configured to search the mapping relationship of the second device in the port configuration file;
the mapping module 308 is configured to map the virtual port to the second device according to the mapping relationship of the second device.
Optionally, in this embodiment, the first device may be an embedded device, and the second device may be a device such as a mobile phone, a tablet computer, or a usb disk. The application is mainly realized by NETLINK (a special type socket), and is specially used for asynchronous communication between kernel space and user space. And creating socket connection through a standard socket mechanism to acquire uevent events broadcasted by the kernel, and analyzing the uevent events.
Alternatively, in this embodiment, as shown in fig. 2, the fork goes out a new process to individually complete the mapping work of the serial port descriptor. When the port bus state change is monitored, the ODMDEV_MGR process is started, and an exit signal is registered. Starting to read the port configuration file, and entering the next flow when the port configuration file exists; when the exit signal occurs, the current program is exited. When the port configuration file exists, checking whether the port configuration file is complete, namely searching whether the mapping relation of the second equipment exists in the port configuration file, and if so, registering a netlink event according to the mapping relation of the second equipment, analyzing the file and initializing the port mapping.
Optionally, in this embodiment, the port bus state change is monitored, and the corresponding serial port descriptor mapping is performed on the port access node according to the mapping relationship in the port configuration file, so that the purpose that the hot-plug bus serial port descriptor is fixed is achieved, and the technical problem that the hot-plug bus serial port descriptor changes is solved.
As an alternative example, the above apparatus further includes:
and the processing module is used for waiting for importing the port configuration file under the condition that the port configuration file is not acquired after determining that the second device corresponding to the binding event occurs at the target port of the first device.
Optionally, in this embodiment, if the port configuration file does not exist, a non-blocking wait for file update event is entered and a wait for exit signal flow is performed.
As an alternative example, the above apparatus further includes:
the creation module is used for creating the mapping relation of the second device according to all the mapping relations in the port configuration file under the condition that the mapping relation of the second device is not found in the port configuration file after the port configuration file of the first device is acquired;
and the adding module is used for adding the mapping relation of the second equipment to the port configuration file.
Optionally, in this embodiment, if the mapping relationship of the second device is not found in the port configuration file, all the mapping relationships in the port configuration file are obtained, the mapping relationship of the second device is created and stored in the port configuration file, then the port configuration file is started and read, and the corresponding serial port descriptor mapping is performed according to the created mapping relationship.
As an alternative example, the creation module includes:
the acquisition unit is used for acquiring the serial port descriptor of each mapping relation in the port configuration file;
the first determining unit is used for determining the serial port descriptor of the second device according to the serial port descriptor and naming rule of each mapping relation in the port configuration file;
and the creating unit is used for creating the mapping relation of the second equipment according to the serial port descriptor of the second equipment.
Alternatively, in this embodiment, a serial port descriptor of each mapping relationship in the port configuration file is obtained, for example, when device 1 maps to/dev/ttyUSB 0, device 2 maps to/dev/ttyUSB 1, device 3 maps to/dev/ttyUSB 2, a mapping relationship of the second device may be created to map the second device to/dev/ttyUSB 3 according to a serial port descriptor naming sequence in the mapping relationship, and a mapping relationship of the second device may be created to map device 1 to/dev/ttyUSB 0, device 2 maps to/dev/ttyUSB 2, device 3 maps to/dev/ttyUSB 3 in the case that each mapping relationship in the port configuration file maps to device 1 to/dev/ttyUSB 0, device 2 maps to/dev/ttyUSB 3, or the second device maps to/dev/ttyUSB 4.
As an alternative example, the mapping module includes:
the second determining unit is used for determining a serial port descriptor of the second device according to the mapping relation of the second device;
and the mapping unit is used for hard mapping the virtual port to the second device according to the serial port descriptor.
Optionally, in this embodiment, after the mapping relationship of the second device is read in the port configuration file, a serial port descriptor in the mapping relationship of the second device is obtained, and corresponding serial port descriptor mapping is performed.
As an alternative example, the above apparatus further includes:
and the first updating module is used for updating the port configuration file under the condition that the port configuration file modification is detected after the port configuration file of the first device is acquired.
Optionally, in this embodiment, during the signal and event monitoring process, if the exit signal occurs, the program is exited, and if the file modification event occurs, the modified port configuration file is obtained for updating.
As an alternative example, the above apparatus further includes:
and the second updating module is used for updating the mapping relation of the second equipment in the port configuration file under the condition that the mapping relation modification of the second equipment is detected after the virtual port is mapped to the second equipment according to the mapping relation of the second equipment.
Optionally, in this embodiment, during the signal and event monitoring process, if a file modification event occurs in a mapping relationship of a second device in the port configuration file, the modified mapping relationship of the second device is obtained to update the mapping relationship of the second device in the port configuration file.
Optionally, in this embodiment, the method is based on the form of programming the C code, and provides a solution to the phenomenon that the serial port of the slave device is not fixed on the hot plug bus of the embedded platform, so that the effects of general use, real-time update and dynamic adaptation are achieved by adopting a plug-in without a third party and a modularized design idea. The method has the advantages of supporting universality, not depending on any third-party plug-in, being capable of transplanting a plurality of embedded operating systems, avoiding multiple development and reducing the labor cost in project maintenance. The configuration updating is dynamically detected, the port configuration file updating event is actively detected, and after the port configuration file is modified, a user can automatically trigger the configuration updating flow.
For other examples of this embodiment, please refer to the above examples, and are not described herein.
Fig. 4 is a schematic diagram of an alternative electronic device, according to an embodiment of the application, as shown in fig. 4, comprising a processor 402, a communication interface 404, a memory 406, and a communication bus 408, wherein the processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408, wherein,
a memory 406 for storing a computer program;
processor 402, when executing a computer program stored on memory 406, performs the following steps:
determining a second device corresponding to a binding event occurring at a target port of the first device;
acquiring a port configuration file of a first device;
searching a mapping relation of the second equipment in the port configuration file;
and mapping the virtual port to the second device according to the mapping relation of the second device.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus. The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 406 may include, but is not limited to, the determination module 302, the acquisition module 304, the lookup module 306, and the mapping module 308 in the fixed equipment port device on the hot-plug bus. In addition, other module units in the fixed equipment port device on the hot plug bus may be included, but are not limited to, and are not described in detail in this example.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is only illustrative, and the device implementing the method for fixing the device port on the hot plug bus may be a terminal device, and the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 4 does not limit the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
The electronic device provided by the embodiment of the application can be a module capable of realizing a communication function or a terminal device comprising the module, and the terminal device can be a mobile terminal or an intelligent terminal. The mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer and the like; the intelligent terminal can be a terminal containing a wireless communication module, such as an intelligent automobile, an intelligent watch, a sharing bicycle, an intelligent cabinet and the like; the module may specifically be any one of a wireless communication module, such as a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, and an NB-IOT communication module.
According to yet another aspect of embodiments of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the steps in the method for fixing a device port on a hot plug bus described above.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for securing a device port on a hot-plug bus, comprising:
determining a second device corresponding to a binding event occurring at a target port of the first device;
acquiring a port configuration file of the first device;
searching the mapping relation of the second equipment in the port configuration file;
and mapping the virtual port to the second equipment according to the mapping relation of the second equipment.
2. The method of claim 1, wherein after determining that the target port of the first device has a second device corresponding to a binding event, the method further comprises:
and waiting for importing the port configuration file under the condition that the port configuration file is not acquired.
3. The method of claim 1, wherein after obtaining the port profile of the first device, the method further comprises:
under the condition that the mapping relation of the second equipment is not found in the port configuration file, creating the mapping relation of the second equipment according to all the mapping relations in the port configuration file;
and adding the mapping relation of the second equipment to the port configuration file.
4. The method of claim 3, wherein creating the mapping of the second device from all mappings in the port configuration file comprises:
acquiring a serial port descriptor of each mapping relation in the port configuration file;
determining the serial port descriptor of the second device according to the serial port descriptor and naming rule of each mapping relation in the port configuration file;
and creating a mapping relation of the second equipment according to the serial port descriptor of the second equipment.
5. The method of claim 1, wherein the mapping virtual ports to the second device according to the mapping relationship of the second device comprises:
determining a serial port descriptor of the second device according to the mapping relation of the second device;
and hard mapping a virtual port to the second device according to the serial port descriptor.
6. The method of claim 1, wherein after obtaining the port profile of the first device, the method further comprises:
and updating the port configuration file under the condition that the port configuration file modification is detected.
7. The method of claim 1, wherein after mapping virtual ports to the second device according to the mapping relationship of the second device, the method further comprises:
and under the condition that the mapping relation of the second equipment is detected to be modified, updating the mapping relation of the second equipment in the port configuration file.
8. An apparatus for securing a device port on a hot-swappable bus, comprising:
the determining module is used for determining a second device corresponding to the binding event occurring at the target port of the first device;
the acquisition module is used for acquiring the port configuration file of the first device;
the searching module is used for searching the mapping relation of the second equipment in the port configuration file;
and the mapping module is used for mapping the virtual port to the second equipment according to the mapping relation of the second equipment.
9. A computer-readable storage medium, having stored thereon a computer program, characterized in that the computer program, when executed by a processor, performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202310445674.1A 2023-04-23 2023-04-23 Method and device for fixing equipment port on hot plug bus and electronic equipment Pending CN116627859A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310445674.1A CN116627859A (en) 2023-04-23 2023-04-23 Method and device for fixing equipment port on hot plug bus and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310445674.1A CN116627859A (en) 2023-04-23 2023-04-23 Method and device for fixing equipment port on hot plug bus and electronic equipment

Publications (1)

Publication Number Publication Date
CN116627859A true CN116627859A (en) 2023-08-22

Family

ID=87637312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310445674.1A Pending CN116627859A (en) 2023-04-23 2023-04-23 Method and device for fixing equipment port on hot plug bus and electronic equipment

Country Status (1)

Country Link
CN (1) CN116627859A (en)

Similar Documents

Publication Publication Date Title
CN110086877B (en) Application program sharing and information sharing display method, device, equipment and medium
CN105376107B (en) Terminal testing method and proxy server
CN109062617A (en) A kind of application method, the mobile terminal of platform that supporting polymorphic type equipment
CN109933289B (en) Storage copy deployment method and system, electronic equipment and storage medium
CN111414374B (en) Block chain transaction concurrent processing method, device and equipment
CN107798064B (en) Page processing method, electronic device and computer readable storage medium
CN114465998A (en) Multi-device file transmission method and device, terminal device and readable storage medium
CN113504918A (en) Equipment tree configuration optimization method and device, computer equipment and storage medium
CN110399166B (en) ME Nonce value saving method, device, equipment and storage medium
CN111026613B (en) Log processing method and device
CN111930363B (en) Block interface code generation method and device
CN110147328B (en) Database performance test method, system, electronic equipment and storage medium
CN106899630B (en) Thumbnail display method and device for pictures in network disk
CN116627859A (en) Method and device for fixing equipment port on hot plug bus and electronic equipment
CN108647139B (en) System test method, device, storage medium and electronic device
KR20150029916A (en) Apparatus and method for setting up computting environments
CN111131497B (en) File transmission method and device, electronic equipment and storage medium
CN114356456A (en) Service processing method, device, storage medium and electronic equipment
CN110825396B (en) Exception handling method and related equipment
CN115469961A (en) Method and device for creating container group, electronic equipment and storage medium
CN111159244A (en) Data query method and device
CN111147556A (en) Load balancing method, device, equipment and storage medium
CN110390064A (en) File updating method, device and system, storage medium and electronic device
CN114185602B (en) Starting method, device and terminal of operating system
CN112445390B (en) Submenu selection method and device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination