CN104657300B - The method and system of car data are obtained by Application Programming Interface - Google Patents
The method and system of car data are obtained by Application Programming Interface Download PDFInfo
- Publication number
- CN104657300B CN104657300B CN201310578535.2A CN201310578535A CN104657300B CN 104657300 B CN104657300 B CN 104657300B CN 201310578535 A CN201310578535 A CN 201310578535A CN 104657300 B CN104657300 B CN 104657300B
- Authority
- CN
- China
- Prior art keywords
- data
- programming interface
- application programming
- vehicle information
- encrypted
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
- G07C5/00—Registering or indicating the working of vehicles
- G07C5/08—Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
Abstract
The present invention proposes a kind of method obtaining car data by Application Programming Interface API, includes the following steps:By the application call Application Programming Interface API in mobile terminal, so that wireless communication connection is established at the on-vehicle information station of mobile terminal and automobile;API receives data requesting instructions, and on-vehicle information station is sent to after data requesting instructions are encrypted;Encrypted data requesting instructions are decrypted in on-vehicle information station, and by carrying out CAN communication with automobile to obtain car data, API is sent to after car data is encrypted;Encrypted car data is decrypted in API, and the car data after decryption is sent to application program.This method can directly acquire car data by mobile terminal so that user understands various data when automobilism, can carry out real-time guard to automobile, ensure traffic safety, easy to use.The present invention also proposes a kind of system obtaining car data by Application Programming Interface API.
Description
Technical field
The present invention relates to automotive field more particularly to a kind of methods obtaining car data by Application Programming Interface API
And a kind of system that car data is obtained by Application Programming Interface API.
Background technology
Develop with the continuous renewal of automotive engineering, the structure and data system of automobile also become to become increasingly complex.In order to
Various protections are carried out to automobile, ensure traffic safety, often need to acquire the CAN on automobile(Controller Area
Network, controller LAN)Bus data, to obtain various data of the vehicle under different operating statuses.
And the method for CAN bus data is to obtain number using tools such as CAN diagnostic equipments on most of acquisition automobiles at present
According to.But this method has the disadvantage that:It needs to buy CAN diagnostic instrments, and the price of CAN diagnostic instrments using this method
Cost is generally higher;In addition, it should also be understood that the specific vehicle agreement of automobile can just understand the number that CAN diagnostic instrments are got
According to, and general extraneous personnel obtain the agreement less than vehicle, enforcement difficulty is big, of high cost, poor user experience.
Invention content
The present invention is directed at least solve one of above-mentioned technical problem.
For this purpose, an object of the present invention is to provide a kind of sides obtaining car data by Application Programming Interface API
Method.This method can directly acquire car data by mobile terminal so that user understands various data when automobilism, can
Real-time guard is carried out to automobile, ensures traffic safety, and easy to use.
It is another object of the present invention to propose a kind of system obtaining car data by Application Programming Interface API.
To achieve the goals above, one kind that the embodiment of first aspect present invention provides passes through Application Programming Interface API
The method for obtaining car data, includes the following steps:Pass through Application Programming Interface described in the application call in mobile terminal
API, so that wireless communication connection is established at the on-vehicle information station of the mobile terminal and automobile;The API receives request of data and refers to
Enable, and be sent to the on-vehicle information station after the data requesting instructions are encrypted, wherein the data requesting instructions by
The application triggers;The encrypted data requesting instructions are decrypted in the on-vehicle information station, and according to described
Data requesting instructions obtain car data by carrying out CAN communication with the automobile, and will be after car data encryption
It is sent to the API;And the encrypted car data is decrypted in the API, and by the automobile after decryption
Data are sent to the application program.
The method according to the ... of the embodiment of the present invention for obtaining car data by Application Programming Interface API, can be provided by API
The interface for obtaining car data establishes after wireless communication connection the CAN network that can obtain vehicle with the on-vehicle information station of automobile
Data information need not buy CAN Reading and writing instruments such as CAN diagnostic equipments, such as directly be obtained with automobile by bluetooth
Data, convenient and efficient, developer is not required to it is to be understood that specific car data agreement, it is only necessary to know that the order code name of acquisition can
To get intuitive data, real-time is high, and cost is relatively low, and the user experience is improved.And this method allows users to reality
When understand automobilism when various data, so as to automobile carry out real-time guard, ensure traffic safety.Meanwhile in API
The data being transmitted between on-vehicle information station are required to encryption, greatly improve the safety of data transmission.
What the embodiment of second aspect of the present invention provided a kind of is by what Application Programming Interface API obtained car data
System, including:Mobile terminal and on-vehicle information station, the on-vehicle information erect-position is on automobile, the on-vehicle information station and the vapour
Vehicle carries out CAN communication, application program is equipped in the mobile terminal, and the mobile terminal has Application Programming Interface API,
Wherein, the application program is for calling the Application Programming Interface API, so that the mobile terminal and the on-vehicle information station
Wireless communication connection is established, and the application program receives the car data after the decryption that the API is sent;It is described
API is sent out for receiving by the data requesting instructions of the application triggers after the data requesting instructions are encrypted
The on-vehicle information station is given, and receives car data after the encryption that the on-vehicle information station is sent, and to encrypted institute
It states and is sent to the application program after car data is decrypted;The on-vehicle information station refers to the encrypted request of data
Order is decrypted, and obtains car data by carrying out CAN communication with the automobile according to the data requesting instructions, and will
It is sent to the API after the car data encryption.
The system according to the ... of the embodiment of the present invention for obtaining car data by Application Programming Interface API, can be provided by API
The interface for obtaining car data establishes after wireless communication connection the CAN network that can obtain vehicle with the on-vehicle information station of automobile
Data information need not buy CAN Reading and writing instruments such as CAN diagnostic equipments, such as directly be obtained with automobile by bluetooth
Data, convenient and efficient, developer is not required to it is to be understood that specific car data agreement, it is only necessary to know that the order code name of acquisition can
To get intuitive data, real-time is high, and cost is relatively low, and the user experience is improved.And the system allows users to reality
When understand automobilism when various data, so as to automobile carry out real-time guard, ensure traffic safety.Meanwhile in API
The data being transmitted between on-vehicle information station are required to encryption, greatly improve the safety of data transmission.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description
Obviously, or practice through the invention is recognized.
Description of the drawings
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments
Obviously and it is readily appreciated that, wherein
Fig. 1 is the flow chart of the method according to the ... of the embodiment of the present invention that car data is obtained by Application Programming Interface API;
Fig. 2 is the module map according to an embodiment of the invention that car data is obtained by Application Programming Interface API;
Fig. 3 is the data flow according to an embodiment of the invention that car data is obtained by Application Programming Interface API
Schematic diagram;
Fig. 4 is the data flow that automobile speed is obtained by Application Programming Interface API according to one specific example of the present invention
Schematic diagram;And
Fig. 5 is illustrated according to the box of the system for obtaining car data by Application Programming Interface API of the embodiment of the present invention
Figure.
Specific implementation mode
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, and is only used for explaining the present invention, and is not considered as limiting the invention.On the contrary, this
The embodiment of invention includes all changes fallen within the scope of the spiritual and intension of attached claims, modification and is equal
Object.
In the description of the present invention, it is to be understood that, term " first ", " second " etc. are used for description purposes only, without
It can be interpreted as indicating or implying relative importance.In the description of the present invention, it should be noted that unless otherwise specific regulation
And restriction, term " connected ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection,
Or it is integrally connected;It can be mechanical connection, can also be electrical connection;It can be directly connected, intermediary can also be passed through
It is indirectly connected.For the ordinary skill in the art, the tool of above-mentioned term in the present invention can be understood with concrete condition
Body meaning.In addition, in the description of the present invention, unless otherwise indicated, the meaning of " plurality " is two or more.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable
Sequence, include according to involved function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
The side according to the ... of the embodiment of the present invention that car data is obtained by Application Programming Interface API is described below in conjunction with attached drawing
Method and system.Wherein, API(Application Programming Interface, Application Programming Interface)It is exactly to operate in fact
System leaves a calling interface of application program for, and application program makes operating system go to hold by the API of call operation system
The order of row application program(Action).
Fig. 1 is the flow chart of the method according to the ... of the embodiment of the present invention that car data is obtained by Application Programming Interface API.
As shown in Figure 1, should be included the following steps by the Application Programming Interface API methods for obtaining car data:
Step S101:By the application call Application Programming Interface API in mobile terminal, so that mobile terminal and vapour
Wireless communication connection is established at the on-vehicle information station of vehicle.For example, applying Application Programming Interface API in automobile Bluetooth with for example having
There is communication between the mobile terminal of android operating systems to use so that it is logical that bluetooth is established at mobile terminal and on-vehicle information station
Letter.
Specifically, by the application call Application Programming Interface API in mobile terminal, so that mobile terminal and vapour
Wireless communication connection is established at the on-vehicle information station of vehicle, can be realized through but not limited to such as under type:
S11:Call API.
S12:API is created and is executed first thread, wherein first thread is used to establish the vehicle-mounted letter of mobile terminal and automobile
Wireless communication connection between breath station, wherein after wirelessly communicating successful connection, shown API creates the second thread.
Step S102:API receives data requesting instructions, and is sent to on-vehicle information after data requesting instructions are encrypted
It stands, wherein data requesting instructions are by application triggers.
Specifically, can be realized through but not limited to following manner:
S21:API receives the data requesting instructions from application triggers.
S22:API executes the second thread, wherein the second thread is used to send encrypted request of data to on-vehicle information station
Instruction, and the encrypted car data sent from on-vehicle information station is received, and the car data after decryption is sent to
Application program.
Step S103:Encrypted data requesting instructions are decrypted in on-vehicle information station, and according to data requesting instructions
By carrying out CAN communication with automobile to obtain car data, and it is sent to API after car data is encrypted.
Step S104:Encrypted car data is decrypted in API, and the car data after decryption is sent to application
Program.
That is, the API is before transmission data request instruction or the on-vehicle information station is sending automobile number
According to corresponding data will be encrypted before;The API is before sending car data or the root of the on-vehicle information station
Corresponding data will be decrypted before obtaining car data according to the data requesting instructions.In this way, in API and vehicle-mounted letter
The data being transmitted between breath station are required to encryption, greatly improve the safety of data transmission.
In one embodiment of the invention, as shown in Fig. 2, mobile terminal 510 mainly include the first bluetooth module 512,
API and application module/HMI(Human Machine Interface, man-machine interface)513.On-vehicle information station 520 includes second
Bluetooth module 521, code module 522 and CAN communication module 523.
First, when starting application program by application module/HMI, application requests API carries out bluetooth connection, blue
After establishing Bluetooth communication between the first bluetooth module 512 and the second bluetooth module 521 after tooth successful connection, API, which is received, to be answered
With the data requesting instructions of program, and the data requesting instructions are converted to Bluetooth communication data format, to Bluetooth communication data
The data requesting instructions of format be encrypted after to send the encrypted data requesting instructions by the first bluetooth module 512.
That is, before encrypted data requesting instructions are sent to on-vehicle information station by API, further include:API is by request of data
The instruction morphing request message for default communication data format such as Bluetooth communication data format, and the request message is added
It is close.
Secondly, on-vehicle information station 520 receives the encrypted request message that API is sent, generation by the second bluetooth module 521
The request message is decrypted in code module 522, and is parsed the request message after decryption to obtain data requesting instructions.
That is, at on-vehicle information station according to data requesting instructions by carrying out CAN communication with automobile with before obtaining car data,
Further include:The request message is decrypted in on-vehicle information station, and parses the request message after decryption to obtain request of data
Instruction.Therefore, if the request message that API is sent is encrypted information, request message is decrypted, is then parsed.
Wherein, the CAN communication module 523 in on-vehicle information station 520 carries out CAN communication to acquire the various fortune of automobile with automobile
Data when row, on-vehicle information station 520 carry out CAN communication according to data requesting instructions, by CAN communication module 523 and automobile,
Car data corresponding with data requesting instructions is obtained, and the car data is packaged by code module 522 by bluetooth and is led to
The response message of letter data format passes through the second bluetooth module 523 and the first bluetooth after then the response message is encrypted
Encrypted response message is sent to API by the Bluetooth communication between module 512.That is, will be encrypted at on-vehicle information station
Car data afterwards is sent to before API, further includes:On-vehicle information station is packaged car data to generate default communication number
It is encrypted according to the response message of format such as Bluetooth communication data format, and to the response message.
Also, API is in the encrypted response message for receiving the transmission of on-vehicle information station 520 by the first bluetooth module 512
Afterwards, the encrypted response message is decrypted first, then according to Bluetooth communication data format, the response after the decryption
Packet parsing is car data corresponding with data requesting instructions at the result of corresponding solicited message, and is fed back to and answers
Use program.In other words, before the car data after decryption is sent to application program by API, further include:The API is answered described
It answers message to be decrypted, and parses the response message after decryption to obtain car data.Therefore, if on-vehicle information station send
The car data is encrypted, then car data is decrypted in API, then parses.
It is, of course, understood that the method that car data is alternatively obtained by Application Programming Interface API,
The API before transmission data request instruction or the on-vehicle information station before sending car data to corresponding data
Without encryption;The API is before sending car data or the on-vehicle information station is obtained according to the data requesting instructions
It takes before car data to corresponding data without decryption.If that the request message that API is sent is not encrypted information,
Then request message is directly parsed;If the car data is not encrypted information, car data is directly parsed.
In one particular embodiment of the present invention, it as shown in figure 3, when starting the application program in mobile terminal, answers
Bluetooth connection is carried out with programmed request call API, API returns to the result of bluetooth connection;When bluetooth connection success, application program
API is called to carry out transmission data request instruction, and the data requesting instructions are converted into request message by API, are sent by bluetooth
To on-vehicle information station;After on-vehicle information station receives request message, the request message is parsed to obtain data requesting instructions, so
Afterwards according to data requesting instructions by and automobile carry out CAN communication by obtain car data corresponding with data requesting instructions, and
It is wrapped into response message, and API is sent back by bluetooth;After API receives response message, the response message is parsed to obtain
Obtain car data corresponding with data requesting instructions;It is answered having parsed car data corresponding with data requesting instructions and sending back
Use program.In the present embodiment, the API is before transmission data request instruction or the on-vehicle information station is sending automobile
To corresponding data without encryption before data;Then the API is before sending car data or the on-vehicle information station
Car data is obtained before to corresponding data without decryption according to the data requesting instructions.
Therefore it says, in an embodiment of the present invention, the CAN network data information of automobile can be obtained using bluetooth so that
User will be seen that the various runtime datas of automobile, and convenient to carry out various protections to automobile, driving is safer, and uses
It is convenient.
According to an example of the present invention, as shown in figure 4, describing the embodiment of the present invention by taking the speed for obtaining automobile as an example
The method that car data is obtained by Application Programming Interface API.
When application program needs the speed of acquisition request automobile, start the application program in mobile terminal, application program
Request call API carries out bluetooth connection, and API returns to the result of bluetooth connection;When bluetooth connection success, with reference to the document of API
The data requesting instructions of the speed of acquisition request automobile, for example, 001 are found, then call the transmission data request instruction of API
Method, and incoming 001 parameter;When API receives the parameter, call the method for JNI by 001 instruction object be packaged into API and
The mode of the communication bag of bluetooth(The communication mode can select to encrypt)Data packet, such as be packaged after result be [XX XX
XX XX XX], which is sent to on-vehicle information station by API by bluetooth, wherein can be as needed
The format of data packet is defined, and the request message can be encrypted in JIN;The communication that on-vehicle information station passes through API and bluetooth
Protocol analysis comes out the data requesting instructions, it is known that the speed of acquisition request automobile is wanted in the instruction;On-vehicle information station is from automobile CAN
After network obtains the speed information of automobile, such as the speed information of automobile is
The car data is packaged as response message by [0x000x000x000x000x000x000x000x00], wherein can be selected pair
Response message is encrypted, and can also define the format of data packet as needed, such as the car data is packaged into API and indigo plant
The form of the communication protocol data of tooth can be [XX XX XX XX XX XX XX XX XX XX XX XX], be sent out by bluetooth
It is sent to API;API calls JNI analytic messages to obtain result as 0 according to agreement, that is, the speed, for example, 0 is parsed, speed
It is put into Message queues for 0 information object, application program is obtained with speed information by the Message queues.
This exemplary method that car data is obtained by Application Programming Interface API, it is convenient and efficient using Bluetooth communication,
Real-time is high, and cost is relatively low.
It is understood that in other embodiments of the invention, can also be substituted with other communication modes, for example, 3G without
Gauze network, WiFi etc., just no longer repeat one by one herein.
The method according to the ... of the embodiment of the present invention for obtaining car data by Application Programming Interface API, can be provided by API
The interface for obtaining car data establishes after wireless communication connection the CAN network that can obtain vehicle with the on-vehicle information station of automobile
Data information need not buy CAN Reading and writing instruments such as CAN diagnostic equipments, such as directly be obtained with automobile by bluetooth
Data, convenient and efficient, developer is not required to it is to be understood that specific car data agreement, it is only necessary to know that the order code name of acquisition can
To get intuitive data, real-time is high, and cost is relatively low, and the user experience is improved.And this method allows users to reality
When understand automobilism when various data, so as to automobile carry out real-time guard, ensure traffic safety.Meanwhile in API
The data being transmitted between on-vehicle information station are required to encryption, greatly improve the safety of data transmission.
Further embodiment of the present invention provides a kind of system obtaining car data by Application Programming Interface API.
As shown in figure 5, the system 500 that should obtain car data by Application Programming Interface API includes:Mobile terminal 510 and vehicle-mounted letter
Breath station 520, on-vehicle information station 520 is located on automobile, and on-vehicle information station 520 carries out CAN communication, mobile terminal 510 with automobile 530
In application program 511 is installed, and mobile terminal 510 has Application Programming Interface API.
Wherein, application program 511 is for calling Application Programming Interface API, so that mobile terminal 510 and on-vehicle information station
520 establish wireless communication connection, and application program 511 receives the car data after the decryption that API is sent;API is used for
The data requesting instructions triggered by application program 511 are received, and on-vehicle information is sent to after data requesting instructions are encrypted
It stands 520, and receives the encrypted car data that on-vehicle information station 520 is sent, and encrypted car data is solved
Application program 511 is sent to after close;The encrypted data requesting instructions are decrypted in on-vehicle information station 520, and according to
Data requesting instructions are sent to by carrying out CAN communication with automobile 530 to obtain car data after encrypting car data
API。
Therefore, the API before transmission data request instruction or the on-vehicle information station send car data it
It is preceding that corresponding data are encrypted;The API is before sending car data or the on-vehicle information station is according to the number
Corresponding data are decrypted before obtaining car data according to request instruction.
Specifically, applying Application Programming Interface API in automobile Bluetooth with for example with android operating systems
Communication between mobile terminal 510 uses so that Bluetooth communication is established at mobile terminal 510 and on-vehicle information station 520.It is located at vapour
On-vehicle information station 520 on vehicle may be coupled on the communication bus of automobile, such as CAN bus, by carrying out CAN with automobile 530
Communication obtains the mass data information of automobile(That is car data).
Application program 511 in mobile terminal 510 calls Application Programming Interface API, so that mobile terminal 510 and automobile
Wireless communication connection is established at on-vehicle information station 520, can be realized through but not limited to such as under type:API is adjusted by application program 511
With rear, for creating and executing first thread, wherein first thread is used to establish the on-vehicle information of mobile terminal 510 and automobile
The wireless communication connection stood between 520, and when wirelessly communicate successful connection after, the second thread of the API establishments.
API is additionally operable to receiving after the data requesting instructions that application program 511 triggers, the second thread of execution, and second
Thread is used to send encrypted data requesting instructions to on-vehicle information station 520, and receives and sent from on-vehicle information station 520
Encrypted car data, and the car data after decryption is sent to application program 511.
In one embodiment of the invention, as shown in Fig. 2, mobile terminal 510 further includes the first bluetooth module 512.Vehicle
It includes the second bluetooth module 521, code module 522 and CAN communication module 523 to carry information station.
First, when by starting application program 511, which asks API to carry out bluetooth connection, bluetooth connection
After establishing Bluetooth communication between the first bluetooth module 512 and the second bluetooth module 521 after success, API receives application program
511 data requesting instructions, and convert the data requesting instructions to Bluetooth communication data format, then by Bluetooth communication data
To send the encrypted data requesting instructions by the first bluetooth module 512 after the data requesting instructions encryption of format.Also
It is to say, API is additionally operable to before encrypted data requesting instructions are sent to on-vehicle information station 520 by the data requesting instructions
It is converted into the request message of default communication data format, and the request message is encrypted.
Secondly, on-vehicle information station 520 receives the encrypted request message that API is sent, generation by the second bluetooth module 521
After the request message is encrypted in code module 522, then the request message after the decryption is parsed and is asked with obtaining data
Ask instruction.That is, on-vehicle information station 520 according to the data requesting instructions by with automobile 530 carry out CAN communication with
Before obtaining car data, request message is decrypted, and parses the request message after decryption to obtain the data
Request instruction.Therefore, if the request message that API is sent is encrypted information, request message is decrypted, is then solved
Analysis.
Wherein, the CAN communication module 523 in on-vehicle information station 520 and the progress of automobile 530 CAN communication are each to acquire automobile
Data when kind operation, on-vehicle information station 520 pass through CAN communication module 523 and automobile 530 carry out according to data requesting instructions
CAN communication obtains car data corresponding with data requesting instructions, and the car data is packaged by code module 522
It at the response message of Bluetooth communication data format, is then encrypted, passes through the second bluetooth module 521 and the first bluetooth module
Encrypted response message is sent to API by the Bluetooth communication between 512.That is, on-vehicle information station 520 will be after it will encrypt
The car data be sent to before the API and the car data be packaged to generate the default communication data lattice
The response message of formula, and the response message is encrypted.
Also, API is in the encrypted response report for receiving the transmission of on-vehicle information station 520 by the first bluetooth module 512
Wen Hou, the first encrypted response message are decrypted, then according to Bluetooth communication data format, answering after the decryption
Result i.e. with data requesting instructions corresponding car data of the packet parsing at corresponding solicited message is answered, and is fed back to
Application program 511.In other words, API by decryption after the car data be sent to application program 511 before to the response report
Text is decrypted, and then the response message after parsing decryption is to obtain the car data.Therefore, if on-vehicle information station
The car data sent is encrypted, then pair goes back car data and be decrypted, then parse.
It is, of course, understood that in other embodiments of the invention, the API transmission data request instruction it
Preceding or described on-vehicle information station is before sending car data to corresponding data without encryption;The API is sending vapour
Before the car data or on-vehicle information station obtains car data before to corresponding data according to the data requesting instructions
Without decryption.If that the request message that API is sent is not encrypted information, then request message is directly parsed;If
The car data is not encrypted information, then is directly parsed to car data.
In one particular embodiment of the present invention, it as shown in figure 3, when starting the application program in mobile terminal, answers
Bluetooth connection is carried out with programmed request call API, API returns to the result of bluetooth connection;When bluetooth connection success, start second
Thread monitors the data that on-vehicle information station is sent, and the method for providing transmission data, and application call API, which carrys out transmission data, to be asked
Instruction is asked, and the data requesting instructions are converted into request message by API, calls the data transmission method for uplink of the second thread, pass through
Bluetooth is sent to on-vehicle information station;After on-vehicle information station receives request message, parses the request message and asked with obtaining data
Ask instruction, then according to data requesting instructions by and automobile carry out CAN communication by obtain vapour corresponding with data requesting instructions
Car data, and it is wrapped into response message, and API is sent back by bluetooth;After API receives response message, parses this and answer
Message is answered to obtain car data corresponding with data requesting instructions;Having parsed automobile number corresponding with data requesting instructions
According to sending back application program.In the present embodiment, the API is before transmission data request instruction or the on-vehicle information station
To corresponding data without encryption before sending car data;Then the API is before sending car data or described
On-vehicle information station obtains car data before to corresponding data without decryption according to the data requesting instructions.
Therefore it says, in an embodiment of the present invention, the CAN network data information of automobile can be obtained using bluetooth so that
User will be seen that the various runtime datas of automobile, and convenient to carry out various protections to automobile, driving is safer, and uses
It is convenient.
The system according to the ... of the embodiment of the present invention for obtaining car data by Application Programming Interface API, can be provided by API
The interface for obtaining car data establishes after wireless communication connection the CAN network that can obtain vehicle with the on-vehicle information station of automobile
Data information need not buy CAN Reading and writing instruments such as CAN diagnostic equipments, such as directly be obtained with automobile by bluetooth
Data, convenient and efficient, developer is not required to it is to be understood that specific car data agreement, it is only necessary to know that the order code name of acquisition can
To get intuitive data, real-time is high, and cost is relatively low, and the user experience is improved.And the system allows users to reality
When understand automobilism when various data, so as to automobile carry out real-time guard, ensure traffic safety.Meanwhile in API
The data being transmitted between on-vehicle information station are required to encryption, greatly improve the safety of data transmission.
It should be appreciated that each section of the present invention can be realized with hardware, software, firmware or combination thereof.Above-mentioned
In embodiment, software that multiple steps or method can in memory and by suitable instruction execution system be executed with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit application-specific integrated circuit, programmable gate array(PGA), scene
Programmable gate array(FPGA)Deng.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
Centainly refer to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be any
One or more embodiments or example in can be combined in any suitable manner.
Although an embodiment of the present invention has been shown and described, it will be understood by those skilled in the art that:Not
In the case of being detached from the principle of the present invention and objective a variety of change, modification, replacement and modification can be carried out to these embodiments, this
The range of invention is limited by claim and its equivalent.
Claims (6)
1. a kind of method obtaining car data by Application Programming Interface API, which is characterized in that include the following steps:
By Application Programming Interface API described in the application call in mobile terminal, so that the mobile terminal and automobile
Wireless communication connection is established at on-vehicle information station;
The Application Programming Interface API receives data requesting instructions, and is sent to after the data requesting instructions are encrypted
The on-vehicle information station, wherein the data requesting instructions are by the application triggers, in the Application Programming Interface API
Before the encrypted data requesting instructions are sent to the on-vehicle information station, further include:The Application Programming Interface API
It converts the data requesting instructions to the request message of default communication data format, and the request message is encrypted;
The encrypted data requesting instructions are decrypted in the on-vehicle information station, and logical according to the data requesting instructions
It crosses and carries out CAN communication with the automobile to obtain car data, and the application is sent to after the car data is encrypted
Programming interface API, wherein logical by carrying out CAN with the automobile according to the data requesting instructions at the on-vehicle information station
Letter is before obtaining car data, to further include:The request message is decrypted in the on-vehicle information station, and after parsing decryption
The request message to obtain the data requesting instructions, the encrypted car data is sent out at the on-vehicle information station
Before giving the Application Programming Interface API, further include:The on-vehicle information station is packaged to generate the car data
The response message of the default communication data format, and the response message is encrypted;And
The encrypted car data is decrypted in the Application Programming Interface API, and by the automobile number after decryption
According to the application program is sent to, the car data after decryption is sent to described answer in the Application Programming Interface API
Before program, further include:The response message is decrypted in the Application Programming Interface API, and parses the institute after decryption
Response message is stated to obtain the car data.
2. the method according to claim 1 for obtaining car data by Application Programming Interface API, which is characterized in that institute
It states through Application Programming Interface API described in the application call in mobile terminal, so that the vehicle of the mobile terminal and automobile
It carries information station and establishes wireless communication connection, further comprise:
Call the Application Programming Interface API;
The Application Programming Interface API is created and is executed first thread, wherein the first thread is described mobile whole for establishing
Wireless communication between end and the on-vehicle information station of the automobile connects, wherein after wirelessly communicating successful connection, the application
Programming interface API creates the second thread.
3. the method according to claim 2 for obtaining car data by Application Programming Interface API, which is characterized in that institute
State Application Programming Interface API and receive data requesting instructions, wherein the data requesting instructions by the application triggers, into
One step includes:
The Application Programming Interface API receives the data requesting instructions from the application triggers;
The Application Programming Interface API executes the second thread, wherein second thread is used to send to the on-vehicle information station
The encrypted data requesting instructions, and the encrypted car data sent from the on-vehicle information station is received, and
The car data after decryption is sent to the application program.
4. a kind of system obtaining car data by Application Programming Interface API, which is characterized in that including:Mobile terminal and vehicle
Information station is carried, for the on-vehicle information erect-position on automobile, the on-vehicle information station carries out CAN communication, the shifting with the automobile
Application program is installed, and the mobile terminal has Application Programming Interface API in dynamic terminal, wherein
The application program is for calling the Application Programming Interface API, so that the mobile terminal and the on-vehicle information station
Wireless communication connection is established, and the application program receives the vapour after the decryption that the Application Programming Interface API is sent
Car data;
The Application Programming Interface API is for receiving by the data requesting instructions of the application triggers, and by the data
Request instruction is sent to the on-vehicle information station after being encrypted, and receives automobile after the encryption that the on-vehicle information station is sent
Data, and it is sent to the application program after the encrypted car data is decrypted, wherein the application programming connects
Mouth API is additionally operable to before the encrypted data requesting instructions are sent to the on-vehicle information station by the request of data
The instruction morphing request message for default communication data format, and the request message is encrypted, the on-vehicle information station
According to the data requesting instructions by carrying out CAN communication with before obtaining car data, to the request with the automobile
Message is decrypted, and parses the request message after decryption to obtain the data requesting instructions;
The encrypted data requesting instructions are decrypted in the on-vehicle information station, and logical according to the data requesting instructions
It crosses and carries out CAN communication with the automobile to obtain car data, and be sent to the application after the car data is encrypted and compile
Journey interface API, wherein the encrypted car data is being sent to the Application Programming Interface by the on-vehicle information station
The car data is packaged to generate the response message of the default communication data format before API, and is answered described
It answers message to be encrypted, the car data after decryption is being sent to the application program by the Application Programming Interface API
The response message is decrypted before, and parses the response message after decryption to obtain the car data.
5. the system according to claim 4 for obtaining car data by Application Programming Interface API, which is characterized in that institute
Application Programming Interface API is stated after by the application call, for creating and executing first thread, wherein described first
Thread is used to establish the wireless communication connection between the mobile terminal and the on-vehicle information station of the automobile, and when wireless communication
After successful connection, the Application Programming Interface API creates the second thread.
6. the system according to claim 5 for obtaining car data by Application Programming Interface API, which is characterized in that institute
It states Application Programming Interface API to be additionally operable to after the data requesting instructions for receiving the application triggers, executes the second thread,
Second thread is used to send the encrypted data requesting instructions to the on-vehicle information station, and receives and come from the vehicle
The encrypted car data that information station is sent is carried, and the car data after decryption is sent to the application program.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310578535.2A CN104657300B (en) | 2013-11-18 | 2013-11-18 | The method and system of car data are obtained by Application Programming Interface |
PCT/CN2014/091328 WO2015070815A1 (en) | 2013-11-18 | 2014-11-17 | Method and system for acquiring automobile data via application programming interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310578535.2A CN104657300B (en) | 2013-11-18 | 2013-11-18 | The method and system of car data are obtained by Application Programming Interface |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104657300A CN104657300A (en) | 2015-05-27 |
CN104657300B true CN104657300B (en) | 2018-09-11 |
Family
ID=53056804
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310578535.2A Active CN104657300B (en) | 2013-11-18 | 2013-11-18 | The method and system of car data are obtained by Application Programming Interface |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104657300B (en) |
WO (1) | WO2015070815A1 (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106169243B (en) * | 2016-08-25 | 2019-03-15 | 武汉理工大学 | A kind of real-time road estimating system and method based on car networking |
CN106292449B (en) * | 2016-09-06 | 2019-02-12 | 合肥移顺信息技术有限公司 | The system and method for vehicle is remotely controlled based on Encrypted short message |
CN107562894B (en) * | 2017-09-06 | 2020-01-03 | 广州供电局有限公司 | API obtaining and applying method for behavior simulation of web application system |
CN109788004B (en) * | 2017-11-10 | 2023-06-02 | 厦门雅迅网络股份有限公司 | Analysis method and system for automatically adapting national standard custom protocol of new energy automobile |
CN110392067B (en) * | 2018-04-16 | 2021-07-20 | 比亚迪股份有限公司 | Development system and method of third-party application |
CN110389538A (en) * | 2018-04-20 | 2019-10-29 | 比亚迪股份有限公司 | Vehicle and its vehicle safety control method, system based on open platform |
CN109063979A (en) * | 2018-07-13 | 2018-12-21 | 四川享宇金信金融服务外包有限公司 | A kind of air control model building method |
CN108876193A (en) * | 2018-07-13 | 2018-11-23 | 四川享宇金信金融服务外包有限公司 | A kind of air control model building method based on credit score |
CN110871748A (en) * | 2018-09-04 | 2020-03-10 | 比亚迪股份有限公司 | Vehicle with a steering wheel |
CN109193592B (en) * | 2018-10-23 | 2020-05-05 | 中国南方电网有限责任公司 | Relay protection data transmission method between relay protection information systems |
CN109286689B (en) * | 2018-11-29 | 2020-12-11 | 北京车联天下信息技术有限公司 | Information sending method and device and vehicle-mounted man-vehicle interaction terminal |
CN109874122A (en) * | 2019-03-25 | 2019-06-11 | 厦门盈趣汽车电子有限公司 | Realize the method and system that intelligent terminal is interacted with mobile unit |
CN111556011B (en) * | 2020-03-24 | 2022-07-12 | 浙江飞碟汽车制造有限公司 | Data analysis method of vehicle-mounted bus based on MATLAB/Simulink |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101109954A (en) * | 2007-06-01 | 2008-01-23 | 清华大学 | Fuel cell vehicle controller monitoring system based on blue tooth communication |
CN202931557U (en) * | 2012-11-22 | 2013-05-08 | 江苏中微凌云科技股份有限公司 | GPS monitoring terminal system based on one-key service |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6751452B1 (en) * | 2000-05-01 | 2004-06-15 | General Motors Coporation | Internet based vehicle data communication system |
CN101662488B (en) * | 2008-08-29 | 2013-10-02 | 比亚迪股份有限公司 | Method and system for remotely monitoring car in real time |
CN202077063U (en) * | 2010-12-13 | 2011-12-14 | 斯必克机电产品(苏州)有限公司 | Automobile network diagnostic system |
US10097993B2 (en) * | 2011-07-25 | 2018-10-09 | Ford Global Technologies, Llc | Method and apparatus for remote authentication |
-
2013
- 2013-11-18 CN CN201310578535.2A patent/CN104657300B/en active Active
-
2014
- 2014-11-17 WO PCT/CN2014/091328 patent/WO2015070815A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101109954A (en) * | 2007-06-01 | 2008-01-23 | 清华大学 | Fuel cell vehicle controller monitoring system based on blue tooth communication |
CN202931557U (en) * | 2012-11-22 | 2013-05-08 | 江苏中微凌云科技股份有限公司 | GPS monitoring terminal system based on one-key service |
Also Published As
Publication number | Publication date |
---|---|
CN104657300A (en) | 2015-05-27 |
WO2015070815A1 (en) | 2015-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104657300B (en) | The method and system of car data are obtained by Application Programming Interface | |
CN104717071B (en) | Road train data authentication method for authenticating and car-mounted terminal | |
CN107682159B (en) | Trusted application management method and trusted application management system of intelligent terminal | |
US20220276855A1 (en) | Method and apparatus for processing upgrade package of vehicle | |
CN105704252B (en) | Bluetooth low energy device data transmission method and device | |
Festag et al. | Field operational tests for cooperative systems: a tussle between research, standardization and deployment | |
CN110191439A (en) | A kind of Transmission system and method for vehicle data | |
JP2022528075A (en) | Message transmission systems, methods and vehicles based on heterogeneous operating systems | |
CN104753804B (en) | A kind of data stream transmitting control method, apparatus and system | |
CN110597546A (en) | Method for upgrading vehicle-mounted controller program and vehicle | |
CN112769700B (en) | Routing method and routing system based on application method number | |
CN109922089A (en) | A kind of method for converting protocol and system based on SDK packet | |
CN109639667A (en) | Data acquisition and transmission method, device and equipment based on local data parsing | |
CN110166410A (en) | A kind of method of safety-oriented data transfer, terminal and multi-mode communication terminal | |
CN113204358A (en) | Software package refreshing service method, service system and readable storage medium | |
CN109286689B (en) | Information sending method and device and vehicle-mounted man-vehicle interaction terminal | |
CN105654168B (en) | Embedded intelligence security module, secure hardware device, system and working method | |
WO2019201218A1 (en) | Development system and method for third-party application | |
CN106597880B (en) | A kind of CAN communication control method and system, host computer, BMS producer and client terminal | |
CN104967738A (en) | Method for controlling vehicle theft prevention using gravity sensor of intelligent terminal equipment | |
CN113455032B (en) | Communication method, communication device, and computer-readable medium | |
WO2017206560A1 (en) | Device to device (d2d) communication method and apparatus, and vehicle networking terminal | |
CN104657365A (en) | Method and system for accessing automobile data through applicable programming interface (API) | |
EP3091701B1 (en) | Dimming method, dimming device and computer storage medium | |
KR101550997B1 (en) | An opening method of the telematics service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |