System software generation method and device, electronic equipment and storage medium

文档序号:1921177 发布日期:2021-12-03 浏览:4次 中文

阅读说明:本技术 系统软件生成方法、装置、电子设备及存储介质 (System software generation method and device, electronic equipment and storage medium ) 是由 不公告发明人 于 2021-08-04 设计创作,主要内容包括:本申请实施例公开了一种系统软件生成方法、装置、电子设备及存储介质,包括:获取第一终端设备的系统软件在测试完成后的强制升级包;解析强制升级包,得到至少一个模块镜像文件;根据开机默认配置数据,对至少一个模块镜像文件中选取的目标模块镜像文件进行修改,得到修改后模块镜像文件;根据第二终端设备中存储器的预设文件分区规则,将剩余模块镜像文件和修改后模块镜像文件分别写入到预设的空的二进制文件中,得到预抄写文件;将预抄写文件发送到第二终端设备中,以使得第二终端设备根据预抄写文件生成系统软件;通过预抄写文件的生成以及根据预抄写文件生成终端设备的系统软件,提高了系统软件生产的效率。(The embodiment of the application discloses a system software generation method, a system software generation device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a forced upgrade package of system software of first terminal equipment after testing is finished; analyzing the forced upgrade package to obtain at least one module mirror image file; modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file; respectively writing the residual module image files and the modified module image files into a preset empty binary file according to a preset file partition rule of a memory in the second terminal equipment to obtain a pre-copy file; sending the pre-copy file to second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file; the efficiency of system software production is improved by generating the pre-copy file and generating the system software of the terminal equipment according to the pre-copy file.)

1. A method for generating system software, comprising:

acquiring a forced upgrade package of system software of first terminal equipment after testing is finished;

analyzing the forced upgrade package to obtain at least one module mirror image file;

modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file;

according to a preset file partition rule of a memory in the second terminal device, writing the residual module image files and the modified module image files into preset empty binary files respectively to obtain pre-copy files;

and sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

2. The method of claim 1, wherein modifying a target module image file selected from at least one module image file according to the boot default configuration data to obtain a modified module image file comprises:

carrying out mirror image format conversion on the module mirror image file to obtain at least one mirror image format conversion file;

determining a mirror image file directory hierarchy of the mirror image format conversion file;

determining at least one mirror image format conversion file to be modified according to the startup default configuration data and the mirror image file directory hierarchy;

modifying the mirror image format conversion file according to the startup default configuration data to obtain a modified mirror image format conversion file;

and recovering the format of the modified mirror image format conversion file to obtain at least one modified module mirror image file.

3. The method of claim 2, wherein modifying the image format conversion file according to the boot default configuration data comprises:

when the mirror image format conversion file comprises a database file, directly modifying a field variable value corresponding to the startup default configuration data in the database file according to a database operation command;

and when the mirror image format conversion file comprises an environment variable configuration file, directly opening the environment variable configuration file, and modifying corresponding parameters in the environment variable configuration file according to the startup default configuration data.

4. The method according to claim 1, wherein when the target module image file comprises an executable file or a static library file, modifying the target module image file selected from the at least one module image file according to the boot default configuration data to obtain a modified module image file, comprising:

directly and independently modifying the module codes or data of the target module image file;

and compiling the modified target module image file to obtain the modified module image file.

5. The method of claim 1, wherein parsing the forced upgrade package to obtain at least one module image file comprises:

unpacking the forced upgrade package according to a software compiling and packing rule;

when the software compiling and packaging rule is encrypted, the software compiling and packaging rule is decrypted based on the encrypted rule so as to restore and obtain a forced upgrading package of a primary version;

and unpacking the forced upgrade package of the native version to obtain at least one module image file.

6. The method of claim 1, wherein the module image file comprises a module image parent file, and wherein parsing the forced upgrade package to obtain at least one module image file comprises:

splitting the forced upgrade package to obtain at least one module mirror image subfile;

determining a module image parent file corresponding to each module image child file;

and automatically synthesizing at least one module mirror image child file corresponding to each module mirror image parent file according to the file format of the module mirror image parent file to obtain at least one module mirror image parent file.

7. The method of claim 1, wherein the module image file comprises a compressed module compressed image file, the method further comprising:

decompressing the module compressed image file to obtain at least one original format image file;

modifying the target module image file selected from the at least one module image file according to the startup default configuration data to obtain a modified module image file, comprising:

and modifying the target module image file selected from the at least one original format image file according to the startup default configuration data to obtain a modified module image file.

8. A system software generation apparatus, comprising:

the acquisition module is used for acquiring a forced upgrade package of the system software of the first terminal device after the test is finished;

the analysis module is used for analyzing the forced upgrade package to obtain at least one module mirror image file;

the modification module is used for modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file;

the writing module is used for respectively writing the residual module image files and the modified module image files into a preset empty binary file according to a preset file partition rule of a memory in the second terminal equipment to obtain a pre-copy file;

and the generating module is used for sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the system software generation method according to any one of claims 1 to 7 are implemented when the program is executed by the processor.

