A file generation method, device, equipment and storage medium

By acquiring and verifying file update data packets and generating target files in combination with data management information segments, the problem of inefficient file updates in the existing technology is solved, and the accuracy and efficiency of file generation are improved.

CN116257267BActive Publication Date: 2025-01-14CHENGDU DESAY SV KAWA TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211500206.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2025-01-14
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

The existing file update methods are inefficient and inconvenient to manage, and the precise generation of target files cannot be effectively achieved.

Method used

By obtaining the pre-determined file update data packets relative to the source file and the target file, using the data packet header for verification, and using the data management information segment to combine the file data set to generate the target file, and using segmented management of the data to be updated to achieve accurate identification and updated.

Benefits of technology

Improve file generation efficiency, ensure the accuracy and management convenience of target files, and accurately generate data content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116257267B_ABST
    Figure CN116257267B_ABST
Patent Text Reader

Abstract

The present invention discloses a file generation method, device, equipment and storage medium, the method comprising: obtaining a file update data packet predetermined relative to a source file and a target file, the file update data packet comprising: a data packet header, a data management information segment and a file data set; after verifying the file update data packet relative to the source file through the data packet header, generating a target file corresponding to the source file according to the data management information segment combined with the file data set. The above technical solution achieves effective management of file update data packets, improves file generation efficiency, and accurately generates target files based on data content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a file generation method, device, equipment and storage medium. Background Art

[0002] With the rapid development of computer hardware and software technology, computer hardware resources are becoming more and more demanding with the software support, and various hardware equipment technologies are becoming more and more mature. In the process of hardware equipment upgrade or data processing, it is required to be fast, stable and safe. Usually, while ensuring data accuracy and data packet diversification, iterative processing should be completed faster while ensuring the security and stability of device software.

[0003] Currently, operating system software or application software is often improved through upgrades, patches, backups, etc. Before improving the functions, it is equivalent to having obtained the files required for improvement. Generally, the improved target files need to be reloaded or solidified into the device to achieve functional improvement.

[0004] Considering that the target file is only an update based on the original file, when implementing the target file loading or solidification, it is only necessary to determine the difference data between the two, and then update the difference data based on the original file to generate a more complete target file. However, the existing update method is mainly traditional sequential writing or replacement, which has low file generation efficiency and is not easy to manage the file generation process. Summary of the invention

[0005] The present invention provides a file generation method, device, equipment and storage medium, which realizes the segmented management of file update data packets, effectively improves the file generation efficiency and ensures the accuracy of target file generation.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for generating a file, comprising:

[0007] Obtaining a file update data packet predetermined relative to a source file and a target file, the file update data packet comprising: a data packet header, a data management information segment, and a file data set;

[0008] After verifying the file update data packet relative to the source file through the data packet header, a target file corresponding to the source file is generated based on the data management information segment combined with the file data set.

[0009] In a second aspect, an embodiment of the present disclosure provides a file generation device, including:

[0010] A data packet acquisition module is used to acquire a file update data packet predetermined relative to a source file and a target file, wherein the file update data packet includes: a data packet header, a data management information segment, and a file data set;

[0011] The target file generation module is used to generate a target file corresponding to the source file according to the data management information segment combined with the file data set after verifying the file update data packet relative to the source file through the data packet header.

