Disclosure of Invention
The invention mainly aims to provide a communication matching method with a coprocessor and a vehicle-mounted main system, and aims to reduce the workload of a provider of the vehicle-mounted main system.
In order to achieve the above object, the present invention provides a method for communication matching with a coprocessor, including:
reading a first customer attribute in system attributes;
searching a first communication protocol corresponding to the first client attribute in a mapping list of a preset client attribute and the communication protocol;
and calling the first communication protocol to communicate with the coprocessor.
Further, before the step of reading the first client attribute in the system attribute of the vehicle-mounted host system, the method includes:
a first customer attribute is received and added to the system attribute.
Further, after the step of invoking the first communication protocol to communicate with the coprocessor, the method includes:
judging whether the vehicle-mounted main system and the coprocessor are successfully communicated;
if the communication fails, a preset action is executed.
Further, the step of executing the preset action includes:
generating reminding characters to be displayed on a display screen of the vehicle-mounted main system; or,
and generating a reminding voice for the loudspeaker to play.
Further, the step of executing the preset action includes:
and sending matching failure information and reason information corresponding to the matching failure to the terminal.
Further, the step of executing the preset action includes:
calling a plurality of preset second communication protocols one by one to establish communication with the coprocessor;
monitoring whether the second communication protocol called currently is successfully communicated with the coprocessor;
and if the communication is successful, selecting the current second communication protocol as the communication protocol of the main processor and the coprocessor.
Further, the customer attribute is a unique number ID representing the customer.
The invention also provides a vehicle-mounted main system matched with the communication of the coprocessor, which comprises the following components:
the reading unit is used for reading a first client attribute in the system attributes;
the searching unit is used for searching a first communication protocol corresponding to the first client attribute in a mapping list of preset client attributes and communication protocols;
and the calling unit is used for calling the first communication protocol to communicate with the coprocessor.
Further, the vehicle-mounted main system matched with the communication of the coprocessor further comprises:
and the receiving and adding unit is used for receiving the first customer attribute and adding the first customer attribute to the system attribute.
Further, the vehicle-mounted main system matched with the communication of the coprocessor further comprises:
the judging unit is used for judging whether the communication between the vehicle-mounted main system and the coprocessor is successful or not;
and the execution unit is used for executing a preset action if the communication between the vehicle-mounted main system and the coprocessor is judged to be failed.
Further, the execution unit includes:
the first execution module is used for generating reminding characters and displaying the reminding characters on a display screen of the vehicle-mounted main system; or generating a reminding voice for the loudspeaker to play.
Further, the execution unit includes:
and the second execution unit is used for sending matching failure information and reason information corresponding to the matching failure to the terminal.
Further, the execution unit includes:
the one-by-one trial module is used for calling a plurality of preset second communication protocols one by one to establish communication with the coprocessor;
the monitoring module is used for monitoring whether the second communication protocol called currently realizes the successful communication with the coprocessor;
and the determining module is used for selecting the current second communication protocol as the communication protocol with the coprocessor if the communication with the coprocessor is successful.
Further, the customer attribute is a unique number ID representing the customer.
The method for communication matching with the coprocessor and the vehicle-mounted main system acquire the first client attribute, then search a first communication protocol corresponding to the first client attribute in a mapping list of the client attribute and the communication protocol, wherein the communication protocol corresponding to the client attribute in the mapping list is the coprocessor used by a corresponding client, and when the first communication protocol is searched, the first communication protocol can be called to communicate with the coprocessor. Compared with the technology, the vehicle-mounted main system provider can uniformly manufacture the vehicle-mounted main system, then a plurality of communication protocols are pre-added into the vehicle-mounted main system, the compatibility of the vehicle-mounted main system is increased, and then a mapping list of the client attribute and the communication protocol is established.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, an embodiment of the present invention provides a method for communication matching with a coprocessor, including the steps of:
and S1, reading the first client attribute in the system attributes.
In step S1, the system attribute is an attribute of the vehicle-mounted host system, which may include information such as a version number of the vehicle-mounted host system. The first customer attribute is an attribute representing the current vehicle-mounted system user, and the current vehicle-mounted system user is a generator combining the vehicle-mounted main system and the coprocessor together.
S2, searching a first communication protocol corresponding to the first client attribute in a mapping list of the preset client attribute and the communication protocol.
In step S2, the mapping list of the client attribute and the communication protocol is a list that is installed in the vehicle-mounted main system by the vehicle-mounted main system provider in advance, and the vehicle-mounted main system provider knows the coprocessors used by different clients in advance, so that the generation of the mapping list of the client attribute and the communication protocol can be completed. The mapping list may be that a plurality of client attributes correspond to the same communication protocol, or that a plurality of communication protocols correspond to the same client attribute. In this embodiment, the client attribute is a unique number ID representing a client, that is, each client corresponds to a unique ID number, and as long as the unique number ID is known, the client can be determined, and thus which coprocessor the vehicle-mounted host system is to be in communication connection with is determined.
And S3, calling the first communication protocol to communicate with the coprocessor.
In step S3, the in-vehicle main system calls the first communication protocol matched by the first client attribute, and thus, the communication with the coprocessor is completed.
Referring to fig. 2, in this embodiment, before the step S1 of reading the first client attribute in the system attributes of the vehicle-mounted host system, the method includes:
s101, receiving a first customer attribute, and adding the first customer attribute to the system attribute.
In step S101, after the vehicle-mounted main system provider knows that the vehicle-mounted main system is to be provided to the first customer, it is not necessary to input or update a communication protocol in the vehicle-mounted main system for the first customer, so as to ensure that the vehicle-mounted main system and the coprocessor of the first customer can be in communication connection, and it is only necessary for the user to input the first customer attribute through the display screen, thereby implementing that the first customer attribute corresponding to the first customer is added in the system attribute of the vehicle-mounted main system, which is simple and convenient, and reduces the workload of the vehicle-mounted main system provider.
In this embodiment, after the step S3 of invoking the first communication protocol to communicate with the coprocessor, the method includes:
and S40, judging whether the communication between the vehicle-mounted main system and the coprocessor is successful.
In step S40, there are many methods for determining whether the communication between the vehicle-mounted main system and the coprocessor is successful, for example, the vehicle-mounted main system sends a search signal to the coprocessor, then waits for a feedback signal from the coprocessor, and if the feedback is out of time, it may be determined that the communication between the vehicle-mounted main system and the coprocessor is failed, and if the normal feedback signal is waited within a specified time, it is determined that the communication between the vehicle-mounted main system and the coprocessor is successful. And knowing whether the communication between the vehicle-mounted main system and the coprocessor is successful, so as to conveniently perform corresponding operation according to the communication condition, for example, if the communication condition is successful, a corresponding coprocessing task can be completed through the coprocessor.
And S50, if the communication fails, executing the preset action.
In step S50, the communication failure executes a preset action, which may be a prompt message, so that the user can know the problem of the vehicle-mounted system in time, and can process the problem in time, or other matching actions.
In this embodiment, the step S50 of executing the preset action includes:
s51, generating reminding characters to be displayed on a display screen of the vehicle-mounted main system; or,
and S52, generating a reminding voice for the loudspeaker to play.
In the step S51, the reminder information is text and is displayed on the display screen of the vehicle-mounted host system, so that the user can use the reminder information to view the reminder information visually; in the step S52, the generated reminding voice is played through the speaker of the vehicle-mounted main system, so that the user can hear the reminding voice to know the communication failure through hearing, and the probability that the user finds the communication failure in time is improved.
In this embodiment, the steps S51 and S52 may be performed simultaneously, so as to improve the probability that the user finds the communication failure in time.
In another embodiment, the step S50 of executing the preset action includes:
and S53, sending matching failure information and reason information corresponding to the matching failure to the terminal.
In step S53, the information of the reason for the matching failure includes a communication protocol matching error, an error in a serial port connecting the vehicle-mounted main system and the coprocessor, and the like. The terminal can be a terminal of a vehicle-mounted system provider, after the vehicle-mounted main system provider receives the matching failure information and the reason information thereof, the matching failure information can be processed at the first time and fed back to the terminal of the client corresponding to the first client attribute, the client does not need to report, the response speed is higher, the completion speed of the solution is further improved, the working efficiency is improved, and the user experience is improved.
In another embodiment, the step S50 of executing the preset action includes:
s54, calling a plurality of preset second communication protocols one by one to respectively communicate with the coprocessor;
s55, monitoring whether the second communication protocol called currently is successfully communicated with the coprocessor;
and S56, if the communication is successful, selecting the current second communication protocol as the communication protocol of the main processor and the coprocessor.
In the above steps S54, S55, and S56, the plurality of second communication protocols are typically other communication protocols than the first communication protocol described in the mapping list of the client attribute and the communication protocol. In this embodiment, that is, the vehicle-mounted main system uses one communication protocol of the plurality of second communication protocols one by one to perform communication connection with the coprocessor, when the vehicle-mounted main system monitors that the communication with the coprocessor is successful, it is determined that the currently used second communication protocol is the communication protocol matched with the vehicle-mounted main system and the coprocessor, that is, it is determined that the current second communication protocol is used as the communication protocol of the main processor and the coprocessor, and in the future communication process, the current second communication protocol is directly called to be used. In a subsequent step, the other second communication protocol and the first communication protocol may also be deleted.
The method for communication matching with the coprocessor of the embodiment of the invention comprises the steps of obtaining a first client attribute, searching a first communication protocol corresponding to the first client attribute in a mapping list of the client attribute and the communication protocol, wherein the communication protocol corresponding to the client attribute in the mapping list is the coprocessor used by a corresponding client, and calling the first communication protocol to communicate with the coprocessor when the first communication protocol is searched. Compared with the technology, the vehicle-mounted main system provider can uniformly manufacture the vehicle-mounted main system, then a plurality of communication protocols are pre-added into the vehicle-mounted main system, the compatibility of the vehicle-mounted main system is increased, and then a mapping list of the client attribute and the communication protocol is established.
Referring to fig. 3, an embodiment of the present invention further provides a vehicle-mounted host system matched with communication of a coprocessor, including:
the reading unit 10 is configured to read a first customer attribute in the system attributes.
In the reading unit 10, the system attribute is an attribute of a vehicle-mounted host system, and may include information such as a version number of the vehicle-mounted host system. The first customer attribute is an attribute representing the current vehicle-mounted system user, and the current vehicle-mounted system user is a generator combining the vehicle-mounted main system and the coprocessor together.
The searching unit 20 is configured to search a first communication protocol corresponding to the first client attribute in a mapping list of preset client attributes and communication protocols.
In the lookup unit 20, the mapping list of the client attribute and the communication protocol is a list that is pre-installed in the vehicle-mounted main system by the vehicle-mounted main system provider, and the vehicle-mounted main system provider is pre-aware of coprocessors used by different clients, so that the mapping list of the client attribute and the communication protocol can be completed, and meanwhile, the vehicle-mounted main system provider adds the communication protocols of the coprocessors corresponding to the clients to the vehicle-mounted main system, that is, all the communication protocols listed in the mapping list are installed in the vehicle-mounted main system. The mapping list may be that a plurality of client attributes correspond to the same communication protocol, or that a plurality of communication protocols correspond to the same client attribute. In this embodiment, the client attribute is a unique number ID representing a client, that is, each client corresponds to a unique ID number, and as long as the unique number ID is known, the client can be determined, and thus which coprocessor the vehicle-mounted host system is to be in communication connection with is determined.
A calling unit 30, configured to call the first communication protocol to communicate with the coprocessor.
In the invoking unit 30, the vehicle-mounted main system invokes the first communication protocol matched by the first client attribute, so that the communication with the coprocessor is completed.
Referring to fig. 4, in this embodiment, the vehicle-mounted main system matched with the coprocessor in communication further includes:
and the receiving and adding unit 101 is used for receiving the first customer attribute and adding the first customer attribute to the system attribute.
In the receiving and adding unit 101, after the vehicle-mounted main system provider knows that the vehicle-mounted main system is to be provided to the first client, it is not necessary to input or update a communication protocol in the vehicle-mounted main system for the first client, so as to ensure that the vehicle-mounted main system and the coprocessor of the first client can be in communication connection, only a user needs to input the first client attribute through a display screen, and the receiving and adding unit 101 adds the first client attribute corresponding to the first client in the system attribute of the vehicle-mounted main system, which is simple and convenient, and reduces the workload of the vehicle-mounted main system provider.
In this embodiment, the vehicle-mounted main system matched with the communication of the coprocessor further includes:
a judging unit 40, configured to judge whether the communication between the vehicle-mounted main system and the coprocessor is successful;
and the execution unit 50 is used for executing a preset action if the communication between the vehicle-mounted main system and the coprocessor is judged to be failed.
In the above-mentioned determining unit 40 and the executing unit 50, there are many methods for determining whether the communication between the vehicle-mounted main system and the coprocessor is successful, for example, the vehicle-mounted main system sends a search signal to the coprocessor, then waits for a feedback signal of the coprocessor, if the feedback is overtime, it can be determined that the communication between the vehicle-mounted main system and the coprocessor is failed, and if the feedback signal is normal within a specified time, it is determined that the communication between the vehicle-mounted main system and the coprocessor is successful. And knowing whether the communication between the vehicle-mounted main system and the coprocessor is successful, so as to conveniently perform corresponding operation according to the communication condition, for example, if the communication condition is successful, a corresponding coprocessing task can be completed through the coprocessor. The communication failure executes the preset action, and the preset action can be reminding information so that a user can know the problem of the vehicle-mounted system in time and can process the problem in time conveniently, and other matching actions can be realized.
Referring to fig. 5, in this embodiment, the executing unit 50 includes:
the first execution module 51 is configured to generate a reminding character and display the reminding character on a display screen of the vehicle-mounted main system; or generating reminding voice to be played through a loudspeaker of the vehicle-mounted main system.
The reminding information is characters and is displayed on a display screen of the vehicle-mounted main system, so that a user can conveniently use the visual checking; the generated reminding voice is played through a loudspeaker of the vehicle-mounted main system, so that a user can know the communication failure through hearing, and the probability that the user finds the communication failure in time is improved.
Referring to fig. 6, in another embodiment, the execution unit 50 includes:
the second executing unit 52 is configured to send matching failure information and reason information corresponding to the matching failure to the terminal.
In the second execution unit 52, the reason information of the matching failure includes a communication protocol matching error, an error in a serial port connecting the vehicle-mounted main system and the coprocessor, and the like. After receiving the matching failure information and the reason information thereof, the vehicle-mounted main system provider can process and feed back the matching failure information and the reason information to the terminal of the client corresponding to the first client attribute at the first time, and does not need to report by the client, so that the response speed is higher, the completion speed of the solution is further improved, the working efficiency is improved, and the user experience is improved.
Referring to fig. 7, in another embodiment, the execution unit 50 includes:
a trial-by-trial module 53, configured to invoke a plurality of preset second communication protocols one by one to establish communication with the coprocessor;
a monitoring module 54, configured to monitor whether the second communication protocol currently invoked achieves successful communication with the coprocessor
A determining module 55, configured to select the current second communication protocol as the communication protocol with the coprocessor if the communication with the coprocessor is successful.
In the trial-by-trial module 53, the monitoring module 54, and the determination module 55, the plurality of second communication protocols are generally other communication protocols than the first communication protocol described in the mapping list of the client attribute and the communication protocol. In this embodiment, the one-by-one trial module 53 is used for the vehicle-mounted main system to perform communication connection with the coprocessor by using one communication protocol of the plurality of second communication protocols one by one, and when the monitoring module 54 monitors that the vehicle-mounted main system and the coprocessor are successfully communicated, the determining unit 55 determines that the currently used second communication protocol is a communication protocol matched with the vehicle-mounted main system and the coprocessor, that is, determines that the current second communication protocol is used as a communication protocol of the main processor and the coprocessor, and directly invokes the current second communication protocol for use in a future communication process. In the following process, the other second communication protocol and the first communication protocol may be deleted.
In the vehicle-mounted main system matched with the coprocessor in communication, according to the embodiment of the invention, the reading unit 10 acquires the first client attribute, then the searching unit 20 searches the first communication protocol corresponding to the first client attribute in the mapping list of the client attribute and the communication protocol, the communication protocol corresponding to the client attribute in the mapping list is the coprocessor used by the corresponding client, and when the first communication protocol is searched, the first communication protocol can be called by the calling unit 30 to communicate with the coprocessor. Compared with the technology, the vehicle-mounted main system provider can uniformly manufacture the vehicle-mounted main system, then a plurality of communication protocols are pre-added into the vehicle-mounted main system, the compatibility of the vehicle-mounted main system is increased, and then a mapping list of the client attribute and the communication protocol is established.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.