A data processing method and device, electronic equipment and storage medium

CN117270923BActive Publication Date: 2026-10-30CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311245145.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2026-10-30
Estimated Expiration
2043-09-25

AI Technical Summary

Technical Problem

[0004]有鉴于此,本申请实施例提供了一种数据处理方法、装置、电子设备及存储介质,以解决现有技术中,OTA主控单元不能及时处理ECU件返回的数据信息,导致数据信息丢失的问题

Benefits of technology

[0009]本申请实施例与现有技术相比存在的有益效果是:本申请实施例中若与主控单元连接的通信服务端接收到预设格式的数据信息,则获取与主控单元连接的电控单元;根据每一电控单元的信息,生成每一电控单元对应的客户端,并在主控单元内生成每一客户端对应的缓冲区,电控单元对应的客户端用于处理电控单元对应的数据信息;将数据信息传输到每一缓冲区,使得每一客户端从对应的缓冲区读取数据信息,对数据信息进行识别,并根据识别结果对数据信息进行处理,其中,通过为每一电控单元设置对应的客户端,每一客户端均从对应的缓冲区读取数据信息,提升了数据读取速度,避免了OTA主控单元不能及时处理ECU件返回的数据信息,导致数据信息丢失的问题;此外避免了多个电控单元从同一缓冲区读取数据,导致读取速度过慢、效率低下、耗费大量时间,不能满足OTA实时性要求的问题;此外,避免了由于多个客户端从同一缓冲区读取数据,导致数据信息读取效率低下,导致需要额外设置“暂存缓冲区”来放置数据信息,使得内存开销进一步增大的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117270923B_ABST
    Figure CN117270923B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, and provides a data processing method and device, electronic equipment and a storage medium. In the method, if a communication server connected with a master control unit receives data information in a preset format, an electric control unit connected with the master control unit is acquired; a client corresponding to each electric control unit is generated according to the information of each electric control unit, and a buffer area corresponding to each client is generated in the master control unit; the client corresponding to the electric control unit is used for processing data information corresponding to the electric control unit; the data information is transmitted to each buffer area, so that each client reads the data information from the corresponding buffer area, identifies the data information, and processes the data information according to the identification result. Through the arrangement of the corresponding client for each electric control unit, each client reads the data information from the corresponding buffer area, the data reading speed is improved, and the problem that data information cannot be processed in time and the data information is lost is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, apparatus, electronic device and storage medium. Background Technology

[0002] With the increasing number of vehicles and the continuous development of computer and network technologies, people have higher and higher requirements for vehicle intelligence and safety, leading to increasingly intelligent and multimedia-enabled vehicles. Current vehicles often deploy various hardware and software applications, such as smart cockpits, sensing systems, autonomous driving systems, and in-vehicle operating systems, navigation applications, and audio-visual playback applications. While these hardware and software components enrich vehicle functionality, they are also more prone to vulnerabilities or require replacement with more advanced versions. Therefore, it is necessary to upgrade and update the vehicle's electronic control unit (ECU).

[0003] During software updates, vehicles can download upgrade packages from OTA (Over-The-Air) upgrade servers and update ECUs using these packages. Currently, during the OTA master control unit's upgrade and flashing process for each ECU, each ECU also needs to provide real-time updates on its upgrade progress and current status to the OTA master control unit for policy control. Since the timing of each ECU's response to the OTA master control unit is random, and the data may be multiple messages, if the OTA master control unit processes the data returned by the ECUs one by one, it can lead to untimely data processing or data blockage, resulting in data loss. Summary of the Invention

[0004] In view of this, embodiments of this application provide a data processing method, apparatus, electronic device, and storage medium to solve the problem in the prior art where the OTA master control unit cannot process the data information returned by the ECU in a timely manner, resulting in data loss.

[0005] A first aspect of this application provides a data processing method, comprising: if a communication server connected to a main control unit receives data information, then acquiring an electronic control unit connected to the communication server; generating a client corresponding to each electronic control unit based on information of each electronic control unit, and generating a buffer corresponding to each client within the main control unit, wherein the client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit; transmitting the data information to each buffer, such that each client reads the data information from the corresponding buffer, identifies the data information, and processes the data information based on the obtained identification result.

[0006] A second aspect of this application provides a data processing apparatus, comprising: an acquisition module for acquiring an electronic control unit connected to a main control unit; a generation module for generating a client corresponding to each electronic control unit based on information of each electronic control unit, and generating a buffer corresponding to each client within the main control unit, wherein the client corresponding to the electronic control unit is used to process data information corresponding to the electronic control unit; and a processing module for transmitting data information to each buffer, such that each client reads data information from the corresponding buffer, identifies the data information, and processes the data information based on the identification result.

[0007] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.

[0008] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.

[0009] The beneficial effects of this application embodiment compared with the prior art are as follows: In this application embodiment, if the communication server connected to the main control unit receives data information in a preset format, it obtains the electronic control unit connected to the main control unit; according to the information of each electronic control unit, a client corresponding to each electronic control unit is generated, and a buffer corresponding to each client is generated in the main control unit. The client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit; the data information is transmitted to each buffer, so that each client reads the data information from the corresponding buffer, identifies the data information, and processes the data information according to the identification result. In this way, by setting a corresponding client for each electronic control unit, each client reads the data information from the corresponding buffer, which improves the data reading speed and avoids the problem that the OTA main control unit cannot process the data information returned by the ECU in time, resulting in data loss; in addition, it avoids the problem that multiple electronic control units read data from the same buffer, resulting in slow reading speed, low efficiency, and a lot of time consumption, which cannot meet the real-time requirements of OTA; furthermore, it avoids the problem that the data information reading efficiency is low due to multiple clients reading data from the same buffer, which requires setting up an additional "temporary buffer" to place the data information, further increasing the memory overhead. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art 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.

[0011] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0012] Figure 2 This is a flowchart illustrating another data processing method provided in an embodiment of this application;

[0013] Figure 3 This is a flowchart illustrating another data processing method provided in an embodiment of this application;

[0014] Figure 4 This is a basic schematic diagram of a communication client set up within a main control unit, as provided in an embodiment of this application.

[0015] Figure 5 This is a flowchart illustrating another data processing method provided in an embodiment of this application;

[0016] Figure 6 This is a basic schematic diagram of another example of setting up a communication client within a main control unit, provided in an embodiment of this application;

[0017] Figure 7 This is a flowchart illustrating another optional data processing method provided in an embodiment of this application;

[0018] Figure 8 This is a flowchart illustrating another optional data processing method provided in an embodiment of this application;

[0019] Figure 9 This is a flowchart illustrating another optional data processing method provided in an embodiment of this application;

[0020] Figure 10 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0021] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0022] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0023] A data processing method and apparatus according to an embodiment of this application will now be described in detail with reference to the accompanying drawings.

[0024] Figure 1 This application provides a data processing method, such as... Figure 1 As shown, the method includes:

[0025] S101. If the communication server connected to the main control unit receives data information, then obtain the electronic control unit connected to the main control unit.

[0026] S102. Based on the information of each electronic control unit, generate a client corresponding to each electronic control unit, and generate a buffer corresponding to each client in the main control unit. The client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit.

[0027] S103. Transmit the data information to each buffer, so that each client reads the data information from the corresponding buffer, identifies the data information, and processes the data information according to the identification result.

[0028] It is understood that the data processing method provided in this example is applied to the OTA master control unit installed in the vehicle. The aforementioned vehicles include vehicles with autonomous or intelligent driving capabilities (including passenger vehicles (such as cars, buses, coaches, minibuses, etc.), cargo vehicles (such as ordinary trucks, box trucks, trailer trucks, enclosed trucks, tank trucks, flatbed trucks, container trucks, dump trucks, special structure trucks), special vehicles (such as logistics delivery vehicles, automated guided vehicles (AGVs), patrol vehicles, cranes, excavators, bulldozers, loaders, road rollers, off-road engineering vehicles, armored engineering vehicles, sewage treatment vehicles, sanitation vehicles, vacuum trucks, floor scrubbers, water sprinkler trucks, sweeping robots, food delivery robots, shopping guide robots, lawnmowers, golf carts, etc.), vehicles with entertainment functions (such as amusement vehicles, amusement park autonomous driving devices, balance bikes, etc.), and rescue vehicles (such as fire trucks, ambulances, power repair vehicles, engineering emergency rescue vehicles, etc.)).

[0029] It is understood that the aforementioned vehicles are equipped with OTA technology to achieve the purpose of downloading OTA upgrade packages and upgrading and rewriting electronic control units (ECUs). This OTA technology includes: an OTA master control unit (UMC), an OTA upgrade agent (UA), and an OTA upgrade slave controller (US). The OTA master control unit is implemented in the vehicle's VBOX, the OTA upgrade agent (UA) is implemented in the VGW (vehicle gateway), and the OTA upgrade slave controller (US) is implemented in the ECU being upgraded. It is understood that there is a communication connection between the VBOX and the VGW, for example, the VBOX and VGW are connected via a 100M / 1000M Ethernet; the VGW is also connected to the ECUs, for example, the VGW is connected to its subordinate ECUs via a 100M / 1000M Ethernet cable or a CAN bus, and one or more ECUs are connected to it. The VBOX carrying the OTA master control unit communicates with the VGW via Ethernet (DOIP protocol) messages. The DOIP message data field defines the ECU source address and destination address. In some examples, the above DOIP message also contains the CLIENT ID, that is, the DOIP message also contains the client identifier.

[0030] Specifically, in step S101, the main control unit determines whether the communication server connected to the main control unit has received data information in a preset format. If the communication server has received data information, then the main control unit is identified as the connected electronic control unit. It is understood that if the data information conforms to the preset format, it indicates that the data information is a response from any electronic control unit based on the upgrade progress and / or current status. It is also understood that when the communication server receives data information in the preset format, the main control unit cannot determine which electronic control unit sent the data information; therefore, the main control unit will identify the connected electronic control unit. In step S102, a corresponding client is set up for each electronic control unit. For example, the main control unit is connected to a communication server, and the communication server is connected to three electronic control units A, B, and C. When the communication server receives data information in a preset format, the main control unit cannot determine whether the data information was sent by electronic control unit A, B, or C. Therefore, the main control unit needs to generate a client corresponding to each electronic control unit based on the information of each electronic control unit, and then use the client to identify and process the data information. For example, the main control unit generates a corresponding client for each electronic control unit based on the identification information of the electronic control unit.

[0031] Continuing from the previous example, it is understandable that the client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit. For example, the client corresponding to electronic control unit A is used to process the data information sent by electronic control unit A, and the client corresponding to electronic control unit B is used to process the data information sent by electronic control unit B. However, client A cannot process the data information sent by electronic control unit B.

[0032] In some examples, since the response times of each ECU to the OTA master control unit are random, and the data may be multiple, if the OTA master control unit processes the data returned by the ECUs one by one, it will lead to untimely data processing or blockage, resulting in data loss. Therefore, to avoid data loss, after setting up a corresponding client for each ECU, the master control unit will also generate a buffer for each client within the master control unit. For example, the master control unit sets up a corresponding client A for ECU A and a corresponding client B for ECU B. Then, the master control unit sets up a corresponding buffer A for client A and a corresponding buffer B for client B. Subsequently, client A reads data from buffer A, and client B reads data from buffer B. This avoids the problem of multiple clients corresponding to multiple ECUs reading data from the same buffer, which leads to slow reading speed, low efficiency, and excessive time consumption, failing to meet the real-time requirements of OTA. In addition, it avoids the problem of low data reading efficiency caused by multiple clients reading data from the same buffer, which requires setting up an additional "temporary buffer" to store data, further increasing memory overhead.

[0033] Understandably, in some examples, the buffer generated above is a circular buffer. A circular buffer is characterized by its starting and ending points being connected, forming a ring structure. A key feature of a circular buffer is that reading and writing can be separated; data can be written but not immediately read, and only read when needed. Furthermore, once data is read, it cannot be read again, essentially a one-time read. A circular buffer creates a circular space in memory, allowing new data to overwrite old data when the buffer is full, thus achieving efficient memory utilization. By maintaining a head pointer and a tail pointer, data read and write operations can be performed quickly.

