Data difference comparison method and device, automobile and storage medium
By obtaining and comparing the configuration data files before and after the OTA upgrade in the automotive software system, using the difference comparison method of broadcast signals and preset order arrangement, the problem of inefficient manual comparison is solved, and the automation and accuracy of data difference comparison is achieved. Sex improvement.
Patent Information
- Application Number
- CN202411040338.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-06
AI Technical Summary
During the OTA upgrade process of the version of the automotive software system, the existing technology relies on manual data comparison, resulting in inefficiency and data omission, making it difficult to accurately identify data differences before and after the upgrade.
By obtaining the configuration data files before and after the OTA upgrade, and automatically comparing them on the corresponding file paths, using the broadcast signal to carry the file paths, ensuring the correct storage and comparison of data files, and using the data difference comparison method arranged in preset order. Quickly identify data abnormalities.
It improves the efficiency and accuracy of data differential comparison, reduces human errors, and enhances the security of the system and the efficiency of development and testing.
Smart Images

Figure CN119088432A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a data difference comparison method, device, automobile and storage medium. Background Art
[0002] In the continuous optimization and improvement of automotive software systems and applications, version OTA upgrade is a key step; currently, the settings and functions of large-screen automotive applications involve a variety of memory methods, such as user account memory, operating habit memory, local settings memory, and power-on startup requirements in compliance with regulations; however, after the version OTA upgrade, these memory methods may have intermediate link errors or certain function memory errors, resulting in differences in data before and after the upgrade.
[0003] The current solution usually relies on testers to manually compare the data before and after the upgrade. However, due to the single testing method and scattered testers, the data comparison is inefficient and data omissions are prone to occur. Summary of the invention
[0004] The technical problem to be solved by the present application is to provide a data difference comparison method, device, vehicle and storage medium to improve the efficiency and accuracy of data comparison.
[0005] In order to solve the above technical problems, the present application provides a data difference comparison method, including: respectively obtaining a first configuration data file and a second configuration data file stored in a first file path and a second file path of a target application; wherein the first configuration data file is a file stored in the first file path by the target application after receiving a first broadcast signal, and the first configuration data file is a file obtained before the version OTA upgrade; the second configuration data file is a file stored in the second file path by the target application after receiving a second broadcast signal, and the second configuration data file is a file obtained after the version OTA upgrade; performing a data difference comparison on the first configuration data file and the second configuration data file, and determining a data difference comparison result.
[0006] Specifically, the target application stores the configuration data before and after the OTA upgrade in the corresponding file path, and then directly captures the configuration data on the corresponding file path for comparison. This can not only reduce human errors and omissions, but also improve the efficiency and accuracy of data difference comparison results.
[0007] Preferably, the first configuration data file is a file stored in the first file path by the target application after receiving the first broadcast signal, specifically including: parsing the received first broadcast signal based on the target application to obtain the first file path; when it is detected that the first file path exists and there is no data file under the first file path, the target application obtains and stores the first configuration data file under the first file path; or, when it is detected that the first file path exists and there is a data file under the first file path, the data file is cleared, and the target application obtains and stores the first configuration data file under the first file path; or, when it is detected that the first file path does not exist, the first file path is created, and the target application obtains and stores the first configuration data file under the first file path.
[0008] Specifically, by considering various possible situations of the file path and setting corresponding processing measures for each situation, duplicate storage or conflict of files can be avoided, ensuring that the first configuration data file is correctly stored in the system.
[0009] Preferably, performing a data difference comparison on the first configuration data file and the second configuration data file to determine a data difference comparison result specifically includes: obtaining all first configuration data in the first configuration data file, arranging all the first configuration data in a preset arrangement order, and generating a first configuration data column; obtaining all second configuration data in the second configuration data file, arranging all the first configuration data in a preset arrangement order, and generating a second configuration data column; obtaining the first configuration data corresponding to the first configuration data column in a target row, and the second configuration data corresponding to the second configuration data column, performing a data difference comparison on the first configuration data and the second configuration data, and obtaining a data difference comparison result corresponding to the target row.
[0010] Specifically, by arranging the first configuration data and the second configuration data into columns in a preset order and then comparing them row by row, the comparison process is more organized, which data are inconsistent can be quickly identified, thereby improving the efficiency of the data comparison process.
[0011] Preferably, a data difference comparison is performed on the first configuration data and the second configuration data to obtain a data difference comparison result corresponding to the target row, specifically including: obtaining a first key value corresponding to the first configuration data, and simultaneously obtaining a second key value corresponding to the second configuration data; when it is detected that the first key value and the second key value satisfy a numerical consistency condition, obtaining the data difference comparison result corresponding to the target row, wherein the data difference comparison result is normal data; or, when it is detected that the first key value and the second key value do not satisfy the numerical consistency condition, obtaining the data difference comparison result corresponding to the target row, wherein the data difference comparison result is abnormal data.
[0012] Specifically, by directly comparing the key values corresponding to the first configuration data and the second configuration data, the data difference comparison result can be quickly determined, thereby improving the efficiency of data comparison.
[0013] Preferably, the generation process of the first broadcast signal specifically includes: monitoring a selection operation acting on the first target object; when a selection operation acting on the first target object is monitored, responding to the selection operation and generating a first broadcast signal corresponding to the first target object, wherein the first broadcast signal carries a first file path.
[0014] Specifically, by carrying the first file path in the first broadcast signal, the target application as the receiving end of the broadcast signal can directly obtain the first file path, thereby improving the efficiency of subsequent file storage.
[0015] Preferably, before receiving the first broadcast signal, the target application also includes: obtaining the broadcast permission corresponding to the first broadcast signal, comparing the broadcast permission with the target application permission corresponding to the target application, and when it is detected that the broadcast permission matches the target application permission, controlling the target application to receive the first broadcast signal; wherein, the target application permission is obtained by the target application through static registration broadcast registration, and the broadcast permission is the permission parameter set when the first broadcast signal is sent.
[0016] Specifically, by comparing the broadcast permissions with the permissions of the target application, it can be ensured that only the target application with the corresponding permissions can receive and process specific broadcast signals; this permission control mechanism effectively enhances the security of the system and prevents unauthorized target applications from receiving and processing sensitive information or performing unauthorized operations.
[0017] Preferably, after determining the data difference comparison result, the method further includes: when it is detected that the data difference comparison result is data anomaly, calling a system log, and determining a cause of the data anomaly based on the system log.
[0018] Specifically, this real-time monitoring and response mechanism can help system administrators or operation and maintenance personnel quickly discover and diagnose problems, and can effectively shorten the time for abnormal data processing.
[0019] The present application also provides a data difference comparison device, including: a configuration data file acquisition module and a data difference comparison module; wherein the configuration data file acquisition module is used to respectively obtain a first configuration data file and a second configuration data file stored by a target application on a first file path and a second file path; wherein the first configuration data file is a file stored in the first file path by the target application after receiving a first broadcast signal, and the first configuration data file is a file obtained before the version OTA upgrade; the second configuration data file is a file stored in the second file path by the target application after receiving a second broadcast signal, and the second configuration data file is a file obtained after the version OTA upgrade; the data difference comparison module is used to perform data difference comparison on the first configuration data file and the second configuration data file, and determine the data difference comparison result.
[0020] Preferably, the first configuration data file in the configuration data file acquisition module is a file stored in the first file path by the target application after receiving the first broadcast signal, specifically including: the target application parses and processes the received first broadcast signal to obtain the first file path; when it is detected that the first file path exists and there is no data file under the first file path, the target application acquires and stores the first configuration data file under the first file path; or, when it is detected that the first file path exists and there is a data file under the first file path, the data file is cleared, and the target application acquires and stores the first configuration data file under the first file path; or, when it is detected that the first file path does not exist, the target application creates the first file path, acquires and stores the first configuration data file under the first file path.
[0021] Preferably, the data difference comparison module is used to perform data difference comparison on the first configuration data file and the second configuration data file to determine the data difference comparison result, specifically including: obtaining all first configuration data in the first configuration data file, arranging all the first configuration data in a preset arrangement order, and generating a first configuration data column; obtaining all second configuration data in the second configuration data file, arranging all the first configuration data in a preset arrangement order, and generating a second configuration data column; obtaining the first configuration data corresponding to the first configuration data column in the target row, and the second configuration data corresponding to the second configuration data column, performing data difference comparison on the first configuration data and the second configuration data, and obtaining the data difference comparison result corresponding to the target row.
[0022] Preferably, the data difference comparison module is used to perform data difference comparison on the first configuration data and the second configuration data to obtain the data difference comparison result corresponding to the target row, specifically including: obtaining a first key value corresponding to the first configuration data, and simultaneously obtaining a second key value corresponding to the second configuration data; when it is detected that the first key value and the second key value satisfy a numerical consistency condition, obtaining the data difference comparison result corresponding to the target row, wherein the data difference comparison result is normal data; or, when it is detected that the first key value and the second key value do not satisfy the numerical consistency condition, obtaining the data difference comparison result corresponding to the target row, wherein the data difference comparison result is abnormal data.
[0023] Preferably, the generation process of the first broadcast signal in the configuration data file acquisition module specifically includes: monitoring a selection operation acting on the first target object; when a selection operation acting on the first target object is monitored, responding to the selection operation and generating a first broadcast signal corresponding to the first target object, wherein the first broadcast signal carries a first file path.
[0024] Preferably, before the target application in the configuration data file acquisition module receives the first broadcast signal, it also includes: obtaining the broadcast permission corresponding to the first broadcast signal, comparing the broadcast permission with the target application permission corresponding to the target application, and when it is detected that the broadcast permission matches the target application permission, controlling the target application to receive the first broadcast signal; wherein, the target application permission is obtained by the target application through static registration broadcast registration, and the broadcast permission is the permission parameter set when the first broadcast signal is sent.
[0025] Preferably, after determining the data difference comparison result, the data difference comparison module further comprises: when it is detected that the data difference comparison result is data anomaly, calling the system log, and determining the cause of the data anomaly based on the system log.
[0026] The present application also provides a car, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the data difference comparison method as described in any one of the above when executing the computer program.
[0027] The present application also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the data difference comparison methods described above.
[0028] Compared with the prior art, the data difference comparison method, device, automobile and storage medium of the present application embodiment have the following beneficial effects:
[0029] By storing the first configuration data file before the version OTA upgrade in the first file path, and storing the second configuration data file after the version OTA upgrade in the second file path, when performing data difference comparison, the first configuration data file and the second configuration data file stored in the first file path and the second file path of the target application are directly obtained, and the data difference comparison is performed on the first configuration data file and the second configuration data file to determine the data difference comparison result. Compared with the manual comparison in the prior art, the present application stores the configuration data before and after OTA upgrade in the corresponding file path by the target application, and then directly captures the configuration data on the corresponding file path for comparison, which can realize automatic data capture and comparison without being affected by human subjective judgment. It can not only reduce human errors and omissions, and improve the efficiency and accuracy of data difference comparison results, but also improve the detection accuracy of abnormal problems in subsequent target applications during development and testing, thereby ensuring the efficiency and convenience of target application development and testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flow chart of an embodiment of a data difference comparison method provided by the present application;
[0031] Figure 2 It is a structural schematic diagram of an embodiment of a data difference comparison device provided by the present application. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0033] Example 1, see Figure 1 , Figure 1 : is a flow chart of an embodiment of a data difference comparison method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes steps 101 and 102, which are specifically as follows:
[0034] Step 101: respectively obtain the first configuration data file and the second configuration data file stored in the first file path and the second file path of the target application; wherein, the first configuration data file is the file stored in the first file path after the target application receives the first broadcast signal, and the first configuration data file is the file obtained before the version OTA upgrade; the second configuration data file is the file stored in the second file path after the target application receives the second broadcast signal, and the second configuration data file is the file obtained after the version OTA upgrade.
[0035] In an embodiment of the present application, the first broadcast signal is generated by monitoring a selection operation on a first target object. When a selection operation on the first target object is monitored, the selection operation is responded to and a first broadcast signal corresponding to the first target object is generated, wherein the first broadcast signal carries a first file path.
[0036] Preferably, the first target object is a data acquisition object before version OTA upgrade; the first target object may exist in the form of a button that can be triggered or clicked on a display device.
[0037] Preferably, when monitoring the selection operation on the first target object, the hovering operation of the mouse arrow may be monitored. When it is detected that the mouse arrow hovers over the first target object area and a mouse click event occurs, it is determined that the first target object is selected.
[0038] Preferably, when generating the first broadcast signal corresponding to the first target object, the corresponding first file path is determined based on the first target object, and based on the set data capture application, a broadcast action is set for the generated first broadcast signal, and the first file path is added to the first broadcast signal as additional data so that the first broadcast signal carries the first file path.
[0039] Preferably, the first file path is a file path used to store data before version OTA upgrade.
[0040] In an embodiment of the present application, after the first broadcast signal is generated, the first broadcast signal is also sent to the target application, and when the first broadcast signal is sent, a permission parameter is added to the first broadcast signal so that the target application identifies whether to receive the first broadcast signal based on the permission parameter.
[0041] Preferably, permission parameters are added to the first broadcast signal by declaring permissions in the Android application manifest file AndroidManifest.xml and setting permissions when sending a broadcast, and based on the permission parameters, it can be determined which applications can receive the broadcast.
[0042] In an embodiment of the present application, before receiving the first broadcast signal, the target application also includes: obtaining the broadcast permission corresponding to the first broadcast signal, comparing the broadcast permission with the target application permission corresponding to the target application, and when it is detected that the broadcast permission matches the target application permission, controlling the target application to receive the first broadcast signal; wherein, the target application permission is obtained by the target application through static registration broadcast registration, and the broadcast permission is the permission parameter set when the first broadcast signal is sent.
[0043] Preferably, the target application permissions corresponding to the target application are permissions declared when registering the broadcast receiver by statically registering the broadcast. This permission also needs to be declared in advance in the Android application manifest file AndroidManifest.xml, and signature permissions are added.
[0044] Preferably, if the broadcast permission of the first broadcast signal matches the target application permission declared when the target application statically registers the broadcast receiver, the system allows the target application to receive the first broadcast signal. If the permissions do not match, the system prevents the target application from receiving the first broadcast signal.
[0045] By declaring broadcast permissions, you can limit which applications can send specific broadcasts and which applications or components can receive the broadcasts. This permission control ensures that data can only be processed by applications with corresponding permissions, preventing unauthorized applications from receiving sensitive data or performing unauthorized operations, thereby enhancing data security.
[0046] In an embodiment of the present application, the target application includes a large-screen application in a vehicle's onboard screen, wherein the large-screen application includes but is not limited to vehicle control, system settings, music and other applications.
[0047] In an embodiment of the present application, the target application parses and processes the received first broadcast signal to obtain a first file path.
[0048] Preferably, the target application obtains additional data by parsing a target field in the first broadcast signal, and obtains the first file path based on the additional data, wherein the target field is a path field.
[0049] In the embodiment of the present application, when it is detected that the first file path exists and no data file exists under the first file path, the target application obtains and stores the first configuration data file under the first file path.
[0050] In an embodiment of the present application, when it is detected that the first file path exists and a data file exists under the first file path, the data file is cleared, and the target application obtains and stores the first configuration data file under the first file path.
[0051] In the embodiment of the present application, when it is detected that the first file path does not exist, the target application creates the first file path, obtains and stores the first configuration data file in the first file path.
[0052] Preferably, when the target application obtains the first configuration data file, the first configuration data corresponding to the target application is obtained, and the first configuration data file is generated based on the first configuration data. The current time is obtained as a timestamp, and splicing processing is performed based on the target application name and the timestamp to obtain the first configuration data file name corresponding to the first configuration data file.
[0053] In the example, the target application name is CarControl, the timestamp is year-month-day-hour-minute-second, and the first configuration data file name is CarControl_year-month-day-hour-minute-second based on the concatenation processing of the target application name and the timestamp.
[0054] Preferably, the first configuration data is application setting data of the target application before the version OTA upgrade, which is one or more setting data that need to be obtained and is set in advance based on user needs, and the setting data can be read from the memory of the target application or from the underlying signal; taking the target application as vehicle control as an example, the first configuration data can be the setting value of the driving mode before the version OTA upgrade.
[0055] Preferably, the number format of the first configuration data is json format, and is written into the first configuration data file in a key-value manner; wherein, the value is of string type; this is because the value can be in the form of Boolean, integer or array, etc., and by uniformly converting them into string type, it can facilitate subsequent reading and display of data and avoid abnormal errors caused by data type conversion.
[0056] Preferably, when the existence of the first file path is detected, the first file path is combined with the first configuration data file name to obtain a first complete file path.
[0057] In example, the first file path is / sdcard / preOTA / , the target application name is CarControl, and the timestamp is year-month-day-hour-minute-second. Based on the target application name and the timestamp, the splicing processing is performed to obtain the data file name CarControl_year-month-day-hour-minute-second. The first file path is combined with the data file name to obtain the first complete file path / sdcard / preOTA / CarControl_year-month-day-hour-minute-second.txt; based on the first complete file path, it can be used to uniquely identify and locate a specific file.
[0058] Preferably, after obtaining the first complete file path, whether there is a data file under the first file path is determined by detecting whether the first complete file path exists; when it is detected that the first complete file path does not exist, it is determined that there is no data file under the first file path; when it is detected that the first complete file path exists, it is determined that there is a data file under the first file path.
[0059] Preferably, when it is detected that the first file path exists and no data file exists under the first file path, the target application stores the first configuration data file under the first complete file path by creating a first complete file path under the first file path.
[0060] Preferably, when it is detected that the first file path exists and no data file exists under the first file path, after clearing the data file, a first complete file path is created under the first file path, and the target application stores the first configuration data file under the first complete file path.
[0061] Preferably, when it is detected that the first file path does not exist, the target application first creates the first file path, creates a first complete file path under the first file path, and then obtains and stores the first configuration data file under the first file path.
[0062] Preferably, the first complete file path is the file path under the first file path; it can ensure that each target application has one and only one configuration data file under the first complete file path, and each configuration file is named with its corresponding target application name and the timestamp when it was written, ensuring that the configuration data written each time is the latest, and also facilitating subsequent viewing and comparison of the data.
[0063] In an embodiment of the present application, the second broadcast signal is generated by monitoring a selection operation on a second target object. When a selection operation on the second target object is monitored, the selection operation is responded to and a second broadcast signal corresponding to the second target object is generated, wherein the second broadcast signal carries a second file path.
[0064] Preferably, the second target object is a data acquisition object after version OTA upgrade; the second target object can exist in the form of a button that can be triggered or clicked on the display device.
[0065] Preferably, when monitoring the selection operation on the second target object, the hovering operation of the mouse arrow may be monitored. When it is detected that the mouse arrow hovers over the second target object area and a mouse click event occurs, it is determined that the second target object is selected.
[0066] Preferably, when generating a second broadcast signal corresponding to the second target object, the corresponding second file path is determined based on the second target object, and based on the set data capture application, a broadcast action is set for the generated second broadcast signal, and the second file path is added to the second broadcast signal as additional data so that the second broadcast signal carries the second file path.
[0067] Preferably, the second file path is a file path used to store data after the version OTA upgrade.
[0068] In an embodiment of the present application, after the second broadcast signal is generated, the second broadcast signal is also sent to the target application, and when the second broadcast signal is sent, a permission parameter is added to the second broadcast signal so that the target application identifies whether to receive the second broadcast signal based on the permission parameter.
[0069] In an embodiment of the present application, before receiving the second broadcast signal, the target application also includes: obtaining the broadcast permission corresponding to the second broadcast signal, comparing the broadcast permission with the target application permission corresponding to the target application, and when it is detected that the broadcast permission matches the target application permission, controlling the target application to receive the second broadcast signal; wherein, the target application permission is obtained by the target application through static registration broadcast registration, and the broadcast permission is the permission parameter set when the second broadcast signal is sent.
[0070] Preferably, if the broadcast permission of the second broadcast signal matches the target application permission declared when the target application statically registers the broadcast receiver, the system allows the target application to receive the second broadcast signal; if the permissions do not match, the system prevents the target application from receiving the second broadcast signal.
[0071] In an embodiment of the present application, the target application parses the received second broadcast signal to obtain a second file path.
[0072] Preferably, the target application obtains additional data by parsing a target field in the second broadcast signal, and obtains a second file path based on the additional data, wherein the target field is a path field.
[0073] In the embodiment of the present application, when it is detected that the second file path exists and no data file exists under the second file path, the target application obtains and stores the second configuration data file under the second file path.
[0074] In an embodiment of the present application, when it is detected that the second file path exists and there is a data file under the second file path, the data file is cleared, and the target application obtains and stores the second configuration data file under the second file path.
[0075] In the embodiment of the present application, when it is detected that the second file path does not exist, the target application creates the second file path, obtains and stores the second configuration data file in the second file path.
[0076] Preferably, when the target application obtains the second configuration data file, the second configuration data corresponding to the target application is obtained, and based on the second configuration data, a second configuration data file is generated, and the current time is obtained as a timestamp, and splicing processing is performed based on the target application name and the timestamp to obtain the second configuration data file name corresponding to the second configuration data file.
[0077] Preferably, the second configuration data is application setting data of the target application after the version OTA upgrade. Taking the target application as vehicle control as an example, the second configuration data can be the setting value of the driving mode after the version OTA upgrade.
[0078] Preferably, the second configuration data is in a json format and is written into the second configuration data file in a key-value manner; wherein the value is of string type;
[0079] Preferably, when the existence of the second file path is detected, the second file path is combined with the second configuration data file name to obtain a second complete file path.
[0080] Preferably, after obtaining the second complete file path, whether there is a data file under the second file path is determined by detecting whether the second complete file path exists; when it is detected that the second complete file path does not exist, it is determined that there is no data file under the second file path; when it is detected that the second complete file path exists, it is determined that there is a data file under the second file path.
[0081] Preferably, when it is detected that the second file path exists and no data file exists under the second file path, the target application stores the second configuration data file under the second complete file path by creating a second complete file path under the second file path.
[0082] Preferably, when it is detected that the second file path exists and no data file exists under the second file path, after clearing the data file, a second complete file path is created under the second file path, and the target application stores the second configuration data file under the second complete file path.
[0083] Preferably, when it is detected that the second file path does not exist, the target application first creates the second file path, creates a second complete file path under the second file path, and then obtains and stores the second configuration data file under the second file path.
[0084] Preferably, the second complete file path is a file path under the second file path; it can be ensured that each target application has one and only one configuration data file under the second complete file path.
[0085] In an embodiment of the present application, when obtaining the first configuration data file and the second configuration data file stored in the first file path and the second file path of the target application, the selection operation acting on the third target object is monitored; when the selection operation acting on the third target object is monitored, the first configuration data file under the first file path is called, and the second configuration data file under the second file path is called at the same time.
[0086] Preferably, the third target object is an object for retrieving data before and after the version OTA upgrade; the third target object may exist in the form of a button that can be triggered or clicked on the display device.
[0087] Preferably, when monitoring the selection operation on the third target object, the hovering operation of the mouse arrow can be monitored. When it is detected that the mouse arrow hovers over the third target object area and a mouse click event occurs, it is determined that the third target object is selected.
[0088] Preferably, when generating the first broadcast signal corresponding to the first target object, the corresponding first file path is determined based on the first target object, and based on the set data capture application, a broadcast action is set for the generated first broadcast signal, and the first file path is added to the first broadcast signal as additional data so that the first broadcast signal carries the first file path.
[0089] Step 102: performing a data difference comparison between the first configuration data file and the second configuration data file to determine a data difference comparison result.
[0090] In an embodiment of the present application, all the first configuration data in the first configuration data file are obtained, and the first configuration data are arranged in a preset order to generate a first configuration data column; all the second configuration data in the second configuration data file are obtained, and the first configuration data are arranged in a preset order to generate a second configuration data column, the first configuration data corresponding to the first configuration data column in the target row and the second configuration data corresponding to the second configuration data column are obtained, and a data difference comparison is performed between the first configuration data and the second configuration data to obtain a data difference comparison result corresponding to the target row.
[0091] Preferably, for the target application, its corresponding configuration data may be one or more. To ensure that the same type of data to be compared can be quickly determined during subsequent data difference comparison, a preset sorting order is pre-set and based on the same preset sorting order, all the first configuration data in the first configuration data file and all the second configuration data in the second configuration data file are arranged respectively. This allows the first configuration data and the second configuration data corresponding to the same row in the arranged first configuration data column and the second configuration data column to be the same type of version data before and after OTA upgrade, and can be directly used for data difference comparison, thereby improving the efficiency of selecting comparison data.
[0092] Preferably, the preset arrangement order is the configuration data arrangement order obtained by arranging all configuration data corresponding to the target application based on user needs; since the first configuration data and the second configuration data are both written into the corresponding configuration data file in the form of key-value, the preset arrangement order can be sorted in the form of key value; for example, the preset arrangement order can be in the form of key1, key2, key3...keyn.
[0093] Preferably, the first key value corresponding to the first configuration data and the second key value corresponding to the second configuration data are the value values of the corresponding configuration data; the value values of the configuration data before and after the version OTA upgrade corresponding to the same key value can be directly determined through the target row.
[0094] Preferably, the target row can be any row in the configuration data column, any multiple rows in the configuration data column, or all rows in the configuration data column; when only part of the data in the configuration data column needs to be compared, the selectivity of the configuration data in the configuration data column can be achieved by setting the target row to any row or multiple rows.
[0095] In an embodiment of the present application, a data difference comparison is performed on the first configuration data and the second configuration data to obtain a data difference comparison result corresponding to the target row, by obtaining a first key value corresponding to the first configuration data, and simultaneously obtaining a second key value corresponding to the second configuration data; when it is detected that the first key value and the second key value satisfy a numerical consistency condition, the data difference comparison result corresponding to the target row is obtained, wherein the data difference comparison result is that the data is normal; or, when it is detected that the first key value and the second key value do not satisfy the numerical consistency condition, the data difference comparison result corresponding to the target row is obtained, wherein the data difference comparison result is that the data is abnormal.
[0096] Preferably, the numerical consistency condition is that the first key value is the same as the second key value.
[0097] Preferably, by directly comparing the first key value and the second key value corresponding to the target row, if they are inconsistent, it means that the data is abnormal and the data has been tampered with before and after the version OTA upgrade; if they are consistent, it means that the data is normal, and the data difference comparison result corresponding to the target row can be quickly determined.
[0098] Preferably, the first configuration data column, the second configuration data column and the data difference comparison result are visually displayed, and the data and data difference comparison results before and after the version OTA upgrade can be fed back to the user in a timely manner, so that the user can quickly obtain the required information.
[0099] In the embodiment of the present application, after determining the data difference comparison result, it also includes: when it is detected that the data difference comparison result is a data anomaly, calling a system log, and determining the cause of the data anomaly based on the system log.
[0100] Preferably, when confirming data anomalies, the system log function will be called to record detailed anomaly information in the system log file; these anomaly information include but are not limited to the timestamp of the anomaly, the specific key of the anomaly data and the corresponding value before and after the upgrade, the program version information for executing the comparison, etc.; therefore, by calling the system log and analyzing the system log, it can be inferred that the data anomaly is caused by the underlying signal jump, switching accounts or habits, and the unique logic of power on and off, so as to achieve rapid positioning of the abnormal node.
[0101] Preferably, the data difference comparison method provided in the embodiment of the present application is suitable for version OTA upgrade test scenarios.
[0102] It should be noted that, for the purpose of simple description, the method embodiments are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited to the described order of actions, because according to the embodiments of the present application, certain steps may be performed in other orders or simultaneously; secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0103] Example 2, see Figure 2 , Figure 2 is a structural diagram of an embodiment of a data difference comparison device provided in an embodiment of the present application, such as Figure 2 As shown, the device includes a configuration data file acquisition module 201 and a data difference comparison module 202, which are specifically as follows:
[0104] The configuration data file acquisition module 201 is used to respectively acquire the first configuration data file and the second configuration data file stored in the first file path and the second file path of the target application; wherein the first configuration data file is a file stored in the first file path by the target application after receiving the first broadcast signal, and the first configuration data file is a file obtained before the version OTA upgrade; the second configuration data file is a file stored in the second file path by the target application after receiving the second broadcast signal, and the second configuration data file is a file obtained after the version OTA upgrade.
[0105] The data difference comparison module 202 is used to compare the data differences between the first configuration data file and the second configuration data file to determine a data difference comparison result.
[0106] In an embodiment of the present application, the first configuration data file in the configuration data file acquisition module 201 is a file stored in the first file path by the target application after receiving the first broadcast signal, specifically including: the target application parses and processes the received first broadcast signal to obtain the first file path; when it is detected that the first file path exists and there is no data file under the first file path, the target application acquires and stores the first configuration data file under the first file path; or, when it is detected that the first file path exists and there is a data file under the first file path, the data file is cleared, and the target application acquires and stores the first configuration data file under the first file path; or, when it is detected that the first file path does not exist, the target application creates the first file path, acquires and stores the first configuration data file under the first file path.
[0107] In the embodiment of the present application, the data difference comparison module 202 is used to perform data difference comparison on the first configuration data file and the second configuration data file to determine the data difference comparison result, specifically including: obtaining all first configuration data in the first configuration data file, arranging all the first configuration data in a preset arrangement order, and generating a first configuration data column; obtaining all second configuration data in the second configuration data file, arranging all the first configuration data in a preset arrangement order, and generating a second configuration data column; obtaining the first configuration data corresponding to the first configuration data column in the target row, and the second configuration data corresponding to the second configuration data column, performing data difference comparison on the first configuration data and the second configuration data, and obtaining the data difference comparison result corresponding to the target row.
[0108] In an embodiment of the present application, the data difference comparison module 202 is used to perform a data difference comparison on the first configuration data and the second configuration data to obtain a data difference comparison result corresponding to the target row, specifically including: obtaining a first key value corresponding to the first configuration data, and simultaneously obtaining a second key value corresponding to the second configuration data; when it is detected that the first key value and the second key value meet a numerical consistency condition, obtaining the data difference comparison result corresponding to the target row, wherein the data difference comparison result is normal data; or, when it is detected that the first key value and the second key value do not meet the numerical consistency condition, obtaining the data difference comparison result corresponding to the target row, wherein the data difference comparison result is abnormal data.
[0109] In an embodiment of the present application, the process of generating the first broadcast signal in the configuration data file acquisition module 201 specifically includes: monitoring a selection operation acting on a first target object; when a selection operation acting on the first target object is monitored, responding to the selection operation and generating a first broadcast signal corresponding to the first target object, wherein the first broadcast signal carries a first file path.
[0110] In an embodiment of the present application, before the target application in the configuration data file acquisition module 201 receives the first broadcast signal, it also includes: obtaining the broadcast permission corresponding to the first broadcast signal, comparing the broadcast permission with the target application permission corresponding to the target application, and when it is detected that the broadcast permission matches the target application permission, controlling the target application to receive the first broadcast signal; wherein, the target application permission is obtained by the target application through static registration broadcast registration, and the broadcast permission is the permission parameter set when the first broadcast signal is sent.
[0111] In the embodiment of the present application, the data difference comparison module 202 is used to determine the data difference comparison result and further includes: when it is detected that the data difference comparison result is a data anomaly, calling the system log and determining the cause of the data anomaly based on the system log.
[0112] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0113] An embodiment of the present application also provides a car, which may include a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the steps of the above data difference comparison method when executing the computer program.
[0114] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the steps of the above data difference comparison method.
[0115] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0116] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0117] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0120] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0121] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0122] In summary, the present application provides a data difference comparison method, device, automobile and storage medium, which respectively obtain a first configuration data file and a second configuration data file stored in a first file path and a second file path of a target application; wherein the first configuration data file is a file stored in the first file path after the target application receives a first broadcast signal, and the first configuration data file is a file obtained before the OTA version upgrade; the second configuration data file is a file stored in the second file path after the target application receives a second broadcast signal, and the second configuration data file is a file obtained after the OTA version upgrade; a data difference comparison is performed on the first configuration data file and the second configuration data file to determine a data difference comparison result; compared with the prior art, the technical solution of the present invention can improve the efficiency and accuracy of data comparison.
[0123] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present application. These improvements and substitutions should also be regarded as the scope of protection of the present application.
Claims
1. A data difference comparison method, characterized in that: include: Respectively obtain a first configuration data file and a second configuration data file stored in a first file path and a second file path of a target application; wherein the first configuration data file is a file stored in the first file path after the target application receives a first broadcast signal, and the first configuration data file is a file obtained before a version OTA upgrade; the second configuration data file is a file stored in the second file path after the target application receives a second broadcast signal, and the second configuration data file is a file obtained after a version OTA upgrade; Perform a data difference comparison on the first configuration data file and the second configuration data file to determine a data difference comparison result.
2. A data difference comparison method as claimed in claim 1, characterized in that: The first configuration data file is a file stored in the first file path after the target application receives the first broadcast signal, and specifically includes: The target application parses and processes the received first broadcast signal to obtain a first file path; When it is detected that the first file path exists and no data file exists under the first file path, the target application obtains and stores the first configuration data file under the first file path; or, When it is detected that the first file path exists and a data file exists under the first file path, the data file is cleared, and the target application obtains and stores the first configuration data file under the first file path; or, When it is detected that the first file path does not exist, the target application creates the first file path, obtains and stores the first configuration data file in the first file path.
3. A data difference comparison method as claimed in claim 1, characterized in that: Comparing the first configuration data file and the second configuration data file for data differences to determine a data difference comparison result specifically includes: Acquire all first configuration data in the first configuration data file, arrange all the first configuration data in a preset arrangement order, and generate a first configuration data column; Acquire all the second configuration data in the second configuration data file, arrange all the first configuration data in a preset arrangement order, and generate a second configuration data column; The first configuration data corresponding to the first configuration data column in the target row and the second configuration data corresponding to the second configuration data column are obtained, and the first configuration data and the second configuration data are compared for data difference to obtain the data difference comparison result corresponding to the target row.
4. A data difference comparison method as claimed in claim 3, characterized in that: Performing a data difference comparison on the first configuration data and the second configuration data to obtain a data difference comparison result corresponding to the target row specifically includes: Acquire a first key value corresponding to the first configuration data, and simultaneously acquire a second key value corresponding to the second configuration data; When it is detected that the first key value and the second key value meet the numerical consistency condition, a data difference comparison result corresponding to the target row is obtained, wherein the data difference comparison result is that the data is normal; or, When it is detected that the first key value and the second key value do not satisfy the numerical consistency condition, a data difference comparison result corresponding to the target row is obtained, wherein the data difference comparison result is a data anomaly.
5. A data difference comparison method as claimed in claim 1, characterized in that: The process of generating the first broadcast signal specifically includes: Listening for a selection operation on a first target object; When a selection operation acting on the first target object is monitored, the selection operation is responded to and a first broadcast signal corresponding to the first target object is generated, wherein the first broadcast signal carries a first file path.
6. A data difference comparison method as claimed in claim 1, characterized in that: Before receiving the first broadcast signal, the target application further includes: Obtain the broadcast permission corresponding to the first broadcast signal, compare the broadcast permission with the target application permission corresponding to the target application, and when it is detected that the broadcast permission matches the target application permission, control the target application to receive the first broadcast signal; wherein the target application permission is obtained by the target application through static registration broadcast, and the broadcast permission is the permission parameter set when the first broadcast signal is sent.
7. A data difference comparison method as claimed in claim 1, characterized in that: After determining the data difference comparison result, the method further includes: When it is detected that the data difference comparison result is data anomaly, the system log is called, and the cause of the data anomaly is determined based on the system log.
8. A data difference comparison device, characterized in that: include: Configure the data file acquisition module and the data difference comparison module; Wherein, the configuration data file acquisition module is used to respectively acquire the first configuration data file and the second configuration data file stored by the target application on the first file path and the second file path; wherein, the first configuration data file is the file stored by the target application under the first file path after receiving the first broadcast signal, and the first configuration data file is the file obtained before the version OTA upgrade; the second configuration data file is the file stored by the target application under the second file path after receiving the second broadcast signal, and the second configuration data file is the file obtained after the version OTA upgrade; The data difference comparison module is used to compare the data differences between the first configuration data file and the second configuration data file, and determine a data difference comparison result.
9. A car, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the data difference comparison method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the data difference comparison method according to any one of claims 1 to 7.
