File synthesis method, device, equipment and storage medium

By querying and replacing the second file address in the vehicle calibration system, and merging the files after deduplication, the problem of low file synthesis efficiency is solved, and efficient file synthesis is achieved.

CN116414773BActive Publication Date: 2025-09-02CHERY AUTOMOBILE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310234221.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-07
Publication Date
2025-09-02
Estimated Expiration
2043-03-07

AI Technical Summary

Technical Problem

In the development process of vehicle calibration systems, multiple files need to be combined into one file to facilitate data observation and calibration, but the file synthesis efficiency in the prior art is low, resulting in high time cost.

Method used

By acquiring the first file and a plurality of second files, using the identifier of the first file to query and replace the address of the second file in the address section, the files are merged after deduplication, and the target files are generated.

Benefits of technology

It shortens the address query time, improves the efficiency of file synthesis, and reduces the time cost of synthesising target files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116414773B_ABST
    Figure CN116414773B_ABST
Patent Text Reader

Abstract

The present application discloses a file synthesis method, apparatus, device, and storage medium, belonging to the field of vehicle calibration system development. The method includes: obtaining a first file and multiple second files, wherein the first file includes an identifier of a first variable and a first address corresponding to the identifier, the first address being located in a first address segment, and any second file includes an identifier of a second variable and a second address corresponding to the identifier, the identifier of the first variable including the identifier of the second variable; based on the identifier of the second variable in each second file, querying the first address corresponding to the identifier within the first address segment; after replacing the second address in each second file with the first address, merging the multiple third files obtained to obtain a target file. Since the first address is stored in the first address segment, it is only necessary to query the first address corresponding to the identifier of the second variable in each second file within the first address segment, which shortens the query time and also shortens the time to generate the target file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of vehicle calibration system development, and in particular to a file synthesis method, device, equipment and storage medium. Background Art

[0002] During the development of a vehicle calibration system, the calibration software within the system is used to monitor and calibrate the data in the vehicle's electronic control unit. This data is often stored in files. Because multiple files are typically generated during the development of a vehicle calibration system, it's necessary to combine these files into a single file to consolidate the data within them and facilitate data monitoring and calibration. Summary of the Invention

[0003] The present invention provides a method, apparatus, device, and storage medium for file synthesis, which can be used to integrate data from multiple files to facilitate data observation and calibration. The technical solution is as follows:

[0004] In one aspect, an embodiment of the present application provides a file synthesis method, the method comprising:

[0005] Obtaining a first file and multiple second files, wherein the first file includes an identifier of a first variable and a first address corresponding to the identifier of the first variable, where the first address is located in a first address segment of the first file; and any second file includes an identifier of a second variable and a second address corresponding to the identifier of the second variable, where the identifier of the first variable includes the identifier of the second variable, and different variables have different identifiers;

[0006] Based on the identifier of the second variable in each second file, searching the first address corresponding to the identifier in the first address segment;

[0007] Replacing the second address in each of the second files with the first address corresponding to the identifier of the second variable in each of the second files to obtain a plurality of third files, where one second file corresponds to one third file;

[0008] The multiple third files are merged to obtain a target file.

[0009] In one possible implementation, the first variable includes a first calibration variable and a first observation variable, the second variable includes a second calibration variable and a second observation variable, a first calibration address corresponding to the identifier of the first calibration variable is located in a second address segment, a first observation address corresponding to the identifier of the first observation variable is located in a third address segment, the first address segment includes the second address segment and the third address segment, and querying the first address corresponding to the identifier in each second file within the first address segment includes:

[0010] Based on the identifier of the second calibration variable in each of the second files, searching the second address section for the first calibration address corresponding to the identifier;

[0011] Based on the identifiers of the second observation variables in the respective second files, the first observation addresses corresponding to the identifiers are searched in the third address section.

[0012] In a possible implementation, the second address includes a second calibration address and a second observation address, and the second address in each of the second files is replaced with the first address corresponding to the identifier of the second variable in each of the second files to obtain multiple third files, including:

[0013] The second calibration address in each of the second files is replaced by the first calibration address corresponding to the identifier of the second calibration variable in each of the second files, and the second observation address in each of the second files is replaced by the first observation address corresponding to the identifier of the second observation variable in each of the second files to obtain the multiple third files.

[0014] In a possible implementation, merging the plurality of third files to obtain a target file includes:

[0015] Traversing each third file, performing deduplication processing on the second variables having the same identifier, wherein the second variables having the same identifier are located in different third files;

[0016] The multiple third files that have undergone deduplication processing are merged to obtain a target file.

[0017] In a possible implementation, traversing each third file and performing duplicate removal on second variables having the same identifier includes:

[0018] dividing the plurality of third files into a plurality of file pairs, wherein each file pair includes two third files;

[0019] For any of the file pairs, if the identifier of the second variable in one third file is the same as the identifier of the second variable in another third file, either the second variable in the one third file or the second variable in the another third file is deleted.

[0020] In a possible implementation, merging the plurality of third files that have undergone deduplication processing to obtain a target file includes:

[0021] Merging the plurality of third files that have undergone deduplication processing to obtain an initial target file;

[0022] The comment statements in the initial target file are deleted to obtain the target file.

[0023] In a possible implementation, the second file includes at least one of an application layer file, an interface layer file, and a bottom layer file.

[0024] In another aspect, a file synthesis device is provided, the device comprising:

[0025] an acquisition module, configured to acquire a first file and a plurality of second files, wherein the first file includes an identifier of a first variable and a first address corresponding to the identifier of the first variable, the first address being located in a first address segment of the first file, and any second file includes an identifier of a second variable and a second address corresponding to the identifier of the second variable, the identifier of the first variable includes the identifier of the second variable, and different variables have different identifiers;

[0026] a query module, configured to query, based on the identifier of the second variable in each second file, a first address corresponding to the identifier in the first address segment;

[0027] A replacement module, configured to replace the second addresses in the respective second files with the first addresses corresponding to the identifiers of the second variables in the respective second files, to obtain a plurality of third files, wherein one second file corresponds to one third file;

[0028] The merging module is used to merge the multiple third files to obtain a target file.

[0029] In one possible implementation, the first variable includes a first calibration variable and a first observation variable, the second variable includes a second calibration variable and a second observation variable, the first calibration address corresponding to the identifier of the first calibration variable is located in the second address segment, the first observation address corresponding to the identifier of the first observation variable is located in the third address segment, the first address segment includes the second address segment and the third address segment, and the query module is used to query the first calibration address corresponding to the identifier in the second address segment based on the identifier of the second calibration variable in each of the second files; and query the first observation address corresponding to the identifier in the third address segment based on the identifier of the second observation variable in each of the second files.

[0030] In one possible implementation, the second address includes a second calibration address and a second observation address, and the replacement module is used to replace the second calibration address in each of the second files with the first calibration address corresponding to the identifier of the second calibration variable in each of the second files, and replace the second observation address in each of the second files with the first observation address corresponding to the identifier of the second observation variable in each of the second files, to obtain the multiple third files.

[0031] In one possible implementation, the merging module is used to traverse each third file and perform deduplication processing on the second variables with the same identifier, where the second variables with the same identifier are located in different third files; and merge the multiple third files that have undergone deduplication processing to obtain a target file.

[0032] In one possible implementation, the merging module is used to divide the multiple third files into multiple file pairs, any file pair including two third files; for any file pair, if the identifier of the second variable in one third file is the same as the identifier of the second variable in another third file, then delete any one of the second variable in the one third file and the second variable in the other third file.

[0033] In a possible implementation, the merging module is configured to merge the plurality of third files that have undergone deduplication processing to obtain an initial target file; and delete comment statements in the initial target file to obtain the target file.

[0034] In a possible implementation, the second file includes at least one of an application layer file, an interface layer file, and a bottom layer file.

[0035] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the computer device implements any of the above-mentioned file synthesis methods.

[0036] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to enable a computer to implement any of the above-mentioned file synthesis methods.

[0037] In another aspect, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the above-described file synthesis methods.

[0038] The technical solutions provided by the embodiments of the present application bring at least the following beneficial effects:

[0039] In an embodiment of the present application, the first file includes an identifier for a first variable and a first address corresponding to the identifier, and the first address is located in the first address segment; the second file includes an identifier for a second variable and a second address corresponding to the identifier. Because the identifier of the first variable contains the identifier of the second variable, and the first address is located in the first address segment, the first address corresponding to the identifier of the second variable in each second file can be queried through the first address segment. This method shortens the query time for the first address and has high query efficiency. Due to the shortened query time, the time cost of subsequently merging multiple files to obtain the target file is also reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0041] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0042] Figure 2 This is a flowchart of a file synthesis method provided by an embodiment of the present application;

[0043] Figure 3This is a flowchart of a method for performing deduplication processing on second variables having the same identifier, provided by an embodiment of the present application;

[0044] Figure 4 This is a flowchart of a method for obtaining a target file provided in an embodiment of the present application;

[0045] Figure 5 is a schematic diagram of a file synthesis method provided in an embodiment of the present application;

[0046] Figure 6 This is a schematic structural diagram of a file synthesis device provided in an embodiment of the present application;