[0034] In some examples, the main control unit generates a client corresponding to each electronic control unit based on the information of each electronic control unit, and generates a buffer corresponding to each client within the main control unit. Since the main control unit does not know the electronic control unit corresponding to the data information, nor does it know which electronic control unit's client should process the data information, the main control unit will transmit the data information to each buffer, so that each client can obtain the aforementioned data information.

[0035] Continuing the previous example, consider an electronic control unit (ECU) connected to a communication server, comprising three ECUs: A, B, and C. ECU A corresponds to buffer A and client A, ECU B corresponds to buffer B and client B, and ECU C corresponds to buffer C and client C. When the main control unit learns that the communication server has received data, it establishes buffers A, B, and C and transmits the data to them. This allows client A to retrieve the data from buffer A, client B to retrieve the data from buffer B, and client C to retrieve the data from buffer C. Each client reads data from its corresponding buffer, improving data reading speed and avoiding the problems of slow reading speed, low efficiency, and excessive time consumption caused by multiple ECUs reading data from the same buffer, which fails to meet OTA real-time requirements. Furthermore, it avoids the inefficiency of data reading caused by multiple clients reading data from the same buffer, which necessitates setting up additional "temporary buffers" to store data, further increasing memory overhead.

[0036] It is understandable that after the client reads data from the corresponding buffer, it will further identify the data and process it according to the identification results. This avoids the problem of each client directly processing the data, resulting in invalid processing due to abnormal data or / or data mismatch with the current client, which would waste system resources.

[0037] According to the technical solution provided in this application embodiment, if the communication server connected to the main control unit receives data information in a preset format, it obtains the electronic control unit connected to the main control unit; based on the information of each electronic control unit, a client corresponding to each electronic control unit is generated, and a buffer corresponding to each client is generated in the main control unit. The client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit; the data information is transmitted to each buffer, so that each client reads the data information from the corresponding buffer, identifies the data information, and processes the data information according to the identification result. In this way, by setting a corresponding client for each electronic control unit, each client reads the data information from the corresponding buffer, which improves the data reading speed and avoids the problem that the OTA main control unit cannot process the data information returned by the ECU in time, resulting in data loss; in addition, it avoids the problem that multiple electronic control units read data from the same buffer, resulting in slow reading speed, low efficiency, and a lot of time consumption, which cannot meet the real-time requirements of OTA; furthermore, it avoids the problem that multiple clients read data from the same buffer, resulting in low data information reading efficiency, which requires setting up an additional "temporary buffer" to store the data information, further increasing memory overhead.

[0038] In some embodiments, such as Figure 2 As shown, before generating the buffer corresponding to each client within the main control unit, the method further includes:

[0039] S201. Obtain the average data length and average data volume of the data received by the communication server;

[0040] S202. Determine the data length of each buffer based on the average data length and average data volume.

[0041] Specifically, the average data length and average data volume received by the communication server are first obtained. It's understood that the data received by the communication server originates from ECUs (Electronic Control Units). Therefore, the average data length received by the communication server characterizes the average data length of the ECU's data information. After obtaining the average data length, the average data volume is then obtained. Finally, based on the average data length and average data volume, the data length of each buffer is calculated. This ensures that the buffer can accommodate the data information transmitted by the communication server, preventing data overwriting and functional abnormalities caused by a small buffer and insufficient cached data volume, which would prevent the client from reading data from the buffer in a timely manner. The calculation formula is as follows:

[0042] S = C * N;

[0043] Where S is the data length of each buffer, C is the average data length, and N is the average data volume. The size of the buffer is determined by the average data length and average data volume, ensuring that the buffer can accommodate the data transmitted by the communication server and avoid the aforementioned problems. It is understood that the average data volume is determined based on the average data length and the total amount of data received per unit time. For example, if the total amount of data received per unit time is X, and the average data length is y, a value is obtained by dividing X by Y. This value is then compared with preset threshold ranges (including: 0-16; 16-32; 32-64; 64-128, etc.). The average data volume is then determined based on the preset threshold range. For example, if X / Y is in the range of 16-32, then 32 is used as the average data volume; and if X / Y is in the range of 32-64, then 64 is used as the average data volume.

