Code packaging method and device applied to swan operating system

Through an automated code packaging process, user identification and configuration information are obtained, and multiple scripts are called to execute code pulling, version replacement, and release. This solves the problem of low automation in Hongmeng operating system code packaging and improves efficiency and accuracy.

CN120670020APending Publication Date: 2025-09-19JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510795862.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In the existing technology, the code packaging of the Hongmeng operating system has a low degree of automation, resulting in low packaging efficiency and accuracy. Each step requires manual operation, which increases manpower and time costs and reduces the success rate.

Method used

By obtaining user identification and packaging configuration information, calling code acquisition, packaging configuration and code package release scripts, the code pulling, version information replacement, compilation and release processes are automatically executed to improve the degree of automation and accuracy.

Benefits of technology

An automated process for packaging the Hongmeng operating system code has been implemented, which improves packaging efficiency and accuracy, reduces the risk of manual intervention, and enhances development efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670020A_ABST
    Figure CN120670020A_ABST
Patent Text Reader

Abstract

The invention discloses a code packaging method and device applied to a swan operating system, and relates to the technical field of application development. A specific embodiment of the invention comprises the following steps: obtaining a user identifier and packaging configuration information from a code packaging request; calling the code acquisition script to pull the software code to a packaging space corresponding to the user identifier according to code configuration information contained in the packaging configuration information; calling a packaging configuration script to replace original version information contained in the packaging configuration file with packaging version information contained in the packaging configuration information; and based on the modified packaging configuration file, packaging the software code into a target code package which can be applied to the Nan Mongolian operating system. According to the embodiment of the invention, the multiple scripts are called to execute the automatic packaging process for the codes of the swan operating system, so that the automation degree, efficiency and accuracy of code packaging of the swan operating system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of application development technology, and in particular to a code packaging method and device applied to the Hongmeng operating system. Background Art

[0002] In application development for the HarmonyOS, generating a code package (such as a HAR package) supported by the HarmonyOS for the code is a necessary step.

[0003] At present, the method of packaging code for the HarmonyOS is for developers to manually modify the packaging configuration parameters of the software project, and further for developers to manually perform the various steps of packaging, compilation, and release based on the configured packaging configuration parameters; the existing method has the problem of low degree of automation of code packaging in the HarmonyOS, and since each step of the packaging operation needs to be completed manually, it leads to low packaging efficiency and low operation accuracy. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides a code packaging method and apparatus for the Hongmeng operating system, which can obtain a user's user ID and packaging configuration information from a code packaging request; call a code acquisition script to pull the software code to the packaging space corresponding to the user ID based on the code configuration information contained in the packaging configuration information; call a packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; and based on the modified packaging configuration file, package the software code into a target code package applicable to the Hongmeng operating system. By calling multiple scripts to execute an automatic packaging process for the Hongmeng operating system's code, the embodiment of the present invention improves the automation, efficiency, and accuracy of the Hongmeng operating system's code packaging.

[0005] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a code packaging method applied to the Hongmeng operating system is provided, which is characterized by including: obtaining the user identifier and packaging configuration information of the user from a code packaging request; calling the code acquisition script to pull the software code to the packaging space corresponding to the user identifier according to the code configuration information contained in the packaging configuration information; obtaining the packaging configuration file in the packaging space, and calling the packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; based on the modified packaging configuration file, packaging the software code into a target code package that can be applied to the Hongmeng operating system.

[0006] Optionally, based on the modified packaging configuration file, packaging the software code into a target code package applicable to the Harmony operating system also includes: obtaining the packaging mode information contained in the packaging configuration information; dynamically modifying the packaging mode parameters of the Harmony operating system packaging instructions contained in the code packaging script to the packaging mode information; calling the modified code packaging script to execute the steps of packaging the software code into a target code package applicable to the Harmony operating system based on the modified packaging configuration file.

[0007] Optionally, the modified code packaging script is called to perform a compilation operation that matches the packaging mode information on the software code; based on the compiled file obtained by the compilation operation, a target code package that can be applied to the Hongmeng operating system is generated.

[0008] Optionally, the code packaging method applied to the Hongmeng operating system further includes: calling a first command contained in the code package release script to add version label information to the target code package, and calling a second command contained in the code package release script to obtain the size information of the target code package; sending the version label information, size information, packaging time of the target code package, and custom packaging information of the target code package as detailed information of the target code package to the packaging management platform.