[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to at least one processor; wherein,

[0015] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the file generation method provided by the above-mentioned first aspect embodiment.

[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the file generation method provided in the embodiment of the first aspect above when executed.

[0017] The file generation method, device, equipment and storage medium of the embodiment of the present invention obtains a file update data packet predetermined relative to a source file and a target file, the file update data packet includes: a data packet header, a data management information segment and a file data set; after verifying the file update data packet relative to the source file through the data packet header, a target file corresponding to the source file is generated according to the data management information segment and the file data set. By adopting the above technical scheme, a file update data packet is predetermined, and the file update data packet is divided into a data packet header, a data management information segment and a file data set. By adopting the structure of the data management information segment, the file data to be updated in the file update data packet can be managed in segments, and the data to be updated can be accurately identified, and the generation of the target file can be further realized. In the above technical scheme, effective management of the file update data packet is achieved, the efficiency of file generation is improved, and the target file is accurately generated based on the data content.

[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a flow chart of a file generation method provided by Embodiment 1 of the present invention;

[0021] Figure 2 It is a schematic diagram of the structure of a file update data packet involved in the file generation method provided in the first embodiment of the present invention;

[0022] Figure 3 It is a structural schematic diagram of a data management information segment involved in a file generation method provided in Embodiment 1 of the present invention;

[0023] Figure 4 is a flow chart of a file generation method provided by Embodiment 2 of the present invention;

[0024] Figure 5 This is an example display diagram of updating operation information involved in the file generation method provided in the second embodiment of the present invention;

[0025] Figure 6 is another example display diagram of updating operation information involved in the file generation method provided in the second embodiment of the present invention;

[0026] Figure 7 This is another example display diagram of updating operation information involved in the file generation method provided in the second embodiment of the present invention;

[0027] Figure 8 This is an example diagram showing the independent execution of file generation logic between two update operation information in the file generation method provided in the second embodiment of the present invention;

[0028] Fig. 9 It is a structural schematic diagram of a file generating device provided by Embodiment 3 of the present invention;

[0029] Fig.10 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. 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 or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment 1

[0033] Figure 1 It is a flowchart of a file generation method provided in Example 1 of the present invention. This embodiment can be applied to situations where device software generates data files in various application scenarios. The method can be executed by a file generation device, and the file generation device can be implemented in the form of hardware and / or software.

[0034] like Figure 1 As shown, the method includes:

[0035] S101, obtaining a file update data package predetermined relative to a source file and a target file.

[0036] The file update data packet includes: a data packet header, a data management information segment, and a file data set.

[0037] In this embodiment, the source file can be understood as a file that has not undergone any file processing operation relative to the target file, and can be used to store code programs, consisting of source programs and data. The target file can be a file that can be directly applied to the device software for upgrading or iteration, and can be specifically understood as a file that stores binary code that can be directly recognized by the central processing unit (CPU) after the source code is compiled. The file update data packet can be a data packet containing file update data for file update or iteration, and can be specifically understood as a data packet containing file difference update data pre-acquired using a known method.

[0038] Figure 2 Schematic diagram of the structure of the file update data packet involved in the file generation method provided in the first embodiment of the present invention. Figure 2 As shown, the file update data packet may at least include: a data packet header 11, a data management information segment 12, and a file data set 13. Among them, the data packet header 11 may include a special reserved field of a fixed length attached to the front of the file update data packet, which is mainly used to store the summary information and signature information of the data management information segment 12 and the file data set 13, and can be used to verify the entire file update data packet. The data management information segment (Information Management Units, IMUS) 12 can be understood as an information segment for data management of file update data. The file data set 13 can be understood as a collection of multiple data information, for example, it can be a plurality of data sets including data0-n.

[0039] Specifically, before executing this step, there is a predetermined file update data packet relative to the source file and the target file. The file update data packet and the data packet header 11, the data management information segment 12 and the file data set 13 included in the file update data packet are obtained.

[0040] S102, after verifying the file update data packet relative to the source file through the data packet header, generate a target file corresponding to the source file according to the data management information segment combined with the file data set.

[0041] In this embodiment, the data packet header can verify the file update data packet based on a specific protocol and algorithm to effectively ensure the accuracy of the data packet. After verifying the file update data packet, based on the information in the data management information segment in the file update data packet and in combination with multiple file data in the file data set, the data in the file update or iteration process can be effectively determined, and the data can be managed, and then the corresponding target file can be generated in combination with the source file.

[0042] In this embodiment, a file update data packet predetermined relative to a source file and a target file is obtained; after verifying the file update data packet relative to the source file through the data packet header, a target file corresponding to the source file is generated according to the data management information segment combined with the file data set. By adopting the above technical solution, the file update data packet is predetermined, and the file update data packet is divided into a data packet header, a data management information segment and a file data set. By adopting the structure of the data management information segment, the file data to be updated in the file update data packet can be managed in segments, and the data to be updated can be accurately identified, and the generation of the target file can be further realized. In the above technical solution, effective management of the file update data packet is achieved, the efficiency of file generation is improved, and the target file is accurately generated based on the data content. As the first optional embodiment of the embodiment, based on the above embodiment, this first optional embodiment also optimizes and adds content about the data management information segment structure.

[0043] This optional embodiment specifically includes:

[0044] a1) The data management information segment includes information segment basic information and at least one data management sub-segment.

[0045] In this embodiment, the data management information segment can be considered as a collection of data management sub-segments, and also includes information segment basic information. Figure 3 is a schematic diagram of the structure of the data management information segment involved in the file generation method provided in the first embodiment of the present invention, such as Figure 3 As shown, the data management information segment 12 includes information segment basic information 121 and at least one data management sub-segment 122. The information segment basic information 121 can be understood as a collection of basic information including the data management information segment, for example, it can include: algorithm version information (version number), small matrix window size, IMUS verification information, etc. The data management sub-segment 122 (Information Management Unit, IMU) can be understood as a separate sub-segment in the data management information segment 12. The data management information segment (IMUS) 12 can include multiple data management sub-segments (IMU) 122, for example, it can include IMU0, IMU1, IMU2, etc.

[0046] Exemplarily, each data management sub-segment 122 may also include information parameters such as operation type, source information, target information, label information, and extended description.

[0047] The operation type can be used to describe the file type to be processed, such as img image file, bin file, ordinary file, etc. Ordinary files can include soft link files, folders, ordinary disk files, etc.

[0048] Source information can be understood as source file information that needs to be used as data reference when generating files.

[0049] The target information can be understood as the file information that needs to be output when the file is generated. It usually includes information such as the hash value and file size of the target file, which is used for the final file generation verification.

[0050] The tag information can be used to treat a source file and a target file for differential and file generation as a set of information. The tag information can better identify the differential and file generation order between multiple sets of source and target information, so that the restoration algorithm can identify the production order of data during differential according to the tag, ensuring that the restoration order is consistent with the differential order.

[0051] The extended information is mainly used for folder restoration and soft link file restoration. According to the user attributes and read-write attributes recorded during the difference, when restoring, not only the file content but also the user attributes and read-write attributes are restored. Specifically, ordinary files are restored with data and attributes, soft link files are restored with link location and attributes, and folders are recursively restored with file contents inside the folder and the attributes of the folder itself.

[0052] b1) The file data set includes at least one differential data segment arranged according to a given sequence number.

[0053] In this embodiment, the differential data segment can be considered as a data segment for storing differential data. Specifically, the file data set is a data information set including multiple differential data segments, and each differential data segment is arranged in the file data set based on a row number, such as data1, data2, data3, etc.

[0054] Furthermore, the data management sub-segment includes: at least one update operation information.

[0055] In this embodiment, the data management subsection 122 can also be understood as a collection of update operation information 1221, and also includes other data management parameter information. The update operation information 1221 can be understood as operation information specifically used for performing file update calculations. In the data management subsection 122, multiple update operation information 1221 can be included.

[0056] Exemplarily, the update operation information 1221 may be updated based on the fun function, so each update operation information 1221 may be named Fun0, Fun1, Fun2, and so on.

[0057] In this optional embodiment, the above technical solution is adopted to determine the data operation method management mechanism, and the data management information segment includes at least one data management sub-segment, each data management sub-segment includes at least one update operation information, and each update operation information can be independently generated based on a specific function operation. The file attributes and data types can be accurately identified, and can be applied to a variety of file generation application scenarios, and flexibly respond to different file generation logics.

[0058] As a second optional embodiment of the embodiment, based on the above embodiment, in the process of generating a target file corresponding to a source file according to the data management information segment combined with the file data set, the second optional embodiment further optimizes and adds:

[0059] a2) After detecting the power-off operation of the device, the update operation information of the operation logic being executed in each data management sub-segment in the data management information segment is recorded at the breakpoint to form a breakpoint record file.