[0044] Continuing with the previous example, taking a circular buffer as an example, and assuming that the average data length of the ECU's data information (response message) is 4096 bytes, those skilled in the art will know that the data length of the circular buffer is a multiple of 4096 bytes. If the average data volume of the communication server is determined to be 32, then the data length of the circular buffer is: 4096 bytes * 32 = 128 Kbytes.

[0045] It is understandable that the data length of the buffer determined above refers to the data length of all buffers. For example, if the data length of the buffer is determined to be 128Kbytes, and there are currently three buffers A, B, and C, then the data length of buffer A is 128Kbytes, the data length of buffer B is 128Kbytes, and the data length of buffer C is also 128Kbytes. This ensures that each buffer can accommodate the data information transmitted by the communication server, avoiding the problem of data loss caused by setting a buffer too small and being unable to accommodate the data information transmitted by the communication server.

[0046] According to the technical solution provided in the embodiments of this application, the average data length and average data volume of the data received by the communication server are obtained; based on the average data length and average data volume, the data length of each buffer is determined so that each buffer can accommodate the data information transmitted by the communication server, ensuring the integrity of the data information and avoiding data overwriting and functional abnormalities caused by the client being unable to read the data information from the buffer in a timely manner due to the buffer being too small and the cached data volume being too low.

[0047] In some embodiments, such as Figure 3 As shown, data information is transmitted to each buffer, including:

[0048] S301, Receive data information transmitted by the communication server through the communication client set in the main control unit;

[0049] S302. Establish a communication channel between the communication client and each buffer, and broadcast data information to the buffer connected to the communication client through the communication client.

[0050] Specifically, such as Figure 4 As shown, the main control unit is equipped with a communication client. The main control unit receives data information transmitted by the communication server through the communication client. It can be understood that a communication channel (socket) can be established between the communication server and the communication client, and the communication server can transmit data information to the communication client through the socket.

[0051] In some examples, such as Figure 4 As shown, when there is only one client in the main control unit, the main control unit establishes a communication channel (socket) between the communication client and each buffer, thereby realizing the communication connection between the communication client and each buffer. After the communication connection is established, the main control unit broadcasts the received data information to each buffer through the communication client, so that each buffer can receive the data information.

[0052] In some examples, the communication client can know whether the buffer has successfully received the data information. If the communication client knows that any buffer has failed to receive the data information, the main control unit will control the communication client to retransmit the data information, thereby ensuring that each buffer can successfully receive the data information, ensuring the integrity of the data information, and avoiding the problem of data abnormality and functional abnormality caused by the buffer failing to successfully obtain the data information.

[0053] According to the technical solution provided in the embodiments of this application, data information transmitted by the communication server is received through a communication client set in the main control unit; a communication channel is established between the communication client and each buffer, and the data information is broadcast to the buffer connected to the communication client through the communication client.

[0054] In some examples, the master control unit has at least two communication clients, such as Figure 5 As shown, a communication channel is established between the communication client and each buffer, and data information is transmitted to the buffer connected to the communication client through the communication client, including:

[0055] S501. Determine the communication client corresponding to each buffer and establish a communication channel between each buffer and its corresponding communication client;

[0056] S502. Broadcast data information to each buffer through the corresponding communication client.

[0057] Specifically, when at least two communication clients are set in the main control unit, it is necessary to further determine the communication client corresponding to each buffer. It is understood that each buffer can only correspond to one communication client, and one communication client can correspond to N buffers. For example, there are two communication clients, namely the first communication client and the second communication client, and four buffers A, B, and D. If buffers A and B correspond to the first communication client, and buffers C and D correspond to the second communication client, then a communication channel is established between buffer A and the first communication client, a communication channel is established between buffer B and the first communication client, a communication channel is established between buffer C and the second communication client, and a communication channel is established between buffer D and the second communication client.

[0058] It is understandable that when at least two communication clients are configured within the main control unit, both clients receive data from the communication server, and the data received by both clients from the communication server is identical. It is also understandable that a communication channel (socket) can be established between the communication server and each client, allowing the communication server to transmit data to each client via the socket.