10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the steps of the system software generation method according to any one of claims 1 to 7.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating system software, an electronic device, and a computer-readable storage medium.

Background

With the rapid development of computer technology, the types of terminal devices (such as televisions or mobile phones) are more and more, and the operation and operation of each terminal device need to depend on system software of the terminal device, so that the system software needs to be deployed for the terminal device before the terminal device leaves a factory;

at present, the deployment of terminal device system software depends on hard copy cloning of software, for example, hard copy system software files from a terminal device that has been tested, and then clone the copied system software files to other terminal devices, so that other terminal devices have system software.

Disclosure of Invention

The embodiment of the application provides a system software generation method and device, electronic equipment and a computer readable storage medium, which can improve the efficiency of system software generation.

The embodiment of the application provides a system software generation method, which comprises the following steps:

acquiring a forced upgrade package of system software of first terminal equipment after testing is finished;

analyzing the forced upgrade package to obtain at least one module mirror image file;

modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file;

according to a preset file partition rule of a memory in the second terminal device, writing the residual module image files and the modified module image files into preset empty binary files respectively to obtain pre-copy files;

and sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

Correspondingly, an embodiment of the present application further provides a system software generating apparatus, including:

the acquisition module is used for acquiring a forced upgrade package of the system software of the first terminal device after the test is finished;

the analysis module is used for analyzing the forced upgrade package to obtain at least one module mirror image file;

the modification module is used for modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file;

the writing module is used for respectively writing the residual module image files and the modified module image files into a preset empty binary file according to a preset file partition rule of a memory in the second terminal equipment to obtain a pre-copy file;

and the generating module is used for sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

Optionally, in some embodiments of the present application, the modifying module includes:

the conversion unit is used for carrying out mirror image format conversion on the module mirror image file to obtain at least one mirror image format conversion file;

the directory determining unit is used for determining the directory hierarchy of the mirror image file of the mirror image format conversion file;

the file determining unit is used for determining at least one mirror image format conversion file to be modified according to the starting default configuration data and the mirror image file directory hierarchy;

the first modification unit is used for modifying the mirror image format conversion file according to the startup default configuration data to obtain a modified mirror image format conversion file;

and recovering the format of the modified mirror image format conversion file to obtain at least one modified module mirror image file.

Optionally, in some embodiments of the present application, the first modifying unit includes:

the first modifying subunit is used for modifying the field variable value corresponding to the startup default configuration data directly in the database file according to the database operation command when the mirror image format conversion file comprises the database file;

and the second modification subunit is used for directly opening the environment variable configuration file when the image format conversion file comprises the environment variable configuration file, and modifying corresponding parameters in the environment variable configuration file according to the startup default configuration data.

Optionally, in some embodiments of the application, when the object module image file includes an executable file or a static library file, the modifying module includes:

the second modification unit is used for directly and independently modifying the module codes or the data of the target module image file;

and the compiling unit is used for compiling the modified target module image file to obtain the modified module image file.

Optionally, in some embodiments of the present application, the parsing module includes:

the first unpacking unit is used for unpacking the forced upgrade package according to the software compiling and packing rule;

the decryption unit is used for decrypting the software compiling and packaging rule based on the encrypted rule when the software compiling and packaging rule is encrypted so as to restore and obtain a primary version forced upgrading packet;

and the second unpacking unit is used for unpacking the forced upgrade package of the native version to obtain at least one module image file.

Optionally, in some embodiments of the present application, the module image file includes a module image parent file, and the parsing module includes:

the third unpacking unit is used for splitting the forced upgrade package to obtain at least one module mirror image subfile;

a parent file determining unit, configured to determine a module image parent file corresponding to each module image child file;

and the synthesis unit is used for automatically synthesizing at least one module mirror image sub-file corresponding to each module mirror image parent file according to the file format of the module mirror image parent file to obtain at least one module mirror image parent file.

Optionally, in some embodiments of the present application, the module image file includes a compressed module compressed image file, and the apparatus further includes:

the decompression unit is used for decompressing the module compressed image file to obtain at least one original format image file;

the modification module comprises:

and the third modification unit is used for modifying the target module image file selected from the at least one original format image file according to the startup default configuration data to obtain the modified module image file.

According to the embodiment of the application, the forced upgrade package generated after the test on the first terminal device is completed is analyzed, the pre-copy file corresponding to the system software is generated by repackaging, and the pre-copy file is sent to the second terminal device, so that the second terminal device can generate the system software according to the pre-copy file, wherein the whole generation process of the pre-copy file can be executed by a script, the generation of the pre-copy file is automatically realized, the generation efficiency of the system software is improved, and the image file to be modified can be modified in the generation process of the pre-copy file, so that the configuration of the startup initialization of the terminal device is realized.

Drawings

In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic view of a scenario of a system software generation method provided in an embodiment of the present application;

FIG. 2 is a flowchart illustrating a system software generation method according to an embodiment of the present disclosure;

fig. 3 is a schematic flow chart of a method for generating a pre-copy file according to an embodiment of the present application;

FIG. 4 is a schematic structural diagram of a system software generation apparatus provided in an embodiment of the present application;

FIG. 5 is a schematic structural diagram of a pre-transcription file generation framework provided in an embodiment of the present application;

fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

Detailed Description

The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The embodiment of the application provides a system software generation method, a system software generation device, electronic equipment and a computer readable storage medium. Specifically, the system software generation method provided by the embodiment of the present application may be executed by an electronic device, where the electronic device includes a terminal device or a server; the terminal equipment can be a television, a mobile phone, a notebook, a desktop or a tablet computer and the like; the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like, and the servers may be directly or indirectly connected by a wired or wireless communication method.

Specifically, in the embodiment of the present application, a terminal device executes a system software generation method as an example, and the execution of the server can be understood by referring to the execution of the system software generation method on the terminal device, where please refer to fig. 1, a specific process of the terminal device executing the system software generation method is as follows:

the method comprises the steps that a terminal device A obtains a forced upgrade package after self test is completed, the obtained forced upgrade package is analyzed to obtain a plurality of module image files, then the module image files are written into an empty binary file according to a preset file partition rule of a memory in the terminal device B to obtain a pre-copying file, then the generated pre-copying file is sent to the terminal device B, and after the terminal device B receives the pre-copying file sent by the terminal device A, system software of the terminal device B is generated according to the pre-copying file. The parsing and writing operations may be performed by a server, which may be understood by reference to the terminal device, and are not specifically described herein.

The preset partition rule is a partition configuration definition table defined in advance on a drive chip (EMMC, embedded multimedia Card) of the terminal device B according to a deployment requirement of system software, so as to ensure that the drive chip can be directly attached to a circuit board of the terminal device B after a Memory (Flash Memory) of the drive chip is burned with a pre-copy file, and the system software is generated on the terminal device B.

In the process of generating the pre-copy file, the corresponding parameters in the corresponding image file can be modified according to the requirement of the default configuration data for starting up, so that the terminal device B can display the corresponding default configuration data for starting up according to the modified data after generating the system software according to the pre-copy file.

According to the embodiment of the application, the forced upgrade package generated after the test on the first terminal device is completed is analyzed, the pre-copy file corresponding to the system software is generated by repackaging, and the pre-copy file is sent to the second terminal device, so that the second terminal device can generate the system software according to the pre-copy file, wherein the whole generation process of the pre-copy file can be executed by a script, the generation of the pre-copy file is automatically realized, the generation efficiency of the system software is improved, and the image file to be modified can be modified in the generation process of the pre-copy file, so that the configuration of the startup initialization of the terminal device is realized.

The following are detailed below. It should be noted that the description sequence of the following embodiments is not intended to limit the priority sequence of the embodiments.

Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a system software generating method according to an embodiment of the present application. The specific flow of the system software generation method can be as follows:

101. and acquiring a forced upgrade package of the system software of the first terminal device after the test is finished.

In the embodiment of the present application, a forced upgrade package corresponding to the system software on the first terminal device after the test is completed is obtained.

In the embodiment of the application, the tested system Software is system Software meeting an SQA (Software Quality Assurance) standard, wherein the Software Quality Assurance is a set of planned and systematic methods for ensuring that proposed standards, steps, practices and methods can be correctly adopted by all projects to a management layer, and Software products and activities are reviewed and audited to verify that the Software is in accordance with the standards.

After the system software of the terminal device is compiled, a User Interface (UI) file and a code are compiled, and then a script (such as a batch file code-img.bat) can be executed to generate a forced upgrade package, wherein in the conventional case, the forced upgrade package is copied to a memory of a driver chip (EMMC) of the second terminal device, and the terminal device can be restarted to see an upgrade prompt and select an upgrade.

102. And analyzing the forced upgrade package to obtain at least one module image file.

In the embodiment of the present application, parsing the forced upgrade package, that is, unpacking the forced upgrade package, obtains a plurality of module image files by unpacking, where the unpacking may be performed according to a compiling and packing rule, in the embodiment of the present application, the module image files include files with a file format of image (image), and in the embodiment of the present application, the module image files are binary data files corresponding to each module of the system software.

In this embodiment of the present application, the mandatory upgrade package may be encrypted when being packaged to prevent leakage of data in the mandatory upgrade package, and therefore, before unpacking the mandatory upgrade package, the mandatory upgrade package needs to be decrypted first, that is, optionally, in some embodiments, the step "parsing the mandatory upgrade package to obtain at least one module image file" may specifically include:

unpacking the forced upgrade package according to the software compiling and packaging rule;

when the software compiling and packaging rule is encrypted, the software compiling and packaging rule is decrypted based on the encrypted rule so as to restore and obtain a forced upgrading package of the original version;

and unpacking the forced upgrade package of the native version to obtain at least one module image file.

The encryption of the forced upgrade package can effectively prevent the leakage of data in the forced upgrade package, and meanwhile, the malicious entry of problem data is also effectively prevented, and the accuracy of system software generation is improved.