[0047] Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of the present application;

[0048] Figure 8 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0050] The following is an introduction to the terms involved in the embodiments of this application.

[0051] A2L file: A descriptive file for calibration, so called because the file name ends in .a2l. During the development of a vehicle calibration system, the calibration software (also called host computer software) in the vehicle calibration system is required to observe and calibrate the data in the vehicle's Electronic Control Unit (ECU). The observed and calibrated data is usually stored in an A2L file. The calibration software parses the A2L file using CCP (CAN Calibration Protocol, a calibration protocol based on the CAN bus) or XCP (Universal Calibration Protocol), enabling observation and calibration of ECU data.

[0052] Based on the different layers of ECU software, A2L files can be divided into application layer A2L files, interface layer A2L files, and bottom layer A2L files. In terms of file content, A2L files include device parameter information, interface data information, and ECU parameter information. Device parameter information describes the basic information of the ECU and the common attributes of the ECU data unit; interface data information describes the interface information required for communication between the calibration system and the ECU; and ECU parameter information describes the detailed contents of the ECU's internal data units.

[0053] ASAP (the Working Group for the Standardization of Application Systems) 2 standard: This standard specifies the description specifications for ECU internal data units. Therefore, the ASAP 2 standard is expressed in the A2L file.

[0054] The Electronic Control Unit (ECU), also known as the vehicle's "on-board computer," controls the vehicle's driving state and various functions. It operates by collecting and exchanging data via sensors and buses, determining the vehicle's status, and controlling actuators to control the vehicle.

[0055] Calibration: Based on the performance requirements of the ECU, the parameters in the ECU are modified online through the calibration software to achieve the purpose of optimizing the ECU performance.

[0056] Observation: Observe the impact of different parameters on the ECU operating status, assist in the calibration process, and optimize ECU performance.

[0057] This application embodiment provides a file synthesis method, please refer to Figure 1 , which shows a schematic diagram of an implementation environment of the method provided in an embodiment of the present application. The implementation environment may include: a terminal 11 and a server 12.

[0058] When a file needs to be synthesized, the terminal 11 can use the method provided in the embodiment of the present application to perform the synthesis. In addition, the server 12 can store the files to be synthesized, and the terminal 11 can obtain the files to be synthesized from the server 12 and then perform the synthesis operation on the files. Of course, the terminal 11 can also store the files to be synthesized.

[0059] Optionally, the terminal 11 can be any electronic product that can interact with the user through one or more methods such as a keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as a PC (Personal Computer), a mobile phone, a smart phone, a PDA (Personal Digital Assistant), a wearable device, a PPC (Pocket PC), a tablet computer, a smart car computer, a smart TV, a smart speaker, etc. The server 12 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. The terminal 11 establishes a communication connection with the server 12 via a wired or wireless network.

[0060] Those skilled in the art should understand that the above-mentioned terminal 11 and server 12 are only examples. Other existing or future terminals or servers that are applicable to this application should also be included in the scope of protection of this application and are included here by reference.

[0061] The present application embodiment provides a file synthesis method which can be applied to the above Figure 1 The implementation environment shown in Figure 1 is as follows. Figure 2 As shown, taking the method applied to a terminal as an example, the method includes the following steps 201 to 204.

[0062] In step 201, a first file and multiple second files are obtained, the first file includes an identifier of a first variable and a first address corresponding to the identifier of the first variable, the first address is located in the first address segment of the first file, any second file includes an identifier of a second variable and a second address corresponding to the identifier of the second variable, the identifier of the first variable contains the identifier of the second variable, and different variables have different identifiers.

[0063] In an exemplary embodiment, the first file can be generated by a compiler and saved in the .adx format. Typically, the number of first files is 1. The first file stores the identifier of the first variable and the first address corresponding to the identifier of the first variable. The identifier of the first variable can be the ID (Identity Document) of the first variable or the name of the first variable, which is not limited in the embodiment of the present application. One first variable corresponds to one identifier. If the first variables are different, the identifiers are also different.

[0064] In addition, the second file may be an A2L file. In one possible implementation, the second file includes at least one of an application layer file, an interface layer file, and a bottom layer file. This application does not limit the number of application layer A2L files, interface layer A2L files, and bottom layer A2L files. Typically, the number of application layer files is one, the number of bottom layer files is one, and the number of interface layer files may be one or more, such as three. Optionally, the second file may include one application layer file, one bottom layer file, and three interface layer files.

[0065] The embodiment of the present application does not limit the method for generating the second file. For example, the default configuration of Matlab / Simulink software (a computer simulation software) can be used for compilation to generate the electronic control unit embedded C code and the corresponding multiple second files. Because the software default configuration is used for compilation, the generated second file contains the initial address of the second variable. For example, the initial address of the second variable can be 0x0000.