[0059] like Figure 6 As shown, the main control unit is equipped with at least two communication clients. Each communication client establishes a communication channel with the corresponding buffer. After the communication connection is established, the main control unit broadcasts the received data information to the corresponding buffer through the communication client, so that each buffer can receive the data information.

[0060] According to the technical solution provided in the embodiments of this application, a communication client corresponding to each buffer is determined, and a communication channel is established between each buffer and its corresponding communication client. Data information is broadcast to each buffer through the communication client corresponding to each buffer. By setting at least two communication clients and receiving data information through the two communication clients and transmitting the data information to the corresponding buffer, the data broadcasting pressure of the buffer is reduced, avoiding the situation where the communication client is under too much pressure and data broadcasting is abnormal, thus further ensuring the integrity and security of the data information.

[0061] In some examples, such as Figure 7 As shown, before obtaining the electronic control unit connected to the main control unit, the method further includes:

[0062] S701, Determine the current status of the vehicle;

[0063] S702. If the current state of the vehicle matches the target state, then obtain the electronic control unit connected to the main control unit.

[0064] Specifically, it is understandable that, in order to avoid the situation where the data information received by the communication server is the data information mistakenly sent by the electronic control unit, resulting in invalid processing, the data processing method provided in this example will further determine the current state of the vehicle when it is determined that the communication server connected to the main control unit has received the data information.

[0065] It is understandable that the vehicle's status includes an upgraded state and a non-upgraded state. The target state is the upgraded state. That is, if the current vehicle status is upgraded, it means that the electronic control unit (ECU) has returned data information and has not sent false information. Therefore, the step of obtaining the ECU connected to the main control unit is executed. Conversely, if the current vehicle status is non-upgraded, the ECU has not entered the upgrade state. In this case, it will not return upgrade progress or other response information, indicating that the ECU has sent false data information. Therefore, the step of obtaining the ECU connected to the main control unit will not be executed.

[0066] Understandably, in some examples, if the communication server connected to the main control unit receives data information, it can directly execute the step of obtaining the electronic control unit connected to the main control unit without needing to further obtain the current vehicle status.

[0067] According to the technical solution provided in the embodiments of this application, the current state of the current vehicle is determined; if the current state of the current vehicle matches the target state, the electronic control unit connected to the main control unit is obtained, which realizes the preliminary verification of the validity of the data information, avoids the situation where the data information received by the communication server is the data information mistakenly sent by the electronic control unit, resulting in invalid processing in the future, and saves system resources.

[0068] In some examples, such as Figure 8 As shown, the data information is identified, and the data information is processed based on the identification results, including:

[0069] S801. Determine the client identifier contained in the data information, and identify the data information based on the client identifier;

[0070] S802. If the identification result of the data information is that the data information corresponds to the data of the current client, then the data information is processed through the current client.

[0071] Specifically, the data information includes CLIENT (client) ID, that is, the data information contains a client identifier: after each client reads the data information from the cache, it will parse the data information to obtain the client identifier carried in the data information, and then match the client identifier with itself to realize the identification of the data information.

[0072] Continuing the previous example, if the data identification result indicates that the data corresponds to the current client, then the data is processed through the current client. Conversely, if the data identification result indicates that the data does not correspond to the current client, then the data is discarded. Specifically, if the client identifier is the same as its own identifier, it means that the data identification result indicates that the data corresponds to the current client, and the data is processed through the current client. Conversely, if the client identifier is different from its own identifier, it means that the data identification result indicates that the data does not correspond to the current client, and the data is discarded.

[0073] For example, there are three clients, A, B, and C. Each client reads data from its corresponding buffer, and the client identifier carried in the data is the same as the client identifier for client A. When client A parses the data and obtains the client identifier, it further processes the data based on the data carried in the data. When client B parses the data and obtains the client identifier, it discards the data directly. Similarly, when client C parses the data and obtains the client identifier, it discards the data directly.

[0074] According to the technical solution provided in the embodiments of this application, by determining the client identifier contained in the data information, the data information is identified based on the client identifier; if the identification result of the data information is that the data information is the data corresponding to the current client, the data information is processed by the current client, so that each client only processes the corresponding data information, avoiding the waste of system resources caused by invalid processing due to each client processing all data information, and saving system resources.