And determining a decryption rule according to the encryption rule of the forced upgrade package, decrypting according to the decryption rule to obtain the forced upgrade package of the original version, and unpacking the forced upgrade package of the original version to obtain the real module image file.

The method comprises the steps of generating a pre-copying file automatically, generating system software automatically, and completing relevant operations automatically by a script in the whole operation process. Wherein the encryption rules may be obtained from the developer.

Because the data size of part of the module image files is large, it is necessary to split the large module image file in advance in the transmission process of the forced upgrade package, that is, split the module image file (module image parent file) into a plurality of child files for transmission, and therefore, a plurality of image files obtained after splitting the forced upgrade package also need to be synthesized according to the parent file to which the image files belong, and synthesized into a module image parent file, that is, optionally, in some embodiments, the step "parsing the forced upgrade package to obtain at least one module image file" may specifically include:

splitting the forced upgrade package to obtain at least one module mirror image subfile;

determining a module image parent file corresponding to each module image child file;

and automatically synthesizing at least one module mirror image child file corresponding to each module mirror image parent file according to the file format of the module mirror image parent file to obtain at least one module mirror image parent file.

According to the requirement of a simple File Transfer Protocol (Tftp), the size of a transmitted File cannot be too large, so that a large File needs to be split into smaller files which can be transmitted in advance, and in order to ensure the accuracy of data, small files need to be synthesized into an original large File after transmission;

the forced upgrade package is divided to obtain a plurality of module image sub-files, and the module image sub-files can be re-synthesized into a parent file according to the parent file to which the module image sub-files belong, so that the parent file with larger data can be restored, wherein the accuracy of generating the subsequent pre-copy file can be improved after the parent file is restored.

In the process of synthesis, sequential synthesis can be performed according to the splitting sequence of the module mirror image subfiles, for example, in the splitting process, the child files are sequentially split according to the sequence of the content of the parent file, then when the child files synthesize the parent file, the child files can be synthesized into the original parent file according to the splitting sequence of the child files, and the file content is ensured not to be disordered after splitting and synthesis, or in the splitting process, the content of the parent file is transmitted in segments, each segment generates one child file, then, according to the sequence of the segments in the parent file, sequential synthesis of each child file is performed, and the consistency of data before and after transmission can be realized.

In the synthesizing process, the restoration is further performed according to the format of the parent file, for example, in the embodiment of the present application, the sparse matrix file (sparse) of Android (Android) in the format of the parent file may be restored according to the format of the sparse matrix file when restoring.

For the data before and after transmission, the consistency of the data can be checked according to an information summarization Algorithm (MD5, Message-Digest Algorithm), so as to ensure the consistency of the data before and after transmission and improve the accuracy of generating the pre-transcription file.

103. And modifying the target module image file selected from the at least one module image file according to the startup default configuration data to obtain the modified module image file.

According to the requirement of a factory for initializing the terminal equipment, the terminal equipment needs to have default configuration after being started, namely, the whole terminal equipment is in a power-on state, for example, for a television, the first start must be as follows: the method comprises the steps that a TV information source directly enters a factory debugging mode, a default channel is a factory internal production line frequency point, a serial port is opened, automatic volume is closed, starting time is within 30 seconds, no user data exists and the like, so that when a pre-copy file is generated, corresponding parameters in an image file can be modified, and when terminal equipment generates system software according to the pre-copy file, starting default configuration data can be directly generated.

The target module image file to be modified is determined through the startup default configuration data, so that the accuracy of obtaining the target module image file can be improved, for example, the target module image file to be modified can be determined according to the data type of the startup default configuration data.

In some embodiments, the step "modifying the target module image file selected from the at least one module image file according to the startup default configuration data to obtain the modified module image file" may specifically include:

carrying out mirror image format conversion on the module mirror image file to obtain at least one mirror image format conversion file;

determining a mirror image file directory hierarchy of a mirror image format conversion file;

determining at least one mirror image format conversion file to be modified according to the startup default configuration data and the mirror image file directory hierarchy;

modifying the mirror image format conversion file according to the startup default configuration data to obtain a modified mirror image format conversion file;

and recovering the format of the modified mirror image format conversion file to obtain at least one modified module mirror image file.

In the embodiment of the application, the image format of the module image file includes a Sparse matrix file (Sparse) of Android (Android), so that the format of the module image file can be converted into an extended file (ext) of linnax (linux), then, each extended file is mounted to obtain a directory hierarchy of each extended file, then, according to default configuration data of the boot, the extended file to be modified is selected from the directory hierarchy, and according to the selected extended file to be modified, the module image file to be modified can be determined.

The converted image file in the file format can be directly modified according to the startup default configuration data, and the parameter value to be modified can be determined through the startup default configuration data, wherein after the parameter modification is performed on the converted file, the format of the file can be restored to a system file (for example, a file in an android system format) required by the second terminal device, so that the determination and modification of the image file of the module to be modified are realized.