[0060] In this embodiment, the breakpoint record file can be understood as a file that records interruption information when file generation is interrupted.

[0061] Specifically, after the device is powered on, during the file generation process, each data management sub-segment within the data management information segment executes operation logic based on each update operation information until it is detected that the device is powered off and the update operation information can no longer execute the file generation operation logic. At this time, breakpoints are recorded for each update operation information, and the position of the interrupted operation logic in each operation information is recorded. Based on each interruption position, a breakpoint record file is formed and stored in the device.

[0062] Furthermore, it also includes:

[0063] a21) After detecting the power-on operation of the device, determine whether there is currently an unfinished file generation logic based on the pre-stored breakpoint record file.

[0064] In this embodiment, the file generation logic can be understood as the operation execution logic for performing the file generation process.

[0065] Specifically, if the device is interrupted during the file generation process, a breakpoint record file will be generated based on the interruption position. After the device is powered on again, the pre-stored breakpoint record file is queried to determine whether there is unfinished file generation logic in the breakpoint record file.

[0066] a22) If it exists, the breakpoint update operation information to be executed is obtained from the breakpoint record file, and the logical execution of the breakpoint update operation information is restored to continue generating the target file corresponding to the source file.

[0067] In this embodiment, the power-off update operation information can be understood as interrupted update operation information based on the breakpoint position.

[0068] Specifically, when querying the breakpoint record file, if it is found that there is an incomplete file generation logic, it can be determined that the last file generation process was not completed, and the breakpoint update operation information in the breakpoint record is obtained. Based on the incomplete file generation logic, start from the breakpoint position and continue to update or iterate the file to generate a target file relative to the source file.

[0069] In this embodiment, a breakpoint record file is automatically generated after the device is powered off, and the breakpoint record file is queried after the power is turned on again to obtain the breakpoint update operation information, continue to execute the unfinished file generation logic, and generate the target file. The above technical solution increases the device's breakpoint continuation capability. If the file update or iteration is interrupted, the device can still continue to generate the target file based on the breakpoint position after the next power-on, without having to execute the file generation logic from the beginning, saving the time of file generation, reducing time costs, and avoiding unnecessary waste of power resources.

[0070] As a third optional embodiment of the embodiment, based on the above embodiment, this third optional embodiment is further optimized and added: according to the source files and target files pre-backed up on the set object, the file update data package relative to the source files and the target files is determined.

[0071] In this embodiment, the setting object can be understood as a device corresponding to the file update data packet generation method.

[0072] Specifically, the file generation method of the embodiment of the present invention is associated with the above-mentioned file update data packet generation method. The file update data packet generation method determines the differential data information between the source file and the target file based on the source file and the target file pre-backed up by the set object, and generates a file update data packet.

[0073] Embodiment 2

[0074] Figure 4 It is a flowchart of a file generation method provided in Example 2 of the present invention. This embodiment is a further optimization of any of the above embodiments and can be applied to situations where device software generates data files in various application scenarios. The method can be executed by a file generation device, which can be implemented in the form of hardware and / or software.

[0075] like Figure 4 As shown, the method includes:

[0076] S201, obtaining a file update data package predetermined relative to a source file and a target file.

[0077] S202: Perform file update data packet verification relative to the source file through the data packet header.