[0009] Optionally, the code packaging method applied to the Hongmeng operating system further includes: obtaining detailed information corresponding to one or more target code packages from the packaging management platform; and visualizing detailed information of each user identifier and the target code package corresponding to the user identifier.

[0010] Optionally, the code packaging method applied to the HarmonyOS operating system further includes: obtaining the calling order of multiple scripts used in the software packaging process; wherein the scripts associated with the calling order are, in sequence: code acquisition script, packaging configuration script, code packaging script, and code package release script; in response to the code packaging request, calling each script in sequence according to the calling order.

[0011] Optionally, each script is called in sequence according to the calling order, including: for any script, when it is determined that the execution status of the script is successful, the next script of the script is automatically called according to the calling order; otherwise, the abnormal information of the script execution is reported.

[0012] To achieve the above-mentioned purpose, according to a second aspect of an embodiment of the present invention, a code packaging device applied to the Hongmeng operating system is provided, characterized in that it includes: a code acquisition module, a packaging configuration module and a packaging module; wherein,

[0013] The code acquisition module is used to obtain the user ID and packaging configuration information of the user from the code packaging request;

[0014] The packaging configuration module is used to call the code acquisition script to pull the software code to the packaging space corresponding to the user identifier according to the code configuration information contained in the packaging configuration information; obtain the packaging configuration file in the packaging space, and call the packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information;

[0015] The packaging module is used to package the software code into a target code package that can be applied to the Hongmeng operating system based on the modified packaging configuration file.

[0016] Optionally, a code packaging device applied to the Harmony operating system is used to package the software code into a target code package applicable to the Harmony operating system based on a modified packaging configuration file, and also includes: obtaining the packaging mode information contained in the packaging configuration information; dynamically modifying the packaging mode parameters of the Harmony operating system packaging instructions contained in the code packaging script to the packaging mode information; calling the modified code packaging script to execute the steps of packaging the software code into a target code package applicable to the Harmony operating system based on the modified packaging configuration file.

[0017] Optionally, a code packaging device applied to the Harmony operating system is used to call the modified code packaging script, perform a compilation operation that matches the packaging mode information on the software code; and generate a target code package that can be applied to the Harmony operating system based on the compiled file obtained based on the compilation operation.

[0018] Optionally, the code packaging device applied to the Hongmeng operating system is further used to call the first command contained in the code package release script to add version label information to the target code package, and call the second command contained in the code package release script to obtain the size information of the target code package; and send the version label information, size information, packaging time of the target code package, and custom packaging information of the target code package as detailed information of the target code package to the packaging management platform.

[0019] Optionally, the code packaging device applied to the HarmonyOS operating system is further used to obtain detailed information corresponding to one or more target code packages from the packaging management platform; and visualize detailed information of each user identifier and the target code package corresponding to the user identifier.

[0020] Optionally, the code packaging device applied to the HarmonyOS operating system is further used to obtain the calling order of multiple scripts used in the software packaging process; wherein, the scripts associated with the calling order are: code acquisition script, packaging configuration script, code packaging script, and code package release script; in response to the code packaging request, each script is called in sequence according to the calling order.

[0021] Optionally, a code packaging device applied to the Hongmeng operating system is used to call each script in sequence according to the calling order, including: for any script, when it is determined that the execution status of the script is successful, automatically calling the next script of the script according to the calling order; otherwise, reporting abnormal information of the script execution.

[0022] To achieve the above-mentioned purpose, according to the third aspect of an embodiment of the present invention, an electronic device for code packaging applied to the HarmonyOS operating system is provided, characterized in that it includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above in the code packaging method applied to the HarmonyOS operating system.

[0023] To achieve the above-mentioned purpose, according to the fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, it implements any of the methods described above in the code packaging method applied to the HarmonyOS operating system.

[0024] To achieve the above-mentioned purpose, according to the fifth aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, characterized in that when the computer program is executed by a processor, it implements any of the code packaging methods described above for application to the HarmonyOS operating system.

[0025] One embodiment of the above invention has the following advantages or beneficial effects: it can obtain a user's user ID and packaging configuration information from a code packaging request; call a code acquisition script to pull the software code to the packaging space corresponding to the user ID based on the code configuration information contained in the packaging configuration information; call a packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; and based on the modified packaging configuration file, package the software code into a target code package applicable to the Hongmeng operating system. This embodiment of the present invention improves the automation, efficiency, and accuracy of Hongmeng operating system code packaging by calling multiple scripts to execute an automatic packaging process for Hongmeng operating system code.