When the mirror format file is modified according to the startup default configuration data, a corresponding manner may be selected to modify the mirror format conversion file according to the type of the mirror format conversion file to be modified, that is, optionally, in some embodiments, the step "modifying the mirror format conversion file according to the startup default configuration data" may specifically include:

when the mirror image format conversion file comprises a database file, directly modifying a field variable value corresponding to the startup default configuration data in the database file according to the database operation command;

and when the mirror image format conversion file comprises an environment variable configuration file, directly opening the environment variable configuration file, and modifying corresponding parameters in the environment variable configuration file according to the startup default configuration data.

The method includes the steps of directly logging in a corresponding database aiming at a database file, calling a database operation command, modifying field variable values in the database, saving and quitting to regenerate the database file after modification, and replacing an original database file, or directly modifying the corresponding field variable values in the database file.

For example, the partition environment variables are modified, such as a factory mode is opened, a serial port is opened, and partition header files (such as gpt.

In some embodiments, the step "modifying the target module image file selected from the at least one module image file according to the default configuration data for startup to obtain a modified module image file" may specifically include:

directly and independently modifying the module codes or data of the mirror image file of the target module;

and compiling the modified target module image file to obtain the modified module image file.

The target module image file is modified independently, so that the efficiency of modifying the module image file can be improved, and the whole generation efficiency of the pre-copy file is improved.

After the target module image file is modified, the modified module image file can directly replace the unpacked module image file with the same name.

When modifying the target module image file, it is necessary to determine whether the target module image file is a compressed file, and when the target module image file is a compressed file, it is also necessary to decompress the target module image file first, and modify corresponding file parameters after decompression, that is, optionally, in some embodiments, when the module image file includes a compressed module compressed image file, the method further includes:

decompressing the module compressed image file to obtain at least one original format image file;

the step of "modifying the target module image file selected from the at least one module image file according to the startup default configuration data" may specifically include:

and modifying the target module image file selected from the at least one original format image file according to the startup default configuration data to obtain a modified module image file.

The generation of the pre-copy file is an automatic process, so that the file after the forced upgrade package is unpacked needs to be detected to detect whether the file is a compressed file, wherein the compressed file needs to be decompressed, and the content of the file can be modified only after the file is decompressed.

The method comprises the steps of compressing the mirror image file, so that the efficiency of file data transmission can be improved, but when the mirror image file needs to be modified, the compressed file needs to be converted into a non-compressed file, and when the binary file is written into a partition, the decompressed mirror image file also needs to be decompressed, so that the mirror image file can be automatically decompressed in the automatic generation process of the pre-copy file, wherein when the compressed mirror image file is decompressed, corresponding decompression software can be called to decompress according to the type of the compressed file.

After the original format image file is modified, the format of the modified image file is restored, and the modified module image file can be obtained.

104. And respectively writing the residual module image file and the modified module image file into a preset empty binary file according to a preset file partition rule of a memory in the second terminal equipment to obtain a pre-copy file.

And the residual module image file is at least one module image file except the target module image file in at least one module image file.

The memory of the second terminal device comprises a driver chip mounted on the terminal device circuit board, wherein a preset file partition rule in the memory of the second terminal device is a partition configuration definition table which is predefined in a memory of the driver chip according to a software project compiling rule, wherein all image files are traversed according to the partition configuration definition table and then sequentially written into a binary file to obtain a pre-copy file, and the driver chip comprises an embedded memory (EMMC, Embedded multimedia Card). The pre-copy file is burned into the drive chip, so that the efficiency of generating the system software can be improved.

105. And sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

After receiving the pre-copy file in the memory (driver chip) of the second terminal device, the second terminal device has system software. Specifically, the second terminal device may burn the pre-copy file into the driver chip, then attach the driver chip to the circuit board of the target terminal system, and burn the pre-copy file into the driver chip, so that the efficiency of generating the system software in the second terminal device may be improved.

In summary, referring to fig. 3, fig. 3 is a schematic flow chart of a method for generating a pre-transcription file according to an embodiment of the present application, which specifically includes:

111. acquiring a system software forced upgrade package (update. img) of a release version after testing;

112. analyzing or unpacking the forced upgrade package to obtain a module mirror image compression sub-file of each module;

113. decompressing each module image compression sub-file to obtain a module image sub-file (the decompression tool uses Iz4_ compress _ tool);

114. synthesizing the sub-files of the module mirror image to obtain at least one parent file of the module mirror image;

115. carrying out format conversion on each module mirror image father file, and mounting the converted module mirror image father file to obtain a directory hierarchy of each module mirror image father file (simg2 img: converting the sparse image into a raw image in ext2 format);

116. determining a module mirror image father file to be modified according to the startup default configuration data and the directory hierarchy, and modifying the module mirror image father file to be modified;

117. repackaging the modified module mirror image father file and the unmodified module mirror image father file, namely carrying out format conversion, and converting the modified module mirror image father file into a system format (img2 simg: converting rawext2 image into formatted sparse image) required by the terminal equipment;

118. writing the modified module mirror image father file after format conversion and the modified module mirror image father file into an empty binary file according to a compiling rule to obtain a pre-copy file (written according to auto _ update. txt file or script/. multidot. command).

The generation of the pre-copy file is realized by unpacking, decompressing, format converting, mounting, modifying, packaging and writing the content of the mirror image file of the forced upgrade package.

According to the embodiment of the application, the forced upgrade package generated after the test on the first terminal device is completed is analyzed, the pre-copy file corresponding to the system software is generated by repackaging, and the pre-copy file is sent to the second terminal device, so that the second terminal device can generate the system software according to the pre-copy file, wherein the whole generation process of the pre-copy file can be executed by a script, the generation of the pre-copy file is automatically realized, the generation efficiency of the system software is improved, and the image file to be modified can be modified in the generation process of the pre-copy file, so that the configuration of the startup initialization of the terminal device is realized.

In order to better implement the system software generation method of the application, the application also provides a system software generation device based on the system software generation method. The terms are the same as those in the above system software generation method, and specific implementation details can refer to the description in the method embodiment.

Referring to fig. 4, fig. 4 is a schematic structural diagram of a system software generating device according to an embodiment of the present application, where the system software generating device may include an obtaining module 201, an analyzing module 202, a modifying module 203, a writing module 204, and a generating module 205, which may specifically be as follows:

the obtaining module 201 is configured to obtain a forced upgrade package after the system software of the first terminal device is tested.

In the embodiment of the present application, a forced upgrade package corresponding to the system software on the first terminal device after the test is completed is obtained.

After the system software of the terminal device is compiled, a User Interface (UI) file and a code are compiled, and then a script (such as a batch file code-img.bat) can be executed to generate a forced upgrade package, wherein in the conventional case, the forced upgrade package is copied to a memory of a driver chip (EMMC) of the second terminal device, and the terminal device can be restarted to see an upgrade prompt and select an upgrade, but in the conventional case, it takes a lot of time to copy the forced upgrade package to the memory of the driver chip, so that the pre-copy file is automatically generated by extracting a mirror image file, the generation of the system software of the second terminal device is realized according to the transmission pre-copy file, and the generation efficiency of the system software is improved.

And the analysis module 202 is configured to analyze the forced upgrade package to obtain at least one module image file.

In the embodiment of the present application, parsing the forced upgrade package, that is, unpacking the forced upgrade package, obtains a plurality of module image files by unpacking, where the unpacking may be performed according to a compiling and packing rule, and in the embodiment of the present application, the module image files include image (image) files.

Optionally, in some embodiments of the present application, the parsing module includes:

the first unpacking unit is used for unpacking the forced upgrade package according to the software compiling and packing rule;

the decryption unit is used for decrypting the software compiling and packaging rule based on the encrypted rule when the software compiling and packaging rule is encrypted so as to restore and obtain a forced upgrade package of the original version;

and the second unpacking unit is used for unpacking the forced upgrade package of the primary version to obtain at least one module image file.

The encryption of the forced upgrade package can effectively prevent the data in the forced upgrade package from being leaked, and meanwhile, the problem data can be effectively prevented from being input, and the accuracy of system software generation is improved.

And determining a decryption rule according to the encryption rule of the forced upgrade package, decrypting according to the decryption rule to obtain the forced upgrade package of the original version, and unpacking the forced upgrade package of the original version to obtain the real module image file.

Optionally, in some embodiments of the present application, the module image file includes a module image parent file, and the parsing module includes:

the third unpacking unit is used for splitting the forced upgrade package to obtain at least one module mirror image subfile;

a parent file determining unit, configured to determine a module image parent file corresponding to each module image child file;

and the synthesis unit is used for automatically synthesizing at least one module mirror image sub-file corresponding to each module mirror image parent file according to the file format of the module mirror image parent file to obtain at least one module mirror image parent file.

According to the requirement of a simple File Transfer Protocol (Tftp), the size of a transmitted File cannot be too large, so that a large File needs to be split into smaller files which can be transmitted in advance, and in order to ensure the accuracy of data, small files need to be synthesized into an original large File after transmission;

the forced upgrade package is divided to obtain a plurality of module image sub-files, and the module image sub-files can be re-synthesized into a parent file according to the parent file to which the module image sub-files belong, so that the parent file with larger data can be restored, wherein the accuracy of generating the subsequent pre-copy file can be improved after the parent file is restored.

In the process of synthesis, sequential synthesis can be performed according to the splitting sequence of the module mirror image subfiles, for example, in the splitting process, the child files are sequentially split according to the sequence of the content of the parent file, then when the child files synthesize the parent file, the child files can be synthesized into the original parent file according to the splitting sequence of the child files, and the file content is ensured not to be disordered after splitting and synthesis, or in the splitting process, the content of the parent file is transmitted in segments, each segment generates one child file, then, according to the sequence of the segments in the parent file, sequential synthesis of each child file is performed, and the consistency of data before and after transmission can be realized.

For the data before and after transmission, the consistency of the data can be checked according to an information summarization Algorithm (MD5, Message-Digest Algorithm), so as to ensure the consistency of the data before and after transmission and improve the accuracy of generating the pre-transcription file.

The modifying module 203 is configured to modify a target module image file selected from the at least one module image file according to the boot default configuration data, so as to obtain a modified module image file.

According to the requirement of a factory for initializing the terminal equipment, the terminal equipment needs to have default configuration after being started, namely, the whole terminal equipment is in a power-on state, for example, for a television, the first start must be as follows: the method comprises the steps that a TV information source directly enters a factory debugging mode, a default channel is a factory internal production line frequency point, a serial port is opened, automatic volume is closed, starting time is within 30 seconds, no user data exists and the like, so that when a pre-copy file is generated, corresponding parameters in an image file can be modified, and when terminal equipment generates system software according to the pre-copy file, starting default configuration data can be directly generated.

The target module image file to be modified is determined through the startup default configuration data, so that the accuracy of obtaining the target module image file can be improved, for example, the target module image file to be modified can be determined according to the data type of the startup default configuration data.

Optionally, in some embodiments of the present application, the modifying module includes:

the conversion unit is used for carrying out mirror image format conversion on the module mirror image file to obtain at least one mirror image format conversion file;

the directory determining unit is used for determining the directory hierarchy of the mirror image file of the mirror image format conversion file;

the file determining unit is used for determining at least one mirror image format conversion file to be modified according to the startup default configuration data and the mirror image file directory hierarchy;

the first modification unit is used for modifying the mirror image format conversion file according to the startup default configuration data to obtain a modified mirror image format conversion file;

and recovering the format of the modified mirror image format conversion file to obtain at least one modified module mirror image file.

The method comprises the steps of determining a directory level of an image file, determining the image file to be modified according to startup default configuration data, and determining a parameter value to be modified in the image file according to the startup default configuration data.

The directory hierarchy of the image file can be obtained by converting the format of the image file, namely, each image file is mounted to obtain the directory hierarchy of the image file.

Optionally, in some embodiments of the present application, the first modifying unit includes:

the first modification subunit is used for modifying the field variable value corresponding to the startup default configuration data directly in the database file according to the database operation command when the mirror image format conversion file comprises the database file;

and the second modification subunit is used for directly opening the environment variable configuration file when the image format conversion file comprises the environment variable configuration file, and modifying corresponding parameters in the environment variable configuration file according to the startup default configuration data.

The method includes the steps of directly logging in a corresponding database aiming at a database file, calling a database operation command, modifying field variable values in the database, saving and quitting to regenerate the database file after modification, and replacing an original database file, or directly modifying the corresponding field variable values in the database file.

For example, the partition environment variables are modified, such as a factory mode is opened, a serial port is opened, and partition header files (such as gpt.

Optionally, in some embodiments of the application, when the target module image file includes an executable file or a static library file, the modifying module includes:

the second modification unit is used for directly and independently modifying the module codes or data of the target module mirror image file;

and the compiling unit is used for compiling the modified target module image file to obtain the modified module image file.

The target module image file is modified independently, so that the efficiency of modifying the module image file can be improved, and the whole generation efficiency of the pre-copy file is improved.

Optionally, in some embodiments of the present application, the module image file includes a compressed module compressed image file, and the apparatus further includes:

the decompression unit is used for decompressing the module compressed image file to obtain at least one original format image file;

the modification module comprises:

and the third modification unit is used for modifying the target module image file selected from the at least one original format image file according to the startup default configuration data to obtain the modified module image file.

The generation of the pre-copy file is an automatic process, so that the file after the forced upgrade package is unpacked needs to be detected to detect whether the file is a compressed file, wherein the compressed file needs to be decompressed, and the content of the file can be modified only after the file is decompressed.

And the writing module 204 is configured to write the remaining module image files and the modified module image files into a preset empty binary file respectively according to a preset file partition rule of a memory in the second terminal device, so as to obtain a pre-copy file.

The memory in the second terminal device comprises a driver chip mounted on a circuit board of the terminal device, wherein a preset file partition rule of the memory in the second terminal device is a partition configuration definition table which is predefined in a memory of the driver chip according to a software project compiling rule, wherein all image files are traversed according to the partition configuration definition table and then sequentially written into a binary file to obtain a pre-copy file, and the driver chip comprises an embedded memory (EMMC, Embedded MultiMedia Card). The pre-copy file is burned into the drive chip, so that the efficiency of generating the system software can be improved.

The generating module 205 is configured to send the pre-copy file to the second terminal device, so that the second terminal device generates the system software according to the pre-copy file.

After receiving the pre-copy file in the memory (driver chip) of the second terminal device, the second terminal device has system software. Specifically, the second terminal device may burn the pre-copy file into the driver chip, then attach the driver chip to the circuit board of the target terminal system, and burn the pre-copy file into the driver chip, so that the efficiency of generating the system software in the second terminal device may be improved.

In the embodiment of the application, the obtaining module 201 first obtains the forced upgrade package of the first terminal device after the test is completed, next, the analysis module 202 analyzes the forced upgrade package acquired by the acquisition module 201 to obtain at least one module image file, and then, the module image file to be modified is determined by the modification module 203 based on the power-on default configuration data, and modifies the corresponding parameters in the module image file according to the default configuration data of the startup to obtain a modified module image file, then, the writing module 204 writes the remaining module image files which do not need to be modified and the modified module image files into the empty binary file together according to the preset file partition rule of the memory in the second terminal device, obtaining a pre-copy file, and finally sending the pre-copy file to the memory by the generation module 205, so that the second terminal device can generate system software according to the pre-copy file; the method and the device for generating the system software have the advantages that the forced upgrade package generated after the test on the first terminal device is completed is analyzed and repackaged to generate the pre-copy file corresponding to the system software, and the pre-copy file is sent to the second terminal device, so that the second terminal device can generate the system software according to the pre-copy file, wherein the whole generation process of the pre-copy file can be executed by a script, the generation of the pre-copy file is automatically realized, the generation efficiency of the system software is improved, and the image file to be modified can be modified in the generation process of the pre-copy file, so that the configuration of starting initialization of the terminal device is realized.

In this embodiment of the present application, the generation of the pre-transcription file may be completed by executing a script, for example, please refer to fig. 5, where fig. 5 is a frame diagram of the pre-transcription file generated by executing the script, and specifically includes:

unpacking module 301: unpacking the forced upgrade package to obtain at least one module mirror image file;

the decompression module 302: when the module image file is a compressed module image compressed file, decompressing the module image compressed file to obtain a module image file;

format conversion module 303: converting the module mirror image file from an android sparse matrix file format into an extended file of Linnax;

the mounting module 304: mounting the extension files to obtain the directory hierarchy of each extension file;

the modification module 305: determining an extended file to be modified according to the startup default configuration data and the directory hierarchy, and correspondingly modifying the extended file to be modified;

a packing module 306: format reduction is carried out on the modified extended file, and the extended file is converted into a module mirror image file corresponding to the android sparse matrix file again;

the writing module 307: writing the unmodified module image file and the modified module image file into a preset binary file together to generate a pre-copy file;

script scheduling management 308: and the system is used for scheduling the execution of each module and generating a pre-copy file.

The automatic generation of the pre-copy file is realized through the scheduling execution of the script, the generation efficiency of the pre-copy file is improved, and the generation efficiency of the subsequent terminal equipment system software is further improved.

In addition, the present application also provides an electronic device, as shown in fig. 6, which shows a schematic structural diagram of the electronic device related to the present application, specifically:

the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:

the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate a system software processor, which mainly handles operating systems, user interfaces, system software programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.

The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional system software and decoding processes by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a system software program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.

The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.

The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more system software programs into the memory 402 according to the following instructions, and the processor 401 runs the system software programs stored in the memory 402, so as to implement various functions as follows:

acquiring a forced upgrade package of system software of first terminal equipment after testing is finished; analyzing the forced upgrade package to obtain at least one module mirror image file; modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file; respectively writing the residual module image files and the modified module image files into a preset empty binary file according to a preset file partition rule of a memory in the second terminal equipment to obtain a pre-copy file; and sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.

The method comprises the steps of analyzing a forced upgrade package generated after testing on a first terminal device is completed, repackaging the forced upgrade package to generate a pre-copy file corresponding to system software, and sending the pre-copy file to a second terminal device to enable the second terminal device to generate the system software according to the pre-copy file, wherein the whole generation process of the pre-copy file can be executed by a script, the generation of the pre-copy file is automatically realized, the generation efficiency of the system software is improved, and a to-be-modified mirror image file can be modified in the generation process of the pre-copy file to realize the configuration of starting initialization of the terminal device.

It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.

To this end, the present application provides a computer-readable storage medium having stored therein a plurality of instructions that can be loaded by a processor to perform the steps of any one of the system software generation methods provided herein. For example, the instructions may perform the steps of:

acquiring a forced upgrade package of system software of first terminal equipment after testing is finished; analyzing the forced upgrade package to obtain at least one module mirror image file; modifying a target module image file selected from at least one module image file according to the startup default configuration data to obtain a modified module image file; respectively writing the residual module image files and the modified module image files into a preset empty binary file according to a preset file partition rule of a memory in the second terminal equipment to obtain a pre-copy file; and sending the pre-copy file to the second terminal equipment so that the second terminal equipment generates system software according to the pre-copy file.

The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.

Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.

Since the instructions stored in the computer-readable storage medium can execute the steps in any system software generation method provided by the present application, the beneficial effects that can be achieved by any system software generation method provided by the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.

The above detailed description is provided for a system software generating method, apparatus, electronic device and computer readable storage medium, and the system software in this document describes the principle and implementation of the present invention by using a specific example, and the description of the above embodiment is only used to help understand the method and its core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific implementation and system software scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种产品性能调整方法、装置、电子设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!