[0078] S203. For each data management sub-segment in the data management information segment, extract the update operation information included in the data management sub-segment.

[0079] In this embodiment, there is at least one update operation information in each data management sub-segment. The update operation information can be information about using the Fun function to update or iterate a file to generate a target file. Each update operation information can include a method type, difference data description information, and a data information matrix set.

[0080] S204. For each update operation information, obtain the method type, difference data description information and data matrix information set included in the update operation information.

[0081] In this embodiment, the method type can be understood as the specific method required to update the operation information based on the file generation logic. It can include: same data replication, new data update and reference difference data update, etc., which are not limited in this embodiment of the present invention. The difference data description information can be understood as the description information of a certain section of difference data in the file data set corresponding to the method type operation in the current update operation information, with the start subscript and length information of the data in the file data set.

[0082] The data information matrix set can be understood as a set of one or more small matrices marked by a small matrix window in the file required by the method type operation in the current update operation operation information. Specifically, it can include a source data information matrix set and a target data information matrix set. Among them, the source data information matrix set can be understood as a set of one or more small matrices marked by a small matrix window in the source file when the file is updated or iterated, and the corresponding source data can be extracted at the specified position as a reference for file generation. The target data matrix information set can be understood as a set of one or more small matrices marked by a small matrix window in the target file, and the corresponding file generation data will be written into the various position information specified by the small matrix set when the file is updated or iterated.

[0083] S205: Generate a target file corresponding to the source file according to the method type in the update operation information, combined with the difference data description information, the data matrix information set and the file data set.

[0084] In this embodiment, based on the data required for each method type operation in the update operation operation information, a data matrix information set is generated based on the file data set, and the file is updated or iterated in combination with the difference data description information to generate a target file corresponding to the source file.

[0085] Furthermore, the file generation method provided by the embodiment of the present invention is based on the large and small matrices to perform file updates or iterations. In this embodiment, the small matrix can be understood as each data information matrix in the data information matrix set, which acts on each update operation information and is used to identify the position and size of each data block. The large matrix is ​​mainly used to express the total count of the data information matrix set in each update operation information, for example, it can include the total count of the small matrices in the source data matrix information set and the target data matrix information set. Therefore, the small matrix is ​​regarded as the details of participating in file generation, and the large matrix is ​​used to control the number of data participating in file generation of a single file update operation information. The large matrix is ​​implicit in the process of file generation.

[0086] In this embodiment, a file update data packet predetermined relative to a source file and a target file is obtained; a file update data packet is verified relative to a source file through a data packet header; for each data management sub-segment in a data management information segment, the update operation information included in the data management sub-segment is extracted; for each update operation operation information, the method type, differential data description information, and data matrix information set included in the update operation operation information are obtained; according to the method type in the update operation operation information, the differential data description information, the data matrix information set, and the file data set, the target file corresponding to the source file is generated. By adopting the above technical solution, using a refined data management information segment, the identification of the target type of file generation is achieved, and through the file update operation information, based on different method types, for the data content that needs to actually participate in the file generation, the size matrix is ​​used to perform file generation, thereby achieving precise data management operations. In the above technical solution, file updates or iterations under different file generation scenario requirements are achieved, and based on each file update operation information, the data content of the generated target file is precisely generated.

[0087] As a first optional embodiment of the embodiment, based on the above embodiment, this first optional embodiment further optimizes and adds a step of generating a target file when the method type is the same data copy.

[0088] Figure 5 1 is an example diagram showing an update operation information involved in the file generation method provided in the second embodiment of the present invention. Figure 5As shown, the update operation information 1221 may include a method type, differential data description information, a source data matrix information set, and a target data matrix information set. The differential data description information may be determined according to the method type in each update operation information 1221, and a source data matrix information set and a target data matrix information set may be constructed. The data in the source file 23 may be extracted according to the constructed source data matrix information set, and the unit matrix in the source data matrix information set may be copied and stored in the target data matrix information set to generate a target file 24.

[0089] Specifically, the step includes:

[0090] a3) When the method type is same data copy, determine that the difference data description information is empty.

[0091] In this embodiment, copying the same data can be understood as restoring the same data from the source data.

[0092] Specifically, the same data is restored from the source data as the target data. At this time, the target data is the same as the source data, so there is no difference data between the source data and the target data, that is, the difference data description information is empty.

[0093] b3) Acquire one or more marked first source unit matrix windows included in the source data matrix information set.

[0094] In this embodiment, the first source unit matrix window can be understood as a small matrix window with specific subscript data in the source file based on the source data information.

[0095] Exemplarily, the source data matrix information set is: {{l,3},{m,1}}, where {l,3} and {m,1} are both first source unit matrix windows.

[0096] Specifically, the source data matrix information set may include multiple first source unit matrix windows, and one or more marked data included in the source file are extracted according to the source data matrix information set, wherein the data with the same subscript is stored in the same source unit matrix window, i.e., the first source unit matrix window. The number of the first source unit matrix windows can be determined based on different requirements, and this embodiment does not limit it.

[0097] c3) extracting the first source window data in each of the first source unit matrix windows from the source file and completing data verification.