[0075] In some examples, such as Figure 9 As shown, the method also includes:

[0076] S901. Determine whether the data information processing is complete;

[0077] S902. If the data information processing is completed, delete the client corresponding to each electronic control unit and delete the buffer corresponding to each client.

[0078] Specifically, after all data information has been processed and there is no data information in each buffer, all clients are deleted directly, and all buffers are also deleted to release memory space and achieve the effect of saving memory space.

[0079] It is understandable that if the data information is not fully processed, the client corresponding to each electronic control unit will not be deleted, nor will the buffer corresponding to each client be deleted.

[0080] According to the technical solution provided in the embodiments of this application, by determining whether the data information has been processed; if the data information has been processed, the client corresponding to each electronic control unit is deleted, and the buffer corresponding to each client is deleted, thus releasing memory space and achieving the effect of saving memory space.

[0081] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0082] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0083] This embodiment also provides a data processing device, such as... Figure 10 As shown, the device includes:

[0084] Acquisition module 1001 is used to acquire the electronic control unit connected to the main control unit;

[0085] The generation module 1002 is used to generate a client corresponding to each electronic control unit based on the information of each electronic control unit, and to generate a buffer corresponding to each client in the main control unit. The client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit.

[0086] The processing module 1003 is used to transmit data information to each buffer, enabling each client to read data information from the corresponding buffer, identify the data information, and process the data information based on the identification results.

[0087] In some examples, the generation module 1002 is also used to obtain the average data length and average data volume of the data received by the communication server; and to determine the data length of each buffer based on the average data length and average data volume.

[0088] In some examples, the processing module 1003 is also used to receive data information transmitted by the communication server through the communication client set in the main control unit; establish a communication channel between the communication client and each buffer; and broadcast the data information to the buffer connected to the communication client through the communication client.

[0089] In some examples, the main control unit is equipped with at least two communication clients; the processing module 1003 is also used to determine the communication client corresponding to each buffer and establish a communication channel between each buffer and the corresponding communication client; and broadcast data information to each buffer through the communication client corresponding to each buffer.

[0090] In some examples, the processing module 1003 is also used to determine the current state of the current vehicle; if the current state of the current vehicle matches the target state, the electronic control unit connected to the main control unit is obtained.

[0091] In some examples, the processing module 1003 is also used to determine the client identifier contained in the data information, and to identify the data information based on the client identifier; if the identification result of the data information is that the data information is the data corresponding to the current client, then the data information is processed through the current client.

[0092] In some examples, the processing module 1003 is also used to determine whether the data information has been processed; if the data information has been processed, the client corresponding to each electronic control unit is deleted, and the buffer corresponding to each client is deleted.

[0093] According to the technical solution provided in the embodiments of this application, the data processing device provided in this embodiment obtains the electronic control unit (ECU) connected to the main control unit; generates a client corresponding to each ECU based on the information of each ECU, and generates a buffer corresponding to each client within the main control unit. The client corresponding to each ECU is used to process the data information corresponding to the ECU; transmits the data information to each buffer, so that each client reads the data information from the corresponding buffer, identifies the data information, and processes the data information according to the identification result. In this way, by setting a corresponding client for each ECU, each client reads the data information from the corresponding buffer, which improves the data reading speed and avoids the problem that the OTA main control unit cannot process the data information returned by the ECU in time, resulting in data loss. In addition, it avoids the problem that multiple ECUs read data from the same buffer, resulting in slow reading speed, low efficiency, and a lot of time consumption, which cannot meet the real-time requirements of OTA. Furthermore, it avoids the problem that multiple clients read data from the same buffer, resulting in low data information reading efficiency, which requires setting up an additional "temporary buffer" to store the data information, further increasing memory overhead.

[0094] Figure 11 This is a schematic diagram of the electronic device 11 provided in an embodiment of this application. Figure 11 As shown, the electronic device 11 of this embodiment includes: a processor 1101, a memory 1102, and a computer program 1103 stored in the memory 1102 and executable on the processor 1101. When the processor 1101 executes the computer program 1103, it implements the steps in the various method embodiments described above. Alternatively, when the processor 1101 executes the computer program 1103, it implements the functions of each module / unit in the various device embodiments described above.