[0026] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.

[0028] Figure 1 This is a flowchart of a code packaging method applied to the Hongmeng operating system provided by an embodiment of the present invention;

[0029] Figure 2 This is a flowchart of a code packaging method applied to the Hongmeng operating system provided by an embodiment of the present invention;

[0030] Figure 3 This is a visual information diagram of a code packaging method applied to the Hongmeng operating system provided by one embodiment of the present invention;

[0031] Figure 4 This is a schematic diagram of the structure of a code packaging device applied to the Hongmeng operating system provided by one embodiment of the present invention;

[0032] Figure 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0033] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0035] In the existing technology, software packaging operations for the HarmonyOS (such as generating HAR packages) usually involve manually modifying the packaging configuration in the software project (such as the packaging environment, packaging variable configuration, etc.), and then manually performing packaging and compilation operations through development tools or command lines. After the packaging is completed, the packaged HAR package needs to be manually published. The entire packaging and publishing process requires manual operation, resulting in a large number of staff involved in the entire packaging and publishing process. In addition to increasing manpower and time costs, there is also the risk of reduced packaging success rate due to manually performed packaging operations.

[0036] In view of this, if Figure 1 As shown, an embodiment of the present invention provides a code packaging method applied to the Hongmeng operating system, which may include the following steps:

[0037] Step S101: Obtain the user ID and packaging configuration information of the user from the code packaging request.

[0038] Specifically, in an embodiment of the present invention, the code is the code contained in the software that can run on the HarmonyOS operating system, and the type of code package formed after the code is packaged can be a HAR package (static shared package, which can be provided to other developers for use) supported by the HarmonyOS, or a HAP package (executable application package), etc.

[0039] Furthermore, an embodiment of the present invention provides a packaging configuration page for developers, through which users can enter packaging configuration information; wherein the packaging configuration information includes code configuration information (for example, including the address of the code, code branch, code library identifier), packaging version information, packaging mode information (for example, including: test mode, formal mode, development mode, etc.), etc.

[0040] After completing the code configuration information on the configuration page, the developer (e.g., user ID: user123) can further initiate a code packaging request on the configuration page. That is, the user ID and packaging configuration information of the user are obtained from the code packaging request.

[0041] Step S102: calling the code acquisition script to pull the software code to the packaging space corresponding to the user identifier according to the code configuration information contained in the packaging configuration information; obtaining the packaging configuration file in the packaging space, calling the packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information.

[0042] Step S103: Based on the modified packaging configuration file, the software code is packaged into a target code package that can be applied to the Hongmeng operating system.

[0043] Specifically, in an embodiment of the present invention, a method for automatically completing code packaging through a code packaging request is to trigger the calling of multiple scripts, wherein the multiple scripts have a dependency relationship in the calling order.

[0044] That is, the calling order of multiple scripts used in the software packaging process is obtained; wherein the scripts associated with the calling order are, in order: code acquisition script, packaging configuration script, code packaging script, and code package release script; and in response to the code packaging request, each script is called in sequence according to the calling order. The calling order of each script includes: for any script, if the execution status of the script is determined to be successful, automatically calling the next script of the script according to the calling order; otherwise, reporting abnormal information about the execution of the script. The embodiments of the present invention improve the reliability and stability of code packaging and release by detecting the execution status of each script and determining whether to call the next script based on the execution status.

[0045] The following describes each script:

[0046] 1) For the code acquisition script: This contains commands for pulling code from the code repository based on the code configuration information. For example, the command is: git clone git@xxxxxxx.git. "git clone" means copying the code from the remote code repository to the local repository (the packaging space corresponding to the user ID), and "git@xxxxxxx.git" represents the address of the code to be pulled in the code repository. In other words, the code acquisition script is called to pull the software code to the packaging space corresponding to the user ID based on the code configuration information contained in the packaging configuration information. The packaging space is managed through a directory created for the user ID.

[0047] 2) For packaging configuration scripts: Specifically, in the packaging space matched by the user identifier, there is usually a packaging configuration file, such as build-profile.json5 included in the HarmonyOS operating system, which manages packaging configuration information in JSON format and contains multiple packaging configuration parameters (for example: version information, signature information, etc.).