[0098] In this embodiment, the first source window data can be understood as the data marked in the first source unit matrix window, for example, the three data marked as 1 in {1,3}.

[0099] Specifically, specific marks and a specific amount of data in the source file are extracted according to the source data matrix information set. For example, according to each first source unit matrix window in the source data matrix information set, data with a subscript of l and a count of 3 small matrix windows and data with a subscript of m and a count of 1 small matrix window are extracted in the source file, and a new matrix sequence with a size of 4 small matrix windows is formed in the memory. Data verification is performed on these data to ensure data integrity and correctness.

[0100] d3) Obtain the first unit matrix window information contained in the target data matrix information set.

[0101] In this embodiment, the first unit matrix window information can be understood as the window information of each small matrix window in the target data matrix information set.

[0102] In this embodiment, the target data matrix information set may be: {{l`,3},{m`,1}}, wherein the information contained in {l`,3} and {m`,1} may be understood as the first unit matrix window information in the target data matrix information set.

[0103] e3) Copying the first source window data according to the first unit matrix window information to form the file content of the target file to be generated from the source file.

[0104] In this embodiment, the first source window data is copied and written into the target data matrix information set by the same data copying method. For example, the data with a subscript of l and a count of 3 small matrix window sizes and the data with a subscript of m and a count of 1 small matrix window size contained in the first source window are written into the positions with a subscript of l' and a count of 3 small matrix window sizes and a subscript of m' and a count of 1 small matrix window size in the target file, and the target file content relative to the source file is generated based on the same data copying method.

[0105] As a second optional embodiment of the embodiment, based on the above embodiment, this second optional embodiment further optimizes and adds a step of generating a target file when the method type is new data update.

[0106] Figure 6 FIG. 1 is another example diagram showing update operation information involved in the file generation method provided in the second embodiment of the present invention. Figure 6As shown, the update operation information 1221 may include a method type, a first difference data identifier, a source data matrix information set, and a target data matrix information set. The source data matrix information set may be determined according to the method type in each update operation information 1221. The target data matrix information set is constructed, and data is extracted from the difference data 25 based on the first difference data identifier and verified and decompressed, and the data is processed according to the method of adding new data update, and finally stored in the target data matrix information set to generate the target file 24.

[0107] Specifically, the step includes:

[0108] a4) When the method type is new data update, determine that the information in the source data matrix information set is empty.

[0109] In this embodiment, the newly added data update (replace) can be understood as decompressing the newly added new data from the differential data.

[0110] Specifically, the newly added data is decompressed from the difference data. At this time, the newly added data has no intersection with the source data. When processing the newly added data, there is no reference in the source data, so the information in the source data matrix information set is empty.

[0111] b4) Acquire the first difference data identifier included in the difference data description information, and the second unit matrix window information included in the target data matrix information set.

[0112] In this embodiment, the first difference data identifier can be understood as the identifier of the difference data when the method type is new data update. For example, it can be {data m, 1000}, which means 1000 difference data marked as m. The difference data identifier can be determined based on different requirements, which is not limited in this embodiment.

[0113] The second unit matrix window information can be understood as the window information of each small matrix in the target data matrix information set. For example, if the target data matrix information set is: {{l`,3},{m`,1}}, then the second unit matrix window information can be understood as {l`,3} or {m`,1}.

[0114] c4) extracting the newly added data corresponding to the first difference data identifier from the file data set to obtain the first difference data after data verification and decompression.

[0115] In this embodiment, the first difference data may be understood as data corresponding to the first difference data identifier.

[0116] Specifically, data whose mark and quantity size conform to the first difference data identifier are extracted from the file data set data0-n as new data, and the new data are verified and decompressed to obtain the first difference data. For example, the difference data with a size of 1000 at the subscript data m can be extracted from the file data set according to the difference data identifier, and the data can be verified and decompressed to generate the first difference data.

[0117] d4) inserting the first difference data into data according to the second unit matrix window information to constitute the file content of the target file to be generated from the source file.

[0118] In this embodiment, the verified and decompressed first difference data is inserted into the file content of the target file according to the mark and quantity information in the second unit matrix window information.

[0119] Exemplarily, after verification, decompression is performed to form a small matrix sequence with a size of 4 small matrix windows. Finally, according to the second unit matrix window information in the target data matrix information set, the data is written into the target file at a location with a subscript of l` counting 3 small matrix window sizes and a subscript of m` counting 1 small matrix window size, and the target file content relative to the source file is generated based on the newly added data update method.

[0120] As a third optional embodiment of the embodiment, based on the above embodiment, this third optional embodiment further optimizes and adds a step of generating a target file when the method type is reference difference data update.

[0121] Figure 7 FIG. 2 is another example of updating operation information involved in the file generation method provided in the second embodiment of the present invention. Figure 7 As shown, the update operation information 1221 may include a method type, a second difference data identifier, a source data matrix information set, and a target data matrix information set. In the execution logic of this file, the method type is reference difference data update, firstly, the second difference data identifier is determined and the source data matrix information set, the target data matrix information set, and the intermediate matrix 26 are constructed, the data in the source file 23 are extracted according to the constructed source data matrix information set, the difference data 25 are extracted according to the second difference data identifier, the data of the intermediate matrix 26 are determined according to the extracted data of the source file 23 and the difference data 25, and the data are inserted according to the unit window of the target data matrix information set to generate the target file 24.