[0066] Furthermore, the identifier of the first variable includes the identifier of the second variable, that is, the first variable includes the second variable. In an exemplary embodiment, the first variable and the second variable may be completely identical or not completely identical. For example, if the first variable is completely identical to the second variable, it means that the first variable is equivalent to the union of the multiple second variables included in the multiple second files; if the first variable and the second variable are not completely identical, it means that the first variable may include other variables in addition to the union of the multiple second variables.

[0067] Regardless of the above-mentioned relationship between the first variable and the second variable, the second variable in any second file exists in the first variable of the first file and does not affect the implementation of the method provided in the embodiment of the present application.

[0068] In step 202 , based on the identifiers of the second variables in the respective second files, a first address corresponding to the identifier is searched in the first address section.

[0069] For example, if the identifier of any second variable in any second file is *a, since the identifier of the first variable includes the identifier of the second variable, the first address corresponding to the identifier *a will exist in the first address segment in the first file.

[0070] Taking the development of a vehicle calibration system as an example, as an example, the process typically involves two variables: a calibration variable and an observation variable. In this case, the first variable can be divided into a first calibration variable and a first observation variable based on variable type. Similarly, the second variable can be divided into a second calibration variable and a second observation variable.

[0071] In an exemplary embodiment, the first calibration variable and the first observation variable are stored in different storage media. For example, the storage media for the first calibration variable may be a Flash memory (also known as flash memory), while the storage media for the first observation variable may be a RAM (Random Access Memory). Because the first calibration variable and the first observation variable are stored in different storage media, they are located in different address segments in the first file.

[0072] Based on the above content, exemplarily, the first calibration address corresponding to the identifier of the first calibration variable is located in the second address segment, the first observation address corresponding to the identifier of the first observation variable is located in the third address segment, and the first address segment includes the second address segment and the third address segment.

[0073] Therefore, in one possible implementation, based on the identifier of the second variable in each second file, the first address corresponding to the identifier is queried within the first address segment, including: based on the identifier of the second calibration variable in each second file, the first calibration address corresponding to the identifier is queried within the second address segment; based on the identifier of the second observation variable in each second file, the first observation address corresponding to the identifier is queried within the third address segment.

[0074] The query principle of the first calibration address and the first observation address is the same as the query principle of the first address mentioned above, and will not be repeated here. In addition, the embodiment of the present application does not limit the range of the second address segment and the third address segment, and can be flexibly set according to experience or actual application scenarios. For example, the second address segment can be 0x80340000-0x803FFFFF; the third address segment can be 0x60000000-0x6010BFFF.

[0075] In step 203 , the second address in each second file is replaced with the first address corresponding to the identifier of the second variable in each second file, thereby obtaining a plurality of third files, where one second file corresponds to one third file.

[0076] For example, if the identifier of any second variable in any second file is *a, and the first address corresponding to the identifier *a is 0x80340000 and the second address corresponding to the identifier *a is 0x0000, then the second address 0x0000 is replaced with 0x80340000. By replacing the addresses of the second variables in each second file using the above method, multiple third files can be generated.

[0077] According to the contents of step 202, when the first variable includes the first calibration variable and the first observation variable, and the second variable includes the second calibration variable and the second observation variable, the second address includes the second calibration address and the second observation address. Replacing the second address in each second file with the first address corresponding to the identifier of the second variable in each second file to obtain multiple third files includes: replacing the second calibration address in each second file with the first calibration address corresponding to the identifier of the second calibration variable in each second file, and replacing the second observation address in each second file with the first observation address corresponding to the identifier of the second observation variable in each second file, to obtain multiple third files.

[0078] The replacement principle of the second calibration address and the second observation address is the same as the replacement principle of the second address mentioned above, and will not be repeated here.

[0079] In step 204, a plurality of third files are merged to obtain a target file.

[0080] For example, if the second file contains an application layer file, an interface layer file, and a bottom layer file, variables within the files at different layers may be interrelated. For example, if a calibration variable is used in both the application layer and the interface layer, it will appear repeatedly in both the application layer and the interface layer files. Given this, multiple third files generated by address replacement in multiple second files may contain duplicate variables. Therefore, duplicate variables need to be deduplicated.

[0081] In one possible implementation, a plurality of third files are merged to obtain a target file, including: traversing each third file, deduplicating second variables with the same identifier, where the second variables with the same identifier are located in different third files; and merging the plurality of third files that have undergone deduplication to obtain the target file.

