A data stream reading method, device, equipment and medium
By obtaining the number of times the data stream is read and using multi-threading to allocate reading tasks, the problem of untimely data stream reading is solved, ensuring timely refresh of the data stream.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LAUNCH TECH CO LTD
- Filing Date
- 2022-12-16
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies fail to effectively distinguish between data streams of different frequencies when reading vehicle data streams, resulting in faster data streams not being read in a timely manner, which affects the overall refresh effect of the data stream.
By obtaining the target read count and actual read count for each data stream within the target time period, multi-threading is used to allocate threads to read the target data stream, ensuring that the faster-moving data streams can be refreshed in a timely manner.
It ensures that the data stream can be read in a timely manner regardless of changes in the data stream frequency, thus preventing the slow reading of a certain data stream from affecting the refresh efficiency of the entire data stream.
Smart Images

Figure CN115964168B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive diagnostics, and in particular to a data stream reading method, apparatus, device, and medium. Background Technology
[0002] Data streams are particularly important in diagnostic analysis. These streams include fault information, real-time operating parameters of the control computer, and control commands between the control computer and the diagnostic tool. Upon receiving this data, the diagnostic equipment displays it as corresponding characters and numbers according to a predetermined communication protocol. When reading multiple data streams from a vehicle using diagnostic equipment, some streams exhibit varying rates of change. These streams need to be refreshed regularly to allow the user to monitor changes.
[0003] The current solution for refreshing data streams is to send multiple request messages in a loop, but it does not differentiate between requests sent at different frequencies. This may cause a slow reading of a certain data stream to affect the refreshing of the entire data stream, and for data streams with higher frequencies, the data cannot be reflected in a timely manner.
[0004] In view of the above-mentioned technologies, finding a data stream reading method, apparatus, device and medium is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a data stream reading method, apparatus, device, and medium that allocates threads according to the refresh rate of the data stream, enabling multi-threaded reading of the data stream and effectively preventing the refresh rate of the entire data stream from being affected by the reading speed of a certain data stream.
[0006] To address the aforementioned technical problems, this application provides a data stream reading method applied to a lower-level machine, which is communicatively connected to a vehicle and diagnostic equipment. The method includes:
[0007] Within the target time period, obtain the target number of reads and the current actual number of reads for each data stream of the vehicle at the current moment;
[0008] The target data stream that needs to be read is determined by comparing the target read count with the actual read count for each data stream.
[0009] Allocate threads for the target data streams separately;
[0010] The target data stream is read using a thread.
[0011] Preferably, the target data stream to be read is determined by the target number of reads and the actual number of reads for each data stream, including:
[0012] For each data stream, if the difference between the target number of reads and the actual number of reads meets a preset condition, the data stream is determined as the target data stream.
[0013] Preferably, reading the target data stream via a thread includes:
[0014] Obtain the read command issued via the diagnostic device;
[0015] Select the read command corresponding to the data stream after thread allocation;
[0016] Read the target data stream based on the thread and the read command.
[0017] Preferably, after reading the target data stream via a thread, the method further includes:
[0018] Displays the reading results after the target data stream has been read;
[0019] Determine if a return command has been read;
[0020] If so, the read target data stream will be sent to the diagnostic device.
[0021] Preferably, the target number of reads for each data stream of the vehicle at the current time is obtained within the target time period, including:
[0022] Obtain the total number of times each data stream should be read within the target time period;
[0023] Based on the relationship between the current time and the target time period, determine the target number of reads for each data stream at the current time, where the current time is within the target time period.
[0024] Preferably, obtaining the total number of times each data stream should be read within the target time period includes:
[0025] Obtain the total number of times each data stream should be read within the target time period from the diagnostic device.
[0026] or,
[0027] Monitor the data refresh rate of each data stream, and based on a preset algorithm, determine the total number of times each data stream should be read within the target time period according to the data refresh rate.
[0028] To address the aforementioned technical problems, this application also provides a data stream reading device, comprising:
[0029] The acquisition module is used to acquire the target number of reads and the current actual number of reads for each data stream of the vehicle at the current time within the target time period;
[0030] The determination module is used to determine the target data stream that needs to be read at the moment by comparing the target number of reads with the actual number of reads for each data stream;
[0031] The allocation module is used to allocate threads for the target data stream.
[0032] The read module is used to read the target data stream via a thread.
[0033] Preferably, the target data stream to be read is determined by the target number of reads and the actual number of reads for each data stream, including:
[0034] For each data stream, if the difference between the target number of reads and the actual number of reads meets a preset condition, the data stream is determined as the target data stream.
[0035] To address the aforementioned technical problems, this application also provides a data stream reading device, including a memory for storing computer programs;
[0036] A processor is used to implement the steps of the data stream reading method described above when executing a computer program.
[0037] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the data stream reading method described above.
[0038] This application provides a data stream reading method applied to a lower-level machine, which communicates with both a vehicle and diagnostic equipment. The method first obtains the target read count and the current actual read count for each data stream of the vehicle within a target time period. It then determines the target data stream to be read based on these counts and allocates threads for each target data stream. This method uses multi-threaded reading of each data stream to ensure that data is read regardless of its speed, effectively preventing slow reading of one data stream from affecting the overall data stream refresh.
[0039] This application also provides a data stream reading device, apparatus, and medium, which correspond to the data stream reading method and thus have the same beneficial effects as the data stream reading method. Attached Figure Description
[0040] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart illustrating the data stream reading method provided in this application embodiment;
[0042] Figure 2 A structural diagram of a data stream reading device provided in another embodiment of this application;
[0043] Figure 3 This is a structural diagram of a data stream reading device provided in another embodiment of this application. Detailed Implementation
[0044] The embodiments of this application will now be described with reference to the accompanying drawings.
[0045] The core of this application is to provide a data stream reading method, apparatus, device, and medium that uses multi-threading to read the data stream, thereby avoiding the impact of the overall data stream refresh on the reading speed of a single data stream.
[0046] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] When using diagnostic equipment to read multiple data streams from a vehicle, some streams change at a high frequency while others change at a low frequency. To facilitate user monitoring of these changes, the high-frequency data streams need to be refreshed promptly. The current solution involves sending multiple messages in a loop, which introduces delays between individual messages and fails to differentiate between the different frequency changes. Sending requests uniformly results in a low overall refresh rate, and the interface only displays a refresh after all data streams have been received, failing to promptly reflect the high-frequency data streams.
[0048] The specific solution of this application is to control the number of times the data stream is read based on the frequency of data stream changes. The diagnostic device packages and sends the read command, and the lower-level machine uses multi-threading to read the data stream, ensuring that the data stream with a high frequency of change can be read in a timely manner, thereby avoiding the impact of the refresh of the entire data stream on the speed of reading a certain data stream.
[0049] It should be noted that the data stream reading method proposed in this application is applied to a lower-level machine, which is communicatively connected to both the vehicle and diagnostic equipment. The diagnostic equipment mentioned in this application can be diagnostic equipment software or other devices with diagnostic functions. Furthermore, the data stream reading method mentioned in this application can be implemented by the lower-level machine's microcontroller unit (MCU) or other types of control devices, without affecting the implementation of the technical method.
[0050] This application provides a data stream reading method applied to a lower-level machine, which is communicatively connected to both a vehicle and diagnostic equipment. Figure 1A flowchart of the data stream reading method provided in the embodiments of this application; as follows: Figure 1 As shown, the method includes the following steps:
[0051] S10: Obtain the target read count and the current actual read count for each data stream of the vehicle at the current time within the target time period.
[0052] The target time period mentioned in this embodiment refers to a specified time period that includes the current moment. Within this target time period, the target read count for each data stream of the vehicle at the current moment refers to the number of times each data stream should be read at that moment. In addition to obtaining the target read count for each data stream of the vehicle at the current moment within the target time period, this step also needs to obtain the current actual read count, which refers to the number of times each data stream of the vehicle is actually read. It is understood that in this embodiment, the target read count for each data stream and the current actual read count may not be the same. The target read count for each data stream may be greater than the actual read count, or it may be less than the actual read count, or the target read count may be equal to the actual read count.
[0053] The target read count for each data stream mentioned in this embodiment reflects the refresh rate of the data stream. Data streams with faster refresh rates have a relatively larger target read count within the target time period, while data streams with slower refresh rates have a relatively smaller target read count within the target time period. The actual read count mentioned in this embodiment refers to the number of times the data stream has been read. It can be understood that initially, the read count is set to zero, and the corresponding read count is incremented by one each time the data stream is read.
[0054] In practical implementation, the lower-level machine may include not only control devices but also storage devices. The storage device can store the target read count and the current actual read count for each data stream of the vehicle at the current moment within the target time period obtained above. It is understood that the acquisition action in this embodiment can be performed by the MCU in the lower-level machine, or by other types of controllers. The acquisition of the target read count and the current actual read count for each data stream of the vehicle at the current moment within the target time period can be real-time; that is, after the MCU or other type of controller obtains the target read count and the current actual read count for each data stream of the vehicle at the current moment within the target time period, it uploads them to the storage device in real time.
[0055] S11: Determine the target data stream to be read by comparing the target read count with the actual read count for each data stream.
[0056] In practice, the lower-level computer determines the target data stream to be read from all data streams based on the target read count and the actual read count for each data stream. For example, given four data streams A, B, C, and D, where the target read count for data stream A is currently 7, for data stream B it is 6, for data stream C it is 5, and for data stream D it is 2. The data stream to be read can be determined by the difference between the target and actual read counts. Assuming the actual read counts for all four data streams are zero, the differences between the target and actual read counts for the four data streams are 7, 6, 5, and 2, respectively. Therefore, all four data streams can be identified as target data streams to be read.
[0057] S12: Allocate threads for the target data stream.
[0058] After determining the target data stream to be read in step S11, it is necessary to allocate threads for each target data stream. In this embodiment, each thread corresponds to acquiring the data value of one target data stream. In specific implementation, the lower-level machine allocates threads for each target data stream to execute the corresponding target data stream read command.
[0059] S13: Read the target data stream via a thread.
[0060] In this embodiment, in step S12, threads are allocated for the target data streams that need to be read. The lower-level machine allocates threads to execute the corresponding read commands and read the target data streams corresponding to the vehicles.
[0061] This application provides a data stream reading method applied to a lower-level machine, which communicates with both a vehicle and diagnostic equipment. The method first obtains the target read count and the current actual read count for each data stream of the vehicle within a target time period. It then determines the target data stream to be read based on these counts and allocates threads for each target data stream, using these threads to read the target data stream. This method effectively determines the data stream to be read, ensuring that it can be read regardless of the speed of data stream changes, and effectively preventing the slow reading of one data stream from affecting the refresh of the entire data stream. By using multiple threads to read each data stream, this method greatly improves the data stream reading efficiency.
[0062] The above embodiments provide a detailed description of the data stream reading method. Based on these embodiments, as a possible implementation, the target data stream to be read is determined by the target number of reads and the actual number of reads for each data stream, including:
[0063] For each data stream, if the difference between the target number of reads and the actual number of reads meets a preset condition, the data stream is determined as the target data stream.
[0064] In practice, after obtaining the target read count and the current actual read count for each data stream of a vehicle within the target time period, the target data stream to be read is determined by comparing the target read count and the actual read count for each data stream. The method for determining the target data stream is as follows: for each data stream, it is determined whether the difference between the target read count and the actual read count for each data stream meets a preset condition. The preset condition can be that the difference between the target read count and the actual read count for a data stream is greater than a preset value. For example, if the target read counts for data streams A, B, and C at the current time are 10, 9, and 8 respectively, but the actual read counts for data streams A, B, and C are all 2, then the differences between the target read count and the actual read count for data streams A, B, and C are 8, 7, and 6 respectively. Assuming the preset value is 0, then the differences between the target read count and the actual read count for data streams A, B, and C all meet the preset condition, and data streams A, B, and C can be determined as the target data streams to be read.
[0065] As one possible implementation, the target number of reads corresponding to each data stream of the vehicle at the current moment within the target time period is obtained as follows:
[0066] Obtain the total number of times each data stream should be read within the target time period;
[0067] Based on the relationship between the current time and the target time period, determine the target number of reads for each data stream at the current time, where the current time is within the target time period.
[0068] Furthermore, obtain the total number of times each data stream should be read within the target time period, including:
[0069] Obtain the total number of times each data stream should be read within the target time period from the diagnostic device.
[0070] or,
[0071] Monitor the data refresh rate of each data stream, and based on a preset algorithm, determine the total number of times each data stream should be read within the target time period according to the data refresh rate.
[0072] In practical applications, there are two ways for the lower-level device to obtain the total number of reads for each data stream within a target time period. One is that the diagnostic equipment developers estimate the total number of reads based on the data stream's change frequency and send it directly to the lower-level device. The other is that the developers formulate a specific algorithm based on the data stream's change frequency and write it into the lower-level device. The lower-level device can then monitor the data refresh rate of each data stream and calculate the total number of reads for each data stream based on the length of the target time period. After obtaining the total number of reads for each data stream within the target time period, the lower-level device also needs to determine the target read count for each data stream at the current moment. This determination is based on the relationship between the current moment and the target time period. In essence, the target time period includes the current moment, and the target read count for the data stream at the current moment is determined based on the proportion of the current moment within the target time period.
[0073] This embodiment obtains the target read count for each data stream, determines whether the difference between the target read count and the actual read count for each data stream meets a preset condition, and if so, allocates a thread for that data stream. This achieves the goal of allocating threads for reading according to the refresh frequency of each data stream, avoiding the inability to read data streams with slow refresh frequencies in a timely manner, which would affect the refresh of the entire data stream.
[0074] The above embodiments provide a detailed description of the data stream reading method. Based on the above embodiments, as a possible implementation, reading the data stream by thread specifically includes the following steps:
[0075] Obtain the read command issued via the diagnostic device;
[0076] Select the read command corresponding to the data stream after thread allocation;
[0077] Read the target data stream based on the thread and the read command.
[0078] The diagnostic device packages the relevant data from each data stream and sends it to the lower-level machine, including read commands. The lower-level machine receives the read commands sent by the diagnostic device, selects the read command corresponding to the data stream after thread allocation, and reads the target data stream according to the thread and read command.
[0079] In this embodiment, the diagnostic device packages all data stream commands, which can reduce the number of interactions between the diagnostic device and the lower-level connector, thereby reducing the time consumption.
[0080] Furthermore, after reading the data stream according to the specified thread, this embodiment also includes:
[0081] Displays the reading results after the target data stream has been read;
[0082] Determine if a return command has been read;
[0083] If so, the read target data stream will be sent to the diagnostic device.
[0084] In practice, the diagnostic equipment organizes the reading of each data stream's sequence number and read commands based on the refresh rate of each data stream. Data streams with faster refresh rates correspond to a larger target read count. The diagnostic equipment packages the read data and sends it to the vehicle's lower-level device. The packaged data includes the read commands, the sequence number of each data stream, the target read count for each data stream, and so on. The lower-level device allocates threads to execute the read commands corresponding to each data stream based on the target read count and the actual read count, thereby reading the vehicle's corresponding data stream.
[0085] The lower-level machine uses multiple threads to read each data stream, which can effectively avoid the slow reading of a certain data stream affecting the refresh of the entire data stream. Moreover, it can display the data immediately after reading a data stream, avoiding the delay caused by waiting to read all the data streams before displaying.
[0086] In addition, it is necessary to determine whether the lower-level machine has read the vehicle's return command. After the lower-level machine reads the vehicle's return command, it sends the value of the corresponding data stream back to the diagnostic equipment for each data stream it reads.
[0087] In this embodiment, the lower-level machine sends the read data stream to the diagnostic device through the returned command, which facilitates the diagnostic device to analyze the data stream. In addition, the interaction function between the lower-level machine and the diagnostic device is also realized.
[0088] In the above embodiments, after the lower-level machine reads the return command, it needs to transmit the read data stream to the diagnostic device to realize the interaction between the diagnostic device and the lower-level machine. Based on the above embodiments, as a possible implementation, after sending the read data stream to the diagnostic device, the diagnostic device also needs to determine whether the data stream returned by the lower-level machine is consistent.
[0089] The diagnostic equipment determines whether it has received the read data stream;
[0090] If so, then determine whether the data stream to be updated is consistent with the data stream after it has been read;
[0091] If the data stream to be updated is consistent with the data stream after it has been read, then the data stream after it has been read will be used as the data stream to be updated, and the data stream to be updated will be refreshed.
[0092] If the data stream to be updated is inconsistent with the data stream that has been read, then the data stream that was last updated will be used as the data stream to be updated, and the data stream to be updated will be refreshed.
[0093] If not, proceed to the step of using the previously updated data stream as the data stream to be updated and refreshing the data stream to be updated.
[0094] In practice, the diagnostic device first determines whether it has received the data stream read by the lower-level machine. If it has, it further determines whether the data stream to be updated is consistent with the read data stream. If they are consistent, the read data stream from the lower-level machine is used as the data stream to be updated, and all data streams are refreshed. If they are inconsistent, the data stream received by the diagnostic device is not the current data stream, and the previous data stream is used, and all data streams are refreshed.
[0095] In this embodiment, the diagnostic device analyzes and judges the data stream transmitted from the lower-level machine, updates the data stream, and refreshes all data streams.
[0096] In the above embodiments, the data stream reading method has been described in detail. This application also provides embodiments corresponding to the data stream reading device. It should be noted that this application describes the embodiments of the device part from two perspectives: one is based on the functional module, and the other is based on the hardware.
[0097] From the perspective of functional modules, this application provides a data stream reading device. Figure 2 This is a structural diagram of a data stream reading device provided in another embodiment of this application; as shown. Figure 2 As shown, the device includes:
[0098] The acquisition module 10 is used to acquire the target number of reads and the current actual number of reads for each data stream of the vehicle at the current time within the target time period;
[0099] Module 11 is used to determine the target data stream that needs to be read at the moment by comparing the target number of reads with the actual number of reads for each data stream.
[0100] Allocation module 12 is used to allocate threads to the target data streams respectively;
[0101] Read module 13 is used to read the target data stream via a thread.
[0102] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0103] The data stream reading device provided in this application first acquires the target read count and the current actual read count for each data stream of a vehicle within a target time period, using module 10. Then, module 11 determines the target read count and actual read count for each data stream to identify the target data stream to be read. Allocation module 12 allocates threads to each target data stream, and reading module 13 reads the target data stream using these threads. By using multiple threads to read each data stream, it ensures that the data stream can be read regardless of its speed of change, effectively preventing the slow reading of one data stream from affecting the refresh of the entire data stream.
[0104] Figure 3 This is a structural diagram of a data stream reading device provided in another embodiment of this application; as shown below. Figure 3 As shown, the data stream reading device includes: a memory 20 for storing computer programs;
[0105] The processor 21 is used to implement the steps of the data stream reading method mentioned in the above embodiments when executing a computer program.
[0106] The data stream reading device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0107] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0108] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the data stream reading method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, data related to the data stream reading method.
[0109] In some embodiments, the data stream reading device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0110] Those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the data stream reading device and may include more or fewer components than illustrated.
[0111] The data stream reading device provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method:
[0112] First, within the target time period, the target read count and the current actual read count for each data stream of the vehicle at the current moment are obtained. The target data stream to be read is determined based on these figures, and a thread is allocated to each target data stream for reading. This method uses multiple threads to read each data stream, ensuring that data is read regardless of its speed of change, effectively preventing the slow reading of one data stream from affecting the refresh of the entire data stream.
[0113] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0114] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] The foregoing provides a detailed description of a data stream reading method, apparatus, device, and medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0116] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A data stream reading method, characterized in that, Applied to a lower-level machine, wherein the lower-level machine is communicatively connected to a vehicle and diagnostic equipment, the method includes: Within the target time period, obtain the target number of reads and the current actual number of reads for each data stream of the vehicle at the current moment; The target data stream that needs to be read is determined by the target number of reads for each data stream and the actual number of reads. Allocate threads for each of the target data streams; The target data stream is read through the thread; The target number of reads corresponding to each data stream of the vehicle at the current moment within the target time period includes: Obtain the total number of times each data stream should be read within the target time period; Based on the relationship between the current time and the target time period, the target number of reads corresponding to each data stream at the current time is determined, wherein the current time is within the target time period; The process of obtaining the total number of times each data stream should be read within the target time period includes: Obtain the total number of times each data stream should be read within the target time period from the diagnostic device. or, Monitor the data refresh frequency of each data stream, and based on a preset algorithm, determine the total number of times each data stream should be read within the target time period according to the data refresh frequency.
2. The data stream reading method according to claim 1, characterized in that, The step of determining the target data stream to be read by comparing the target read count and the actual read count for each data stream includes: For each data stream, if the difference between its target number of reads and the actual number of reads meets a preset condition, the data stream is determined as the target data stream.
3. The data stream reading method according to claim 1, characterized in that, The step of reading the target data stream through the thread includes: Obtain the read command issued via the diagnostic device; Select the read command corresponding to the data stream after thread allocation; The target data stream is read according to the thread and the read command.
4. The data stream reading method according to any one of claims 1 to 3, characterized in that, After reading the target data stream through the thread, the method further includes: Display the reading results of the target data stream after it has been read; Determine if a return command has been read; If so, the read target data stream will be sent to the diagnostic device.
5. A data stream reading device, characterized in that, include: The acquisition module is used to acquire the target number of reads and the current actual number of reads for each data stream of the vehicle at the current time within the target time period; The determination module is used to determine the target data stream that needs to be read now by comparing the target number of reads for each data stream with the actual number of reads. The allocation module is used to allocate threads to the target data streams respectively; The reading module is used to read the target data stream through the thread; Specifically, the acquisition module is used to acquire the total number of times each data stream should be read within the target time period; and to determine the target number of reads for each data stream at the current time based on the relationship between the current time and the target time period, wherein the current time is located within the target time period. The acquisition module is specifically used to acquire the total number of times each data stream should be read within a target time period from the diagnostic device; or, to monitor the data refresh frequency of each data stream and determine the total number of times each data stream should be read within a target time period based on a preset algorithm and the data refresh frequency.
6. The data stream reading device according to claim 5, characterized in that, The step of determining the target data stream to be read by comparing the target read count and the actual read count for each data stream includes: For each data stream, if the difference between its target number of reads and the actual number of reads meets a preset condition, the data stream is determined as the target data stream.
7. A data stream reading device, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the steps of the data stream reading method as described in any one of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data stream reading method as described in any one of claims 1 to 4.