[0122] Specifically, the step includes:

[0123] a5) When the method type is reference difference data update, obtaining a second difference data identifier included in the difference data description information and third unit matrix window information included in the target data matrix information set.

[0124] In this embodiment, reference difference data update (diff) can be understood as a method of updating target data by combining reference source data with difference data. The second difference data identifier can be understood as the identifier of difference data when the method type is reference difference data update. For example, it can also be {data m, 1000}, which means 1000 difference data marked as m. The difference data identifier can be determined based on different requirements, which is not limited in this embodiment.

[0125] The third unit matrix window information can be understood as the window information of each small matrix in the target data matrix information set. For example, if the target data matrix information set is: {{l`,2},{m`,2}}, then the third unit matrix window information can be understood as {l`,2} or {m`,2}.

[0126] b5) Acquire one or more marked second source unit matrix windows included in the source data matrix information set.

[0127] In this embodiment, the second source unit matrix window can be understood as a small matrix window with specific marking data in the source file based on the source data information.

[0128] Exemplarily, the source data matrix information set is: {{l,3},{m,1}}, where {l,3} and {m,1} are both second source unit matrix windows.

[0129] Specifically, there are multiple different second source unit matrix windows in the source data matrix information set, and the second source unit matrix windows are formed based on specific labels and specific quantity data. One or more marked second source unit matrix windows included in the source data matrix information set are obtained.

[0130] c5) extracting the second source window data in each of the second source unit matrix windows from the source file and completing data verification.

[0131] In this embodiment, the second source window data can be understood as the data stored in the second source unit matrix window. For example, it can be three data marked as 1, which are recorded as the second source window data. In the source file, there can be the same data or zero data that are filtered out between the data marked with different subscripts.

[0132] Exemplarily, data with a subscript of l and a count of 3 small matrix window sizes and data with a subscript of m and a count of 1 small matrix window size in the source file are extracted according to the source data matrix information set, and the data are verified to ensure their accuracy and completeness.

[0133] d5) extracting the difference data corresponding to the second difference data identifier from the file data set, and obtaining the second difference data after data verification and decompression.

[0134] In this embodiment, the second difference data can be understood as the data corresponding to the second difference data identifier.

[0135] Specifically, data whose mark and quantity size match the second difference data identifier are extracted from the file data set data0-n as difference data, and the difference data is verified and decompressed to determine the second difference data. For example, the difference data with a size of 1000 at the subscript data m can be extracted from the file data set according to the difference data identifier, and the data is verified and decompressed to generate the second difference data.

[0136] e5) determining intermediate matrix window data according to the second source window data and the second difference data.

[0137] In this embodiment, the intermediate matrix window data may be data of a matrix window formed based on the combination of the second source window data and the second difference data.

[0138] Exemplarily, a new matrix sequence, namely the intermediate matrix, is formed in the memory, with a size of 4 small matrix windows. At the same time, the difference data with a size of 1000 at the subscript data m is extracted from the file information set according to the difference data information. The intermediate matrix window information is verified as source data, and then the intermediate matrix window information and the data m difference data are combined to restore the target data with the same size of 4 small matrix windows.

[0139] f5) inserting the intermediate matrix window data according to the third unit matrix window information to form the file content of the target file to be generated from the source file.

[0140] In this embodiment, the target data is written into the position of the target file with the subscript l` counting 2 small matrix window sizes and the subscript m` counting 2 small matrix window sizes according to the third unit matrix window information in the target data matrix information set, and the file content of the target file is formed based on the reference difference data updating method.

[0141] Furthermore, each file execution logic corresponding to the update operation information can be run independently.

[0142] In this embodiment, each target file is managed independently using a data management information segment, so that there is no necessary order between the restoration targets. At the same time, file update operation information is used in each data management sub-segment, and each differential restoration unit is independently divided, so that the original inevitable restoration process from beginning to end is transformed into a restoration process with each file update operation information as a unit. The source data corresponding to the source data matrix information set on which the restoration process of each file update operation information depends is independent of the difference data of the file data set. This allows multiple file update operation information to be restored simultaneously based on the file generation logic, greatly improving the restoration speed.

[0143] Figure 8 : is an example diagram showing the independent execution of file generation logic between two update operation information in the file generation method provided in the second embodiment of the present invention, such as Figure 8 As shown, two update operation information 1221 for executing file generation logic in parallel are described. Among them, the first update operation information 1221 may include the method type for copying the same data, differential data description information, source data matrix information set and target data matrix information set. The second update operation information 1221 may include the method type for updating the reference difference data, the second difference data identifier, the source data matrix information set and the target data matrix information set. It can be seen that when the update operation information 1221 based on the same data copy method executes the file generation logic, it does not affect the execution of the file generation logic by another update operation information 1221 based on the reference difference data update method. The only intersection of the two update operation information 1221 executing the file generation logic at the same time is to extract data from the same source file 23 and generate the target file 24, and there is no mutual interference in the logical operations of both parties.