[0082] like Figure 3 As shown, the method of traversing each third file and performing deduplication processing on the second variables with the same identifier includes the following steps 2041 to 2042.

[0083] Step 2041: Divide the plurality of third files into a plurality of file pairs, where each file pair includes two third files.

[0084] Dividing the plurality of third files into a plurality of file pairs refers to combining the plurality of third files in pairs. For example, if there are four third files A, B, C, and D, then a total of six file pairs can be divided, namely, file pairs (A, B), (A, C), (A, D), (B, C), (B, D), and (C, D).

[0085] Step 2042: For any file pair, if the identifier of the second variable in one third file is the same as the identifier of the second variable in another third file, delete any one of the second variable in one third file and the second variable in another third file.

[0086] For example, if the identifier of any second variable in the third file A is searched, it is necessary to determine whether the identifier of any second variable exists in the third file B, the third file C, and the third file D. Taking the above-mentioned file pair (A, B) as an example, if the identifier of the second variable a in the third file A is the same as the identifier of the second variable b in the third file B, since different variables have different identifiers, it can be determined that the second variable a is the same as the second variable b. In this case, the second variable a in the third file A can be deleted, or the second variable b in the third file B can be deleted. The method for searching the identifier of the second variable a in the file pairs (A, C) and (A, D) is similar.

[0087] In the process of searching for a second variable a with the same identifier as above, you can use the regular expression r"\s+ / \*\s+Name\s+\* / " to match the identifier of the second variable a. This method can quickly find variables with the same identifier with high accuracy.

[0088] After obtaining multiple third files that have undergone deduplication processing, the multiple third files are merged to obtain the target file. Figure 4 As shown, this step may include the following steps 2043 to 2044.

[0089] Step 2043: Merge the multiple third files that have undergone deduplication processing to obtain an initial target file.

[0090] Any third file includes multiple different file blocks such as HEADER, MODULE, AXIS_PTS, CHARACTERISTIC, MEASUREMENT, COMPU_METHOD, GROUP, etc.

[0091] Among them, HEADER is used to describe project information, such as project number, project version, etc. A third file corresponds to a project. MODULE contains all relevant information of ECU, such as memory allocation of ECU, etc. CHARACTERISTIC is used to define calibration variables, including the name and address of calibration variables. AXIS_PTS is used to define the type of axis corresponding to the variable. For example, when the calibration variable requires multiple axes (X, Y) to determine, AXIS_PTS is needed to define one of the axes. MEASUREMENT is used to define observation variables, including the name and address of the observation variable. COMPU_METHOD is used to define calculation formulas, which can be referenced by calibration variables and observation variables. GROUP is used to combine calibration variables and observation variables according to a certain logic, forming a drop-down menu in the calibration software, so that users can select variables from it.

[0092] Therefore, when performing a merging operation on multiple third files, it is sufficient to merge multiple file blocks of each third file to obtain an initial target file.

[0093] Step 2044: Delete the comment statements in the initial target file to obtain the target file.

[0094] After obtaining the initial target file, you can delete the comment statements in the initial target file. This operation can also be called initializing the initial target file. After deleting the comment statements, the number of target files obtained is 1.

[0095] In an exemplary embodiment, a regular expression can be used to delete comment statements in a file. For example, in an A2L file, / ** / represents a comment statement. For the string ' / *ECU Address* / 0x0000 / *@ECU_Address@TCM_stTraShiftInProgress_E@* / ' that can reflect the variable address, ' / *ECU Address* / ' and ' / *@ECU_Address@TCM_stTraShiftInProgress_E@* / ' are comment statements. If you need to delete ' / *ECU Address* / ' and ' / *@ECU_Address@TCM_stTraShiftInProgress_E@* / ' in the string and retain the '0x0000' substring in the string, you can use the regular matching expression "\s+ / \*.*?\* / ". This expression can quickly delete comment statements in a string by performing greedy matching and returning as few matches as possible.

[0096] Figure 5 Schematic diagram of the file synthesis method. Figure 5 In the example, the application layer file in 501 is automatically generated based on the Matlab / Simulink automatic code tool; the interface layer file is independently developed by the user; the bottom layer file is delivered as a black box by the supplier; 502 is a burnable file, which is the machine code file obtained by the compiler after the application layer, interface layer and bottom layer source code are compiled and linked. This file contains the actual addresses of all application layer, interface layer and bottom layer variables. After replacing the variable addresses in multiple A2L files with the actual addresses of the corresponding variables in the burnable files, the function recursive method in 503 is used to traverse multiple A2L files, and then the identifiers of the variables in multiple A2L files are matched using regular matching expressions, and the identifiers of the same variables are searched for duplicates and duplicate operations are removed. Then, multiple A2L files are merged, and the comment statements in the merged files are deleted using the greedy matching method, and the target file 504 is finally obtained.