[0048] In an embodiment of the present invention, a packaging configuration file in the packaging space is obtained, and a packaging configuration script is called to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information.

[0049] The package configuration script includes a version modification command, which is as follows:

[0050] sed -i "s / \"SDK_VERSION\"\ *:\ *\".*\" / \"SDK_VERSION\": \"${globalParams.user.SDK_VERSION}\" / " build-profile.json5

[0051] This command replaces the "SDK_VERSION" field value (the original version information) in the build-profile.json5 file (the packaging configuration file) with the environment variable globalParams.user.SDK_VERSION (the packaging version information). Using the "-i" parameter, this command directly modifies (replaces) the packaging configuration file build-profile.json5 with the new packaging version information. This improves the automation, efficiency, and accuracy of modifying packaging configuration files.

[0052] 3) Code packaging scripts: These contain packaging commands supported by the Hongmeng operating system (e.g., the hpm command and its parameters). The packaging commands contain packaging mode parameters (i.e., packaging mode information), which can be set to, for example, test mode (debug), official mode (release), development mode (dev), etc. Developers can test or deliver code by executing different packaging modes at different development stages.

[0053] In an embodiment of the present invention, the packaging mode information included in the packaging configuration information is obtained; the packaging mode parameters of the Hongmeng operating system packaging instructions included in the code packaging script are dynamically modified to the packaging mode information; the modified code packaging script is called to execute the steps of packaging the software code into a target code package applicable to the Hongmeng operating system based on the modified packaging configuration file. In this embodiment of the present invention, the packaging mode parameters included in the packaging command in the code packaging script are dynamically modified to the packaging mode information configured by the user, and the modified code packaging script is further called to execute the steps of packaging the software code into a target code package applicable to the Hongmeng operating system based on the modified packaging configuration file.

[0054] Furthermore, the process of packaging the target code package includes a compilation operation for the code, that is, calling the modified code packaging script to perform a compilation operation that matches the packaging mode information on the software code; based on the compilation file obtained based on the compilation operation, a target code package that can be applied to the Hongmeng operating system is generated.

[0055] 4) Code package publishing script: In an embodiment of the present invention, an automatic code package publishing process is implemented by calling a code package publishing script.

[0056] Specifically, the first command included in the calling code package release script is used to add version tag information to the target code package. The first command is a Git command of the code repository, and the version tag information is added to the target code package (ie, tagging) through the Git command.

[0057] Furthermore, the second command included in the code package release script is called to obtain the size information of the target code package. The second command includes the stat command and the awk command. These two commands are used to calculate the size (i.e., size information) of the target code package. For example, the size of the aaa.HAR package file is 1.55MB.

[0058] Furthermore, various information including version tag information, size information, packaging time of the target code package, and customized packaging information of the target code package (such as records of modified code in the target code package, update log information, etc.) is sent to the packaging management platform as detailed information of the target code package.

[0059] That is, the first command included in the code package release script is called to add version tag information to the target code package, and the second command included in the code package release script is called to obtain the size information of the target code package; the version tag information, size information, packaging time of the target code package, and custom packaging information of the target code package are sent to the packaging management platform as detailed information of the target code package.

[0060] In the embodiment of the present invention, the code package publishing script may also be divided into a first packaging script containing a first command and a second packaging script containing a second command.

[0061] Furthermore, the curl command can be used to execute a step of sending the version tag information, size information, packaging time of the target code package, and customized packaging information of the target code package as detailed information of the target code package to the packaging management platform.

[0062] The embodiment of the present invention implements an automated process of "one-click packaging and release" for the Hongmeng operating system code by automatically calling multiple scripts, which greatly improves the efficiency and accuracy of code packaging.

[0063] like Figure 2 As shown, an embodiment of the present invention provides a process of a code packaging method applied to the Hongmeng operating system, which may include the following steps:

[0064] Step S201: The user configures packaging information based on the configuration page provided by the packaging management platform.

[0065] Step S202: Call the code acquisition script to pull the software code.

[0066] Step S203: calling the package configuration script to modify the configuration file version information.

[0067] Step S204: calling the code packaging script to generate a target code package.

[0068] Step S205: calling the code package publishing script to publish the target code package to the packaging management platform.