[0144] In this embodiment, the above technical solution is adopted, and the independent execution characteristics between the data management information segment IMUS and the file update operation information are used to complete the parallel flash restoration process, so that the target file can be quickly generated. Compared with the traditional serial flash logic, the problem of always executing the restoration process serially from beginning to end, resulting in a long running time, is solved. The above technical solution effectively saves time costs and greatly improves the efficiency of file generation.

[0145] Embodiment 3

[0146] Fig. 9 Schematic diagram of the structure of a file generation device provided by Embodiment 3 of the present invention. Fig. 9 As shown, the device comprises:

[0147] The data packet acquisition module 31 is used to acquire a file update data packet predetermined relative to the source file and the target file, wherein the file update data packet includes: a data packet header, a data management information segment and a file data set;

[0148] The target file generation module 32 is used to generate a target file corresponding to the source file according to the data management information segment and the file data set after verifying the file update data packet relative to the source file through the data packet header.

[0149] By adopting the above technical solution, the file update data packet is predetermined, and the file update data packet is divided into a data packet header, a data management information segment, and a file data set. By adopting the structure of the data management information segment, the file data to be updated in the file update data packet can be segmented and managed, and the data to be updated can be accurately identified, and the target file can be further generated. In the above technical solution, effective management of the file update data packet is achieved, the file generation efficiency is improved, and the target file is accurately generated based on the data content.

[0150] Optionally, the data management information segment includes information segment basic information and at least one data management sub-segment;

[0151] The file data set includes at least one differential data segment arranged according to a given sequence number;

[0152] Wherein, the data management sub-segment includes: at least one update calculation operation information.

[0153] Optionally, the target file generation module 32 includes:

[0154] an operation information extraction unit, configured to extract, for each data management sub-segment in the data management information segment, update operation information included in the data management sub-segment;

[0155] A specific information acquisition unit is used to acquire, for each update operation information, the method type, difference data description information and data matrix information set included in the update operation information;

[0156] The target file generating unit is used to generate the target file corresponding to the source file according to the method type in the update operation information, in combination with the difference data description information, the data matrix information set and the file data set.

[0157] Optionally, the target file generation unit is specifically applied to:

[0158] In the case where the method type is same data replication, determining that the difference data description information is empty;

[0159] Acquire one or more marked first source unit matrix windows included in the source data matrix information set;

[0160] Extracting the first source window data in each of the first source unit matrix windows from the source file and completing data verification;

[0161] Obtain the first unit matrix window information contained in the target data matrix information set;

[0162] The first source window data is copied according to the first unit matrix window information to form the file content of the target file to be generated by the source file.

[0163] Optionally, the target file generation unit is specifically applied to:

[0164] In the case where the method type is new data update, determining that the information in the source data matrix information set is empty;

[0165] Acquire the first difference data identifier included in the difference data description information, and the second unit matrix window information included in the target data matrix information set;

[0166] Extracting the newly added data corresponding to the first difference data identifier from the file data set to obtain first difference data after data verification and decompression;

[0167] The first difference data is inserted into the second unit matrix window information to form the file content of the target file to be generated from the source file.

[0168] Optionally, the target file generation unit is specifically applied to:

[0169] In the case where the method type is reference difference data update, obtaining a second difference data identifier included in the difference data description information and third unit matrix window information included in the target data matrix information set;

[0170] Acquire one or more marked second source unit matrix windows included in the source data matrix information set;

[0171] Extracting the second source window data in each of the second source unit matrix windows from the source file and completing data verification;

[0172] Extracting difference data corresponding to the second difference data identifier from the file data set to obtain second difference data after data verification and decompression;

[0173] Determining intermediate matrix window data according to the second source window data and the second difference data;

[0174] The intermediate matrix window data is inserted according to the third unit matrix window information to form the file content of the target file to be generated from the source file.

[0175] Optionally, the target file generation module 32 also includes a breakpoint record generation unit, which is used to record the breakpoints of the update operation information of the operation logic being executed in each data management sub-segment in the data management information segment after detecting the power-off operation of the device, so as to form a breakpoint record file.

[0176] Optionally, the breakpoint record generating unit is specifically applied to:

[0177] After detecting the power-on operation of the device, determining whether there is currently an unfinished file generation logic based on the pre-stored breakpoint record file;

[0178] If it exists, the breakpoint update operation information to be executed is obtained from the breakpoint record file, and the logical execution of the breakpoint update operation information is restored to continue generating the target file corresponding to the source file.

[0179] Optionally, the file generation device further includes a data package determination module, which is used to determine a file update data package relative to the source file and the target file based on the source file and the target file pre-backed up on the set object.

[0180] The file generation device provided in the embodiment of the present invention can execute the file generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0181] Embodiment 4

[0182] Fig.10 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein. The electronic device 40 may also include a vehicle with processing computing capabilities.

[0183] like Fig.10As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0184] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0185] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a file generation method.

[0186] In some embodiments, the file generation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the file generation method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the file generation method in any other appropriate manner (e.g., by means of firmware).