[0095] Electronic device 11 may be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 11 may include, but is not limited to, processor 1101 and memory 1102. Those skilled in the art will understand that... Figure 11 This is merely an example of electronic device 11 and does not constitute a limitation on electronic device 11. It may include more or fewer components than shown, or different components.

[0096] The processor 1101 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0097] The memory 1102 can be an internal storage unit of the electronic device 11, such as a hard disk or RAM of the electronic device 11. The memory 1102 can also be an external storage device of the electronic device 11, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, FlashCard, etc., equipped on the electronic device 11. The memory 1102 can also include both internal and external storage units of the electronic device 11. The memory 1102 is used to store computer programs and other programs and data required by the electronic device.

[0098] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0099] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium can be appropriately added or removed according to regional requirements and patent practice requirements. For example, in some regions, according to regional requirements and patent practice, a computer-readable medium may not include electrical carrier signals and telecommunication signals.

[0100] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A data processing method, characterized in that, The method includes: If the communication server connected to the main control unit receives data information, then the electronic control unit connected to the communication server is obtained; Based on the information of each electronic control unit, a client corresponding to each electronic control unit is generated, and a buffer corresponding to each client is generated in the main control unit. The client corresponding to the electronic control unit is used to process the data information corresponding to the electronic control unit. The data information is transmitted to each of the buffers, so that each client reads the data information from the corresponding buffer, identifies the data information, and processes the data information according to the identification result. Transmitting the data information to each of the buffers includes: receiving the data information transmitted by the communication server through a communication client set in the main control unit; establishing a communication channel between the communication client and each of the buffers; and broadcasting the data information to the buffers connected to the communication client through the communication client. The process of identifying the data information and processing the data information based on the identification result includes: determining the electronic control unit corresponding to the current client, identifying the data information based on the electronic control unit corresponding to the current client; and if the identification result of the data information indicates that the data information is data corresponding to the current client, then processing the data information through the current client.

2. The method according to claim 1, characterized in that, Before generating the buffer corresponding to each client within the main control unit, the method further includes: Obtain the average data length and average data volume of the data received by the communication server; The data length of each buffer is determined based on the average data length and the average data volume.

3. The method according to claim 2, characterized in that, The main control unit is equipped with at least two communication clients; a communication channel is established between the communication clients and each buffer, and the data information is transmitted to the buffer connected to the communication client through the communication client, including: Determine the communication client corresponding to each buffer, and establish a communication channel for each buffer and its corresponding communication client; The data information is broadcast to each of the buffers by means of the communication client corresponding to each of the buffers.

4. The method according to claim 1, characterized in that, Before acquiring the electronic control unit connected to the main control unit, the method further includes: Determine the current state of the vehicle. If the current state of the current vehicle matches the target state, then the electronic control unit connected to the main control unit is acquired.

5. The method according to claim 1, characterized in that, The method further includes: Determine whether the data information has been processed completely; If the data information processing is completed, then delete the client corresponding to each of the electronic control units and delete the buffer corresponding to each of the clients.

6. A data processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire information about the electronic control units connected to the main control unit. The generation module is used to generate a client corresponding to each electronic control unit based on the information of each electronic control unit, and to generate a buffer corresponding to each client in the main control unit. The client corresponding to each electronic control unit is used to process the data information corresponding to the electronic control unit. The processing module is configured to transmit the data information to each of the buffers, enabling each client to read the data information from the corresponding buffer, identify the data information, and process the data information based on the identification result. Transmitting the data information to each buffer includes: receiving data information transmitted by a communication server through a communication client configured within the main control unit; establishing a communication channel between the communication client and each buffer, and broadcasting the data information to the buffer connected to the communication client through the communication client; identifying the data information and processing it based on the identification result includes: determining the electronic control unit corresponding to the current client, identifying the data information based on the electronic control unit corresponding to the current client; if the identification result indicates that the data information corresponds to the current client, then processing the data information through the current client.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-ECU parallel flashing method, device and system and storage medium

    CN116382744A

  • Communication method of vehicle-mounted network and vehicle-mounted network

    CN116506828A