[0097] In an embodiment of the present application, the first file includes an identifier for a first variable and a first address corresponding to the identifier, and the first address is located in the first address segment; the second file includes an identifier for a second variable and a second address corresponding to the identifier. Because the identifier of the first variable contains the identifier of the second variable, and the first address is located in the first address segment, the first address corresponding to the identifier of the second variable in each second file can be queried through the first address segment. This method shortens the query time for the first address and has high query efficiency. Due to the shortened query time, the time cost of subsequently merging multiple files to obtain the target file is also reduced.

[0098] See also Figure 6 , an embodiment of the present application provides a file synthesis device, the device comprising:

[0099] An acquisition module 601 is configured to acquire a first file and multiple second files, wherein the first file includes an identifier of a first variable and a first address corresponding to the identifier of the first variable, where the first address is located in a first address segment of the first file; and any second file includes an identifier of a second variable and a second address corresponding to the identifier of the second variable, where the identifier of the first variable includes the identifier of the second variable, and different variables have different identifiers.

[0100] A query module 602 is configured to query, based on the identifier of the second variable in each second file, a first address corresponding to the identifier in the first address segment;

[0101] A replacement module 603 is configured to replace the second address in each second file with the first address corresponding to the identifier of the second variable in each second file, thereby obtaining a plurality of third files, where one second file corresponds to one third file;

[0102] The merging module 604 is configured to merge the plurality of third files to obtain a target file.

[0103] In one possible implementation, the first variable includes a first calibration variable and a first observation variable, the second variable includes a second calibration variable and a second observation variable, the first calibration address corresponding to the identifier of the first calibration variable is located in the second address segment, the first observation address corresponding to the identifier of the first observation variable is located in the third address segment, the first address segment includes the second address segment and the third address segment, and the query module 602 is used to query the first calibration address corresponding to the identifier in the second address segment based on the identifier of the second calibration variable in each second file; and query the first observation address corresponding to the identifier in the third address segment based on the identifier of the second observation variable in each second file.

[0104] In one possible implementation, the second address includes a second calibration address and a second observation address, and the replacement module 603 is used to replace the second calibration address in each second file with the first calibration address corresponding to the identifier of the second calibration variable in each second file, and replace the second observation address in each second file with the first observation address corresponding to the identifier of the second observation variable in each second file, to obtain multiple third files.

[0105] In one possible implementation, the merging module 604 is used to traverse each third file and perform deduplication processing on the second variables with the same identifier, where the second variables with the same identifier are located in different third files; and merge the multiple third files that have undergone deduplication processing to obtain a target file.

[0106] In one possible implementation, the merging module 604 is configured to divide the plurality of third files into a plurality of file pairs, wherein any file pair includes two third files; and for any file pair, if an identifier of a second variable in one third file is the same as an identifier of a second variable in another third file, then either the second variable in one third file or the second variable in the other third file is deleted.

[0107] In a possible implementation, the merging module 604 is configured to merge the plurality of third files that have undergone deduplication processing to obtain an initial target file; and delete comment statements in the initial target file to obtain the target file.

[0108] In a possible implementation, the second file includes at least one of an application layer file, an interface layer file, and a bottom layer file.

[0109] In an embodiment of the present application, the first file includes an identifier for a first variable and a first address corresponding to the identifier, and the first address is located in the first address segment; the second file includes an identifier for a second variable and a second address corresponding to the identifier. Because the identifier of the first variable includes the identifier of the second variable, and the first address is located in the first address segment, the first address corresponding to the identifier of the second variable in each second file can be queried through the first address segment. This device shortens the query time for the first address and has high query efficiency. Due to the shortened query time, the time cost of subsequently merging multiple files to obtain the target file is also reduced.

[0110] It should be noted that the apparatus provided in the above embodiments is merely illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0111] Figure 7This is a structural diagram of a server provided in an embodiment of the present application. The server may have relatively large differences due to different configurations or performances, and may include one or more processors 701 and one or more memories 702, wherein the processor 701 may be a central processing unit (CPU), and the one or more memories 702 store at least one computer program, which is loaded and executed by the one or more processors 701 to enable the server to implement the file synthesis method provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.

[0112] Figure 8 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may be a smartphone, tablet computer, laptop computer, or desktop computer. The terminal may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.

[0113] Typically, the terminal includes: a processor 1501 and a memory 1502 .

