Data parsing optimization method, device, system and storage medium

By determining the fields that need to be assigned in the class entity object and storing data values using the buffer, the problem of low parsing efficiency caused by the large amount of proto data is solved, and a more efficient data parsing process is achieved.

CN116088859BActive Publication Date: 2025-08-15CHONGQING CHANGAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310168031.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2025-08-15
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

Because the proto data volume is large, and the entity object of the class does not require the data values of all fields, the process of looping through the proto data takes a lot of time, which seriously reduces the data parsing efficiency.

Method used

By looping through the class entity object, determining the field that needs to be assigned, obtaining the position information of the field, and obtaining the data value based on the position information, using the buffer to store the data value obtained for the first time, and directly reading the subsequent data value from the buffer, avoiding traversing all proto file format data.

Benefits of technology

It reduces the complexity of the assignment of a single field, reduces the time-consuming process of assignment, and improves the efficiency of the data analysis process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116088859B_ABST
    Figure CN116088859B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of data parsing technology, and provides a data parsing optimization method, device, system and storage medium. The data parsing optimization method includes: obtaining proto file format data to be processed and a class entity object that needs to be assigned a value locally on the vehicle side; looping through the class entity object to determine all fields in the class entity object that need to be assigned a value; obtaining the location information of the data value corresponding to the field from the proto file format data according to the field; obtaining the data value corresponding to the location information according to the location information; and assigning the data value to the corresponding field in the class entity object. When obtaining a data value, the method in the present application only needs to traverse the class entity object instead of all the proto file format data, and when it is not the first time to obtain the data, it can be directly obtained from the cache, which reduces the complexity of assigning a single field, thereby reducing the time consumption of the assignment process and improving the efficiency of the entire parsing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data analysis technology, and specifically relates to a data analysis optimization method, device, system and storage medium. Background Art

[0002] With the rapid development of automobiles in recent years, the pursuit of vehicle safety and reliability has become increasingly stringent. Consequently, intelligent driving assistance systems have emerged. These systems utilize a variety of sensors installed on vehicles to acquire environmental data both inside and outside the vehicle, and then perform a series of processing and analysis on this data to assist the driver in driving safely.

[0003] After collecting environmental data through sensors, vehicles usually need to use visualization tools to parse the binary data transmitted to the vehicle through the communication protocol framework into local specific class entity objects. In the traditional data parsing process, the binary data needs to be processed into intermediate proto data first, and then all proto data needs to be traversed and recursively analyzed to find the data values of all fields in the corresponding local class entity object. Finally, the data values are assigned to the corresponding fields in the class entity object. However, since the amount of proto data is usually large, and the class entity object does not require the data values of all fields in the proto data, the process of traversing the proto data requires a lot of time. In addition, each subsequent addition of proto data requires traversing all proto data, which seriously reduces the efficiency of data parsing. Summary of the Invention

[0004] The purpose of the present invention is to provide a data parsing optimization method, device, system and storage medium to solve the problem pointed out in the background technology that, since the amount of proto data is usually large and the class entity object does not require the data values of all fields in the proto data, the process of looping through the proto data takes a long time, which seriously reduces the data parsing efficiency.

[0005] In order to achieve the above technical objectives, the technical solutions adopted by the present invention are as follows:

[0006] In a first aspect, a data analysis and optimization method is provided, the data analysis and optimization method comprising:

[0007] Obtain the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side;

[0008] Loop through the class entity objects to determine all fields in the class entity objects that need to be assigned values;

[0009] According to the field, obtain the location information of the data value corresponding to the field from the proto file format data;

[0010] According to the location information, obtaining the data value corresponding to the location information;

[0011] Assign the data value to the corresponding field in the class entity object.

[0012] In conjunction with the first aspect, before the step of acquiring a data value corresponding to the location information according to the location information, the data analysis and optimization method further includes:

[0013] Determine whether the position information and the data value corresponding to the position information have been stored in the cache. If the position information and the data value corresponding to the position information are not stored in the cache, store the position information and the data value corresponding to the position information in the cache before executing the next step. If the position information and the data value corresponding to the position information have been pre-stored in the cache, directly execute the next step.

[0014] In conjunction with the first aspect, in the step of obtaining the data value corresponding to the position information according to the position information:

[0015] If the position information and the data value corresponding to the position information are stored in the buffer after being determined not to be stored in the buffer, the data value corresponding to the position information is read from the proto file format data / the buffer;

[0016] If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the data value corresponding to the position information is directly read from the buffer.

[0017] In combination with the first aspect, before the step of obtaining the proto file format data to be processed and the class entity object that needs to be assigned locally, the data parsing optimization method further includes:

[0018] Obtain binary data transmitted from the outside to the vehicle;

[0019] Deserialize the binary data into proto file format data to be processed.