[0069] Specifically, steps S201 through S205 describe the automated process for "one-click packaging and publishing" of the Hongmeng OS code by calling various scripts in this embodiment of the present invention. The detailed description of each script is consistent with that of steps S101 through S103 and will not be repeated here.

[0070] Step S206: Visualizing information of the target code package.

[0071] In an embodiment of the present invention, visualization of information about different target code packages for different users is provided. That is, detailed information corresponding to one or more target code packages is obtained from a packaging management platform; and detailed information about each user ID and the target code package corresponding to the user ID is visualized.

[0072] Figure 3 A visualization page 300 is shown, such as Figure 3 As shown, it shows the "user identification" and the detailed information of the target code package, including visualization options such as "packaging execution status", "packaging mode information", "packaging time", "code information", and "operating system", as well as the detailed information of the target code packages corresponding to multiple users.

[0073] Figure 3 The "Operation Options" are also shown. By triggering the "Regenerate" button component, you can re-execute the "One-click Packaging and Publishing" process (depending on the packaging execution status); you can also trigger the "Test" button component to obtain the target code package to perform subsequent operations (such as testing, etc.).

[0074] Furthermore, the packaging management platform provided by the embodiment of the present invention can manage code package information of multiple operating systems. Therefore, the operating system type to which a user's target code package belongs can be identified as the Harmony operating system by setting the "operating system" to "HarmonyOS".

[0075] The embodiment of the present invention improves the management efficiency of multiple code packages and the code packaging efficiency of developers by visualizing a list of user identifiers and detailed information of target code packages.

[0076] In an embodiment of the present invention, the calling sequence between multiple scripts can also be visually displayed through a page, and the currently called script can be dynamically highlighted, further improving the visualization of the code packaging process.

[0077] like Figure 4 As shown, an embodiment of the present invention provides a code packaging device 400 applied to the Hongmeng operating system, including: a code acquisition module 401, a packaging configuration module 402 and a packaging module 403; wherein,

[0078] The code acquisition module 401 is used to obtain the user ID and packaging configuration information of the user from the code packaging request;

[0079] The packaging configuration module 402 is configured to call a code acquisition script to pull the software code to the packaging space corresponding to the user identifier according to the code configuration information included in the packaging configuration information; obtain the packaging configuration file in the packaging space, and call the packaging configuration script to replace the original version information included in the packaging configuration script with the packaging version information included in the packaging configuration information;

[0080] The packaging module 403 is used to package the software code into a target code package that can be applied to the Hongmeng operating system based on the modified packaging configuration file.

[0081] An embodiment of the present invention also provides an electronic device for code packaging applied to the HarmonyOS operating system, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in any of the above embodiments.

[0082] An embodiment of the present invention further provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method provided in any of the above embodiments is implemented.

[0083] An embodiment of the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the code packaging methods described above for the Hongmeng operating system.

[0084] Figure 5 An exemplary system architecture 500 is shown to which a code packaging method applied to a Hongmeng operating system or a code packaging device applied to a Hongmeng operating system according to an embodiment of the present invention can be applied.

[0085] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0086] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, and 503, such as e-commerce client applications, web browser applications, search applications, instant messaging tools, and email clients.

[0087] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting various client applications, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0088] Server 505 can be a server that provides various services, such as a background management server that provides support for client applications used by users on terminal devices 501, 502, and 503. The background management server can serve as a packaging management platform to manage the configuration information and packaging details of multiple HarmonyOS code packages, and visually display the packaging execution status and packaging details of the code packages and feedback them to the terminal devices.

[0089] It should be noted that the code packaging method applied to the Harmony operating system provided in the embodiment of the present invention is generally executed by terminal devices 501, 502, and 503. Accordingly, the code packaging device applied to the Harmony operating system is generally set in the terminal devices 501, 502, and 503.

[0090] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0091] Reference below Figure 6 , which shows a schematic structural diagram of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0092] like Figure 6 As shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of system 600 are also stored in RAM 603. CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.

[0093] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, mouse, and the like; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 608 including devices such as a hard disk; and a communication section 609 including a network interface card such as a LAN card or a modem. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 610 as needed, so that computer programs read from the removable media can be installed in the storage section 608 as needed.

[0094] In particular, according to embodiments disclosed herein, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program containing program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609 and / or installed from removable media 611. When executed by central processing unit (CPU) 601, the computer program performs the aforementioned functions defined in the system of the present invention.

