File updating method and device, equipment and storage medium
By automatically detecting and updating files, JOSN and XML files are generated, which solves the problems of inefficiency and high error rate of traditional file update methods, and achieves efficient and accurate file updates.
Patent Information
- Application Number
- CN202411274877.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-10
AI Technical Summary
Traditional file update methods rely on manual operations, are inefficient and have high error rates, and cannot meet the high requirements for file accuracy, timeliness and completeness in the modern information age.
By obtaining component source file packages, decompressing and detecting each component package, generating JOSN files and XML files, determining the update method based on the detection results, automatically updating the files, improving update efficiency and accuracy.
The automated file update process is realized, which improves the update speed and accuracy, reduces the manual error rate, and meets the needs of modern technology for the efficiency and accuracy of file updates.
Smart Images

Figure CN119105785A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of file updating, and in particular to a file updating method, apparatus, device and storage medium. Background Art
[0002] In today's information age, files, as an important carrier of information storage and transmission, need to be updated more and more frequently. With the continuous advancement of technology and the sustainable development of business, various fields have put forward higher requirements on the accuracy, timeliness and integrity of files.
[0003] Traditional file update methods mainly rely on manual operations. For example, when a file needs to be updated, the user needs to manually check the version and compilation method of each installed update component to determine whether an update is needed. However, this method is inefficient and has a high error rate. Summary of the invention
[0004] In view of this, the present application provides a file updating method, apparatus, device and storage medium, which are used to solve the problem that the traditional file updating method mainly relies on manual operation. For example, when a file needs to be updated, the user needs to manually check the version and compilation method of each installed update component to determine whether an update is needed. However, this method is inefficient and has a high error rate.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a file updating method includes:
[0007] Get the component source file package;
[0008] Decompressing the component source file package to obtain each first component package;
[0009] For each of the first component packages, determine the package type of the first component package, and detect the first component package according to the package type to generate a JOSN file;
[0010] Determine the update method of the file to be updated by using the JOSN file, and create an XML file according to the update method;
[0011] The files to be updated are updated using the JOSN files and the XML files.
[0012] Preferably, the detecting the first component package according to the package type to generate a JOSN file includes:
[0013] If the package type of the first component package is a driver program type, decompressing the first component package to obtain each first sub-document;
[0014] Determine whether there is a first sub-document belonging to a preset device information document in each of the first sub-documents;
[0015] If yes, obtaining the version information in the first sub-document belonging to the preset device information document;
[0016] Determining whether the version information in the first sub-document is consistent with the version information recorded in the pre-acquired driver list;
[0017] If they are consistent, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
[0018] Preferably, the detecting the first component package according to the package type to generate a JOSN file includes:
[0019] If the package type of the first component package is an application type, obtaining version information of the first component package from the first component package;
[0020] Determining whether the version information of the first component package is consistent with the version information recorded in the pre-acquired application list;
[0021] If they are consistent, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
[0022] Preferably, the detecting the first component package according to the package type to generate a JOSN file includes:
[0023] If the package type of the first component package is other than the driver type and the application type, then obtaining each first component in the first component package;
[0024] Aggregate each of the first components into a file in a preset JOSN format to obtain a JOSN file.
[0025] Preferably, generating a JOSN file corresponding to the second component package includes:
[0026] For the second component package, determine each second component in the second component package;
[0027] Get the component installation sequence of the file to be updated;
[0028] Matching each of the second components with the component installation sequence respectively, and determining a matching degree;
[0029] The second components corresponding to the mismatch degree are used as new components;
[0030] Using each second component corresponding to a partial match as each update component;
[0031] The second components corresponding to the complete match are used as the old components;
[0032] Each of the newly added components, each of the updated components and / or each of the old components is aggregated into a file in a preset JOSN format to obtain a JOSN file.
[0033] Preferably, the method of determining the update mode of the file to be updated by using the JOSN file includes:
[0034] Get each component contained in the JOSN file;
[0035] determining a component type for each of the components;
[0036] The component type of each component is compared with a pre-established update method comparison table to determine each update method corresponding to each component type.
[0037] Preferably, the updating of the to-be-updated file by using each of the JOSN files and each of the XML files comprises:
[0038] Get the component installation sequence of the file to be updated;
[0039] For each of the JOSN files and the XML files corresponding thereto, one or more update methods are obtained from the XML files. For each of the update methods:
[0040] If the update mode is to add, then extract the corresponding newly added components from the JOSN file, determine the installation position of each newly added component, and insert each newly added component into the component installation sequence according to the installation position;
[0041] If the update method is a regular update, the corresponding update components are extracted from the JOSN file, the installation components corresponding to the update components are determined in the component installation sequence, and the corresponding installation components in the component installation sequence are updated using the update components.
[0042] In a second aspect, a file updating device includes:
[0043] A component source file package acquisition module is used to acquire a component source file package;
[0044] A decompression module, used for decompressing the component source file package to obtain each first component package;
[0045] A JOSN file generating module, configured to determine, for each of the first component packages, a package type of the first component package, and detect the first component package according to the package type to generate a JOSN file;
[0046] An XML file creation module, used to determine an update method for the file to be updated using the JOSN file, and create an XML file according to the update method;
[0047] An updating module is used to update the files to be updated by using the JOSN files and the XML files.
[0048] In a third aspect, a file updating device includes a memory and a processor;
[0049] The memory is used to store programs;
[0050] The processor is used to execute the program to implement each step of the file updating method as described in any one of the first aspects.
[0051] In a fourth aspect, a storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the file updating method as described in any one of the first aspects are implemented.
[0052] It can be seen from the above technical solution that the present application obtains a component source file package; decompresses the component source file package to obtain each first component package; for each first component package, determines the package type of the first component package, and detects the first component package according to the package type to generate a JOSN file; uses the JOSN file to determine the update method for the file to be updated, and establishes an XML file according to the update method; uses each of the JOSN files and each of the XML files to update the file to be updated. The solution first obtains the component source file package to be used for the update, and decompresses it to obtain the first component packages therein, and for each first component package, performs different detection methods according to its different package types to generate a JOSN file. Considering the package type for detection can make the detection result more accurate. Subsequently, the update method can be determined according to the JOSN file generated by the detection, so as to generate an XML file, and then the JOSN file and the XML file are used to update the file to be updated. After the detection, the file is generated in the form of JOSN format, which can be more concise and flexible, convenient for storing data, and help to improve the speed of subsequent updates using JOSN files. In addition, using different update methods for different situations can also improve the efficiency of the update, which can solve the problems of low efficiency and high error rate of the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0054] Figure 1 An optional flow chart of a file update method provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of the structure of a file updating device provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of the structure of a file updating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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.
[0058] The embodiment of the present invention provides a file update method, which can be applied to various computer terminals or intelligent terminals. The execution subject can be a processor or server of the computer terminal or intelligent terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0059] S1: Get the component source file package.
[0060] The component source file package in this application is a collection of all source files required to implement a specific component, including source code files, resource files, and document files, etc. These files may exist in different component packages respectively.
[0061] The component source file package is used in this application to update the files to be updated, and may also be referred to as a component installation package.
[0062] The file to be updated refers to a file that needs to be updated, which may be a version update, a content update, a name update, etc. The file type may be any type, and this embodiment does not impose any limitation on this.
[0063] S2: Decompress the component source file package to obtain each first component package.
[0064] The component source file package contains multiple component packages, and they correspond to updates in different directions and degrees. From multiple aspects, different first component packages have functional differences. For example, some first component packages can add new functions to the files to be updated, and some first component packages can improve the existing functions in the files to be updated; differences in security, including vulnerability repairs, security enhancements, etc.; differences in compatibility, compatibility with new operating systems or software environments, compatibility with other components or software, etc.; differences in performance optimization, such as code optimization or resource management optimization.
[0065] Therefore, each component package can update a part of the file to be updated. In order to make the update more comprehensive, after obtaining the component source file package, first decompress the component source file package. You can use an online decompression tool or a third-party decompression tool to decompress it, and obtain multiple component packages in the component source file package as each first component package.
[0066] S3: For each of the first component packages, determine the package type of the first component package, and detect the first component package according to the package type to generate a JOSN file.
[0067] It is mentioned in the above step S2 that the update directions of the first component packages are different. Specifically, the package types of the first component packages are different. Different package types may correspond to different update methods. In order to make the update process more efficient and the update effect better, each first component package needs to be detected before the update, such as detecting whether they correspond to the file to be updated. For example, for software, the version of the file to be updated is 2.1, and the version of the component corresponding to the first component package is 2.0. If the first component package is used to update the file to be updated, the version of the file to be updated will be regressed; or the updated version of the first component package is not recorded in the version list, that is, the updated version is still under testing, or the updated version has errors and cannot be put into use at present. Therefore, if the first component package is used to update the file to be updated, it will have an adverse effect on the file to be updated.
[0068] Based on the above problems, after obtaining each first component package in the component source file package, it is necessary to perform detection and generate a JOSN file based on the detection results. The JOSN file is a lightweight file for storing data. It uses a concise text format, which can facilitate the transmission and storage of data and can be used across platforms. It is also flexible and can represent various complex data structures. Therefore, it can better store the detection results and facilitate subsequent updates to the files to be updated.
[0069] It should be noted that the JOSN file contains not only the test results but also the component information, and the update function is implemented based on the test results and the component information.
[0070] S4: Determine the update method of the file to be updated by using the JOSN file, and create an XML file according to the update method.
[0071] It is understandable that the component information contained in the JOSN file may refer to multiple components, each of which may be regarded as a component for implementing the update function, which has a specific function and logical structure. It may be composed of multiple files, or it may cooperate with other components to implement more complex functions.
[0072] Since the JOSN file contains the detection results and component information, it is possible to determine how the first component can update the update file based on the detection results and component information, that is, determine the update method. This is because different first component packages are different, so the update methods will also be different.
[0073] On the one hand, for example, for independent application components, they can be updated through automatic update programs, download a complete installation package or update package to overwrite the old version of the file, or they can be updated through the application store; for plug-ins or extension components, they usually rely on the main application, and check the version of the plug-in when the main application starts to determine whether to update the plug-in or extension; there will also be corresponding update methods for libraries or framework components. On the other hand, the first component package is also divided into critical and non-critical. For important and critical first component packages, it is necessary to choose a more rigorous and comprehensive update method. For less important and non-critical first component packages, the update method can be determined by focusing on the speed or efficiency of the update. This can also improve the efficiency of updating using component source file packages in general.
[0074] After determining the update method, you can generate another XML file and store the update method in the XML file. The XML file has the characteristics of readability and self-description, and can be better combined with the JOSN file to realize the update function.
[0075] The XML file can also store the current version information of the file to be updated.
[0076] S5: Using each of the JOSN files and each of the XML files to update the file to be updated.
[0077] In this step, the file to be updated may be updated by using the components included in the JOSN file and the update method recorded in the XML file.
[0078] It can be seen from the above technical solution that the present application obtains a component source file package; decompresses the component source file package to obtain each first component package; for each first component package, determines the package type of the first component package, and detects the first component package according to the package type to generate a JOSN file; uses the JOSN file to determine the update method for the file to be updated, and establishes an XML file according to the update method; uses each of the JOSN files and each of the XML files to update the file to be updated. The solution first obtains the component source file package to be used for the update, and decompresses it to obtain the first component packages therein, and for each first component package, performs different detection methods according to its different package types to generate a JOSN file. Considering the package type for detection can make the detection result more accurate. Subsequently, the update method can be determined according to the JOSN file generated by the detection, so as to generate an XML file, and then the JOSN file and the XML file are used to update the file to be updated. After the detection, the file is generated in the form of JOSN format, which can be more concise and flexible, convenient for storing data, and help to improve the speed of subsequent updates using JOSN files. In addition, using different update methods for different situations can also improve the efficiency of the update, which can solve the problems of low efficiency and high error rate of the existing technology.
[0079] In the method provided by the embodiment of the present invention, the first component package is detected according to the package type to generate a JOSN file process, based on different package types, specifically including the following aspects, starting from the package type of driver class, application type and other types.
[0080] 1. Package type is driver type
[0081] A driver-type component package is a software component package that enables the operating system to communicate with and control a specific hardware device. It contains multiple files for installing, configuring, and updating the driver for a specific hardware device.
[0082] The testing process includes:
[0083] Decompressing the first component package to obtain each first sub-document;
[0084] Determine whether there is a first sub-document belonging to a preset device information document in each of the first sub-documents;
[0085] If yes, obtaining the version information in the first sub-document belonging to the preset device information document;
[0086] Determining whether the version information in the first sub-document is consistent with the version information recorded in the pre-acquired driver list;
[0087] If they are consistent, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
[0088] Specifically, the device information document is also called an inf (Information File) document, which is often used to install drivers for hardware devices. It contains version information, so the first component package needs to be decompressed to obtain each first sub-document, and then the version information is compared and judged to determine whether there is a first sub-document belonging to the inf document in each first sub-document. If so, the version information is obtained from it, and it is determined whether the version information is consistent with the version information recorded in the driver list. Only when the version information in the inf document is recorded in the driver list can it be determined that the version information is correct and can be used for updating. This also means that the first component package can be used for updating, that is, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
[0089] If the inf document does not exist in the first sub-document, or if the inf document exists but the version information contained therein is not recorded in the driver list, the first component package is marked and fed back to the staff for recording.
[0090] (ii) Package type is application type (APP)
[0091] An application-type component package is a collection of various components required to construct a specific application.
[0092] The testing process includes:
[0093] Obtaining version information of the first component package from the first component package;
[0094] Determining whether the version information of the first component package is consistent with the version information recorded in the pre-acquired application list;
[0095] If they are consistent, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
[0096] Specifically, if the first component package is an application type, then there is no inf document in the first component package, so there is no need to determine whether there is an inf document therein. The version information can be directly extracted from the first component package, and compared and judged. The comparison and judgment method is the same as the driver type, which will not be repeated here.
[0097] (III) The package type is other than the driver type and application type.
[0098] The testing process includes:
[0099] If the package type of the first component package is other than the driver type and the application type, then obtaining each first component in the first component package;
[0100] Aggregate each of the first components into a file in a preset JOSN format to obtain a JOSN file.
[0101] Specifically, in addition to the driver type and the application type, there are other types of first component packages. If the first component package is neither a driver type nor an application type, there is no need to judge the version information. The first components in the first component package are directly obtained, and the first components are summarized into a file in a preset JOSN format to obtain a JOSN file.
[0102] Among them, the package type can be determined by the driver_type information in the first component package. If driver_type=driver, the package type is a driver type; if driver_type=APP, the package type is an application type; if driver_type=other, the package type is a type other than a driver type and an application type.
[0103] In an example, taking driver chipset as an example:
[0104] First, determine that num_chipset_newver has a partially matched installation component 1 [stage1] in the component installation sequence. Also determine that the new version is newver, and the package type of the first component package / the second component package is driver_type=driver. Then, a component information in the generated JOSN file is:
[0105] {
[0106] 'Component 1':{"describe":"driver", "name":"1.chipset_0.2" , "stage":"[stage 1]", "version":"0.2", "filepath":"c:\Component_file\1.chipset_0.2"}
[0107] 'Component 2':{"describe":"APP", "name":"2.AUDIOUI_0.3" , "stage":"[stage 2]", "version":"0.3", "filepath":"c:\Component_file\1.chipset_0.2"}
[0108] }
[0109] Furthermore, for the first component package of the driver type and the application type, the process of generating the corresponding JOSN file after using it as the second component package includes:
[0110] For the second component package, determine each second component in the second component package;
[0111] Get the component installation sequence of the file to be updated;
[0112] Matching each of the second components with the component installation sequence respectively, and determining a matching degree;
[0113] The second components corresponding to the mismatch degree are used as new components;
[0114] Using each second component corresponding to a partial match as each update component;
[0115] The second components corresponding to the complete match are used as the old components;
[0116] Each of the newly added components, each of the updated components and / or each of the old components is aggregated into a file in a preset JOSN format to obtain a JOSN file.
[0117] Specifically, the file to be updated will correspond to a component installation sequence, which contains multiple components arranged in sequence. Each component will be updated in sequence, and the second component package is a component package used for updating. Therefore, each second component in the second component package is determined, and each second component is matched with each component in the component installation sequence to determine what type of component each second component is. For example, for one of the second components, the second component does not exist in the component installation sequence and does not correspond / match any installation component in the component installation sequence, then it means that the second component is a new component and it is treated as a new component; if the second component does not exist in the component installation sequence, but it corresponds to an installation component in the component installation sequence, although it is not a complete match, but a partial match, it can be considered that there is a certain relationship, which means that the second component is an updated component; if it is a complete match, it means that the second component is an old component and the second component does not need to be updated. The specific judgment standard is the reference matching degree. The present application sets three forms of matching degree, namely, no match, partial match and complete match. The matching degree can also be regarded as a percentage. If the matching degree is 100%, it is a complete match. If the matching degree is 1%~99%, it is a partial match. If the matching degree is 0%, it is a no match. The matching degree of the complete match can also be set at more than 90%, and the matching degree of the partial match can be set at 1%~90%. It can be determined according to the specific situation and needs, and this embodiment does not limit this.
[0118] Then no matter what type of component the second component is, it is aggregated into a file in a preset JOSN format to obtain a JOSN file.
[0119] If the component package corresponding to the JOSN file is a first component package of a type other than the driver type and the application type, the generation method of the JOSN file corresponding to the first component package is the same as the generation method of the JOSN file corresponding to the above-mentioned second component package, which will not be repeated here.
[0120] The following embodiment describes in detail the process of using the JOSN file in the present application to determine the update method for the file to be updated.
[0121] Get each component contained in the JOSN file;
[0122] determining a component type for each of the components;
[0123] The component type of each component is compared with a pre-established update method comparison table to determine each update method corresponding to each component type.
[0124] Specifically, first obtain each component contained in the JOSN file, and determine the component type of each component. Corresponding to the above embodiment, if the component package corresponding to the JOSN file is a first component package of other types except the driver type and the application type, then the component contained in the JOSN file is a first component, and the component type is a new component / updated component / old component; if the component package corresponding to the JOSN file is a second component package, then each component contained therein is a second component, and the component type is also a new component / updated component / old component.
[0125] The update method is determined according to the component type and the pre-established update method comparison table. The update method comparison table is a table including component types and update methods, and its format may be as shown in the following Table 1:
[0126] Table 1
[0127]
[0128] It should be noted that a first component / second component corresponds to an update method, which does not affect the update methods of other components. For example, a second component package contains three components, namely an update component, a new component and an old component. Then, when the JOSN file and XML file corresponding to the second component package are used to update the update file, the update component will be used to update the update file in accordance with the update method corresponding to the update component, and the new component will also be used to update the update file in accordance with the update method corresponding to the new component.
[0129] The following embodiments illustrate the process of updating the file to be updated by each of the JOSN files and each of the XML files in this application.
[0130] Get the component installation sequence of the file to be updated;
[0131] For each of the JOSN files and the XML files corresponding thereto, one or more update methods are obtained from the XML files. For each of the update methods:
[0132] If the update mode is to add, then extract the corresponding newly added components from the JOSN file, determine the installation position of each newly added component, and insert each newly added component into the component installation sequence according to the installation position;
[0133] If the update method is a regular update, the corresponding update components are extracted from the JOSN file, the installation components corresponding to the update components are determined in the component installation sequence, and the corresponding installation components in the component installation sequence are updated using the update components.
[0134] Specifically, other update methods may also be included, such as only updating the hardware identifiers (HWID) of some components in the component installation sequence or modifying the detection date of the installed components; some installed components in the component installation sequence may also be deleted. In this case, it is also necessary to modify the project name and the name of the XML file corresponding to the file to be updated at the same time. Then the XML file will be marked with the project name and an update word "update".
[0135] The update method of the conventional update can be considered as just an iterative update of the version, and there is no need to delete the installed components in the component installation sequence, nor to add components in the component installation sequence.
[0136] The newly added update method requires adding components to the component installation sequence. The position to add / insert into the component installation sequence needs to be set in advance. You can define a file in advance, which contains the relevant information of the installation location and is named in the *.ini file format. If the newly added component [stage*] is already in the installation sequence inst.ini, the program will move the [stage*+1] component in the original version backward.
[0137] For example, if the installation position is indicated by a number, and a new component is pre-set with the number [stage2], there may or may not be an installation component with the number [stage2] in the component installation sequence. Therefore, it is necessary to make a judgment and divide it into the following two insertion methods according to the judgment situation:
[0138] Note: The installation component numbered [stage2] and the newly added component numbered [stage2] here only have the same number, not the same components.
[0139] 1) If the number [stage2] already exists in the component installation sequence, that is, the component installation sequence contains an installation component numbered [stage2], then the number of this installation component is changed to [stage2+1], that is, [stage3], and the new component occupies the position [stage2] in the component installation sequence.
[0140] It should be noted that since the installation component originally numbered [stage2] becomes [stage3], if there are other installation components after this installation component in the component installation sequence, the numbers of the subsequent installation components with consecutive numbers need to be deduced in the same way, for example:
[0141] Before insertion, the numbering information in the component installation sequence is:
[0142] [stage1], [stage2], [stage3], [stage4], [stage6].
[0143] After inserting the new component numbered [stage2], the numbering information in the component installation sequence becomes:
[0144] [stage1], [stage2] (new), [stage2+1], [stage3+1], [stage4+1], [stage6], that is, [stage1], [stage2] (new), [stage3], [stage4], [stage5], [stage6].
[0145] 2) If there is no installation component numbered [stage2] in the component installation sequence, then the new component is inserted between the installation component numbered [stage1] and the installation component numbered [stage>2] in the component installation sequence, and the numbers of the remaining installation components remain unchanged.
[0146] It should be noted that different update methods do not conflict with each other. A component source file package may correspond to multiple update methods and can be updated simultaneously or sequentially.
[0147] Furthermore, after the update is completed, the present application can also use open source packaging tools to execute mount and unmount instructions to perform packaging operations, such as DISM.exe, and can perform data integrity detection, specifically using hash values for detection:
[0148] Before the update, the hash value of each newly added component / updated component is obtained. After the update is completed, the hash value is calculated again and compared. If there is an error, it means that there is a problem in the update process and it needs to be traced; if there is no error, it means that there is no problem in the update process. This can ensure the effectiveness and integrity of the update process and ensure the success rate of the update.
[0149] and Figure 1 Corresponding to the method described above, the embodiment of the present invention also provides a file updating device for updating Figure 1 In the specific implementation of the method, the file update device provided in the embodiment of the present invention can be used in a computer terminal or various mobile devices, combined with Figure 2 , introduce the file update device, such as Figure 2 As shown, the device may include:
[0150] A component source file package acquisition module 10 is used to acquire a component source file package;
[0151] A decompression module 20, used for decompressing the component source file package to obtain each first component package;
[0152] A JOSN file generating module 30, for determining the package type of each first component package, and detecting the first component package according to the package type to generate a JOSN file;
[0153] An XML file creation module 40 is used to determine an update method for the file to be updated using the JOSN file, and to create an XML file according to the update method;
[0154] The updating module 50 is used to update the file to be updated by using each of the JOSN files and each of the XML files.
[0155] It can be seen from the above technical solution that the present application obtains a component source file package; decompresses the component source file package to obtain each first component package; for each first component package, determines the package type of the first component package, and detects the first component package according to the package type to generate a JOSN file; uses the JOSN file to determine the update method for the file to be updated, and establishes an XML file according to the update method; uses each of the JOSN files and each of the XML files to update the file to be updated. The solution first obtains the component source file package to be used for the update, and decompresses it to obtain the first component packages therein, and for each first component package, performs different detection methods according to its different package types to generate a JOSN file. Considering the package type for detection can make the detection result more accurate. Subsequently, the update method can be determined according to the JOSN file generated by the detection, so as to generate an XML file, and then the JOSN file and the XML file are used to update the file to be updated. After the detection, the file is generated in the form of JOSN format, which can be more concise and flexible, convenient for storing data, and help to improve the speed of subsequent updates using JOSN files. In addition, using different update methods for different situations can also improve the efficiency of the update, which can solve the problems of low efficiency and high error rate of the existing technology.
[0156] Furthermore, the embodiment of the present application provides a file update device. Optionally, Figure 3 The hardware structure diagram of the file update device is shown in FIG. Figure 3 The hardware structure of the file updating device may include: at least one processor 01 , at least one communication interface 02 , at least one memory 03 and at least one communication bus 04 .
[0157] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0158] The processor 01 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0159] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0160] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following file update method, including:
[0161] Get the component source file package;
[0162] Decompressing the component source file package to obtain each first component package;
[0163] For each of the first component packages, determine the package type of the first component package, and detect the first component package according to the package type to generate a JOSN file;
[0164] Determine the update method of the file to be updated by using the JOSN file, and create an XML file according to the update method;
[0165] The files to be updated are updated using the JOSN files and the XML files.
[0166] Optionally, the detailed functions and extended functions of the program may refer to the description of the file updating method in the method embodiment.
[0167] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is running, controls the device where the storage medium is located to execute the following file update method, including:
[0168] Get the component source file package;
[0169] Decompressing the component source file package to obtain each first component package;
[0170] For each of the first component packages, determine the package type of the first component package, and detect the first component package according to the package type to generate a JOSN file;
[0171] Determine the update method of the file to be updated by using the JOSN file, and create an XML file according to the update method;
[0172] The files to be updated are updated using the JOSN files and the XML files.
[0173] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0174] Optionally, the detailed functions and extended functions of the program may refer to the description of the file updating method in the method embodiment.
[0175] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0176] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0177] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0178] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A file updating method, characterized in that: include: Get the component source file package; Decompressing the component source file package to obtain each first component package; For each of the first component packages, determine the package type of the first component package, and detect the first component package according to the package type to generate a JOSN file; Determine the update method of the file to be updated by using the JOSN file, and create an XML file according to the update method; The files to be updated are updated using the JOSN files and the XML files.
2. The method according to claim 1, characterized in that The detecting the first component package according to the package type to generate a JOSN file includes: If the package type of the first component package is a driver program type, decompressing the first component package to obtain each first sub-document; Determine whether there is a first sub-document belonging to a preset device information document in each of the first sub-documents; If yes, obtaining the version information in the first sub-document belonging to the preset device information document; Determining whether the version information in the first sub-document is consistent with the version information recorded in the pre-acquired driver list; If they are consistent, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
3. The method according to claim 1, characterized in that The detecting the first component package according to the package type to generate a JOSN file includes: If the package type of the first component package is an application type, obtaining version information of the first component package from the first component package; Determining whether the version information of the first component package is consistent with the version information recorded in the pre-acquired application list; If they are consistent, the first component package is used as the second component package, and a JOSN file corresponding to the second component package is generated.
4. The method according to claim 1, characterized in that The detecting the first component package according to the package type to generate a JOSN file includes: If the package type of the first component package is other than the driver type and the application type, then obtaining each first component in the first component package; Aggregate each of the first components into a file in a preset JOSN format to obtain a JOSN file.
5. The method according to claim 2 or 3, characterized in that: The generating of the JOSN file corresponding to the second component package includes: For the second component package, determine each second component in the second component package; Get the component installation sequence of the file to be updated; Matching each of the second components with the component installation sequence respectively, and determining a matching degree; The second components corresponding to the mismatch degree are used as new components; Using each second component corresponding to a partial match as each update component; The second components corresponding to the complete match are used as the old components; Each of the newly added components, each of the updated components and / or each of the old components is aggregated into a file in a preset JOSN format to obtain a JOSN file.
6. The method according to claim 1, characterized in that Determining the update method of the file to be updated by using the JOSN file includes: Get each component contained in the JOSN file; determining a component type for each of the components; The component type of each component is compared with a pre-established update method comparison table to determine each update method corresponding to each component type.
7. The method according to claim 1, characterized in that The updating of the to-be-updated file by using each of the JOSN files and each of the XML files includes: Get the component installation sequence of the file to be updated; For each of the JOSN files and the XML files corresponding thereto, one or more update methods are obtained from the XML files. For each of the update methods: If the update mode is to add, then extract the corresponding newly added components from the JOSN file, determine the installation position of each newly added component, and insert each newly added component into the component installation sequence according to the installation position; If the update method is a regular update, the corresponding update components are extracted from the JOSN file, the installation components corresponding to the update components are determined in the component installation sequence, and the corresponding installation components in the component installation sequence are updated using the update components.
8. A file updating device, characterized in that: include: A component source file package acquisition module is used to acquire a component source file package; A decompression module, used for decompressing the component source file package to obtain each first component package; A JOSN file generating module, configured to determine, for each of the first component packages, a package type of the first component package, and detect the first component package according to the package type to generate a JOSN file; An XML file creation module, used to determine an update method for the file to be updated using the JOSN file, and create an XML file according to the update method; An updating module is used to update the files to be updated by using the JOSN files and the XML files.
9. A file updating device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the file updating method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the file updating method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and system for rapidly updating lots of small files
CN106775802A
Multi-software system upgrading method
WO2006136060A1