[0020] In a second aspect, a data analysis and optimization device is provided, the data analysis and optimization device comprising:

[0021] The first acquisition module is used to obtain the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side;

[0022] A traversal module, configured to traverse the class entity object in a loop and determine all fields in the class entity object that need to be assigned values;

[0023] A second acquisition module is used to obtain the location information of the data value corresponding to the field from the proto file format data according to the field;

[0024] A third acquisition module is used to acquire the data value corresponding to the position information according to the position information;

[0025] The assignment module is used to assign the data value to the corresponding field in the class entity object.

[0026] In conjunction with the second aspect, the data analysis and optimization device further includes:

[0027] A judgment module is used to judge whether the position information and the data value corresponding to the position information have been stored in the buffer. If the position information and the data value corresponding to the position information are not stored in the buffer, the position information and the data value corresponding to the position information are stored in the buffer before executing the next step. If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the next step is directly executed.

[0028] In combination with the second aspect, the third acquisition module is further configured to:

[0029] If the position information and the data value corresponding to the position information are stored in the buffer after being determined not to be stored in the buffer, the data value corresponding to the position information is read from the proto file format data / the buffer;

[0030] If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the data value corresponding to the position information is directly read from the buffer.

[0031] In conjunction with the second aspect, the data analysis and optimization device further includes:

[0032] The fourth acquisition module is used to obtain binary data transmitted from the outside to the local vehicle end;

[0033] The deserialization module is used to deserialize the binary data and deserialize the binary data into proto file format data to be processed.

[0034] In a third aspect, a data analysis and optimization system is provided, characterized in that the data analysis and optimization system includes a controller and a memory, and a computer program is stored in the memory. When the computer program is executed by the controller, the data analysis and optimization system performs the data analysis and optimization method as described in any one of the first aspects.

[0035] In a fourth aspect, a computer-readable storage medium is provided, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is run on a computer, the computer executes the data analysis and optimization method as described in any one of the first aspects.

[0036] The invention adopting the above technical solution has the following advantages:

[0037] 1. Through the data parsing optimization method of this application, when it is necessary to assign a value to a local class entity object on the vehicle side, the location information of the field that needs to be assigned is first found by looping through the local class entity object on the vehicle side, and then the data value is obtained based on the location information, and finally the data value is assigned to the corresponding field in the class entity object. Compared with the traditional parsing method of looping through all proto file format data to find the data value of the field, the method in this application first determines which fields are in the class entity object, and then accurately obtains the data value based on the location information of these fields. It does not need to traverse all proto file format data, thereby reducing the complexity of assigning a single field, thereby reducing the time consumption of the assignment process and improving the efficiency of the entire parsing process.

[0038] 2. Through the data parsing optimization method of the present application, when the data value corresponding to a field is obtained for the first time, the data value and location information are stored in a pre-set buffer. When the data value of the corresponding field is subsequently obtained, the data value can be directly read from the buffer through the location information. This design can further reduce the time consumption of the assignment process, thereby improving the efficiency of the entire parsing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention can be further illustrated by the non-limiting examples given in the accompanying drawings;

[0040] Figure 1 Schematic diagram of the process of data analysis and optimization method in an embodiment of the present invention;

[0041] Figure 2 This is a system block diagram of a data analysis and optimization device according to an embodiment of the present invention;

[0042] Among them, 31, the first acquisition module; 32, the traversal module; 33, the second acquisition module; 34, the third acquisition module; 35, the assignment module; 36, the judgment module; 37, the fourth acquisition module; 38, the deserialization module. DETAILED DESCRIPTION

[0043] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that similar or identical parts in the drawings or descriptions are numbered the same. Implementations not shown or described in the drawings are known to those of ordinary skill in the art. In the description of this application, the terms "first," "second," etc. are used solely to distinguish descriptions and are not to be construed as indicating or implying relative importance.

[0044] like Figure 1 As shown, the embodiment of the present application provides a data analysis optimization method, which may include the following steps:

[0045] S110, obtaining the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side;

[0046] S120, looping through the class entity object to determine all fields in the class entity object that need to be assigned values;

[0047] S130. According to the field, obtain location information of the data value corresponding to the field from the proto file format data;

[0048] S140. Acquire the data value corresponding to the location information according to the location information;

[0049] S150: Assign the data value to the corresponding field in the class entity object.

[0050] Through the above-mentioned data parsing optimization method, when it is necessary to assign a value to a class entity object local to the vehicle, the first step is to loop through the class entity object local to the vehicle to find the location information of the field to be assigned a value, then obtain the data value based on the location information, and finally assign the data value to the corresponding field in the class entity object. Compared with the traditional parsing method of looping through all proto file format data to find the data value of the field, the method in this embodiment first determines which fields are in the class entity object, and then accurately obtains the data value based on the location information of these fields. This method does not require looping through all proto file format data, reduces the complexity of assigning a single field, thereby reducing the time consumption of the assignment process and improving the efficiency of the entire parsing process.

