Mapping manager and bus adapter connection system for automotive buses
By configuring the mapping table of the mapping manager and dynamic sorting to associate logical channels and hardware channels, the problem of automobile bus adapter replacement and compatibility in the existing technology is solved, efficient adapter configuration and data communication are achieved, and application development efficiency and efficiency are improved. Software reliability.
Patent Information
- Application Number
- CN202211061631.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-02
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-08-02
AI Technical Summary
The software of existing automotive bus adapters needs to be hard-coded, which results in the need to modify the software when replacing the adapter, which increases the workload and reduces software reliability, and makes it difficult to distinguish and be compatible with different adapters.
By configuring the mapping table of the mapping manager, the logical channels are associated with the hardware channels, and data communication is implemented through the mapping table, and information fields such as application name, channel type, hardware type, and serial number are used for dynamic sorting and association.
It implements a universal architecture for applications to access bus adapter resources, allowing arbitrary configuration of adapter models and hardware channels, avoiding software modifications, improving development efficiency and reducing the possibility of errors.
Smart Images

Figure CN115499268B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202110878601.2, and the application date is August 2, 2021. The name of the invention is: bus adapter and channel binding configuration method, mapping manager and connection system. Technical Field
[0002] The invention belongs to the technical field of automobile bus adapters, and in particular relates to a bus adapter and channel binding configuration method, a mapping manager and a connection system. Background Art
[0003] The vehicle bus adapter consists of a device with a USB interface at one end and a single or multiple vehicle bus interfaces (CAN bus, LIN bus, FlexRay bus, automotive Ethernet, etc.) at the other end. There are many types of existing vehicle bus adapters from different manufacturers. The vehicle bus adapter needs to be equipped with a host computer application developed by the user to monitor the vehicle bus. The host computer application often needs to connect multiple vehicle bus adapters to access multiple buses at the same time. During the application process, the existing technical solutions usually hard-code the vehicle bus adapters that need to be connected in the software.
[0004] In the application process, the existing technical solution hard codes the required vehicle bus adapter in the software, which brings two problems:
[0005] First, replacing car bus adapter A with car bus adapter B requires software modification at the same time, so as to replace the connection code of car bus adapter A with the connection code of car bus adapter B, which requires additional software modification time; if car bus adapter B is replaced with car bus adapter A later, the software needs to be modified again. Some users will try to support both car bus adapter A and car bus adapter B at the same time, and complete the adapter switching through configuration, but this method also has the problem of incompatibility with car bus adapter C.
[0006] Secondly, if the software connects two similar car bus adapters A and B at the same time, in the two cases where A is plugged into the computer first and then B, and B is plugged into the computer first and then A, the software will find it difficult to distinguish which is A and which is B. Even if the user reads the car bus adapter serial number to bind A and B, it is difficult to automatically handle the bus adapter identification problem after A is replaced by C in subsequent applications.
[0007] Such problems ultimately need to be solved by modifying the software, which will increase the workload and reduce the reliability of the software.
[0008] Therefore, based on the above technical problems, it is necessary to design a new bus adapter and channel binding configuration method, mapping manager and connection system. Summary of the invention
[0009] The object of the present invention is to provide a bus adapter and channel binding configuration method, a mapping manager and a connection system.
[0010] In order to solve the above technical problems, the present invention provides a bus adapter and channel binding and configuration method, comprising:
[0011] Configure the mapping table of the mapping manager;
[0012] Associating the logical channels with the corresponding hardware channels through a mapping table; and
[0013] Connect the logical channels to the corresponding hardware channels for data communication.
[0014] Further, the method for configuring the mapping table of the mapping manager includes:
[0015] Configure the 6 information fields in the mapping table;
[0016] The six information fields in the mapping table include: application name, channel type, logical channel index, hardware type, hardware index and hardware channel index.
[0017] Further, the application name is a string name of an application using the mapping manager;
[0018] The channel type is the channel type of the logical channel that the mapping manager is responsible for mapping;
[0019] The logical channel index is the logical channel resource number of the application, which increases from small to large;
[0020] The hardware type is the manufacturer type of the corresponding bus adapter and the bus adapter model of the manufacturer;
[0021] The hardware index is a number used to distinguish the same type of hardware after the corresponding bus adapter is inserted, and the number is dynamically adjusted according to the serial number sorting method of the bus adapter;
[0022] The hardware channel index is a serial number of a hardware channel of the same type carried inside the corresponding bus adapter, and the serial number is pre-set in the same bus adapter.
[0023] Furthermore, the hardware index is obtained by sorting the bus adapter serial numbers in ascending order. After the serial numbers SN of the bus adapters are sorted in ascending order, the bus adapter with the smallest serial number has the lowest hardware index.
[0024] Further, the method of associating the logical channel with the corresponding hardware channel through the mapping table includes:
[0025] Each logical channel is associated with a hardware channel of the bus adapter according to the mapping table.
[0026] Further, the method of connecting the logical channel with the corresponding hardware channel for data communication includes:
[0027] When the application connects to the bus adapter, it scans all supported bus adapters, and then searches all mapping tables contained in the mapping manager for the mapping table associated with the application according to the application name;
[0028] Search for the existence of the corresponding hardware according to the hardware type, hardware index and hardware channel index in the mapping table corresponding to each logical channel associated with the application;
[0029] If it exists, the corresponding bus adapter is initialized and the data transceiver function of the logical channel is connected to the hardware channel of the corresponding bus adapter for data communication, otherwise the connection fails.
[0030] In a second aspect, the present invention further provides a bus adapter and channel binding and configuration system, comprising:
[0031] A mapping table configuration module, which configures the mapping table of the mapping manager;
[0032] an association module, which associates the logical channel with the corresponding hardware channel through a mapping table; and
[0033] The connection module connects the logical channel with the corresponding hardware channel for data communication.
[0034] In a third aspect, the present invention further provides a mapping manager.
[0035] The mapping manager is adapted to associate logical channels with hardware channels.
[0036] In a fourth aspect, the present invention further provides a bus adapter connection system, comprising:
[0037] application modules, mapping managers, and bus adapters;
[0038] The mapping manager is adapted to associate each logical channel in the application module with a hardware channel of the bus adapter and then connect them to perform data communication.
[0039] The beneficial effect of the present invention is that the present invention realizes a general architecture for an application to access bus adapter resources by configuring a mapping table of a mapping manager; associating a logical channel with a corresponding hardware channel through the mapping table; and connecting the logical channel with the corresponding hardware channel for data communication. The application using the architecture can arbitrarily configure the bus adapter model and hardware channel it needs to connect. After each configuration change, the mapping relationship takes effect immediately without modifying the user's software, thereby improving the efficiency of application development and reducing the possibility of errors.
[0040] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flow chart of the bus adapter and channel binding and configuration method involved in the present invention;
[0044] Figure 2 It is a schematic diagram of bus adapter and channel binding and configuration involved in the present invention;
[0045] Figure 3 It is a schematic diagram of a bus adapter hardware index sorting method involved in the present invention;
[0046] Figure 4 It is a principle block diagram of the bus adapter and channel binding and configuration system involved in the present invention;
[0047] Figure 5 It is a principle block diagram of the bus adapter connection system involved in the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Example 1
[0050] Figure 1 The present invention is a flowchart of a bus adapter and channel binding and configuration method.
[0051] like Figure 1 As shown, this embodiment 1 provides a bus adapter and channel binding and configuration method, including: configuring a mapping table of a mapping manager; associating a logical channel with a corresponding hardware channel through the mapping table; and connecting the logical channel with the corresponding hardware channel for data communication, realizing a general architecture for an application to access bus adapter resources. Applications using this architecture can arbitrarily configure the bus adapter model and hardware channel they need to connect to. After each configuration change, the mapping relationship takes effect immediately without modifying the user's software, thereby improving application development efficiency and reducing the possibility of errors.
[0052] Figure 2 It is a schematic diagram of bus adapter and channel binding and configuration involved in the present invention.
[0053] like Figure 2As shown, in this embodiment, the method for configuring the mapping table of the mapping manager includes: the mapping manager is responsible for associating each logical channel with a hardware channel of the bus adapter, each association is implemented by a mapping table described by the mapping manager, each mapping table contains 6 information fields, all of which together constitute a mapping network between potential applications in the computer and potential bus adapters; the mapping table in the mapping manager can be added and deleted by the user at will, and the 6 information fields in the mapping table can be arbitrarily configured; the 6 information fields in the mapping table include: application name, channel type, logical channel index, hardware type, hardware index and hardware channel index; the application is for the supported vehicle bus type, each type with single or multiple logical channels The number and type of logical channels are configured by the user (for example, the user can configure the number and type of logical channels through the corresponding software); for example, the CAN bus supported by application A has three logical channels, and the mapping target corresponding to each logical channel is managed by the mapping manager; through the mapping table, each logical channel of the mapping manager is associated with a hardware channel of the bus adapter, thereby realizing a general architecture for applications to access bus adapter resources. Applications using this architecture can arbitrarily configure the bus adapter model and hardware channel they need to connect to, so that only the software configuration needs to be modified instead of the software to cope with the problem of replacing the vehicle bus adapter and connecting it to the computer in sequence, thereby avoiding additional development investment and ensuring the reliability of the software.
[0054] In this embodiment, the application name is the string name of the application using the mapping manager, such as application A; the channel type is the channel type of the logical channel that the mapping manager is responsible for mapping, such as the logical channel A of application A, which is a CAN bus type; the logical channel index is the logical channel resource number of the application, which increases from small to large. The logical channel index is the number given to the logical channel, and the index value is the numbering sequence. The index value increases from small to large. If there are 3 logical channels, their indexes are: 0, 1, 2 respectively; the hardware type is the manufacturer type of the corresponding bus adapter and the bus adapter model of the manufacturer; the hardware index is the number of the corresponding bus adapter to distinguish the same hardware type after it is inserted into the computer, and the number is dynamically adjusted in the computer according to the serial number sorting method of the bus adapter; the hardware channel index is the number of the same type of hardware channel carried inside the corresponding bus adapter, and the number is pre-set in the same bus adapter, such as hardware channel A of bus adapter A.
[0055] Figure 3 It is a schematic diagram of the bus adapter hardware index sorting method involved in the present invention.
[0056] like Figure 3As shown, in this embodiment, the hardware index is obtained by sorting the bus adapter serial number in ascending order. After sorting the serial numbers SN of each bus adapter in ascending order, the hardware index of the bus adapter with the smallest serial number is the lowest; the hardware index is obtained by sorting the bus adapter serial number in ascending order, and the sorting method is based on string comparison. The bus adapter serial number is read according to the API interface provided by the bus adapter manufacturer; for example, a total of N bus adapters of the same type from the same manufacturer are inserted into the computer, and the serial number SN of each bus adapter is different. After sorting the SN serial numbers in ascending order, the hardware index of the bus adapter with the smallest serial number (SN=000001) is the lowest, and the hardware index of the bus adapter with the second smallest serial number (SN=000123) is the second lowest, and so on.
[0057] In this embodiment, the method of associating the logical channels with the corresponding hardware channels through the mapping table includes: associating each logical channel with the corresponding hardware channel of the bus adapter according to the mapping table.
[0058] In this embodiment, the method for connecting the logical channel with the corresponding hardware channel for data communication includes: scanning all supported bus adapters inserted in the computer when the application connects to the bus adapter, and then searching the mapping table associated with the application according to the application name in all mapping tables contained in the mapping manager; searching whether the corresponding hardware exists according to the hardware type, hardware index and hardware channel index in the mapping table corresponding to each logical channel associated with the application; if it exists, initializing the corresponding bus adapter, and connecting the data transceiver function of the logical channel with the hardware channel of the corresponding bus adapter to realize data communication between the application logical channel and the corresponding bus, if it is found that the hardware corresponding to the application logical channel does not exist during the connection process, the connection fails; a general architecture for application access to bus adapter resources is realized, and the application using this architecture can arbitrarily configure the bus adapter model and hardware channel it needs to connect, and after each configuration change, the mapping relationship takes effect immediately without modifying the user's software, thereby improving the efficiency of application development and reducing the possibility of errors, and at the same time realizing that the user's application can indiscriminately access the channel resources of automobile bus adapters produced by different manufacturers, and changing the bus adapter or changing the hardware channel during the application process only requires modifying the configuration without modifying the software, and the user can achieve twice the result with half the effort by choosing this method when developing an application.
[0059] Example 2
[0060] Figure 4 It is a principle block diagram of the bus adapter and channel binding and configuration system involved in the present invention.
[0061] like Figure 4As shown, on the basis of Example 1, this Example 2 further provides a bus adapter and channel binding and configuration system, including: a mapping table configuration module, configuring a mapping table of a mapping manager; an association module, associating a logical channel with a corresponding hardware channel through a mapping table; and a connection module, connecting the logical channel with the corresponding hardware channel for data communication, realizing a general architecture for an application to access bus adapter resources. An application using this architecture can arbitrarily configure the bus adapter model and hardware channel it needs to connect. After each configuration change, the mapping relationship takes effect immediately without modifying the user's software, thereby improving the efficiency of application development and reducing the possibility of errors. At the same time, it is realized that the user's application can indiscriminately access the channel resources of automobile bus adapters produced by different manufacturers. In the application process, changing the bus adapter or changing the hardware channel only requires modifying the configuration without modifying the software. When the user develops an application, choosing this method can achieve twice the result with half the effort.
[0062] In this embodiment, the method in which the mapping table configuration module configures the mapping table of the mapping manager, the association module associates the logical channel with the corresponding hardware channel through the mapping table, and the connection module connects the logical channel with the corresponding hardware channel for data communication has been described in detail in Example 1 and will not be repeated in this embodiment.
[0063] Example 3
[0064] Based on Example 1, this Example 3 also provides a mapping manager, which is suitable for associating logical channels with hardware channels, realizing a general architecture for applications to access bus adapter resources. Applications using this architecture can arbitrarily configure the bus adapter model and hardware channel they need to connect to. After each configuration change, the mapping relationship takes effect immediately without modifying the user's software, thereby improving application development efficiency and reducing the possibility of errors.
[0065] In this embodiment, the method for associating the logical channel with the hardware channel adopts the bus adapter and channel binding and configuration method in Embodiment 1.
[0066] Example 4
[0067] Figure 5 It is a principle block diagram of the bus adapter connection system involved in the present invention.
[0068] like Figure 5As shown, based on the third embodiment, the fourth embodiment further provides a bus adapter connection system, including: an application module (a module provided with an application), a mapping manager and a bus adapter; the mapping manager is suitable for associating each logical channel in the application module with the hardware channel of the bus adapter and then connecting them for data communication; the user's application can indiscriminately access the channel resources of the automobile bus adapters produced by different manufacturers, and changing the bus adapter or the hardware channel during the application process only requires modifying the configuration without modifying the software. When the user develops an application, choosing this method can achieve twice the result with half the effort.
[0069] In this embodiment, the application module can have a single or multiple logical channels; the bus adapter can have a single or multiple hardware channels.
[0070] In this embodiment, the application module, mapping manager and bus adapter are adapted to use the bus adapter and channel binding and configuration method in Embodiment 1 to associate each logical channel with the hardware channel of the bus adapter and then connect them for data communication.
[0071] In summary, the present invention realizes a general architecture for an application to access bus adapter resources by configuring a mapping table of a mapping manager; associating a logical channel with a corresponding hardware channel through the mapping table; and connecting the logical channel with the corresponding hardware channel for data communication. An application using the architecture can arbitrarily configure the bus adapter model and hardware channel it needs to connect to. After each configuration change, the mapping relationship takes effect immediately without modifying the user's software. This improves the efficiency of application development and reduces the possibility of errors.
[0072] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0073] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0074] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0075] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A mapping manager for automotive buses, It is characterized in that The mapping manager is adapted to associate logical channels with hardware channels; The mapping manager includes: a mapping table; Configure the 6 information fields in the mapping table; The six information fields in the mapping table include: application name, channel type, logical channel index, hardware type, hardware index and hardware channel index; The logical channels are associated with the corresponding hardware channels through a mapping table, which includes: Associating each logical channel with a hardware channel of the bus adapter according to a mapping table; The application name is a string name of an application using the mapping manager; The channel type is the channel type of the logical channel that the mapping manager is responsible for mapping; The logical channel index is the logical channel resource number of the application; The hardware type is the manufacturer type of the corresponding bus adapter and the bus adapter model of the manufacturer; The hardware index is a number used to distinguish the same type of hardware after the corresponding bus adapter is inserted; The hardware channel index is the number of the same type of hardware channel carried inside the corresponding bus adapter, and the number is pre-set in the same bus adapter; The mapping manager is adapted to associate and connect each logical channel in the application module with a hardware channel of the bus adapter to perform data communication, specifically comprising: When the application connects to the bus adapter, it scans all supported bus adapters, and then searches all mapping tables contained in the mapping manager for the mapping table associated with the application according to the application name; Search for the existence of the corresponding hardware channel according to the hardware type, hardware index and hardware channel index in the mapping table corresponding to each logical channel associated with the application; If it exists, the bus adapter corresponding to the hardware channel is initialized and the data transceiver function of the logical channel is connected to the hardware channel of the corresponding bus adapter for data communication, otherwise the connection fails.
2. The mapping manager according to claim 1, It is characterized in that The hardware index is obtained by sorting the bus adapter serial numbers in ascending order. After the serial numbers SN of the bus adapters are sorted in ascending order, the bus adapter with the smallest serial number has the lowest hardware index.
3. A bus adapter connection system, It is characterized in that include: An application module, a mapping manager and a bus adapter as claimed in claim 1 or 2; The mapping manager is adapted to associate each logical channel in the application module with a hardware channel of the bus adapter and then connect them to perform data communication.
4. A bus adapter connection system for a vehicle bus, It is characterized in that Using the bus adapter connection system as claimed in claim 3; The applications in the application module are targeted at the supported vehicle bus types, each type with single or multiple logical channels, and the number and type of logical channels are user-configured.
Citation Information
Patent Citations
Method for managing mapping information of flash controller
CN101714065A
Field bus communication adapter with configurable characteristic
CN1791103A
Interprocessor communication protocol
US20050027904A1
Address converter in a data processing apparatus
US4188662A
Physical-to-logical bus mapping scheme for computer systems having multiple PCI bus configuration
US5761448A
