File generation method and device
By writing file contents into file metadata, the content merging between multiple files is solved, and the problem of inability to merge file contents in the prior art is improved, and file query and analysis efficiency and data security are improved.
Patent Information
- Application Number
- CN202410959002.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-29
AI Technical Summary
The prior art cannot directly merge multiple report files that cannot read file contents, and can only perform page reordering, and cannot merge file contents, resulting in inefficiency of users when viewing and analyzing.
The file content is first written in the metadata of each file, so that the file content merging between multiple files can be realized through metadata to generate a merged file.
Through the merger of file content, the generated merged files are easier to query and analyze data, which improves the user's query and analysis efficiency of merged files, and enhances the efficiency of file filtering and data security.
Smart Images

Figure CN119046037A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the general field of data processing technology, and in particular to a file generation method and device. Background Art
[0002] After using diagnostic equipment to diagnose the vehicle under test, each type of operation will generate a report file, such as a fault code report and a data flow report. However, in order to facilitate user viewing, it is generally necessary to merge multiple scattered report files into a total report file. However, this report file is generally a file that cannot directly read the file content, such as a report file in PDF (portable document format). The merging of this type of report file is generally only an operation of reordering the pages, and it is impossible to merge the file content. Summary of the invention
[0003] The present application provides a file generation method and device, by first writing the file content of each file into the metadata of the file, so that the file content of multiple files can be merged later according to the file content in the metadata of each file.
[0004] In a first aspect, the present application provides a method for generating a file, the method comprising:
[0005] Acquire multiple target files, where file contents of the multiple target files cannot be directly read, and metadata of each target file among the multiple target files includes the file contents of the target file previously written;
[0006] Get the file content in the metadata of each target file among multiple target files;
[0007] Merging the file content in the metadata of each target file in the multiple target files to obtain merged file content;
[0008] Generate a merged file based on the merged file content.
[0009] It can be seen that in this application, for the merging of multiple target files whose file contents cannot be directly read, it is necessary to first write the file contents of each target file in the metadata of the target file, so that when the files are merged, the file contents of multiple target files can be merged by obtaining the file contents in the metadata of each target file. Compared with the existing merging of file pages, this application makes the generated merged file easier to query and analyze data based on the merging of file contents, thereby improving the efficiency of users in querying and analyzing data on merged files.
[0010] In a feasible example, the file content includes basic file information, and acquiring multiple target files includes: selecting multiple target files from the multiple files according to the relevance of basic file information of different files.
[0011] In the present application, the files to be merged are screened by the correlation between the basic file information of different files, so that the efficiency of screening the files to be merged can be improved.
[0012] In a feasible example, the target file is a vehicle fault diagnosis file, and the basic information of the file includes at least one of the detected vehicle information, maintenance organization name, file type, file generation status, file generation time, maintenance personnel, and diagnostic software version; before selecting multiple target files from multiple files according to the correlation of the basic information of different files, the method also includes: when at least one piece of information in the basic information of different files is the same, or the difference between the basic information of different files is less than a preset range, determining that the basic information of different files is correlated.
[0013] In the present application, for a vehicle fault diagnosis file that contains multiple types of basic file information, when determining whether the basic file information is related, the relationship between at least one type of information can be used to determine the relationship, which can improve the richness of screening the target file.
[0014] In a feasible example, the file content included in the metadata of each target file is in an encrypted state, and obtaining the file content in the metadata of each target file among multiple target files includes: obtaining the encrypted file content in the metadata of each target file among multiple target files; decrypting the encrypted file content to obtain the decrypted file content.
[0015] In this application, the file content is encrypted and written into the file's metadata, which can improve the data security of the file content.
[0016] In a feasible example, the file content includes basic file information in a first attribute and detailed file data in a second attribute, and the file content in the metadata of each target file in multiple target files is merged to obtain merged file content, including: merging the basic file information in the metadata of each target file in the multiple target files into merged file basic information, and merging the file detailed data in the metadata of each target file in the multiple target files into merged file detailed data; determining the merged file content based on the merged file basic information and the merged file detailed data.
[0017] In this application, the basic file information and the detailed file data are written into different single attributes, so that the basic file information and the detailed file data can be obtained separately in the future. In addition, the report content is divided into the basic file information and the detailed file data, and the basic file information and the detailed file data are merged separately, so that the merging of the file content is logical.
[0018] In a feasible example, the merged file basic information includes at least one merged sub-information, and the merged file detailed data includes at least one merged sub-data; the file basic information in the metadata of each target file in multiple target files is merged into the merged file basic information, and the file detailed data in the metadata of each target file in multiple target files is merged into the merged file detailed data, including: merging the file basic information with the same or related data types in the metadata of multiple target files to obtain at least one merged sub-information; merging the file detailed data with the same or related data types in the metadata of multiple target files to obtain at least one merged sub-data.
[0019] In the present application, the merging of basic file information and detailed file data of multiple target files is performed based on the basic file information or detailed file data of the same or related data types, thereby making the merged file content easier to query and analyze, thereby improving the efficiency of users in querying and analyzing data through the merged file content.
[0020] In a feasible example, when a merged file is generated based on merged file content, the merged file content is written into the metadata of the merged file. After the merged file is generated based on the merged file content, the method also includes: obtaining a first file content, and the merged file content in the metadata of the merged file, wherein the first file corresponding to the first file content is a file that can directly read the file content; merging the first file content with the merged file content to obtain a first merged file content; and generating a first merged file based on the first merged file content.
[0021] In the present application, the merged file can also be merged with other files that can directly obtain the file content, thereby increasing the scope of application of file merging.
[0022] In a second aspect, the present application provides a file generation device, the device comprising:
[0023] An acquisition unit, used for acquiring a plurality of target files, wherein the file contents of the plurality of target files cannot be directly read, and the metadata of each target file in the plurality of target files includes the file contents of the target file previously written;
[0024] The acquisition unit is further used to acquire the file content in the metadata of each target file in the plurality of target files;
[0025] A processing unit, configured to merge the file content in the metadata of each target file among the multiple target files to obtain merged file content;
[0026] The processing unit is further used to generate a merged file according to the merged file content.
[0027] In a third aspect, the present application provides an electronic device comprising a processor, a memory, and a communication interface. The processor, the memory, and the communication interface are interconnected and perform communication with each other. The memory stores executable program code, the communication interface is used for wireless communication, and the processor is used to call the executable program code stored in the memory to execute, for example, some or all of the steps described in any method of the first aspect.
[0028] In a fourth aspect, the present application provides a computer-readable storage medium, in which electronic data is stored. When the electronic data is executed by a processor, it is used to execute the electronic data to implement some or all of the steps described in the first aspect of the present application.
[0029] In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative work.
[0031] Figure 1 A schematic diagram of the structure of a file generation system provided in an embodiment of the present application;
[0032] Figure 2 A flowchart of a file generation method provided in an embodiment of the present application;
[0033] Figure 3 A schematic diagram of a file storage directory structure provided in an embodiment of the present application;
[0034] Figure 4 A schematic diagram of a process of merging file contents provided in an embodiment of the present application;
[0035] Figure 5A schematic diagram of another process of merging file contents provided in an embodiment of the present application;
[0036] Figure 6 A block diagram of the functional units of a file generation device provided in an embodiment of the present application;
[0037] Figure 7 A block diagram of the functional units of another file generation device provided in an embodiment of the present application;
[0038] Figure 8 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps is not limited to the listed steps, but optionally includes steps that are not listed, or optionally includes other steps inherent to these processes, methods, products or devices.
[0041] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0042] See also Figure 1 , Figure 1 A schematic diagram of the structure of a file generation system provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the file generating system 100 includes a terminal device 101 and a diagnostic device 102 .
[0043] The terminal device 101 is a device that generates files after the user performs a diagnostic operation, such as a desktop computer, a laptop computer, a tablet computer, a smart phone, etc., and a diagnostic program is installed on the terminal device 101.
[0044] The diagnostic device 102 is connected to the terminal device 101 and the vehicle respectively. The user invokes the diagnostic device 102 to obtain the diagnostic data on the vehicle by executing the diagnostic program on the terminal device 101, thereby generating a file based on the diagnostic data. The diagnostic device 102 can be independent of the vehicle or installed on the vehicle.
[0045] Specifically, when the terminal device 101 generates a file based on the diagnosis of the vehicle by the diagnostic device 102, the file content of the current file will be written into the metadata of the current file. When the terminal device 101 needs to merge files, it will obtain multiple target files to be merged, obtain the file content in the metadata of each target file in the multiple target files, merge the file content in the metadata of each target file in the multiple target files to obtain the merged file content, and finally generate a merged file based on the merged file content. In this way, the merging of file contents can be achieved, rather than just the merging of file pages.
[0046] Based on this, an embodiment of the present application provides a file generation method, and the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0047] See also Figure 2 , Figure 2 A flowchart of a file generation method provided in an embodiment of the present application is provided. The method is applied to the above-mentioned terminal device or other devices that can be used for file generation, such as Figure 2 As shown, the method comprises the following steps:
[0048] Step S201, obtaining multiple target files.
[0049] Among them, the file contents of multiple target files cannot be read directly, and the metadata of each target file in the multiple target files includes the file content of the target file written in advance, and the file content may include basic file information and detailed file data. Exemplarily, the target file may be a file in PDF format. The file content of the target file included in the metadata of each target file is written during the target file generation process. Metadata is data that describes data, mainly information that describes data attributes, and is used to support functions such as indicating storage location, historical data, resource search, file records, etc. Metadata may include multiple attributes, such as a title attribute, a keywords attribute, a subject attribute, etc.
[0050] The following is a detailed example to illustrate the generation process of each file:
[0051] Exemplarily, when generating a file, the basic information of the file and the detailed data of the file are converted into serialized json strings respectively, and then the converted json strings are encrypted by BASE64 encoding and written into the Title attribute in the metadata of the file to be generated. The json string converted from the corresponding file detailed data is encrypted by BASE64 encoding and written into the keywords Keywords attribute in the metadata of the file to be generated. The basic information of the file and the detailed data of the file are generated according to the specified file display style, and finally the file is named, and the file generation is completed. If the file is a vehicle fault diagnosis report file, then the name of the file can be vehicle model_VIN code_report type_report generation time, for example: FORD_1FT8W3DT9CEB00000_AllSystemDTC_20240508012057.
[0052] The following is a detailed description of the current steps:
[0053] In a feasible embodiment, the file content includes basic file information, and acquiring multiple target files includes: selecting multiple target files from multiple files according to the relevance of basic file information of different files.
[0054] Among them, when determining multiple target files to be merged, it is necessary to screen out the files to be merged from the multiple files that can be selected for merging, and the present application can screen according to the basic file information of the multiple files. Then, after obtaining multiple files that can be selected for merging, it is necessary to obtain the basic file information in the metadata of each of the multiple files, and select multiple target files from the multiple files according to the relevance of the basic file information of different files.
[0055] The correlation of basic information of different files may refer to the existence of identical or related information between the basic information of different files, for example, the editing dates in the basic information of different files are the same. Screening multiple files based on the basic information of the files can make the screening conditions more sufficient and the efficiency of screening the files to be merged higher. The multiple files refer to files that can be used for merging. For example, files that can be used for merging can be obtained based on a saved file directory, which refers to a directory formed after saving when a file is generated according to the above method (referring to the file generation method in which the file content is written into metadata during the above file generation process). For example, please refer to Figure 3 , Figure 3 A schematic diagram of a structure of a storage file directory provided in an embodiment of the present application, such as Figure 3As shown, the file name of each file will be displayed in the saved file directory, such as FORD_1FT8xxx0000_AlLxxDTC_2024xx.pdf.
[0056] In the present application, the files to be merged are screened by the correlation between the basic file information of different files, so that the efficiency of screening the files to be merged can be improved.
[0057] Specifically, in a feasible embodiment, the target file is a vehicle fault diagnosis file, and the basic information of the file includes at least one of the detected vehicle information, the name of the maintenance organization, the file type, the file generation status, the file generation time, the maintenance personnel, and the diagnostic software version; before selecting multiple target files from multiple files according to the correlation of the basic information of different files, the method also includes: when at least one piece of information in the basic information of different files is the same, or the difference between the basic information of different files is less than a preset range, determining that the basic information of different files is correlated.
[0058] Among them, before selecting multiple target files from multiple files according to the correlation of the basic information of different files, it is necessary to determine the different files with correlation of the basic information of the files. Since the basic information of the files includes multiple types at this time, it can be determined that the basic information of the files of different files is related when at least one of the basic information of the different files is the same, for example, multiple vehicle fault diagnosis files for the same detected vehicle are merged. It is also possible to determine that the basic information of different files is related when the difference between the basic information of different files is less than a preset range, for example, when merging multiple vehicle fault diagnosis files within a certain day, the preset range can be set so that the difference between the report generation time in the basic information of the files of multiple vehicle fault diagnosis files within a certain day is less than the preset range.
[0059] In addition, users can also set filtering conditions by themselves. For example, they can use a certain file as a reference and select multiple target files corresponding to the same vehicle as the detected vehicle corresponding to the file, or select multiple target files that are not only the same as the detected vehicle corresponding to the file, but also have the same generation date as the file corresponding to the file.
[0060] Specifically, the file types in the vehicle fault diagnosis file may include fault code files, data stream files, ADAS calibration files, I / M Readiness files, battery detection files, merge files, etc.; the detected vehicle information may include vehicle VIN, model, brand, year, mileage, license plate number, etc.; the maintenance organization information may include name, address, telephone, fax, etc.; the file generation status may include before maintenance, after maintenance, diagnostic scan, etc. The file detailed data is the data that can generate the vehicle fault diagnosis file corresponding to the file type in the basic information of the file. For example, the data of the full system fault code file is the fault code information of each system in the vehicle detection, and the data of the data stream file is the data stream information of a certain system at a specific time.
[0061] In the present application, for a vehicle fault diagnosis file that contains multiple types of basic file information, when determining whether the basic file information is related, the relationship between at least one type of information can be used to determine the relationship, which can improve the richness of screening the target file.
[0062] Step S202: Obtain the file content in the metadata of each target file among the multiple target files.
[0063] The file content may include basic file information and detailed file data. The basic file information mainly covers the external features of the file, and the internal data of the file is mainly presented in the form of detailed file data. There is a certain correspondence between the detailed file data and the basic file information. As shown in the above embodiment, if the file type in the basic file information includes a data stream file, then the detailed file data is the corresponding data stream information at a specific moment.
[0064] In addition, in a feasible embodiment, the file content included in the metadata of each target file is in an encrypted state, and obtaining the file content in the metadata of each target file among multiple target files includes: obtaining the encrypted file content in the metadata of each target file among multiple target files; decrypting the encrypted file content to obtain the decrypted file content.
[0065] In order to ensure the data security of the file content, the file content can be encrypted before writing it into the metadata of the target file, and the encrypted file content can be written into the metadata after encryption. Correspondingly, after obtaining the file content from the metadata of the file in the future, the file content needs to be decrypted before using it. As shown in the above embodiment, encryption can be performed by BASE64 encoding, and decryption can be performed by BASE64 decoding.
[0066] In this application, the file content is encrypted and written into the file's metadata, which can improve the data security of the file content.
[0067] Step S203: merge the file contents in the metadata of each target file in the multiple target files to obtain merged file contents.
[0068] Different from the page merging in the prior art, the present application merges the file contents of each target file after obtaining the file contents in the metadata of each target file in multiple target files, thereby obtaining the merged file contents. In this way, the merged file generated subsequently realizes the merging of file contents.
[0069] The following is a detailed description of the current steps:
[0070] In a feasible embodiment, the file content includes basic file information in a first attribute and detailed file data in a second attribute, and the file content in the metadata of each target file in multiple target files is merged to obtain merged file content, including: merging the basic file information in the metadata of each target file in the multiple target files into merged file basic information, and merging the file detailed data in the metadata of each target file in the multiple target files into merged file detailed data; determining the merged file content based on the merged file basic information and the merged file detailed data.
[0071] The file content may include basic file information and detailed file data, and the basic file information and detailed file data may be written into different single attributes in the metadata, that is, the basic file information may be written into the first attribute of the metadata, and the detailed file data may be written into the second attribute of the metadata. For example, the first attribute may be a title attribute, and the second attribute may be keyword data. Writing the basic file information and detailed file data into different single attributes makes it easier to obtain the basic file information and detailed file data from the metadata later.
[0072] Since the data types of the basic file information and the detailed file data are quite different, the file contents in the metadata of each target file among the multiple target files are merged to obtain the merged file contents, and the basic file information and the detailed file data can be merged separately. Specifically, the basic file information in the metadata of each target file among the multiple target files is merged into the merged file basic information, and the detailed file data in the metadata of each target file among the multiple target files is merged into the merged file detailed data, and finally the merged file contents are determined according to the merged file basic information and the merged file detailed data.
[0073] In this application, the basic file information and the detailed file data are written into different single attributes, so that the basic file information and the detailed file data can be obtained separately in the future. In addition, the report content is divided into the basic file information and the detailed file data, and the basic file information and the detailed file data are merged separately, so that the merging of the file content is logical.
[0074] The following is a detailed description of “merging the file basic information in the metadata of each target file in the multiple target files into the merged file basic information, and merging the file detailed data in the metadata of each target file in the multiple target files into the merged file detailed data” in the above embodiment:
[0075] Specifically, in a feasible embodiment, the merged file basic information includes at least one merged sub-information, and the merged file detailed data includes at least one merged sub-data; the file basic information in the metadata of each target file in multiple target files is merged into the merged file basic information, and the file detailed data in the metadata of each target file in multiple target files is merged into the merged file detailed data, including: merging the file basic information with the same or related data types in the metadata of multiple target files to obtain at least one merged sub-information; merging the file detailed data with the same or related data types in the metadata of multiple target files to obtain at least one merged sub-data.
[0076] Among them, when the basic information of the file and the detailed data of the file are merged separately, it is not a single matter to splice the contents of the basic information of the file and the detailed data of the file of each target file separately, but to merge the contents corresponding to the same or related data formats in the basic information of the file and the file information data separately. For example, the basic information of the file includes multiple data types, namely, the detected vehicle information, the file type, the file generation status, etc. Then, for the merging of the basic information of the file between different target files, it should also be the merging of the detected vehicle information of the first target file and the detected vehicle information of the second target file, the merging of the file type of the first target file and the file type of the second target file, and so on. And the same is true for the merging between the detailed data of the files. This data type can also be used to characterize the reference object of the data, and the reference object can also be the above-mentioned detected vehicle information, file type, file generation status and other similar contents.
[0077] In addition, for the merging of basic file information, redundant data existing after the merging can also be deleted, while the merging of detailed report data should not directly delete redundant data, but it can be deleted if certain conditions are met.
[0078] Exemplarily, merging basic file information of the same or related data types in the metadata of multiple target files to obtain at least one merged sub-information includes: merging basic file information of the same or related data types in the metadata of multiple target files to obtain at least one first merged sub-information; deleting redundant content in each first merged sub-information of the at least one first merged sub-information to obtain at least one merged sub-information.
[0079] Merging detailed file data of the same or related data types in the metadata of multiple target files to obtain at least one merged sub-data includes: merging detailed file data of the same or related data types in the metadata of multiple target files to obtain at least one first merged sub-data; when a first sub-data and a second sub-data are identical in a second merged sub-data of at least one first merged sub-data, and basic file information corresponding to the first sub-data and the second sub-data have identical information greater than a preset ratio, deleting any data in the first sub-data and the second sub-data to obtain at least one merged sub-data.
[0080] Moreover, for the merging of specific data, specific data can also be generated after the merging. For example, for the vehicle diagnosis scenario, since the basic file information in the vehicle fault diagnosis file includes the file type, when the basic file information of multiple vehicle fault diagnosis files is merged, the file type in the basic file information will generate specific data as a "merged file" after the merger, which is used to indicate that the file type is the type of the merged file. Since there is a certain correspondence between the file detailed data and the file type in the vehicle fault diagnosis file, for example, when the file type is a fault code report, the file detailed data corresponds to the fault code report under specific conditions, then the data display format of the file detailed data corresponding to different file types will definitely be different. When merging files, directly changing the data type to a merged report is conducive to the unified display of detailed data of different files.
[0081] The following diagrams are used to explain in detail. Figure 4 , Figure 4 A flowchart of a file content merging process provided in an embodiment of the present application. Figure 4 As shown in FIG. 1 , two file basic information to be merged are the first file basic information and the second file basic information. Each file basic information includes three sub-information of different data types, namely the first sub-information, the second sub-information and the third sub-information. If the file basic information of each target file is concatenated, the result is as follows: Figure 4As shown, after the first file basic information and the second file basic information are merged, the merged file basic information is obtained. It can be seen that the content in the merged file basic information is a merger of the entire content of the first file basic information and the entire content of the second file basic information.
[0082] Also, see Figure 5 , Figure 5 This is another flowchart of file content merging provided in the embodiment of the present application. Figure 5 As shown in FIG. 1 , two basic file information to be merged are included, namely, the first basic file information and the second basic file information, and each basic file information includes three sub-information of different data types, namely, the first sub-information, the second sub-information and the third sub-information. If the first basic file information and the second basic file information are merged according to the method shown in this embodiment, then Figure 5 As shown, the file basic information of the same or related data types in the first file basic information and the second file basic information are merged to obtain merged file basic information including three merged sub-information.
[0083] In the present application, the merging of basic file information and detailed file data of multiple target files is performed based on the basic file information or detailed file data of the same or related data types, thereby making the merged file content easier to query and analyze, thereby improving the efficiency of users in querying and analyzing data through the merged file content.
[0084] Step S204, generating a merged file according to the merged file content.
[0085] When generating a merged file based on the merged file contents, the file contents of multiple target files can be merged, and when generating a merged file, the merged file can also be generated according to a preset merged file display style. This makes the merged file more readable. For the automotive diagnosis scenario, it is convenient for users to diagnose and view the vehicle through the merged file.
[0086] In addition, in a feasible embodiment, when a merged file is generated based on the merged file content, the merged file content is written into the metadata of the merged file. After the merged file is generated based on the merged file content, the method also includes: obtaining the first file content and the merged file content in the metadata of the merged file, the first file corresponding to the first file content is a file that can directly read the file content; merging the first file content with the merged file content to obtain the first merged file content; and generating a first merged file based on the first merged file content.
[0087] Among them, in order to facilitate the subsequent merging of the merged file with other files, the merged file content needs to be written into the metadata of the merged file during the generation process. Specifically, the basic information of the merged file in the merged file can be written into the first attribute of the metadata of the merged file, and the detailed data of the merged file in the merged file can be written into the second attribute of the metadata of the merged file. In addition to the merging between files whose file contents cannot be read directly, the file merging shown in this embodiment can also be used for files whose file contents can be read directly. For example, in the automobile diagnosis scenario, in the process of diagnosing the automobile through the diagnostic program, when the file content is read by the diagnostic device, the file content has not yet generated the above-mentioned file. At this time, the file content can be directly obtained.
[0088] After directly obtaining the first file content, it is necessary to obtain the merged file content in the metadata of the merged file, and similarly merge the first file content with the merged file content according to the method shown in the above embodiment to obtain the first merged file content, and finally generate the first merged file according to the first merged file content.
[0089] In addition, for the merge between the first file and the merged file, it is also possible to merge the first file with multiple target files at the same time before the merged file is generated. During the merging process, it is also necessary to obtain the file content in the metadata of each target file in the multiple target files, and merge the file content of each target file with the first file content to obtain the first merged file content, and generate the first merged file based on the first merged file content. For the automobile diagnosis scenario, if the diagnostic file content is read during the diagnosis process, two options can be provided when saving the diagnostic file, one is to directly save the file of this type, and the other is to merge the files. If the user chooses to merge the files, multiple diagnostic files that meet the preset conditions can be selected based on the diagnostic file as the standard, and the files can be merged according to the above steps.
[0090] In the present application, the merged file can also be merged with other files that can directly obtain the file content, thereby increasing the scope of application of file merging.
[0091] It can be seen that in the embodiment of the present application, for the merging of multiple target files whose file contents cannot be directly read, it is necessary to first write the file content of the target file in the metadata of each target file during the generation process of each target file, so that when the files are merged, the file content in the metadata of each target file can be obtained, thereby realizing the merging of the file contents of multiple target files. Compared with the merging of existing pages, the merged file generated by the present application is easier to query and analyze data, which improves the efficiency of users in querying and analyzing data on the merged file.
[0092] In accordance with the above-mentioned embodiments, please refer to Figure 6 , Figure 6 This is a block diagram of the functional units of a file generation device provided in an embodiment of the present application. The file generation device is the above-mentioned terminal device or a part of the terminal device, such as Figure 6 As shown, the file generating device 60 includes:
[0093] An acquisition unit 601 is used to acquire a plurality of target files, the file contents of the plurality of target files cannot be directly read, and the metadata of each target file in the plurality of target files includes the file contents of the target file previously written;
[0094] The acquisition unit 601 is further used to acquire the file content in the metadata of each target file among the multiple target files;
[0095] A processing unit 602 is used to merge the file content in the metadata of each target file in the multiple target files to obtain merged file content;
[0096] The processing unit 602 is further configured to generate a merged file according to the merged file content.
[0097] In a feasible embodiment, the file content includes basic file information. In terms of acquiring multiple target files, the acquiring unit 601 is specifically used to: select multiple target files from multiple files according to the relevance of basic file information of different files.
[0098] In a feasible embodiment, the target file is a vehicle fault diagnosis file, and the basic information of the file includes at least one of the detected vehicle information, maintenance organization name, file type, file generation status, file generation time, maintenance personnel, and diagnostic software version; the file generation device 60 also includes a determination unit 603, which is used to determine that the basic information of different files is correlated before selecting multiple target files from multiple files based on the correlation of basic information of different files, when at least one piece of information in the basic information of different files is the same, or the difference between the basic information of different files is less than a preset range.
[0099] In a feasible embodiment, the file content included in the metadata of each target file is in an encrypted state. In terms of obtaining the file content in the metadata of each target file among multiple target files, the acquisition unit 601 is specifically used to: obtain the encrypted file content in the metadata of each target file among multiple target files; decrypt the encrypted file content to obtain the decrypted file content.
[0100] In a feasible embodiment, the file content includes basic file information in the first attribute and detailed file data in the second attribute. In terms of merging the file content in the metadata of each target file in multiple target files to obtain merged file content, the processing unit 602 is specifically used to: merge the basic file information in the metadata of each target file in the multiple target files into merged file basic information, and merge the detailed file data in the metadata of each target file in the multiple target files into merged file detailed data; determine the merged file content based on the merged file basic information and the merged file detailed data.
[0101] In a feasible embodiment, the merged file basic information includes at least one merged sub-information, and the merged file detailed data includes at least one merged sub-data; in terms of merging the file basic information in the metadata of each target file in multiple target files into the merged file basic information, and merging the file detailed data in the metadata of each target file in multiple target files into the merged file detailed data, the processing unit 602 is specifically used to: merge the file basic information with the same or related data types in the metadata of multiple target files to obtain at least one merged sub-information; merge the file detailed data with the same or related data types in the metadata of multiple target files to obtain at least one merged sub-data.
[0102] In a feasible embodiment, when generating a merged file based on the merged file content, the processing unit 602 is also used to write the merged file content into the metadata of the merged file, and after generating the merged file based on the merged file content, the acquisition unit 601 is used to acquire the first file content and the merged file content in the metadata of the merged file, and the first file corresponding to the first file content is a file that can directly read the file content; the processing unit 602 is also used to merge the first file content with the merged file content to obtain the first merged file content; and generate the first merged file based on the first merged file content.
[0103] It can be understood that since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part in this application should be synchronously adapted to the device embodiment part and will not be repeated here.
[0104] In the case of integrated units, such as Figure 7 As shown, Figure 7 This is a block diagram of the functional units of another file generation device 60 provided in an embodiment of the present application. Figure 7In the embodiment, the file generation device 60 includes: a processing module 712 and a communication module 711. The processing module 712 is used to control and manage the actions of the file generation device 60, for example, the steps of the acquisition unit 601, the processing unit 602 and the determination unit 603, and / or other processes for executing the technology described herein. The communication module 711 is used to support the interaction between the file generation device 60 and other devices. Figure 7 As shown, the file generating device 60 may further include a storage module 713 , and the storage module 713 is used to store the program code and data of the file generating device 60 .
[0105] Among them, the processing module 712 can be a processor or a controller, for example, a central processing unit (CPU), a general processor, a digital signal processor (DSP), an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 711 can be a transceiver, an RF circuit or a communication interface, and the like. The storage module 713 can be a memory.
[0106] Among them, all relevant contents of each scenario involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here. Figure 2 The file generation method shown.
[0107] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When a computer instruction or computer program is loaded or executed on a computer, a process or function according to an embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center containing one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0108] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 may include one or more of the following components: a processor 801, a memory 802 and a communication interface 803. The processor 801, the memory 802 and the communication interface 803 are interconnected and perform communication work with each other, wherein the memory 802 may store one or more computer programs, and the one or more computer programs may be configured to implement the methods described in the above embodiments when executed by one or more processors 801.
[0109] The processor 801 may include one or more processing cores. The processor 801 uses various interfaces and lines to connect the various parts of the entire electronic device 800, and executes various functions and processes data of the electronic device 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 802, and calling data stored in the memory 802. Optionally, the processor 801 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 801 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 801, and may be implemented separately through a communication chip.
[0110] The memory 802 may include a random access memory (RAM) or a read-only memory (ROM). The memory 802 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 800 during use, etc.
[0111] It is understandable that the electronic device 800 may include more or fewer structural elements than those in the above structural block diagram, for example, including a power module, physical buttons, a WiFi (Wireless Fidelity) module, a speaker, a Bluetooth module, a sensor, etc., which are not limited here.
[0112] The electronic device 800 may be a terminal device or a part of a terminal device.
[0113] An embodiment of the present application provides a computer-readable storage medium, wherein program data is stored in the computer-readable storage medium, and when the program data is executed by a processor, it is used to execute part or all of the steps of any one of the file generation methods recorded in the above method embodiments.
[0114] The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps of any file generation method described in the above method embodiment. The computer program product may be a software installation package.
[0115] It should be noted that, for the method embodiments of any of the aforementioned file generation methods, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can 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 present application.
[0116] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude multiple situations. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0117] A person skilled in the art can understand that all or part of the steps in the various methods of the method embodiments of any of the above-mentioned file generation methods can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a disk or an optical disk, etc.
[0118] The embodiments of the present application are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of a file generation method and device of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of a file generation method and device of the present application, there may be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0119] The present application is described with reference to the flowcharts and / or block diagrams of the methods, hardware products, and computer program products of the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks 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 device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing 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.
[0120] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture 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.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0122] It can be understood that any product that is controlled or configured to execute the processing method of the flowchart described in the method embodiment of a file generation method of the present application, such as the terminal and computer program product in the above flowchart, falls within the scope of the related products described in the present application.
[0123] Obviously, those skilled in the art can make various changes and modifications to the file generation method and device provided by the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for generating a file, It is characterized in that The method comprises: Acquire a plurality of target files, wherein file contents of the plurality of target files cannot be directly read, and metadata of each target file among the plurality of target files includes file contents of the target file previously written; Obtaining file content in metadata of each target file among the multiple target files; Merging the file content in the metadata of each target file in the multiple target files to obtain merged file content; A merged file is generated according to the merged file content.
2. The method according to claim 1, It is characterized in that The file content includes basic file information, and obtaining multiple target files includes: The multiple target files are selected from multiple files according to the relevance of the basic file information of different files.
3. The method according to claim 2, It is characterized in that The target file is a vehicle fault diagnosis file, and the basic information of the file includes at least one of the detected vehicle information, maintenance organization name, file type, file generation status, file generation time, maintenance personnel, and diagnostic software version; Before selecting the multiple target files from multiple files according to the correlation of the basic file information of different files, the method further includes: when at least one piece of information in the basic file information of different files is the same, or the difference between the basic file information of different files is less than a preset range, determining that the basic file information of different files is correlated.
4. The method according to claim 1 or 2, It is characterized in that The file content includes basic file information in the first attribute and detailed file data in the second attribute, and merging the file content in the metadata of each target file in the multiple target files to obtain merged file content includes: Merging the file basic information in the metadata of each target file in the multiple target files into merged file basic information, and merging the file detailed data in the metadata of each target file in the multiple target files into merged file detailed data; The content of the merged file is determined according to the merged file basic information and the merged file detailed data.
5. The method according to claim 4, It is characterized in that The merged file basic information includes at least one merged sub-information, and the merged file detailed data includes at least one merged sub-data; merging the file basic information in the metadata of each target file in the multiple target files into the merged file basic information, and merging the file detailed data in the metadata of each target file in the multiple target files into the merged file detailed data, comprises: Merging basic file information of the same or related data types in the metadata of the multiple target files to obtain at least one merged sub-information; The detailed file data of the same or related data types in the metadata of the multiple target files are merged to obtain at least one merged sub-data.
6. The method according to any one of claims 1 to 5, It is characterized in that The file content included in the metadata of each target file is in an encrypted state, and obtaining the file content in the metadata of each target file among the multiple target files includes: Obtaining encrypted file content in metadata of each target file among the plurality of target files; The encrypted file content is decrypted to obtain the decrypted file content.
7. The method according to any one of claims 1 to 6, It is characterized in that When generating a merged file according to the merged file content, the merged file content is written into the metadata of the merged file. After generating the merged file according to the merged file content, the method further includes: Acquire the first file content and the merged file content in the metadata of the merged file, wherein the first file corresponding to the first file content is a file whose file content can be directly read; Merging the first file content with the merged file content to obtain a first merged file content; Generate a first merged file according to the content of the first merged file.
8. A file generating device, It is characterized in that The device comprises: an acquisition unit, configured to acquire a plurality of target files, wherein the file contents of the plurality of target files cannot be directly read, and the metadata of each target file in the plurality of target files includes the file contents of the target file previously written; The acquisition unit is further used to acquire the file content in the metadata of each target file in the multiple target files; A processing unit, configured to merge the file content in the metadata of each target file among the multiple target files to obtain merged file content; The processing unit is further configured to generate a merged file according to the content of the merged file.
9. An electronic device, It is characterized in that The device comprises: A processor, a memory, and a communication interface, wherein the processor, the memory, and the communication interface are connected to each other and perform communication work between them; The memory stores executable program code, and the communication interface is used for wireless communication; The processor is used to call the executable program code stored in the memory to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, It is characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.
