A vehicle single-channel and multi-channel parallel diagnosis method and system
By applying for a resource pool in vehicle diagnosis for resource processing and time-sharing multiplexing, parallel diagnosis in single channel and multi-channel is realized, solving the problem of long diagnosis time in the existing technology, and improving user experience and hardware resource utilization. efficiency.
Patent Information
- Application Number
- CN202111274820.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-10-29
AI Technical Summary
When the existing technology uses the CAN bus for vehicle diagnosis, due to hardware resource limitations and serial processing mode, the diagnosis time is long, and parallel diagnosis in single channel and multi-channel cannot be realized, which affects the user experience.
By applying for a resource pool in the diagnostic application layer, resource processing and data allocation are implemented, time-sharing multiplexing and exclusive sharing mode of diagnostic data are realized, parallel diagnosis in single channel and multi-channel is supported, and resource pools are used for data processing. and sending to meet the parallel needs of diagnostic services.
It realizes the processing of diagnostic data of multiple diagnostic channels in a single process, reduces the requirements for hardware resources, shortens the diagnosis time, provides a better user experience, and meets the exclusive demand of diagnostic services for channels.
Smart Images

Figure CN113961356B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of vehicle controller diagnosis and software upgrade, and in particular relates to vehicle single-channel and multi-channel parallel diagnosis technology. Background Art
[0002] Users have new diagnostic requirements for the intelligence and interconnection of automobiles, including OTA and remote diagnostic functions. Limited by the rate limit of the CAN bus, the current OTA or remote diagnosis mainly adopts the controller serial processing mode, but the whole event takes a long time and the user experience is not good. The parallel diagnosis method can maximize the use of the CAN bus load, shorten the overall implementation time, and provide a better user experience. When the host computer is the controller in the car, the hardware resources are greatly limited, and the controller being diagnosed or upgraded may not allow parallel diagnosis due to its own hardware and software conditions, and the controllers are all on the same bus.
[0003] The Chinese patent document with the publication number CN104483960B discloses a technology named "A method for parallel processing of data transmission and reception in an automobile diagnostic communication module". The technology mainly starts two sub-threads or interrupt services during the diagnostic initialization process to request data and bus interaction with the host computer. When the host computer needs to send data, it requests an interrupt or sub-thread to receive the host computer data and sets a flag. Then the sub-thread or interrupt module detects the data flag and sends the data to the bus. When there is data to be uploaded, the flag is set. Then the main thread or interrupt detects whether there is data to be uploaded, and then uploads the information according to the demand. The data interaction sub-thread processes the data to distinguish the data according to the applicable channel ID of the diagnostic service. This technology has high requirements for the carrier hardware platform. It needs to use sub-threads or interrupt services and needs to open sub-threads or add interrupt services every time it is parallel. It must be completed after all single diagnostic applications are completed. It cannot be applied to the vehicle gateway or other controllers for integration; this technology cannot realize the parallelization of the entire segment of data within a single channel ID.
[0004] The Chinese patent document with the publication number CN103616886B discloses a technology named "A method for realizing multi-channel parallel automobile diagnosis and automobile diagnostic equipment". This technology sends multiple channel connection protocol instructions to the automobile communication interface device through the diagnosis end of the automobile diagnostic equipment. Then the automobile communication interface device checks whether the communication protocol class objects corresponding to the multiple channel connection protocol instructions have been constructed. If not, the communication protocol class objects are constructed according to the channel connection protocol instructions, and the channel ID of the automobile computer system corresponding to the communication protocol class object is recorded. Finally, according to the channel ID of the automobile computer system, the diagnosis end distributes diagnostic scanning instructions to each automobile computer system to realize the interaction between the automobile diagnostic equipment and the automobile computer system corresponding to the channel ID, so as to realize multi-channel parallel communication and establish communication connection with multiple automobile computer systems. Because the diagnostic service directly establishes a corresponding relationship with the hardware channel, when the same hardware channel needs to complete multiple diagnostic requirements, the parallelization within the same hardware channel cannot be completed, and the number of parallelization is limited by the number of hardware channels. Summary of the invention
[0005] The purpose of the present invention is to provide a vehicle single-channel and multi-channel parallel diagnosis method and system, and to solve the technical problem of: adopting a parallel diagnosis method to fully utilize the CAN bus load, shorten the overall diagnosis time, and provide a good experience. However, the carrier of the upper computer is an in-vehicle controller, and the hardware resources are greatly limited. In addition, the controller being diagnosed or upgraded does not allow parallel diagnosis due to its own hardware and software conditions or being on the same bus.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a vehicle single-channel and multi-channel parallel diagnosis method, comprising the following steps:
[0007] A: The diagnostic application layer applies for resources from a resource pool, wherein the resource pool is generated through the following process: the packaged and unpacked parts of the diagnostic service are resourceized according to the diagnostic ID and channel, and then the resourceization of the diagnostic service is used to establish the resource pool.
[0008] B: Send the message to be sent to the resource applied for in A, and the diagnostic application layer runs other tasks according to the needs and queries the resource reception status;
[0009] C: Send the message to the sending buffer;
[0010] D: Upload the message received on the bus to the resource pool;
[0011] E: Unpack the message in D, and return the unpacked message when the diagnostic application layer queries.
[0012] Preferably,
[0013] In A, check whether the resource number is less than the resource quantity. If so, continue to determine whether the transceiver ID of the current resource is consistent with the physical channel and the application value. If so, write the resource information to the current resource and return the resource number of the current resource.
[0014] If the resource number is not less than the resource quantity, check whether there are idle resources. If so, bind the idle resources to the diagnostic service and return the resource number. If not, return resource application failure.
[0015] Preferably,
[0016] After E, F is also included. When the current diagnostic service has been completed, a resource release interface is called to release the resource, and the diagnostic application layer confirms the release.
[0017] Preferably,
[0018] In said B, said diagnostic application layer inputs the ID of sending and receiving, the sending message data, the resource number and the resource mode into the sending interface;
[0019] Check whether the channel sending conditions are met. If yes, check whether the channel has functional addressing and is sending. If yes, set the resource sending flag to queue state. If not, set the resource sending flag to wait for sending, and write the data, transceiver ID and resource mode to the resource.
[0020] If the channel sending conditions are not met, the channel is in exclusive mode and does not support data sending.
[0021] Preferably,
[0022] In the D and E, check whether the resource reception is completed. If so, check whether the reception is a negative response code 78. If so, set the reception timeout T and return the received length and data. If the reception is not a negative response code 78, directly return the received length and data.
[0023] If the resource reception is not completed, no reception data is returned.
[0024] Preferably,
[0025] In B, C and D, the message processing process is as follows: check whether the received driver layer message is not processed, if so, check whether the receiving ID and channel of any resource are consistent with the message, if so, fill it into the resource message receiving cache;
[0026] If no driver layer message is received and not processed, check whether the resource number is less than the number of resources. If so, check whether the current resource has any cached received message that has not been processed. If so, process the received message immediately.
[0027] If the resource number is not less than the resource quantity, check whether the current resource has a sending task. If so, group a frame of message and fill the message into the sending buffer.
[0028] Preferably,
[0029] In the C, a channel sending condition check is also included, including the following check steps:
[0030] C1: Check whether the resource number is less than the resource quantity. If so, check whether the resource number is consistent with the requested resource number. If not, proceed to the next step.
[0031] C2: Check whether the resource channel is consistent with the information sending channel. If so, proceed to the next step;
[0032] C3: Check whether the sending resource status is exclusive. If so, check whether there is a sending or receiving task in progress for the current resource. If so, return the channel sending condition test failed;
[0033] C4: If the sending resource status is not exclusive, check whether the current resource is in exclusive use. If so, return that the channel sending condition test has failed;
[0034] C5: In C1, if the resource number is not less than the resource quantity, the channel sending condition detection is directly returned to pass.
[0035] The present invention also provides a vehicle single-channel and multi-channel parallel diagnosis system, comprising:
[0036] The application module is used for the diagnostic application layer to apply for resources from the resource pool, wherein the resource pool is generated through the following process: the packaging and unpacking parts of the diagnostic service are resource-processed according to the diagnostic ID and channel, and then the resource pool is established by utilizing the resourceization of the diagnostic service.
[0037] The first sending module is used to send the message to be sent to the resource applied for in the application module, and the diagnostic application layer runs other tasks according to the demand and queries the resource receiving status;
[0038] A second sending module, used for sending the message in the resources in the first sending module to a sending buffer;
[0039] An upload module, used for uploading messages received on the bus to the resource pool;
[0040] An unpacking module, used for unpacking messages received on the resource intra-bus in the resource pool;
[0041] A return module is used to return the unpacked message when the diagnostic application layer queries.
[0042] Preferably,
[0043] In the application module, check whether the resource number is less than the number of resources. If so, continue to determine whether the current resource's transceiver ID is consistent with the physical channel and application value. If so, write the resource information into the current resource and return the current resource number. If the resource number is not less than the number of resources, check whether there are free resources. If so, bind the free resources to the diagnostic service and return the resource number. If not, return resource application failure.
[0044] Preferably,
[0045] When the current diagnostic service has been completed, a resource release interface is called to release it, and the diagnostic application layer confirms the release, wherein the current diagnostic service is a current single diagnostic service or all current diagnostic services.
[0046] Preferably,
[0047] In the first sending module, the diagnostic application layer inputs the sending and receiving ID, the sending message data, the resource number and the resource mode into the sending interface;
[0048] Check whether the channel sending conditions are met. If yes, check whether the channel has functional addressing and is sending. If yes, set the resource sending flag to queue state. If not, set the resource sending flag to wait for sending, and write the data, transceiver ID and resource mode to the resource.
[0049] If the channel sending conditions are not met, the channel is in exclusive mode and does not support data sending.
[0050] Preferably,
[0051] In the upload module, unpacking module and return module, check whether the price difference resource reception is completed. If so, check whether the reception is a negative response code 78. If so, set the reception timeout T and return the received length and data. If the reception is not a negative response code 78, directly return the received length and data.
[0052] If the resource reception is not completed, no reception data is returned.
[0053] Preferably,
[0054] In the first sending module, the second sending module and the upload module, the message processing process is as follows: check whether the received driver layer message is not processed, if so, check whether the receiving ID and channel of any resource are consistent with the message, if so, fill it into the resource message receiving cache;
[0055] If no driver layer message is received and not processed, check whether the resource number is less than the number of resources. If so, check whether the current resource has any cached received message that has not been processed. If so, process the received message immediately.
[0056] If the resource number is not less than the resource quantity, check whether the current resource has a sending task. If so, group a frame of message and fill the message into the sending buffer.
[0057] Preferably,
[0058] The second sending module also includes a channel sending condition check, including the following checking steps: the first step is to check whether the resource number is less than the resource quantity. If so, check whether the resource number is consistent with the requested resource number. If not, execute the next step; the second step is to check whether the resource channel is consistent with the sending information channel. If so, execute the next step; the third step is to check whether the sending resource status is exclusive. If so, check whether the current resource has a sending or receiving task authentication execution. If so, return the channel sending condition test failed; the fourth step is to check whether the sending resource status is not exclusive, check whether the current resource is in exclusive use, and if so, return the channel sending condition test failed; the fifth step, in the first step, if the resource number is not less than the resource quantity, directly return the channel sending condition test passed.
[0059] By adopting the above technical solution, the beneficial technical effects that can be achieved by the present invention are stated as follows:
[0060] First, the code of the present invention runs in a loop, and processes the diagnostic data of multiple diagnostic channels in a single process in a time-division multiplexing manner.
[0061] Second, in step A, the diagnostic application layer applies for resources from the resource pool. The resource pool generation process is as follows: the diagnostic service packaging and unpacking parts are resource-processed according to the diagnostic ID and channel, and then the resource pool is established by utilizing the diagnostic service resourceization. The present invention adopts the data resourceization processing of the diagnostic application layer, which is separated from data processing and data sending, and reduces the requirements for hardware or platform through dynamic resource allocation.
[0062] Third, the present invention utilizes abstract processing of diagnostic dialogues to perform resource allocation and data processing for each diagnostic dialogue without relying on specific data channels, thereby realizing the splitting of resources and underlying data transmission and reception to meet the diagnostic parallelism within a single channel. The specific implementation is: based on the sent / received diagnostic ID, it is determined which diagnostic dialogue resource should be used to process the data to be sent or received.
[0063] Fourth, the present invention provides an exclusive sharing mode. When a resource is set to be exclusive, the CAN channel used by the resource can only be used exclusively by the resource. If other resources use the CAN channel to send and receive messages, they will be blocked, thereby satisfying the demand of controllers that cannot run in parallel for exclusive use of the diagnostic channel for diagnostic services. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is the overall flow chart of the present invention;
[0065] Figure 2 It is a resource application and release flow chart of the present invention;
[0066] Figure 3 is a flow chart of sending and receiving diagnostic data of the present invention;
[0067] Figure 4 It is a flowchart of message data processing;
[0068] Figure 5 It is a flow chart of the shared and exclusive mode processing of the present invention. DETAILED DESCRIPTION
[0069] The present invention will be further described below in conjunction with the accompanying drawings.
[0070] like Figure 1 As shown, the present invention provides a vehicle single-channel and multi-channel parallel diagnosis method. The CANTP processing layer is the core part of the entire process, which consists of two parts: first, a resource pool that stores the intermediate state and process quantity of a single diagnostic dialogue; second, a CANTP logic general processing module, which polls each resource when the program is running, and performs universal logic processing on the diagnostic message according to the state of the diagnostic dialogue in each resource and in accordance with the ISO15765 protocol.
[0071] A vehicle single-channel and multi-channel parallel diagnosis method comprises the following steps:
[0072] A: The diagnostic application layer applies for resources from the resource pool, where the resource pool is generated through the following process: the packaging and unpacking parts of the diagnostic service are resource-based according to the diagnostic ID and channel, and then the resourceization of the diagnostic service is used to establish a resource pool.
[0073] B: Send the message to be sent to the resource applied for in A. The diagnostic application layer runs other tasks according to the requirements and queries the resource reception status.
[0074] C: Send the message to the send buffer;
[0075] D: upload the message received on the bus to the resource pool;
[0076] E: Unpack the message in D and return the unpacked message when the diagnostic application layer queries.
[0077] like Figure 2 As shown in the figure, the resource application process is as follows:
[0078] The first step is to determine whether the resource number i is less than the number of resources. If so, determine whether the send and receive ID of the current resource is consistent with the physical channel and the application value. If they are consistent, write the resource information to the current resource and return the current resource number.
[0079] In the second step, if the transceiver ID of the current resource is inconsistent with the physical channel and the application value, continue to determine whether the transceiver ID of the next resource is consistent with the physical channel and the application value, until the transceiver ID of the current resource is consistent with the physical channel and the application value, write the resource information into the current resource, and return the resource number of the current resource.
[0080] The third step is, if the resource number is not less than the resource quantity, then determine whether the resource number n is less than the resource quantity. If so, write the resource information into the current resource and return the current resource number.
[0081] Specifically, the i and n in the first step are used to represent two polling operations, but the judgment conditions for jumping out of the polling are different.
[0082] Step 4: If n is not less than the number of resources, the application failure is directly returned.
[0083] In addition, the above resource application process can also be expressed as follows: In the first step, the loop variable i is used to traverse the resources in all resource libraries. If the transceiver ID and physical channel of a resource are consistent with the transceiver ID and physical channel input by the applicant, the loop is jumped out, the resource number is returned to the applicant, and the resource application process ends. If after the traversal, there is no resource whose transceiver ID and physical channel are consistent with the transceiver ID and physical channel input by the applicant, the second step is entered.
[0084] The second step is to use the loop variable n to traverse the resource library again to determine whether there are any idle resources in the resource library. If so, write the transceiver ID and physical channel information of the newly applied resource into the idle resource number and return the resource number. If no resource is idle after the traversal is completed, the application fails.
[0085] like Figure 2 As shown, when the entire diagnostic service or a single diagnostic service is completed, the diagnostic application layer will release the applied resources. The release process is: initialize the message ID and channel, and set the resource status to idle.
[0086] like Figure 3As shown, diagnostic data is sent through resources in the resource pool. The process of sending diagnostic data is as follows:
[0087] In the first step, the diagnostic application layer inputs the send / receive ID, resource number, send data, and resource mode into the send interface.
[0088] The second step is to check whether the channel sending conditions are met. If so, check whether the channel has function addressing being sent. If not, set the resource sending flag to wait for sending, and write the data, transceiver ID and resource mode to the resource.
[0089] In the third step, if the channel has function addressing being sent, the resource sending flag is set to the queue state, and the data, transceiver ID and resource mode are written to the resource.
[0090] Step 4: If the channel sending conditions are not met, the channel is in exclusive mode and does not support data sending. Try again later.
[0091] like Figure 3 As shown, the resources in the resource pool receive the response message sent by the diagnosed controller, that is, the process of receiving the diagnostic data is as follows:
[0092] The first step is to check whether the resource reception is completed. If not, it returns no received data.
[0093] The second step, if yes, then continue to determine whether the received response code is a negative response code 78, if not, directly return the received length and data.
[0094] Step 3: If the response code is 78, set the receiving timeout T, where T is 5s, and then return the receiving length and data.
[0095] like Figure 4 As shown in the figure, the message data processing flow is as follows:
[0096] The first step is to determine whether there is any unprocessed driver layer message received. If so, determine whether the receiving ID and channel of any resource are consistent with the message. If so, fill it into the resource message receiving cache.
[0097] In the second step, if the receiving ID and channel of any resource are inconsistent with the message, continue to determine whether there is any unprocessed driver layer message received.
[0098] In the third step, if no driver layer message is received and not processed, it is determined whether the resource number is less than the number of resources. If so, it is determined whether the current resource has a cached received message that has not been processed. If so, the received message is processed.
[0099] The fourth step is, if the current resource has no cached received message that has not been processed, determine whether the current resource has a sending task. If so, group the data into a frame message and fill the message into the sending buffer.
[0100] like Figure 5 As shown in the figure, the processing flow of shared and exclusive modes is as follows:
[0101] When the data sending interface is called, the channel sending condition detection is entered and all channels are polled.
[0102] The first step is to determine whether the current resource number is consistent with the requested resource number. If so, directly check the next resource. If not, execute the next step.
[0103] The second step is to determine whether the resource channel is consistent with the information sending channel. If not, check the next resource. If yes, execute the next step.
[0104] The third step is to determine whether the sending resource status is exclusive. If so, determine whether the current resource (the polled resource) has a sending or receiving task in progress. If so, the return channel sending condition test fails, otherwise determine the next resource.
[0105] Step 4: If the sending resource status is not exclusive, check whether the current resource (the polled resource) is exclusive. If so, return that the channel sending condition test has not passed, otherwise check the next resource.
[0106] If the return condition is not met after all resource detections are completed, the return condition is met.
[0107] The present invention also provides a vehicle single-channel and multi-channel parallel diagnosis system, comprising:
[0108] The application module is used for the diagnostic application layer to apply for resources from the resource pool, wherein the resource pool is generated through the following process: the packaged and unpacked parts of the diagnostic service are resourced according to the diagnostic ID and channel, and then the resourceization of the diagnostic service is used to establish the resource pool.
[0109] The first sending module is used to send the message to be sent to the resource applied for in the application module, diagnose the application layer to run other tasks according to the demand, and query the resource reception status;
[0110] A second sending module, used for sending the message in the resources in the first sending module to the sending buffer;
[0111] The upload module is used to upload the messages received on the bus to the resource pool;
[0112] An unpacking module, used for unpacking messages received on the resource intra-bus in the resource pool;
[0113] The return module is used to return the unpacked message when the diagnostic application layer is queried.
[0114] Optionally,
[0115] In the application module, check whether the resource number is less than the number of resources. If so, continue to determine whether the current resource's transceiver ID is consistent with the physical channel and the application value. If so, write the resource information to the current resource and return the current resource number. If the resource number is not less than the number of resources, check whether there are free resources. If so, bind the free resources to the diagnostic service and return the resource number. If not, return resource application failure.
[0116] Optionally,
[0117] When the current diagnostic service has been completed, the resource release interface is called to release it, and the diagnostic application layer confirms the release, wherein the current diagnostic service is a current single diagnostic service or all current diagnostic services.
[0118] Optionally,
[0119] In the first sending module, the diagnostic application layer inputs the sending and receiving ID, the sending message data, the resource number and the resource mode into the sending interface;
[0120] Check whether the channel sending conditions are met. If yes, check whether the channel has functional addressing and is sending. If yes, set the resource sending flag to queue state. If not, set the resource sending flag to wait for sending, and write the data, transceiver ID and resource mode to the resource.
[0121] If the channel sending conditions are not met, the channel is in exclusive mode and does not support data sending.
[0122] Optionally,
[0123] In the upload module, unpacking module and return module, check whether the price difference resource reception is completed. If so, check whether the reception is a negative response code 78. If so, set the reception timeout T and return the received length and data. If the reception is not a negative response code 78, directly return the received length and data.
[0124] If the resource reception is not completed, no reception data is returned.
[0125] Optionally,
[0126] In the first sending module, the second sending module and the upload module, the message processing process is as follows: check whether the received driver layer message is not processed, if so, check whether the receiving ID and channel of any resource are consistent with the message, if so, fill it into the resource message receiving cache;
[0127] If no driver layer message is received and not processed, check whether the resource number is less than the number of resources. If so, check whether the current resource has any cached received message that has not been processed. If so, process the received message immediately.
[0128] If the resource number is not less than the resource quantity, check whether the current resource has a sending task. If so, group a frame of message and fill the message into the sending buffer.
[0129] Optionally,
[0130] The second sending module also includes a channel sending condition check, including the following checking steps: the first step is to check whether the resource number is less than the resource quantity. If so, check whether the resource number is consistent with the requested resource number. If not, execute the next step; the second step is to check whether the resource channel is consistent with the sending information channel. If so, execute the next step; the third step is to check whether the sending resource status is exclusive. If so, check whether the current resource has a sending or receiving task authentication execution. If so, return the channel sending condition test failed; the fourth step is to check whether the sending resource status is not exclusive, check whether the current resource is in exclusive use, and if so, return the channel sending condition test failed; the fifth step, in the first step, if the resource number is not less than the resource quantity, directly return the channel sending condition test passed.
Claims
1. A vehicle single-channel and multi-channel parallel diagnosis method, characterized in that: The following steps are involved: A: The diagnostic application layer applies for resources from a resource pool, wherein the resource pool is generated by the following process: resource processing is performed on the packaged and unpacked parts of the diagnostic service according to the diagnostic ID and the channel, and then the resource pool is established by using the resourceization of the diagnostic service; B: Send the message to be sent to the resource applied for in A, and the diagnostic application layer runs other tasks according to the needs and queries the resource reception status; C: Send the message to the sending buffer; D: Upload the message received on the bus to the resource pool; E: unpack the message in D, and return the unpacked message when the diagnostic application layer queries; In B, C and D, the message processing process is as follows: check whether the received driver layer message is not processed, if so, check whether the receiving ID and channel of any resource are consistent with the message, if so, fill it into the resource message receiving cache; If no driver layer message is received and not processed, check whether the resource number is less than the number of resources. If so, check whether the current resource has any cached received message that has not been processed. If so, process the received message immediately. If the resource number is not less than the resource quantity, check whether the current resource has a sending task. If so, group a frame of message and fill the message into the sending buffer.
2. The vehicle single-channel and multi-channel parallel diagnosis method according to claim 1, characterized in that: In A, check whether the resource number is less than the resource quantity. If so, continue to determine whether the transceiver ID of the current resource is consistent with the physical channel and the application value. If so, write the resource information to the current resource and return the current resource number. If the resource number is not less than the resource quantity, check whether there are idle resources. If so, bind the idle resources to the diagnostic service and return the resource number. If not, return resource application failure.
3. The vehicle single-channel and multi-channel parallel diagnosis method according to claim 1, characterized in that: After E, F is also included. When the current diagnostic service has been completed, a resource release interface is called to release the resource, and the diagnostic application layer confirms the release.
4. The vehicle single-channel and multi-channel parallel diagnosis method according to claim 1, characterized in that: In said B, said diagnostic application layer inputs the ID of sending and receiving, the sending message data, the resource number and the resource mode into the sending interface; Check whether the channel sending conditions are met. If yes, check whether the channel has functional addressing and is sending. If yes, set the resource sending flag to queue state. If not, set the resource sending flag to wait for sending, and write the data, transceiver ID and resource mode to the resource. If the channel sending conditions are not met, the channel is in exclusive mode and does not support data sending.
5. The vehicle single-channel and multi-channel parallel diagnosis method according to claim 1, characterized in that: In the D and E, check whether the resource reception is completed. If so, check whether the reception is a negative response code 78. If so, set the reception timeout T and return the received length and data. If the reception is not a negative response code 78, directly return the received length and data. If the resource reception is not completed, no reception data is returned.
6. The vehicle single-channel and multi-channel parallel diagnosis method according to claim 1, characterized in that: In the C, a channel sending condition check is also included, including the following check steps: C1: Check whether the resource number is less than the resource quantity. If so, check whether the resource number is consistent with the requested resource number. If not, proceed to the next step. C2: Check whether the resource channel is consistent with the information sending channel. If so, proceed to the next step; C3: Check whether the sending resource status is exclusive. If so, check whether there is a sending or receiving task in progress for the current resource. If so, return the channel sending condition test failed; C4: If the sending resource status is not exclusive, check whether the current resource is in exclusive use. If so, return that the channel sending condition test has failed; C5: In C1, if the resource number is not less than the resource quantity, the channel sending condition detection is directly returned to pass.
7. A vehicle single-channel and multi-channel parallel diagnostic system, characterized in that: include: An application module is used for the diagnostic application layer to apply for resources from a resource pool, wherein the resource pool is generated through the following process: resource processing is performed on the packaged and unpacked parts of the diagnostic service according to the diagnostic ID and the channel, and then the resource pool is established by using the resourceization of the diagnostic service; The first sending module is used to send the message to be sent to the resource applied for in the application module, and the diagnostic application layer runs other tasks according to the demand and queries the resource receiving status; A second sending module, used for sending the message in the resources in the first sending module to a sending buffer; An upload module, used for uploading messages received on the bus to the resource pool; An unpacking module, used for unpacking messages received on the resource intra-bus in the resource pool; A return module, used to return the unpacked message when the diagnostic application layer queries; In the first sending module, the second sending module and the upload module, the message processing process is as follows: check whether the received driver layer message is not processed, if so, check whether the receiving ID and channel of any resource are consistent with the message, if so, fill it into the resource message receiving cache; If no driver layer message is received and not processed, check whether the resource number is less than the number of resources. If so, check whether the current resource has any cached received message that has not been processed. If so, process the received message immediately. If the resource number is not less than the resource quantity, check whether the current resource has a sending task. If so, group a frame of message and fill the message into the sending buffer.
8. The vehicle single-channel and multi-channel parallel diagnosis system according to claim 7, characterized in that: In the application module, check whether the resource number is less than the number of resources. If so, continue to determine whether the current resource's transceiver ID is consistent with the physical channel and application value. If so, write the resource information into the current resource and return the current resource number. If the resource number is not less than the number of resources, check whether there are free resources. If so, bind the free resources to the diagnostic service and return the resource number. If not, return resource application failure.
9. The vehicle single-channel and multi-channel parallel diagnosis system according to claim 7, characterized in that: When the current diagnostic service has been completed, a resource release interface is called to release it, and the diagnostic application layer confirms the release, wherein the current diagnostic service is a current single diagnostic service or all current diagnostic services.
10. The vehicle single-channel and multi-channel parallel diagnosis system according to claim 7, characterized in that: In the first sending module, the diagnostic application layer inputs the sending and receiving ID, the sending message data, the resource number and the resource mode into the sending interface; Check whether the channel sending conditions are met. If yes, check whether the channel has functional addressing and is sending. If yes, set the resource sending flag to queue state. If not, set the resource sending flag to wait for sending, and write the data, transceiver ID and resource mode to the resource. If the channel sending conditions are not met, the channel is in exclusive mode and does not support data sending.
11. The vehicle single-channel and multi-channel parallel diagnosis system according to claim 7, characterized in that: In the upload module, unpacking module and return module, check whether the resource reception is completed. If so, check whether the reception is a negative response code 78. If so, set the reception timeout T and return the received length and data. If the reception is not a negative response code 78, directly return the received length and data. If the resource reception is not completed, no reception data is returned.
12. The vehicle single-channel and multi-channel parallel diagnosis system according to claim 7, characterized in that: In the second sending module, a channel sending condition check is also included, including the following checking steps: the first step is to check whether the resource number is less than the resource quantity, if so, check whether the resource number is consistent with the requested resource number, if not, execute the next step; The second step is to check whether the resource channel is consistent with the information sending channel. If so, proceed to the next step; The third step is to check whether the sending resource status is exclusive. If so, check whether there is a sending or receiving task in progress for the current resource. If so, the return channel sending condition test fails. In the fourth step, if the sending resource status is not exclusive, check whether the current resource is exclusive. If so, return the channel sending condition test failure; in the fifth step, in the first step, if the resource number is not less than the resource quantity, directly return the channel sending condition test passed.