[0114] The processor 1501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1501 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1501 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0115] Memory 1502 may include one or more computer-readable storage media, which may be non-transitory. Memory 1502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1502 is used to store at least one instruction, which is executed by processor 1501 to enable the terminal to implement the file synthesis method provided in the method embodiment of the present application.

[0116] In some embodiments, the terminal may optionally include a peripheral device interface 1503 and at least one peripheral device. The processor 1501, memory 1502, and peripheral device interface 1503 may be connected via a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 1503 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1504, a display screen 1505, a camera assembly 1506, an audio circuit 1507, a positioning assembly 1508, and a power supply 1509.

[0117] The peripheral device interface 1503 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1501 and the memory 1502. In some embodiments, the processor 1501, the memory 1502, and the peripheral device interface 1503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1501, the memory 1502, and the peripheral device interface 1503 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0118] RF circuit 1504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1504 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1504 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. RF circuit 1504 may optionally include an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. RF circuit 1504 may communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, RF circuit 1504 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0119] Display screen 1505 is used to display a user interface (UI). This UI may include graphics, text, icons, videos, or any combination thereof. When display screen 1505 is a touchscreen display, it is also capable of collecting touch signals on or above the surface of display screen 1505. These touch signals can be input as control signals to processor 1501 for processing. Display screen 1505 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 1505, located on the front panel of the terminal. In other embodiments, there can be at least two display screens 1505, located on different surfaces of the terminal or in a foldable design. In still other embodiments, display screen 1505 can be a flexible display screen, located on a curved or foldable surface of the terminal. Display screen 1505 can also be configured as a non-rectangular, irregular shape, also known as a special-shaped screen. Display screen 1505 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0120] The camera assembly 1506 is used to capture images or videos. Optionally, the camera assembly 1506 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1506 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0121] The audio circuit 1507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1501 for processing, or input into the radio frequency circuit 1504 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each disposed at different locations of the terminal. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1501 or the radio frequency circuit 1504 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1507 may also include a headphone jack.

[0122] The positioning component 1508 is used to locate the current geographical location of the terminal to implement navigation or LBS (Location Based Service).

[0123] Power supply 1509 is used to power various components in the terminal. Power supply 1509 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1509 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0124] In some embodiments, the terminal further includes one or more sensors 1510 , including but not limited to: an acceleration sensor 1511 , a gyroscope sensor 1512 , a pressure sensor 1513 , a fingerprint sensor 1514 , an optical sensor 1515 , and a proximity sensor 1516 .

[0125] The accelerometer 1511 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal. For example, the accelerometer 1511 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 1501 can control the display screen 1505 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 1511. The accelerometer 1511 can also be used to collect game or user motion data.

[0126] The gyroscope sensor 1512 can detect the terminal's body orientation and rotation angle. It can work in conjunction with the accelerometer 1511 to collect the user's 3D movements of the terminal. Based on the data collected by the gyroscope sensor 1512, the processor 1501 can implement the following functions: motion sensing (such as changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0127] The pressure sensor 1513 can be set in the side frame of the terminal and / or the lower layer of the display screen 1505. When the pressure sensor 1513 is set in the side frame of the terminal, it can detect the user's grip signal of the terminal, and the processor 1501 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 1513. When the pressure sensor 1513 is set in the lower layer of the display screen 1505, the processor 1501 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 1505. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0128] The fingerprint sensor 1514 is used to collect the user's fingerprint, and the processor 1501 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 1514, or the fingerprint sensor 1514 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 1501 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 1514 can be set on the front, back, or side of the terminal. When a physical button or manufacturer logo is set on the terminal, the fingerprint sensor 1514 can be integrated with the physical button or manufacturer logo.

[0129] Optical sensor 1515 is used to detect ambient light intensity. In one embodiment, processor 1501 can control the display brightness of display screen 1505 based on the ambient light intensity detected by optical sensor 1515. Specifically, when the ambient light intensity is high, the display brightness of display screen 1505 is increased; when the ambient light intensity is low, the display brightness of display screen 1505 is decreased. In another embodiment, processor 1501 can also dynamically adjust the shooting parameters of camera assembly 1506 based on the ambient light intensity detected by optical sensor 1515.

[0130] Proximity sensor 1516, also known as a distance sensor, is typically located on the front panel of the terminal. Proximity sensor 1516 is used to detect the distance between the user and the front of the terminal. In one embodiment, when proximity sensor 1516 detects that the distance between the user and the front of the terminal is gradually decreasing, processor 1501 controls display screen 1505 to switch from the screen-on state to the screen-off state. When proximity sensor 1516 detects that the distance between the user and the front of the terminal is gradually increasing, processor 1501 controls display screen 1505 to switch from the screen-off state to the screen-on state.

