Communication interface function configuration method and apparatus, communication system, device, and medium
Patent Information
- Application Number
- CN202310609587.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-05-25
AI Technical Summary
In existing technologies, once the configuration information such as the device number of a high-speed serial computer expansion bus interface is set, it is difficult to change flexibly, resulting in poor compatibility when expanding interface functions and the inability to load the corresponding driver according to requirements.
By receiving the target device type, a mapping relationship between the current configuration information and the device address information is established, the storage space of the communication interface is reconfigured and the device driver is loaded, thereby enabling flexible configuration of the interface functions.
It improves the flexibility and compatibility of the communication interface, ensures the integrity and reliability of data read and write operations, and avoids read and write anomalies.
Smart Images

Figure CN116578350B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data communication, and more specifically to communication interface function configuration methods, apparatus, communication systems, devices and media. Background Technology
[0002] The Peripheral Component Interconnect Express (PCIe) interface, based on high-speed serial interconnect technology, supports various devices such as graphics cards, hard drives, and network cards. It can also be expanded to other interfaces, such as Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), Universal Serial Bus (USB), and display interfaces. Different devices or interface types can be identified by the PCIe interface's device number to achieve different functions. However, because the device number and other configuration information of the PCIe interface in existing devices generally do not change after configuration, when the system needs to expand the PCIe interface to other functionalities, the system cannot load the corresponding driver based on the PCIe interface's configuration information. An additional adapter interface needs to be set up to complete the functional expansion of the PCIe interface, resulting in low flexibility and poor compatibility. Summary of the Invention
[0003] In view of this, the present invention provides a communication interface function configuration method, apparatus, communication system, device and medium to solve the problem that the functions of the high-speed serial computer expansion bus interface cannot be flexibly configured.
[0004] In a first aspect, the present invention provides a method for configuring communication interface functions, including:
[0005] The target device type of the target communication interface sent by the receiving control terminal;
[0006] Based on the target device type, determine the current configuration information of the target communication interface; the current configuration information includes the current base address information;
[0007] A mapping relationship is established between the current base address information and the device address information of the target device type; the device address information is a pre-set address information corresponding to each device type; the mapping relationship is used to map read and write operations to the current base address information.
[0008] In this way, the configuration information of the communication interface can be updated as needed, and the mapping relationship with the target device can be re-established based on the updated configuration information, thereby realizing flexible configuration of the communication interface function.
[0009] As an optional implementation, based on the target device type, the current configuration information of the target communication interface is determined, including:
[0010] Based on the target device type, determine the target configuration information of the target communication interface;
[0011] In response to a feature update request, the target configuration information is determined to be the current configuration information of the target communication interface.
[0012] As an optional implementation, based on the target device type, the target configuration information of the target communication interface is determined, including:
[0013] Determine the target device information and target address information corresponding to the target device type;
[0014] Configure the target address space information of the target communication interface based on the target address information.
[0015] As an optional implementation, the target address information includes target space information and target base address information; based on the target address information, determining the target address space information of the target communication interface includes:
[0016] Based on the target space information, determine the size of the target address space;
[0017] Based on the target base address information and the size of the address space, the address range of the target address space of the target communication interface is determined to identify the target address space information.
[0018] As an optional implementation, the target configuration information is determined as the current configuration information of the target communication interface, including:
[0019] The target device information is determined as the current device information of the target communication interface;
[0020] The target base address information is determined as the current base address information of the target communication interface;
[0021] The target address space information is determined as the current address space information of the target communication interface.
[0022] Secondly, the present invention provides a communication interface function configuration method, including:
[0023] Obtain the target device type of the target communication interface and send the target device type to the communication interface chip;
[0024] Get the current device type of multiple communication interfaces;
[0025] Based on the current device type of multiple communication interfaces, storage space is allocated to multiple communication interfaces, and a mapping relationship is established between the allocated storage space and the current base address information of the communication interface chip; the mapping relationship is used to map read and write operations mapped to the current base address information to the allocated storage space.
[0026] Based on the current device type of multiple communication interfaces, load the device driver for the target device corresponding to the multiple communication interfaces; the device driver is used to call and operate the target device.
[0027] In this way, the device type of the communication interface can be updated as needed, storage space can be reallocated, and the corresponding device driver can be loaded, thereby achieving flexible configuration of the communication interface function.
[0028] As an optional implementation, after obtaining the target device type of the target communication interface and sending the target device type to the communication interface chip, and before obtaining the current device type of multiple communication interfaces, the method further includes:
[0029] When the target communication interface completes the current read / write operation, or when the target communication interface does not perform a read / write operation, the read / write operation of the target communication interface is stopped, and a function update request is sent to the communication interface chip.
[0030] In this way, it can be fully guaranteed that the current read and write operations of the target communication interface that needs to be reconfigured are completed before the configuration information of the target communication interface is updated, thus ensuring the integrity of data read and write and improving the reliability of the communication interface.
[0031] As an optional implementation, based on the current device type of multiple communication interfaces, storage space is allocated to multiple communication interfaces, and a mapping relationship is established between the allocated storage space and the current base address information of the communication interface chip, including:
[0032] When there is an updated communication interface among multiple communication interfaces where the current device type is inconsistent with the historical device type, storage space is allocated for the updated communication interface, and a mapping relationship is established between the allocated storage space and the current base address information of the communication interface chip.
[0033] In this way, allocating storage space only to the communication interface with reconfiguration function can reasonably allocate memory space without affecting the operation of other communication interfaces without reconfiguration function.
[0034] As an optional implementation, based on the current device type of multiple communication interfaces, the device driver for the target device corresponding to multiple communication interfaces is loaded, including:
[0035] When there is an updated communication interface among multiple communication interfaces where the current device type is inconsistent with the historical device type, load the device driver of the target device corresponding to the updated communication interface.
[0036] Thirdly, the present invention provides a communication interface function configuration device, comprising:
[0037] The target device type receiving module is used to receive the target device type of the target communication interface sent by the control terminal.
[0038] The current configuration information determination module is used to determine the current configuration information of the target communication interface based on the target device type; the current configuration information includes the current base address information;
[0039] The mapping relationship establishment module is used to establish a mapping relationship between the current base address information and the device address information of the target device type; the device address information is pre-set and corresponds to the address information of each device type; the mapping relationship is used to map read and write operations to the current base address information.
[0040] Fourthly, the present invention provides a communication interface function configuration device, comprising:
[0041] The target device type acquisition module is used to acquire the target device type of the target communication interface and send the target device type to the communication interface chip.
[0042] The current device type acquisition module is used to acquire the current device type of multiple communication interfaces;
[0043] The storage space allocation module is used to allocate storage space for multiple communication interfaces based on the current device type of the multiple communication interfaces, and to establish a mapping relationship between the allocated storage space and the current base address information of the communication interface chip; the mapping relationship is used to map read and write operations mapped to the current base address information to the allocated storage space;
[0044] The device driver loading module is used to load the device drivers for the target devices corresponding to multiple communication interfaces based on the current device type of multiple communication interfaces; the device drivers are used to call and operate the target devices.
[0045] Fifthly, the present invention provides a communication system, which includes a control terminal and a communication interface chip; the communication interface chip is connected to the control terminal.
[0046] The control terminal obtains the target device type of the target communication interface and sends the target device type to the communication interface chip.
[0047] The communication interface chip, based on the communication interface function configuration method of the first aspect or any corresponding embodiment described above, and the target device type, establishes a mapping relationship between the device address information of the target device type and the current base address information of the target device type, so as to map read and write operations to the current base address information;
[0048] Based on the communication interface function configuration method of the second aspect above or any corresponding embodiment, the control terminal allocates storage space for each communication interface and establishes a mapping relationship between the allocated storage space and the current base address information, so as to map the read and write operations mapped to the current base address information to the allocated storage space.
[0049] The control terminal loads the device driver corresponding to each communication interface based on the communication interface function configuration method of the second aspect above or any corresponding embodiment, so as to call and operate the device corresponding to each communication interface.
[0050] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the communication interface function configuration method of the first aspect or the second aspect or any corresponding embodiment thereof.
[0051] In a seventh aspect, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the communication interface function configuration method of the first aspect or the second aspect or any corresponding embodiment thereof. Attached Figure Description
[0052] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0053] Figure 1 This is a schematic diagram of an environment provided in an embodiment of the present invention;
[0054] Figure 2 This is a flowchart illustrating a communication interface function configuration method according to an embodiment of the present invention;
[0055] Figure 3 This is a flowchart illustrating another communication interface function configuration method according to an embodiment of the present invention;
[0056] Figure 4This is a flowchart illustrating another communication interface function configuration method according to an embodiment of the present invention;
[0057] Figure 5 This is a flowchart illustrating another communication interface function configuration method according to an embodiment of the present invention;
[0058] Figure 6 This is a structural block diagram of a communication interface function configuration device according to an embodiment of the present invention;
[0059] Figure 7 This is a structural block diagram of a communication interface function configuration device according to an embodiment of the present invention;
[0060] Figure 8 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] Please see Figure 1 , Figure 1 This is a schematic diagram of an environment provided by an embodiment of the present invention, including a control terminal 101, a communication interface chip 102, and multiple devices 103. The control terminal 101 can obtain the user's update request for the communication interface function, i.e., the target communication interface and the target device type of the target communication interface, and send it to the communication interface 102. The communication interface 102 updates the configuration information of the target communication interface according to the target communication interface and the target device type of the target communication interface. Simultaneously, the control terminal 101 reallocates the storage space of the communication interface and loads the device driver of the corresponding device 103, thereby realizing the function switching of the communication interface in the communication interface chip 102.
[0063] Specifically, on the one hand, the communication interface chip 102 receives the target device type of the target communication interface sent by the control terminal 101; based on the target device type, it determines the current configuration information of the target communication interface; and establishes a mapping relationship between the current base address information in the current configuration information and the device address information of the target device type; the device address information is a pre-set address information corresponding to each device type.
[0064] On the other hand, the control terminal 101 obtains the target device type of the target communication interface and sends the target device type to the communication interface chip 102; obtains the current device type of multiple communication interfaces; allocates storage space for multiple communication interfaces based on the current device type of multiple communication interfaces, and establishes a mapping relationship between the storage space and the current base address information of the communication interface chip; and loads the device driver of the target device corresponding to the multiple communication interfaces based on the current device type of multiple communication interfaces.
[0065] As an optional implementation, the communication interface chip 102 may be provided with multiple communication interfaces. These communication interfaces can all be configured as switchable communication interfaces, or some communication interfaces can be configured as fixed-function communication interfaces, while others can be configured as switchable communication interfaces. When the control terminal 101 retrieves the device type of the communication interface in the communication interface chip 102 to reallocate storage space, it may choose not to retrieve the device types of these fixed-function communication interfaces.
[0066] As an optional implementation method, the number and function type of fixed-function communication interfaces can be determined according to user needs, or the communication interfaces with higher demand can be selected and configured after a needs survey in advance.
[0067] As an optional implementation, the communication interface chip 102 may also include a control module and an address mapping module. The control module is responsible for determining the current configuration information of the target communication interface based on the target device type of the target communication interface sent by the control terminal 101, while the address mapping module is responsible for establishing a mapping relationship between the current base address information of the target communication interface and the device address information.
[0068] As an optional implementation, the control terminal 101 can be any integrated circuit, device, or equipment that can access the communication interface chip 102.
[0069] As an alternative implementation, each of the multiple devices 103 can be a different type of device or a device of the same type.
[0070] According to an embodiment of the present invention, a method for configuring communication interface functions is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0071] This embodiment provides a communication interface function configuration method, which can be used in the aforementioned integrated circuit, device, or equipment for accessing the communication interface chip 102. Figure 2This is a flowchart of a communication interface function configuration method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0072] Step S201: Receive the target device type of the target communication interface sent by the control terminal.
[0073] In this embodiment of the invention, the communication interface chip 102 is connected to the control terminal 101. The control terminal 101, as a platform for interaction with the user, can obtain the user's configuration requirements for the communication interface functions, including the communication interface whose functions need to be updated (i.e., the target communication interface) and the functions that the target communication interface needs to update (i.e., the target device type). The control terminal 101 sends the target device type of the target communication interface to the communication interface chip 102, so that the communication interface chip 102 can start reconfiguring and switching the functions of the communication interface based on the target device type of the target communication interface.
[0074] Step S202: Determine the current configuration information of the target communication interface based on the target device type.
[0075] In this embodiment of the invention, the current configuration information includes the current device information and the current base address information of the target communication interface. The device information characterizes the device type of the corresponding communication interface, i.e., the function type. The device information and its corresponding device type are shown in Table 1 below. Based on the target device type, a unique piece of device information can be determined, namely the target device information of that target device type. This target device information is used as the current device information of the target communication interface. Based on the target device type or the target device information, the current base address information of the target communication interface can be determined.
[0076] Table 1
[0077] Equipment Information Equipment type 0x00 Undefined device 0x01 High-capacity storage controller 0x02 Network Controller 0x03 Display Controller 0x05 memory controller 0x09 Input device controller 0x0c Serial bus controller
[0078] In this embodiment of the invention, when the control terminal 101 is started and initialized, a base address information is allocated to each device. This base address information establishes a mapping relationship with the device address information inside the communication interface chip 102 and with the storage space allocated in the control terminal 101, thereby serving as an intermediate address to establish a mapping relationship between the device address information inside the communication interface chip 102 and the storage space allocated in the control terminal 101.
[0079] As an optional implementation, when there are no devices of the same type among the multiple devices 103, the corresponding base address information can be uniquely determined based on the device information. Therefore, the target device information and target base address information can be uniquely determined based on the target device type of the target communication interface.
[0080] As an optional implementation, when multiple devices 103 of the same type exist, these devices 103 of the same type have the same device information, but different base address information, which is used to distinguish them.
[0081] Optionally, when the target device type of the target communication interface obtained by the control terminal 101 is a device type with multiple devices 103, if the user update request obtained by the control terminal 101 does not specify a specific device, then the base address information of the unactivated device 103 can be found among the devices 103 with the device type of the target device type, and one base address information can be selected as the target base address information of the target communication interface, that is, one device 103 is selected from the unactivated devices 103 to be enabled.
[0082] Optionally, when the target device type of the target communication interface obtained by the control terminal 101 is a device type with multiple devices 103, if the user update request obtained by the control terminal 101 specifies a specific device, for example, devices of the same device type can be numbered to form a distinction, then the base address information of the specified device can be directly used as the target base address information of the target communication interface.
[0083] Step S203: Establish a mapping relationship between the current base address information and the device address information of the target device type.
[0084] In this embodiment of the invention, the device address information is pre-set address information corresponding to each device type. The device address information is the address information built into the communication interface chip 102, which represents the base address of each device type, that is, each device, in the address space inside the communication interface chip 102, that is, the starting address of the address space inside the communication interface chip 102.
[0085] In this embodiment of the invention, the communication interface chip 102 establishes a mapping relationship between the current base address information and the device address information corresponding to the target communication interface, so as to map read and write operations to the current base address information. Then, the control terminal 101 establishes a mapping relationship between the current base address information corresponding to the target communication interface and the storage space in the control terminal 101, thereby establishing a mapping relationship between the device address information of the target communication interface and the storage space in the control terminal 101, thus mapping operations on the target communication interface to the storage space in the control terminal 101, realizing the mapping of bus access operations of the target communication interface to the corresponding device.
[0086] The communication interface function configuration method provided in this embodiment reconfigures the current configuration information of the target communication interface according to the target device type of the target communication interface, thereby re-establishing the mapping relationship between the target communication interface and the target device, and realizing flexible configuration of the communication interface function.
[0087] This embodiment provides a communication interface function configuration method, which can be used in the aforementioned integrated circuit, device, or equipment for accessing the communication interface chip 102. Figure 3 This is a flowchart of another communication interface function configuration method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0088] Step S301: Receive the target device type of the target communication interface sent by the control terminal. For details, please refer to [link to relevant documentation]. Figure 2 Step S201 of the illustrated embodiment will not be described again here.
[0089] Step S302: Determine the current configuration information of the target communication interface based on the target device type.
[0090] Specifically, step S302 above includes:
[0091] Step S3021: Determine the target configuration information of the target communication interface based on the target device type.
[0092] In this embodiment of the invention, since the target communication interface may be performing read and write operations, directly reconfiguring the current configuration information of the target communication interface would cause the current read and write operations to be interrupted, resulting in read and write abnormalities. Therefore, when the communication interface chip 102 receives the target device type of the target communication interface, it first prepares its configuration information, but does not directly update the current configuration information of the target communication interface. That is, it first determines the target configuration information of the target communication interface.
[0093] As an optional implementation, step S3021 above may include:
[0094] Step a1: Determine the target device information and target address information corresponding to the target device type.
[0095] In this embodiment of the invention, firstly, based on the target device type of the target communication interface, the corresponding target device information and target address information are determined. The target device information is the device information corresponding to the target device type; the target address information is the address information corresponding to the target device type, and as described in step S202 above, the target address information is set accordingly.
[0096] Step a2: Based on the target address information, configure the target address space information of the target communication interface.
[0097] In this embodiment of the invention, the target address information includes target spatial information and target base address information. Its spatial information, like the device address information, is built into the communication interface chip 102. Each device address has corresponding spatial information, and the size of the address space information of the communication interface is consistent with the size of the space of its corresponding device address information. Therefore, when determining the target address information, it is necessary to determine the spatial information of the device address information corresponding to the target device type, which is the target spatial information.
[0098] In this embodiment of the invention, as described in step S202 above, the target address information of the target communication interface is determined based on the target device type.
[0099] As an optional implementation, step a2 above may include:
[0100] Step a21: Determine the size of the target address space based on the target space information.
[0101] In this embodiment of the invention, the target space information represents the spatial size of the device address information corresponding to the target device type, and also represents the spatial size of its corresponding target address space. Therefore, the spatial size of the target address space can be determined based on the target space information.
[0102] Step a22: Based on the target base address information and the size of the address space, determine the address range of the target address space of the target communication interface to determine the target address space information.
[0103] In this embodiment of the invention, the target base address information is used as the starting address of the address segment of the target address space. Then, combined with the size of the address space, the address segment range of the target address space is determined, thereby obtaining the target address space information. All read and write operations mapped within the range of this target address space information are read and write operations targeting the target communication interface.
[0104] Step S3022: In response to the function update request, the target configuration information is determined as the current configuration information of the target communication interface.
[0105] In this embodiment of the invention, when the current read / write operation of the target communication interface in the control terminal 101 is completed, it indicates that the configuration information of the target communication interface can be updated and the function of the target communication interface can be reconfigured. At this time, the control terminal 101 generates a function update request. Correspondingly, in response to the function update request, the communication interface chip 102 determines the target configuration information as the current configuration information to complete the configuration update of the target communication interface.
[0106] As an optional implementation, the communication interface chip 102 may be equipped with a device function register, which includes a reset function bit. This reset function bit is used to implement function update requests. When the communication interface chip 102 is first started, the reset function bit is enabled, thereby activating the reset function bit and ensuring that its value correctly reflects the function update request.
[0107] As an optional implementation, when the current read / write operation of the target communication interface in the control terminal 101 is completed, the reset function bit of the device function register is set to 1. When the value of the reset function bit is 1, the communication interface chip 102 generates a response, that is, in response to the function update request, and determines the target configuration information as the current configuration information.
[0108] As an optional implementation, corresponding to the target configuration information, the current configuration information includes current device information, current base address information, and current address space information. Based on this, step S3022 above may include: determining the target device information as the current device information of the target communication interface; determining the target base address information as the current base address information of the target communication interface; and determining the target address space information as the current address space information of the target communication interface.
[0109] Step S303: Establish a mapping relationship between the current base address information and the device address information of the target device type. For details, please refer to [link to relevant documentation]. Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0110] The communication interface function configuration method provided in this embodiment does not directly update the configuration information of the target communication interface. Instead, it generates a function update request after the current read / write operation of the target communication interface is completed. The communication interface chip 102 updates the configuration of the target communication interface in response to the function update request, thereby avoiding read / write abnormalities caused by the interruption of the current read / write operation and ensuring the reliability of the communication interface chip 102.
[0111] This embodiment provides a communication interface function configuration method, which can be used in the aforementioned integrated circuit, device, or equipment for accessing the communication interface chip 102. Figure 4 This is a flowchart of another communication interface function configuration method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:
[0112] Step S401: Obtain the target device type of the target communication interface and send the target device type to the communication interface chip.
[0113] In this embodiment of the invention, the control terminal 101, as a platform for interaction with the user, is able to obtain the user's configuration requirements for the communication interface functions, including the communication interface whose functions need to be updated, i.e., the target communication interface, and the functions that the target communication interface needs to update, i.e., the target device type. The control terminal 101 sends the target device type of the target communication interface to the communication interface chip 102, so that the communication interface chip 102 can start reconfiguring and switching the functions of the communication interface based on the target device type of the target communication interface.
[0114] Step S402: Obtain the current device type of multiple communication interfaces.
[0115] In this embodiment of the invention, in order to reallocate the storage space in the control terminal 101, after the communication interface chip 102 has reconfigured the current configuration information of the target communication interface, the current device type of each communication interface in the communication interface chip 102 is obtained.
[0116] As an optional implementation, after the communication interface chip 102 completes the reconfiguration of the current configuration information of the target communication interface, it can generate a signal through external power-on or other means to inform the control terminal 101 that the communication interface chip 102 has completed the relevant operations on the functional configuration of the target communication interface, and the control terminal 101 can reallocate the storage space of each communication interface.
[0117] Step S403: Based on the current device type of multiple communication interfaces, allocate storage space for multiple communication interfaces, and establish a mapping relationship between the allocated storage space and the current base address information of the communication interface chip.
[0118] In this embodiment of the invention, storage space can be allocated to each communication interface according to the communication protocol corresponding to the communication interface. Simultaneously, in order to map the bus access operations of the target communication interface to the corresponding device, a mapping relationship is established between the storage space allocated in the control terminal 101 and the current base address information corresponding to the target communication interface in the communication interface chip 102. Read and write operations mapped to the current base address information can be mapped to this storage space, thereby establishing a mapping relationship between the device address information of the target communication interface and the storage space in the control terminal 101, thus mapping operations on the target communication interface to operations on the storage space in the control terminal 101.
[0119] Step S404: Based on the current device type of multiple communication interfaces, load the device driver of the target device corresponding to the multiple communication interfaces.
[0120] In this embodiment of the invention, in order to configure the functions of the communication interface onto the corresponding device, it is necessary not only to establish a mapping relationship between the device address information of the target communication interface and the storage space in the control terminal 101, but also to load the device driver of the corresponding target device so as to be able to call and operate the corresponding target device, thereby providing a hardware foundation for the function configuration of the communication interface. Thus, the device type of the communication interface can be updated as needed, the storage space can be reallocated, and the corresponding device driver can be loaded, thereby achieving flexible configuration of the communication interface functions.
[0121] This embodiment provides a communication interface function configuration method, which can be used in the aforementioned integrated circuit, device, or equipment for accessing the communication interface chip 102. Figure 5 This is a flowchart of another communication interface function configuration method according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps:
[0122] Step S501: Obtain the target device type of the target communication interface and send the target device type to the communication interface chip. For details, please refer to [link to relevant documentation]. Figure 4 Step S401 of the illustrated embodiment will not be described again here.
[0123] Step S502: When the target communication interface completes the current read / write operation, or when the target communication interface does not perform a read / write operation, stop the read / write operation of the target communication interface and send a function update request to the communication interface chip.
[0124] In this embodiment of the invention, since the target communication interface may be performing read / write operations, directly reconfiguring the current configuration information of the target communication interface would interrupt the current read / write operation, leading to read / write anomalies. Therefore, a function update request is set to inform the communication interface 102 when to reconfigure the current configuration information of the target communication interface. Specifically, when the target communication interface completes the current read / write operation, or when the target communication interface is not performing a read / write operation, a function update request is initiated to the communication interface chip, and the read / write operation of the target communication interface is stopped to avoid read / write anomalies.
[0125] In this way, it can be fully guaranteed that the current read and write operations of the target communication interface that needs to be reconfigured are completed before the configuration information of the target communication interface is updated, thus ensuring the integrity of data read and write and improving the reliability of the communication interface.
[0126] Step S503: Obtain the current device type of multiple communication interfaces. For details, please refer to [link to relevant documentation]. Figure 4 Step S402 of the illustrated embodiment will not be described again here.
[0127] Step S504: Based on the current device type of multiple communication interfaces, allocate storage space for multiple communication interfaces, and establish a mapping relationship between the allocated storage space and the current base address information of the communication interface chip.
[0128] In this embodiment of the invention, some communication interfaces do not have their device types modified, meaning their current device types are consistent with their historical device types. Since the communication interface chip 102 has not reconfigured the configuration information for these interfaces, their storage space does not need to be reconfigured. However, when the current device type of a communication interface differs from its historical device type—that is, when there is an updated communication interface among the multiple communication interfaces whose current device type differs from its historical device type—it indicates that the configuration information for this updated communication interface was obtained through reconfiguration. In this case, storage space needs to be allocated for the updated communication interface, and a mapping relationship needs to be established between the storage space and the current base address information of the communication interface chip. Thus, allocating storage space only to communication interfaces with reconfiguration functionality allows for reasonable allocation of memory space without affecting the operation of other communication interfaces that have not been reconfigured.
[0129] As an optional implementation, the updated communication interface is the target communication interface mentioned above. However, the control terminal 101 cannot directly know which of the multiple communication interfaces in the communication interface chip 102 are the current communication interfaces with reconfigured configuration information. Instead, it can only obtain the current device type of these communication interfaces. Based on the current device type and historical device type of these communication interfaces, it determines which communication interfaces have changed their configuration information. Thus, it determines the communication interfaces that need to reallocate storage space, i.e., the updated communication interfaces or the target communication interfaces.
[0130] As an optional implementation, when the function of the communication interface is reconfigured, the storage space occupied by the communication interface before reconfiguration will be released, and the stored data will be cleared; that is, the storage space originally occupied by the target communication interface or the updated communication interface will be released, and the originally stored data will be cleared.
[0131] As an optional implementation, when allocating storage space, memory can be allocated directly to each target communication interface or the updated communication interface according to the communication protocol corresponding to the communication interface.
[0132] As an optional implementation, when allocating storage space, the storage space occupied by the target communication interface or the updated communication interface before reconfiguration can be used as the storage space of the device corresponding to the target communication interface or the updated communication interface before reconfiguration. When other communication interfaces are subsequently configured for the device, the storage space can be reactivated.
[0133] Step S505: Based on the current device type of multiple communication interfaces, load the device driver of the target device corresponding to the multiple communication interfaces.
[0134] In this embodiment of the invention, the device type of some communication interfaces among multiple communication interfaces has not been modified, that is, the current device type of these communication interfaces is consistent with the historical device type. The communication interface chip 102 has not reconfigured the configuration information of these communication interfaces, so the storage space of these communication interfaces does not need to be reconfigured. However, when the current device type of a communication interface is inconsistent with the historical device type, that is, when there is an updated communication interface among multiple communication interfaces whose current device type is inconsistent with the historical device type, it indicates that the configuration information of the updated communication interface has been reconfigured. At this time, it is necessary to load the device driver corresponding to the updated communication interface to provide a hardware foundation for the functional configuration of the communication interface.
[0135] As an optional implementation, a security verification can also be established between the communication interface chip 102 and the control terminal 101. Specifically, the initial device information and vendor information of some communication interfaces in the communication interface chip 102 can be set to 0xff. When the communication interface chip 102 is connected to the control terminal 101, the control terminal 101 cannot properly identify the device type of these communication interfaces, and therefore cannot use these communication interfaces. At the same time, a key is set in the communication interface chip 102 or the control terminal 101 for security verification, and a third-party interface, such as a Universal Asynchronous Receiver / Transmitter (UART) interface, is introduced. Through this third-party interface, communication is established between the control terminal 101 and the communication interface chip 102, thereby completing the security verification of the key. After the security verification is successful, the control terminal 101 sends the target device type and target vendor type of the communication interface in the communication interface chip 102 to the communication interface chip 102 through the third-party interface, so that the communication interface chip 102 configures the corresponding communication interface according to the target device type, thereby opening the communication interface to the control terminal 101. By establishing a security verification between the communication interface chip 102 and the control terminal 101, a specific communication interface can only be enabled after the security verification is passed, thereby improving the security and reliability of the communication interface chip 102.
[0136] This embodiment also provides a communication interface function configuration device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "module" and "unit" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0137] This embodiment provides a communication interface function configuration device, such as... Figure 6 As shown, it includes:
[0138] The target device type receiving module 601 is used to receive the target device type of the target communication interface sent by the control terminal;
[0139] The current configuration information determination module 602 is used to determine the current configuration information of the target communication interface based on the target device type; the current configuration information includes the current base address information;
[0140] The mapping relationship establishment module 603 is used to establish a mapping relationship between the current base address information and the device address information of the target device type; the device address information is a pre-set address information corresponding to each device type; the mapping relationship is used to map read and write operations to the current base address information.
[0141] As an optional implementation, the current configuration information determination module 602 includes:
[0142] The target configuration information determination unit is used to determine the target configuration information of the target communication interface based on the target device type.
[0143] The current configuration information determination unit is used to determine the target configuration information as the current configuration information of the target communication interface in response to a function update request.
[0144] As an optional implementation, the target configuration information determination unit includes:
[0145] The target device information determination subunit is used to determine the target device information and target address information corresponding to the target device type.
[0146] The target address space information determination subunit is used to configure the target address space information of the target communication interface based on the target address information.
[0147] As an optional implementation, the target address information includes target spatial information and target base address information; the target address spatial information determining subunit includes:
[0148] The target address space determination submodule is used to determine the size of the target address space based on the target space information.
[0149] The target address space information determination submodule is used to determine the address range of the target address space of the target communication interface based on the target base address information and the size of the address space, so as to determine the target address space information.
[0150] As an optional implementation, the current configuration information determination unit includes:
[0151] The current device information determination subunit is used to determine the target device information as the current device information of the target communication interface;
[0152] The current base address information determination subunit is used to determine the target base address information as the current base address information of the target communication interface;
[0153] The current address space information determination subunit is used to determine the target address space information as the current address space information of the target communication interface.
[0154] This embodiment provides a communication interface function configuration device, such as... Figure 7 As shown, it includes:
[0155] The target device type acquisition module 701 is used to acquire the target device type of the target communication interface and send the target device type to the communication interface chip.
[0156] The current device type acquisition module 702 is used to acquire the current device type of multiple communication interfaces;
[0157] The storage space allocation module 703 is used to allocate storage space for multiple communication interfaces based on the current device type of multiple communication interfaces, and to establish a mapping relationship between the allocated storage space and the current base address information of the communication interface chip; the mapping relationship is used to map read and write operations mapped to the current base address information to the allocated storage space.
[0158] The device driver loading module 704 is used to load the device driver of the target device corresponding to multiple communication interfaces based on the current device type of multiple communication interfaces; the device driver is used to call and operate the target device.
[0159] As an optional implementation, the device further includes:
[0160] The function update request initiation module is used to stop the read and write operations of the target communication interface and initiate a function update request to the communication interface chip when the target communication interface completes the current read and write operation or when the target communication interface does not perform a read and write operation.
[0161] As an optional implementation, the storage space allocation module 703 includes:
[0162] The storage space allocation unit is used to allocate storage space for an updated communication interface when there is an updated communication interface among multiple communication interfaces whose current device type is inconsistent with the historical device type, and to establish a mapping relationship between the allocated storage space and the current base address information of the communication interface chip.
[0163] As an optional implementation, the device driver loading module 704 includes:
[0164] The device driver loading unit is used to load the device driver of the target device corresponding to the updated communication interface when there is an updated communication interface among multiple communication interfaces where the current device type is inconsistent with the historical device type.
[0165] This embodiment also provides a communication system, which includes a control terminal and a communication interface chip, the communication interface chip being connected to the control terminal. This communication system can use the communication interface function configuration method described above to configure and switch the functions of the communication interface in the communication interface chip.
[0166] Specifically, the control terminal obtains the target device type of the target communication interface and sends the target device type to the communication interface chip. Based on the communication interface function configuration method described above and the target device type, the communication interface chip establishes a mapping relationship between the device address information of the target device type and the current base address information of the target device type, so as to map read and write operations to the current base address information. Based on the communication interface function configuration method described above, the control terminal allocates storage space for each communication interface and establishes a mapping relationship between the allocated storage space and the current base address information, so as to map read and write operations mapped to the current base address information to the allocated storage space. Based on the communication interface function configuration method described above, the control terminal loads the device driver corresponding to each communication interface to call and operate the device corresponding to each communication interface.
[0167] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 8 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 10 as an example.
[0168] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GPA), or any combination thereof.
[0169] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0170] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transient memory, such as at least one disk storage device, flash memory device, or other non-transient solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0171] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0172] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0173] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0174] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for configuring communication interface functions, characterized in that, The method includes: The control terminal receives the target device type of the target communication interface sent by the control terminal; wherein the control terminal obtains the target device type of the target communication interface and sends the target device type to the communication interface chip; Based on the target device type, determine the current configuration information of the target communication interface; the current configuration information includes the current base address information; A mapping relationship is established between the current base address information and the device address information of the target device type; the device address information is pre-set and corresponds to the address information of each device type; the mapping relationship is used to map read and write operations to the current base address information; The control terminal also acquires the current device type of multiple communication interfaces; when there is an updated communication interface among the multiple communication interfaces whose current device type is inconsistent with the historical device type, storage space is allocated for the updated communication interface, and a mapping relationship is established between the allocated storage space and the current base address information of the communication interface chip; the mapping relationship is used to map read and write operations mapped to the current base address information to the allocated storage space. The control terminal also loads the device driver for the target device corresponding to the multiple communication interfaces based on the current device type of the multiple communication interfaces; the device driver is used to call and operate the target device.
2. The method according to claim 1, characterized in that, Determining the current configuration information of the target communication interface based on the target device type includes: Based on the target device type, determine the target configuration information of the target communication interface; In response to a feature update request, the target configuration information is determined as the current configuration information of the target communication interface.
3. The method according to claim 2, characterized in that, Based on the target device type, the target configuration information of the target communication interface is determined, including: Determine the target device information and target address information corresponding to the target device type; Based on the target address information, configure the target address space information of the target communication interface.
4. The method according to claim 3, characterized in that, The target address information includes target space information and target base address information; determining the target address space information of the target communication interface based on the target address information includes: Based on the target space information, the size of the target address space is determined; Based on the target base address information and the size of the address space, the address range of the target address space of the target communication interface is determined to determine the target address space information.
5. The method according to claim 4, characterized in that, Determining the target configuration information as the current configuration information of the target communication interface includes: The target device information is determined as the current device information of the target communication interface; The target base address information is determined as the current base address information of the target communication interface; The target address space information is determined as the current address space information of the target communication interface.
6. The method according to claim 1, characterized in that, After the control terminal obtains the target device type of the target communication interface and sends the target device type to the communication interface chip, but before obtaining the current device type of multiple communication interfaces, when the target communication interface completes the current read / write operation, or when the target communication interface does not perform a read / write operation, the control terminal stops the subsequent read / write operation of the target communication interface and initiates a function update request to the communication interface chip.
7. The method according to claim 1, characterized in that, The control terminal also loads the device driver for the target device corresponding to the multiple communication interfaces based on the current device type of the multiple communication interfaces, including: When the control terminal has an updated communication interface among the multiple communication interfaces where the current device type is inconsistent with the historical device type, it loads the device driver of the target device corresponding to the updated communication interface.
8. A communication interface function configuration device, characterized in that, The device includes: The target device type receiving module is used to receive the target device type of the target communication interface sent by the control terminal; wherein, the control terminal obtains the target device type of the target communication interface and sends the target device type to the communication interface chip; The current configuration information determination module is used to determine the current configuration information of the target communication interface based on the target device type; the current configuration information includes current base address information; A mapping relationship establishment module is used to establish a mapping relationship between the current base address information and the device address information of the target device type; the device address information is pre-set address information corresponding to each device type; the mapping relationship is used to map read and write operations to the current base address information; The control terminal also acquires the current device type of multiple communication interfaces; when there is an updated communication interface among the multiple communication interfaces whose current device type is inconsistent with the historical device type, storage space is allocated for the updated communication interface, and a mapping relationship is established between the allocated storage space and the current base address information of the communication interface chip; the mapping relationship is used to map read and write operations mapped to the current base address information to the allocated storage space. The control terminal also loads the device driver for the target device corresponding to the multiple communication interfaces based on the current device type of the multiple communication interfaces; the device driver is used to call and operate the target device.
9. A communication system, characterized in that, The system includes a control terminal and a communication interface chip; the communication interface chip is connected to the control terminal; the communication system operates the communication interface function configuration method as described in any one of claims 1 to 7.
10. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the communication interface function configuration method according to any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the communication interface function configuration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for allocating mapping address space
CN106874218A
Configuration method and related apparatus
CN109284140A