[0187] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0188] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0189] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0190] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0191] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0192] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0193] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0194] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A file generation method, characterized in that: include: Acquire a file update data packet predetermined relative to a source file and a target file, wherein the file update data packet includes: a data packet header, a data management information segment, and a file data set; After performing file update data packet verification on the source file through the data packet header, generating a target file corresponding to the source file according to the data management information segment combined with the file data set; Wherein, the file data set includes at least one differential data segment arranged according to a given sequence number; The step of generating a target file corresponding to the source file according to the data management information segment in combination with the file data set includes: For each data management sub-segment in the data management information segment, extracting update operation information included in the data management sub-segment; For each update operation information, obtaining the method type, difference data description information and data matrix information set included in the update operation information; Generate a target file corresponding to the source file according to the method type in the update operation information, combined with the difference data description information, the data matrix information set and the file data set; Among them, the method types include: same data copying, new data updating and reference difference data updating; the data matrix information set is a set of one or more small matrices marked by a small matrix window in the file that are required by the method type operation in the current update operation information.

2. The method according to claim 1, characterized in that The data management information segment includes information segment basic information and at least one data management sub-segment; wherein the data management sub-segment includes: at least one update operation information.

3. The method according to claim 1, characterized in that The method type in the update operation information is combined with the difference data description information, the data matrix information set and the file data set to generate a target file corresponding to the source file, including: In the case where the method type is same data replication, determining that the difference data description information is empty; Acquire one or more marked first source unit matrix windows included in the source data matrix information set; Extracting the first source window data in each of the first source unit matrix windows from the source file and completing data verification; Obtain the first unit matrix window information contained in the target data matrix information set; The first source window data is copied according to the first unit matrix window information to form the file content of the target file to be generated from the source file.

4. The method according to claim 1, characterized in that: The method type in the update operation information is combined with the difference data description information, the data matrix information set and the file data set to generate a target file corresponding to the source file, including: In the case where the method type is new data update, determining that the information in the source data matrix information set is empty; Acquire the first difference data identifier included in the difference data description information, and the second unit matrix window information included in the target data matrix information set; Extracting the newly added data corresponding to the first difference data identifier from the file data set to obtain first difference data after data verification and decompression; The first difference data is inserted into the second unit matrix window information to form the file content of the target file to be generated from the source file.

5. The method according to claim 1, characterized in that The method type in the update operation information is combined with the difference data description information, the data matrix information set and the file data set to generate a target file corresponding to the source file, including: In the case where the method type is reference difference data update, obtaining a second difference data identifier included in the difference data description information and third unit matrix window information included in the target data matrix information set; Acquire one or more marked second source unit matrix windows included in the source data matrix information set; Extracting the second source window data in each of the second source unit matrix windows from the source file and completing data verification; Extracting difference data corresponding to the second difference data identifier from the file data set, and obtaining second difference data after data verification and decompression; Determining intermediate matrix window data according to the second source window data and the second difference data; The intermediate matrix window data is inserted according to the third unit matrix window information to form the file content of the target file to be generated from the source file.

6. The method according to any one of claims 1 to 5, characterized in that: In the process of generating a target file corresponding to the source file according to the data management information segment and the file data set, the process further includes: After the device power-off operation is detected, the update operation information of the operation logic being executed in each data management sub-segment in the data management information segment is recorded at a breakpoint to form a breakpoint record file.

7. The method according to claim 6, characterized in that Also includes: After detecting the power-on operation of the device, determining whether there is currently an unfinished file generation logic based on the pre-stored breakpoint record file; If it exists, the breakpoint update operation information to be executed is obtained from the breakpoint record file, and the logical execution of the breakpoint update operation information is restored to continue generating the target file corresponding to the source file.

8. The method according to any one of claims 1 to 5, characterized in that: Also includes: Based on the source file and the target file backed up in advance on the setting object, a file update data package relative to the source file and the target file is determined.

9. A file generating device, comprising: A data packet acquisition module, used to acquire a file update data packet predetermined relative to a source file and a target file, wherein the file update data packet includes: a data packet header, a data management information segment, and a file data set; A target file generation module, configured to generate a target file corresponding to the source file according to the data management information segment and the file data set after verifying the file update data packet of the source file through the data packet header; Wherein, the file data set includes at least one differential data segment arranged according to a given sequence number; Wherein, the target file generation module includes: an operation information extraction unit, configured to extract, for each data management sub-segment in the data management information segment, update operation information included in the data management sub-segment; A specific information acquisition unit is used to acquire, for each update operation information, the method type, difference data description information and data matrix information set included in the update operation information; A target file generating unit, configured to generate a target file corresponding to the source file according to the method type in the update operation information, in combination with the difference data description information, the data matrix information set and the file data set; Among them, the method types include: same data copying, new data updating and reference difference data updating; the data matrix information set is a set of one or more small matrices marked by a small matrix window in the file that are required by the method type operation in the current update operation information.

10. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the file generation method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the file generation method according to any one of claims 1 to 8 when executed.

Citation Information

Patent Citations

  • Metadata synchronizing method and system

    CN102467529A

  • Non-coverage code updating method and device, equipment and medium

    CN114924771A