[0131] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0132] In an exemplary embodiment, a computer device is further provided, comprising a processor and a memory, wherein the memory stores at least one computer program. The at least one computer program is loaded and executed by one or more processors to enable the computer device to implement any of the above-mentioned file synthesis methods.

[0133] In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor of a computer device to enable the computer to implement any of the above-mentioned file synthesis methods.

[0134] In one possible implementation, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0135] In an exemplary embodiment, a computer program product or computer program is also provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the above-described file synthesis methods.

[0136] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, storage, display, etc.), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the first file involved in this application was obtained with full authorization.

[0137] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.

[0138] It should be noted that the terms "first," "second," etc. (if any) in the specification and claims of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the above exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0139] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A file synthesis method, characterized in that: The method comprises: Obtain a first file and multiple second files, wherein the first file includes an identifier of a first variable and a first address corresponding to the identifier of the first variable, the first address being located in a first address segment in the first file, and any second file includes an identifier of a second variable and a second address corresponding to the identifier of the second variable, the identifier of the first variable includes the identifier of the second variable, and different variables have different identifiers; wherein the first variable includes a first calibration variable and a first observation variable, the second variable includes a second calibration variable and a second observation variable, the first calibration address corresponding to the identifier of the first calibration variable is located in the second address segment, the first observation address corresponding to the identifier of the first observation variable is located in a third address segment, and the first address segment includes the second address segment and the third address segment; wherein the first file is a file in the .adx format generated by a compiler; and the second file is an A2L file; Based on the identifier of the second calibration variable in each of the second files, querying the second address segment for a first calibration address corresponding to the identifier of the second calibration variable; based on the identifier of the second observation variable in each of the second files, querying the third address segment for a first observation address corresponding to the identifier of the second observation variable; Replacing the second calibration addresses in each of the second files with the first calibration addresses corresponding to the identifiers of the second calibration variables in each of the second files, and replacing the second observation addresses in each of the second files with the first observation addresses corresponding to the identifiers of the second observation variables in each of the second files, to obtain the plurality of third files, where one second file corresponds to one third file; Traverse each third file and deduplicate the second variables with the same identifier, where the second variables with the same identifier are located in different third files; merge the multiple third files that have undergone deduplication to obtain an initial target file; and use a greedy matching method to delete comment statements in the initial target file to obtain the target file.

2. The method according to claim 1, characterized in that The traversing each third file and performing duplicate removal on the second variables having the same identifier includes: dividing the plurality of third files into a plurality of file pairs, wherein each file pair includes two third files; For any of the file pairs, if the identifier of the second variable in one third file is the same as the identifier of the second variable in another third file, either the second variable in the one third file or the second variable in the another third file is deleted.

3. The method according to any one of claims 1-2, characterized in that The second file includes at least one of an application layer file, an interface layer file, and a bottom layer file.

4. A file synthesis device, characterized in that: The device comprises: An acquisition module is configured to acquire a first file and multiple second files, wherein the first file includes an identifier of a first variable and a first address corresponding to the identifier of the first variable, the first address being located in a first address segment in the first file, and any second file includes an identifier of a second variable and a second address corresponding to the identifier of the second variable, the identifier of the first variable including the identifier of the second variable, and different variables having different identifiers; the first variable includes a first calibration variable and a first observation variable, the second variable includes a second calibration variable and a second observation variable, the first calibration address corresponding to the identifier of the first calibration variable being located in a second address segment, the first observation address corresponding to the identifier of the first observation variable being located in a third address segment, the first address segment including the second address segment and the third address segment; wherein the first file is a file in the .adx format generated by a compiler; and the second file is an A2L file; a query module configured to query, within the second address segment, a first calibration address corresponding to the identifier of the second calibration variable based on the identifier of the second calibration variable in each of the second files; and query, within the third address segment, a first observation address corresponding to the identifier of the second observation variable based on the identifier of the second observation variable in each of the second files; a replacement module, configured to replace the second calibration addresses in each of the second files with the first calibration addresses corresponding to the identifiers of the second calibration variables in each of the second files, and replace the second observation addresses in each of the second files with the first observation addresses corresponding to the identifiers of the second observation variables in each of the second files, to obtain the plurality of third files, with one second file corresponding to one third file; The merging module is used to traverse each third file and deduplicate the second variables with the same identifier, where the second variables with the same identifier are located in different third files; merge the multiple third files that have been deduplicated to obtain an initial target file; and use a greedy matching method to delete the comment statements in the initial target file to obtain the target file.

5. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor, so that the computer device implements the file synthesis method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement the file synthesis method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • A2L file merging method and apparatus

    CN108733674A