[0095] It should be noted that the computer-readable medium described in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0097] The modules and / or units involved in the embodiments of the present invention may be implemented in software or in hardware. The modules and / or units described may also be provided in a processor. For example, they may be described as follows: a processor includes a code acquisition module, a packaging configuration module, and a packaging module. The names of these modules do not, in some cases, constitute a limitation on the module itself. For example, the code acquisition module may also be described as a "module for obtaining a user's user identification and packaging configuration information from a code packaging request."

[0098] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the device includes: obtaining the user's user identification and packaging configuration information from the code packaging request; calling the code acquisition script to pull the software code to the packaging space corresponding to the user identification according to the code configuration information contained in the packaging configuration information; obtaining the packaging configuration file in the packaging space, calling the packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; based on the modified packaging configuration file, packaging the software code into a target code package that can be applied to the Hongmeng operating system.

[0099] An embodiment of the present invention can obtain a user's user ID and packaging configuration information from a code packaging request; call a code acquisition script to pull the software code to the packaging space corresponding to the user ID based on the code configuration information contained in the packaging configuration information; call a packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; and based on the modified packaging configuration file, package the software code into a target code package applicable to the Hongmeng operating system. By calling multiple scripts to execute an automatic packaging process for the Hongmeng operating system's code, the embodiment of the present invention improves the automation, efficiency, and accuracy of the Hongmeng operating system's code packaging.

[0100] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A code packaging method applied to Hongmeng operating system, characterized in that: include: Obtain the user ID and packaging configuration information from the code packaging request; Calling a code acquisition script to pull the software code to the packaging space corresponding to the user identifier according to the code configuration information included in the packaging configuration information; Obtaining a packaging configuration file in the packaging space, and calling a packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; Based on the modified packaging configuration file, the software code is packaged into a target code package that can be applied to the Hongmeng operating system.

2. The method according to claim 1, characterized in that The step of packaging the software code into a target code package applicable to the Hongmeng operating system based on the modified packaging configuration file further includes: Obtaining the packaging mode information included in the packaging configuration information; Dynamically modify the packaging mode parameters of the Hongmeng operating system packaging instructions contained in the code packaging script to the packaging mode information; Call the modified code packaging script and execute the steps of packaging the software code into a target code package that can be applied to the Hongmeng operating system based on the modified packaging configuration file.

3. The method according to claim 2, characterized in that Further including: Calling the modified code packaging script to perform a compile operation matching the packaging mode information on the software code; Based on the compiled file obtained by the compilation operation, a target code package that can be applied to the Hongmeng operating system is generated.

4. The method according to claim 1, wherein Further including: Calling a first command included in the code package publishing script to add version tag information to the target code package, and calling a second command included in the code package publishing script to obtain size information of the target code package; The version tag information, the size information, the packaging time of the target code package, and the custom packaging information of the target code package are used as detailed information of the target code package and sent to a packaging management platform.

5. The method according to claim 4, characterized in that Further including: Obtain the detailed information corresponding to one or more target code packages from the packaging management platform; Each user ID and the detailed information of the target code package corresponding to the user ID are visualized.

6. The method according to claim 1, characterized in that Further including: Obtain the calling order of multiple scripts used in the software packaging process; wherein the scripts associated with the calling order are: code acquisition script, packaging configuration script, code packaging script, and code package publishing script; In response to the code packaging request, each script is called in sequence according to the calling order.

7. The method according to claim 6, characterized in that The step of calling each script in sequence according to the calling order includes: For any script, when it is determined that the execution status of the script is successful, the next script of the script is automatically called according to the calling sequence; Otherwise, report the abnormal information of the script execution.

8. A code packaging device applied to Hongmeng operating system, characterized in that: include: Get the code module, packaging configuration module and packaging module; among them, The code acquisition module is used to obtain the user ID and packaging configuration information of the user from the code packaging request; The packaging configuration module is configured to call a code acquisition script to pull the software code to the packaging space corresponding to the user identifier according to the code configuration information contained in the packaging configuration information; obtain a packaging configuration file in the packaging space, and call a packaging configuration script to replace the original version information contained in the packaging configuration file with the packaging version information contained in the packaging configuration information; The packaging module is used to package the software code into a target code package that can be applied to the Hongmeng operating system based on the modified packaging configuration file.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product comprising a computer program, characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.