[0051] In this embodiment, before the step of obtaining a data value corresponding to the location information according to the location information, the data analysis and optimization method may further include the following steps:

[0052] Determine whether the position information and the data value corresponding to the position information have been stored in the cache. If the position information and the data value corresponding to the position information are not stored in the cache, store the position information and the data value corresponding to the position information in the cache before executing the next step. If the position information and the data value corresponding to the position information have been pre-stored in the cache, directly execute the next step.

[0053] It is understandable that during the data parsing process, there will be multiple processes of obtaining the data values of the corresponding fields, and in the subsequent acquisition process, the data values that have been obtained previously may be repeatedly obtained. If the data values are repeatedly obtained from all the proto file format data, it will obviously take more time. Therefore, the significance of this step is that when the data value corresponding to a field is obtained for the first time, the data value and location information are stored in a pre-set buffer, and when the data value of the corresponding field is obtained subsequently, the data value can be directly read from the buffer through the location information. This design can further reduce the time consumption of the assignment process, thereby improving the efficiency of the entire parsing process.

[0054] In combination with the above-mentioned additional steps, in this embodiment, the step of obtaining the data value corresponding to the position information according to the position information can be divided into two cases, specifically:

[0055] If the position information and the data value corresponding to the position information are stored in the buffer after being determined not to be stored in the buffer, the data value corresponding to the position information is read from the proto file format data / the buffer;

[0056] If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the data value corresponding to the position information is directly read from the buffer.

[0057] It is understandable that when the data value corresponding to a field is first obtained, the data value and location information are not stored in the cache. They must be extracted from the proto file format data before the data value and location information can be stored in the cache. On this basis, whether reading the data value from the proto file format data or from the cache is equally time-consuming, and there is no difference between the two reading methods. If the data value and location information are already stored in the cache, the data value can be read directly from the cache without going through the step of extracting the data value from the proto file format data, which can significantly reduce the time consumption.

[0058] In this embodiment, before the step of obtaining the proto file format data to be processed and the class entity object to be assigned locally, the data parsing optimization method further includes:

[0059] Obtain binary data transmitted from the outside to the vehicle;

[0060] Deserialize the binary data into proto file format data to be processed.

[0061] Through the above steps, the binary data can be deserialized into proto file format data, which is convenient for subsequent processing of the proto file format data.

[0062] In summary, combined with all the above steps, the data parsing optimization method in the embodiment of the present application specifically includes the following steps:

[0063] S210, obtaining binary data transmitted from the outside to the vehicle;

[0064] S220, deserializing the binary data into proto file format data to be processed;

[0065] S230: Obtain the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side;

[0066] S240: Loop through the class entity object to determine all fields in the class entity object that need to be assigned values;

[0067] S250. According to the field, obtain location information of the data value corresponding to the field from the proto file format data;

[0068] S260. Determine whether the position information and the data value corresponding to the position information have been stored in the cache. If the position information and the data value corresponding to the position information are not stored in the cache, store the position information and the data value corresponding to the position information in the cache before executing the next step. If the position information and the data value corresponding to the position information have been pre-stored in the cache, directly execute the next step.

[0069] S270: Acquire the data value corresponding to the location information according to the location information;

[0070] S280: Assign the data value to the corresponding field in the class entity object.

[0071] The above data parsing optimization method can reduce the complexity of field assignment in class entity objects, thereby reducing the time consumption of field assignment operations and improving the efficiency of the data parsing process.

[0072] like Figure 2 As shown, the embodiment of the present application also provides a data parsing optimization device, which is applied to the above-mentioned data parsing optimization method. The optimization device includes a first acquisition module 31, a traversal module 32, a second acquisition module 33, a third acquisition module 34, and an assignment module 35. Through the mutual cooperation of each module, the above-mentioned data parsing optimization method is implemented. The functions of each module are as follows:

[0073] The first acquisition module 31 is used to obtain the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side;

[0074] A traversal module 32 is used to traverse the class entity object in a loop and determine all fields in the class entity object that need to be assigned values;

[0075] A second acquisition module 33 is used to obtain the location information of the data value corresponding to the field from the proto file format data according to the field;

[0076] A third acquisition module 34 is configured to acquire the data value corresponding to the position information according to the position information;

[0077] The assignment module 35 is used to assign the data value to the corresponding field in the class entity object.

[0078] In this embodiment, the data analysis and optimization device further includes:

[0079] The judgment module 36 is used to judge whether the position information and the data value corresponding to the position information have been stored in the cache. If the position information and the data value corresponding to the position information are not stored in the cache, the position information and the data value corresponding to the position information are stored in the cache before executing the next step. If the position information and the data value corresponding to the position information have been pre-stored in the cache, the next step is directly executed.

[0080] In this embodiment, the third acquisition module 34 is further configured to:

[0081] If the position information and the data value corresponding to the position information are stored in the buffer after being determined not to be stored in the buffer, the data value corresponding to the position information is read from the proto file format data / the buffer;

[0082] If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the data value corresponding to the position information is directly read from the buffer.

[0083] In this embodiment, the data parsing and optimization device further includes a fourth acquisition module 37 and a deserialization module 38, wherein:

[0084] The fourth acquisition module 37 is used to acquire binary data transmitted from the outside to the vehicle side;

[0085] The deserialization module 38 is used to perform deserialization processing on the binary data and deserialize the binary data into proto file format data to be processed.

[0086] An embodiment of the present application also provides a data analysis and optimization system, which includes a controller and a memory, wherein a computer program is stored in the memory. When the computer program is executed by the controller, the data analysis and optimization system executes the data analysis and optimization method as described above.

[0087] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the data analysis and optimization method as described above.

[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented through hardware, or can be implemented with the help of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a braking device, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0089] The above describes in detail a data parsing optimization method, device, system, and storage medium provided by the present invention. The description of the specific embodiments is only intended to help understand the method and core concept of the present invention. It should be noted that for those skilled in the art, without departing from the principles of the present invention, various improvements and modifications may be made to the present invention, and such improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A data analysis and optimization method, characterized in that: The data analysis and optimization method comprises: Obtain the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side; Loop through the class entity objects to determine all fields in the class entity objects that need to be assigned values; According to the field, obtain the location information of the data value corresponding to the field from the proto file format data; determining whether the position information and the data value corresponding to the position information are already stored in a buffer; if the position information and the data value corresponding to the position information are not stored in the buffer, storing the position information and the data value corresponding to the position information in the buffer before executing the next step; and if the position information and the data value corresponding to the position information are already stored in the buffer, directly executing the next step; According to the location information, obtaining the data value corresponding to the location information; Assigning the data value to the corresponding field in the class entity object; In the step of obtaining the data value corresponding to the position information according to the position information: If the position information and the data value corresponding to the position information are stored in the buffer after it is determined that they are not stored in the buffer, then the data value corresponding to the position information is read from the proto file format data or the buffer; If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the data value corresponding to the position information is directly read from the buffer.

2. The data analysis and optimization method according to claim 1, characterized in that: Before the step of obtaining the proto file format data to be processed and the class entity object to be assigned locally, the data parsing optimization method further includes: Obtain binary data transmitted from the outside to the vehicle; Deserialize the binary data into proto file format data to be processed.

3. A data analysis and optimization device, characterized in that: The data analysis and optimization device comprises: The first acquisition module is used to obtain the proto file format data to be processed and the class entity object that needs to be assigned locally on the vehicle side; A traversal module, configured to traverse the class entity object in a loop and determine all fields in the class entity object that need to be assigned values; A second acquisition module is used to obtain the location information of the data value corresponding to the field from the proto file format data according to the field; A third acquisition module is used to acquire the data value corresponding to the position information according to the position information; An assignment module, configured to assign the data value to a corresponding field in the class entity object; a determination module, configured to determine whether the position information and the data value corresponding to the position information have been stored in a buffer; if the position information and the data value corresponding to the position information are not stored in the buffer, storing the position information and the data value corresponding to the position information in the buffer before executing the next step; and if the position information and the data value corresponding to the position information have been pre-stored in the buffer, directly executing the next step; The third acquisition module is further configured to: If the position information and the data value corresponding to the position information are stored in the buffer after it is determined that they are not stored in the buffer, then the data value corresponding to the position information is read from the proto file format data or the buffer; If the position information and the data value corresponding to the position information have been pre-stored in the buffer, the data value corresponding to the position information is directly read from the buffer.

4. The data analysis and optimization device according to claim 3, characterized in that: The data analysis and optimization device also includes: The fourth acquisition module is used to obtain binary data transmitted from the outside to the local vehicle end; The deserialization module is used to deserialize the binary data and deserialize the binary data into proto file format data to be processed.

5. A data analysis and optimization system, characterized in that: The data analysis and optimization system includes a controller and a memory, wherein a computer program is stored in the memory. When the computer program is executed by the controller, the data analysis and optimization system executes the data analysis and optimization method as described in claim 1 or 2.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is run on a computer, the computer is enabled to execute the data analysis and optimization method according to claim 1 or 2.

Citation Information

Patent Citations

  • Method and system for dynamically using structured data

    CN108052590A

  • Data serialization method and device, data deserialization method and device, equipment and storage medium

    CN115687466A