Code and operating system generation method and device, server and electronic equipment
By configuring and generating the operating system source code based on the configuration information of the electronic device on the server side, the problems of high and low efficiency of operating system customization in the existing technology are solved, and efficient and low-cost operating system customization and electronic device production are achieved.
Patent Information
- Application Number
- CN202210548804.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-05-20
AI Technical Summary
In the prior art, the customization cost of operating systems is high and the efficiency is low, resulting in a decrease in the production efficiency of smart devices.
By obtaining the configuration information of the electronic device on the server side, configuring the system information of the target operating system based on the information, and generating the target source code so that the electronic device can call and generate its specific operating system.
It greatly improves the customization efficiency of the operating system, reduces the customization cost, thereby reducing the production cost of electronic equipment, improving production efficiency and product competitiveness.
Smart Images

Figure CN114840194B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a method and device for generating a code and an operating system, a server, and an electronic device. Background Art
[0002] With the development of science and technology, electronic devices such as smart wearable devices and smart home devices are being used more and more widely. Among them, different smart electronic devices require different operating systems to control their operation to ensure that users get a better experience. In this way, for different smart electronic devices, it is necessary to customize the corresponding operating system according to the specific conditions of the smart electronic devices produced. The customization cost of the operating system is high and the efficiency is low, which greatly reduces the production efficiency of smart electronic devices. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method and device for generating a code and an operating system, a server and an electronic device, which can solve the problem in the prior art that the customization cost of the operating system is high and the efficiency is low, thereby greatly reducing the production efficiency of smart devices.
[0004] In a first aspect, an embodiment of the present application provides a code generation method, which is used for a server, and the method includes: obtaining configuration information of an electronic device; configuring system information of a target operating system according to the configuration information; generating a target source code according to the configured system information; wherein the configuration information includes software and hardware parameter configuration information of the electronic device.
[0005] In a second aspect, an embodiment of the present application provides a method for generating an operating system, which is used for an electronic device. The method for generating an operating system includes: obtaining a target source code in a server; generating a target operating system data packet based on the target source code and local sensitive data; generating a target operating system based on the target operating system data packet; wherein the target source code is used to indicate system information after the target operating system is configured.
[0006] In a third aspect, an embodiment of the present application provides a code generation device, which is used for a server, and the device includes: an acquisition unit, used to acquire configuration information of an electronic device; a processing unit, used to configure system information of a target operating system according to the configuration information; the processing unit is also used to generate a target source code according to the configured system information; wherein the configuration information includes software and hardware parameter configuration information of the electronic device.
[0007] In a fourth aspect, an embodiment of the present application provides a device for generating an operating system, and the device for generating an operating system is used in an electronic device, and the device for generating an operating system includes: an acquisition unit, used to acquire a target source code in a server; a processing unit, used to generate a target operating system data packet based on the target source code and local sensitive data; the processing unit is also used to generate a target operating system based on the target operating system data packet; wherein the target source code is used to indicate system information after the target operating system is configured.
[0008] In a fifth aspect, an embodiment of the present application provides a server, which includes a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the code generation method of the first aspect are implemented.
[0009] In a sixth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the method for generating an operating system as in the second aspect are implemented.
[0010] In the seventh aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the code generation method of the first aspect are implemented, or when the program or instruction is executed by a processor, the steps of the operating system generation method of the second aspect are implemented.
[0011] In an eighth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the code generation method of the first aspect, or the processor is used to run programs or instructions to implement the steps of the operating system generation method of the second aspect.
[0012] In a ninth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium, and is executed by at least one processor to implement the steps of the code generation method of the first aspect, or the program product is executed by at least one processor to implement the steps of the operating system generation method of the second aspect.
[0013] In an embodiment of the present application, when customizing an operating system, on the server side, configuration information of the electronic device is obtained; system information of the target operating system is configured according to the configuration information; and target source code is generated according to the configured system information; wherein the configuration information includes software and hardware parameter configuration information of the electronic device. Through the above code generation method, when customizing the operating system of an electronic device, the server obtains the configuration information of the electronic device, and then configures the system information of the target operating system preset in the server according to the obtained configuration information, and generates the corresponding target source code according to the configured system information, so that the electronic device can call the target source code to generate its specific operating system.
[0014] In this way, when generating the operating system of the electronic device, the server modifies the preset target operating system according to the configuration information of the electronic device obtained, and generates the corresponding target source code according to the modified target operating system, so that the corresponding electronic device can call the target source code to generate its specific operating system. That is, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets their own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and thus improving the product competitiveness of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a method for generating a code according to an embodiment of the present application;
[0016] Figure 2 A schematic diagram of a flow chart of a method for generating an operating system provided in an embodiment of the present application;
[0017] Figure 3 A structural block diagram of a code generation device provided in an embodiment of the present application;
[0018] Figure 4 A structural block diagram of a device for generating an operating system provided in an embodiment of the present application;
[0019] Figure 5 A hardware schematic diagram of a server provided in an embodiment of the present application;
[0020] Figure 6 One of the hardware schematic diagrams of the electronic device provided in the embodiment of the present application;
[0021] Figure 7 The second hardware schematic diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0023] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0024] The embodiment of the first aspect of the present application proposes a method for generating a code. The execution subject of the technical solution of the method for generating a code provided in the embodiment of the present application can be a device for generating a code, which can be determined according to actual use requirements and is not limited in the embodiment of the present application. In order to more clearly describe the method for generating a code provided in the embodiment of the present application, the following method embodiment takes the execution subject of the method for generating a code as a device for generating a code for exemplary description.
[0025] The following, in conjunction with the accompanying drawings, describes in detail the code generation method provided in the embodiment of the first aspect of the present application through specific embodiments and their application scenarios.
[0026] like Figure 1 As shown, the embodiment of the present application provides a method for generating a code, which is applied to a server. The method may include the following steps S102 to S106:
[0027] Step S102: Acquire configuration information of the electronic device.
[0028] The code generation method provided in the embodiment of the present application is used for a server. The server may be a terminal device or a functional module in the terminal device. The specific form of the server may be determined according to actual use requirements and is not specifically limited in the embodiment of the present application.
[0029] Specifically, when customizing the operating system of an electronic device, operation steps are included on the server side and the electronic device side, wherein the server and the electronic device whose operating system needs to be customized can communicate with each other. When customizing the operating system of an electronic device, for the server side, the server obtains the configuration information of the electronic device whose operating system needs to be customized, and then customizes the operating system of the electronic device according to the obtained configuration information.
[0030] The server and the electronic device communicate by connecting a data line or a data interface, and data transmission between the server and the electronic device is realized through the data line or the data interface, thereby realizing the customization of the electronic device operating system. In the actual application process, the server and the electronic device can also communicate wirelessly, and data transmission between the server and the electronic device is realized through the wireless transmission function. The communication method between the server and the electronic device can be determined according to the actual situation, and no specific limitation is made here.
[0031] Furthermore, the electronic device may be an electronic device such as a smart wearable device or a smart home device that requires an independent operating system to ensure its user experience. Specifically, the electronic device may be an electronic device such as a smart bracelet, a smart watch, a wireless headset, a sweeping robot, etc., and no specific restrictions are made here.
[0032] Furthermore, the configuration information includes the hardware and software parameter configuration information of the electronic device, and the hardware and software parameter configuration information may specifically include the screen information, memory information, component configuration information, function module configuration information, interface information, etc. of the electronic device. Specifically, the screen information may include information such as whether there is an LCD screen, screen size, etc.; the memory information includes total memory information; the component configuration information includes battery information, sensor information, etc.; the function module configuration information includes the support information of the electronic device for each function module, for example, whether the electronic device supports voice function, WIFI function, NFC (NearField Communication, short-range wireless communication) function, Bluetooth function, etc.
[0033] Furthermore, the above configuration information may also include picture configuration information of the electronic device, which includes specific information such as picture content, picture type, picture tags, etc. During the application process, the server can obtain the specific information included in the picture configuration information by parsing the obtained picture configuration information.
[0034] Step S104: configuring system information of the target operating system according to the configuration information.
[0035] The configuration information includes the software and hardware parameter configuration information and image configuration information of the electronic device.
[0036] Furthermore, the target operating system is an operating system pre-stored in the server, and the target operating system includes function module information and application information. In this way, for electronic devices with different configurations, the server can modify the function module information and application information in the target operating system according to the specific configuration information of the electronic device, so as to obtain the function module information and application information that meet the use requirements of the electronic device.
[0037] Furthermore, the above-mentioned system information includes resource allocation information (such as memory resources, power resources, network resources, etc.) of the target operating system, functional module information, operating mode (such as safety mode, child mode, privacy mode, etc.) information, call information of picture configuration information, application information (application list) and other information.
[0038] Specifically, after the server obtains the configuration information of the electronic device, including software and hardware parameter configuration information and image configuration information, the system information of the target operating system is configured according to the obtained configuration information. Specifically, the resource allocation information, functional module information, operation mode information, image configuration information calling information, application information and other information of the target operating system are modified and configured according to the above configuration information to modify the target operating system and obtain a basic operating system that basically meets the use requirements of the electronic device.
[0039] Step S106: Generate target source code according to the configured system information.
[0040] Specifically, after the server configures the system information of the target operating system according to the acquired configuration information of the electronic device, the server integrates the configuration modification of the system information such as resource allocation information, functional module information, operation mode information, image configuration information calling information, application information, etc. of the target operating system, and then generates a target source code including all the above-mentioned modification configuration operations, so that the electronic device can call the target source code, thereby quickly and conveniently generating the target operating system it needs.
[0041] Through the above code generation method provided in the embodiment of the present application, the customization steps of the operating system are divided into two aspects: the server side and the electronic device side. On the server side, the configuration information of the electronic device is obtained; the system information of the target operating system is configured according to the configuration information; the target source code is generated according to the configured system information; wherein the configuration information includes the software and hardware parameter configuration information of the electronic device. Through the above code generation method, when customizing the operating system of the electronic device, the server obtains the configuration information of the electronic device, and then configures the system information of the target operating system preset in the server according to the obtained configuration information, so as to modify the above target operating system to an operating system that basically meets the various functions of the electronic device, and generates the corresponding target source code according to the configured system information, so that the electronic device can call the target source code to generate its specific operating system.
[0042] In this way, when generating the operating system of the electronic device, the server modifies the preset target operating system according to the configuration information of the electronic device obtained, and generates the corresponding target source code according to the modified target operating system, so that the corresponding electronic device can call the target source code to generate its specific operating system. That is, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets their own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and thus improving the product competitiveness of the electronic device.
[0043] In the embodiment of the present application, the above configuration information includes picture configuration information and software and hardware parameter configuration information. On this basis, the above step S104 may specifically include the following steps S104a to S104g:
[0044] Step S104a: updating the configuration template according to the image configuration information and the software and hardware parameter configuration information to obtain a target parameter configuration table of the electronic device.
[0045] The image configuration information includes specific information such as image content, image type, and image tags. During the application process, the server can obtain the specific information contained in the image configuration information by parsing the acquired image configuration information. The software and hardware parameter configuration information includes the screen information of the electronic device (whether there is an LCD screen, screen size), memory information (total memory), function module configuration information (whether the electronic device supports voice function, WIFI function, NFC function, Bluetooth function, etc.), component configuration information (battery information, sensor information), and other information.
[0046] Furthermore, the configuration template is a basic parameter configuration template pre-stored in the server, which can be an official configuration template or a third-party shared configuration template, or a configuration template customized by the user according to the actual situation of the electronic device. The specific source of the configuration template can be selected according to the actual situation, and is not limited here.
[0047] Specifically, during the customization process of the operating system, the server modifies and updates the pre-stored parameter configuration template based on the acquired image configuration information of the electronic device and the software and hardware parameter configuration information, thereby automatically generating a target parameter configuration table for the corresponding electronic device, so that the system information of the target operating system in the server can be subsequently modified and configured according to the target parameter configuration table.
[0048] In addition, in the actual application process, the developer can also manually generate a target parameter configuration table for the electronic device according to the configuration information of the electronic device, and generate a specific target parameter configuration table according to the specific configuration information of the electronic device to ensure the accuracy of the target parameter configuration table.
[0049] Step S104b: configuring resource allocation information of the target operating system according to the target parameter configuration table.
[0050] The target parameter configuration table is a configuration table generated according to the software and hardware parameter configuration information and the image configuration information of the electronic device, and the target parameter configuration table includes the resource configuration information of the electronic device.
[0051] Furthermore, the resources that the electronic device needs to allocate include memory resources, power resources, network resources, etc., that is, the resource configuration information includes resource configuration information such as memory resource configuration information, power resource configuration information, network resource configuration information, etc. of the electronic device. On this basis, the resource allocation information includes resource allocation information such as memory resource allocation information, power resource allocation information, network resource allocation information, etc.
[0052] Specifically, in the process of customizing the operating system of an electronic device, the server configures the memory resource allocation information, power resource allocation information, network resource allocation information and other resource configuration information of the target operating system according to the memory resource configuration information, power resource configuration information, network resource configuration information and other resource configuration information in the generated target parameter configuration table of the electronic device, so that the resource allocation information of the target operating system corresponds to the usage requirements of the electronic device.
[0053] Step S104c: tailoring the function modules in the target operating system according to the target parameter configuration table to configure the function module information of the operating system.
[0054] Among them, the above-mentioned target parameter configuration table includes functional module configuration information of the electronic device, specifically including support information of the electronic device for each functional module, for example, whether the electronic device supports voice function, WIFI function, NFC function, Bluetooth function, etc.
[0055] Specifically, in the process of customizing the operating system of an electronic device, the server tailors and optimizes multiple functional modules in the target operating system based on the support information of the electronic device for each functional module in the generated target parameter configuration table of the electronic device, so as to configure the functional module information of the target operating system according to the specific functional module configuration information of the electronic device, optimize the configuration of the functional modules of the operating system, and reduce the memory resources occupied by the generated operating system.
[0056] Step S104d: configuring the operation mode information of the target operating system according to the image configuration information.
[0057] The picture configuration information includes specific information such as picture content, picture type, and picture tags. During the application process, the server can obtain the specific information included in the picture configuration information by parsing the obtained picture configuration information.
[0058] Furthermore, the operating mode of the target operating system may include multiple operating modes such as a safe mode, a child mode, and a privacy mode.
[0059] Specifically, in the process of customizing the operating system of an electronic device, the server configures the operating mode information of the target operating system based on the analysis results of the image configuration information of the electronic device, so as to perform targeted configuration of the operating mode of the target operating system (such as safety mode, child mode, privacy mode, etc.) according to the specific image configuration information of the electronic device, thereby ensuring the targetedness and diversity of the operating mode of the operating system.
[0060] In addition, in the actual application process, the developer can also customize the operating mode information of the target operating system according to actual needs to personalize the operating mode of the target operating system.
[0061] Step S104e: configure the calling information of the picture configuration information.
[0062] The picture configuration information includes specific information such as picture content, picture type, and picture tags. During the application process, the server can obtain the specific information included in the picture configuration information by parsing the obtained picture configuration information.
[0063] Furthermore, the above-mentioned calling information includes a calling range of the picture configuration information, that is, an application program or a functional module in the electronic device that can call the above-mentioned picture configuration information.
[0064] Specifically, in the process of customizing the operating system of an electronic device, the server configures the calling information of the image configuration information according to the analysis result of the image configuration information of the electronic device, so as to set the usage of the image configuration information (such as desktop image, lock screen image, application image, etc.) according to the specific image configuration information of the electronic device.
[0065] In addition, in the actual application process, the developer can also customize the calling range of the image configuration information according to the image naming information, so as to personalize the usage of the image configuration information.
[0066] Step S104f: configuring the application list information of the target operating system according to the target parameter configuration table and the image configuration information.
[0067] The target operating system includes information of multiple application programs.
[0068] Specifically, in the process of customizing the operating system of an electronic device, the server cuts and optimizes multiple application information in the target operating system according to the target parameter configuration table and image configuration information of the electronic device, so as to configure the application information in the target operating system according to the specific configuration information of the electronic device to obtain a corresponding application list, optimize the configuration of the operating system's applications, and reduce the memory resources occupied by the generated operating system.
[0069] In the actual application process, the developer can also customize the application list of the target operating system to personalize the application list of the target operating system.
[0070] In addition, it should be noted that there is no clear execution order between the five operation steps from step S104b to step S104f. In actual application, the five operation steps from step S104b to step S104f can be executed simultaneously, or can be executed successively in a certain execution order. The execution order of the five operation steps from step S104b to step S104f is not specifically limited here.
[0071] Step S104g: Determine the configured system information of the target operating system according to the configured resource allocation information, function module information, operation mode information, call information and application list information.
[0072] Specifically, after the server configures and modifies the system information such as resource allocation information, functional module information, operation mode information, image configuration information calling information and application list information of the target operating system according to the acquired configuration information including image configuration information and software and hardware parameter configuration information, the configuration results of the above-mentioned system information of the target operating system are integrated to generate a target source code including all the above-mentioned modification configuration operations, so that the electronic device can call the target source code, thereby quickly and conveniently generating the target operating system required by itself.
[0073] In the above embodiment provided by the present application, when generating the operating system of the electronic device, the server generates the target parameter configuration table of the electronic device according to the software and hardware parameter configuration information and the image configuration information of the electronic device, and then automatically configures the resource allocation information, function module information, operation mode information, calling information of the image configuration information, application list information and other system information of the target operating system according to the target parameter configuration table and / or the image configuration information, and integrates the configuration results of the system information of the target operating system to generate a target source code including all the above modification configuration operations, so that the electronic device can call the target source code, thereby quickly and conveniently generating the target operating system required by itself. In this way, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets their own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device.
[0074] In the embodiment of the present application, the above step S104c may specifically include the following steps S104c1 and S104c2:
[0075] Step S104c1: determining matching information between the functional modules in the target operating system and the electronic device according to the target parameter configuration table.
[0076] Among them, the above-mentioned target parameter configuration table includes functional module configuration information of the electronic device, specifically including support information of the electronic device for each functional module, for example, whether the electronic device supports voice function, WIFI function, NFC function, Bluetooth function, etc.
[0077] Furthermore, the target operating system includes multiple functional modules to meet the requirements of implementing various functions of electronic devices.
[0078] Specifically, during the customization process of the operating system, the functional module configuration information of the electronic device is determined according to the target parameter configuration table, and then the functional module configuration information is matched with multiple functional modules in the target operating system to determine the matching information between the multiple functional modules in the target operating system and the electronic device, that is, to determine the support information of the electronic device for the multiple functional modules after the target operating system.
[0079] Step S104c2: When the electronic device does not support the function module in the target operating system, delete the function module in the target operating system.
[0080] Specifically, the function module configuration information of the electronic device is determined according to the target parameter configuration table, and then the support information of the electronic device for the multiple function modules after the target operating system is determined according to the matching result of the function module configuration information and the multiple function modules in the target operating system. In the case that the electronic device does not have a certain function module, that is, in the case that the electronic device does not support a certain function module in the target operating system, the function module in the target operating system is deleted, so as to optimize the function modules of the corresponding operating system according to the specific function module configuration information of the electronic device, thereby reducing the memory resources occupied by the generated operating system.
[0081] For example, when the electronic device does not support the NFC function, the NFC function module in the target operating system is deleted; when the electronic device does not support the voice function, the voice module in the target operating system is deleted.
[0082] In the above-mentioned embodiment provided by the present application, when the function modules in the target operating system are cut, the matching information between the function modules in the target operating system and the electronic device is determined according to the target parameter configuration table, and then when the electronic device does not support the function modules in the target operating system, the function modules in the target operating system are deleted. In this way, the function modules of the corresponding operating system are automatically cut and optimized according to the specific function module configuration information of the electronic device, which reduces the memory resources occupied by the generated operating system and improves the customization and modification efficiency of the operating system.
[0083] In the embodiment of the present application, the resource allocation information includes memory mode information. On this basis, the above step S104b may specifically include the following steps S104b1 and S104b2:
[0084] Step S104b1: Determine the total memory amount of the electronic device according to the target parameter configuration table.
[0085] The target parameter configuration table includes resource configuration information of the electronic device. The resources to be allocated to the electronic device include memory resources, so the resource configuration information specifically includes memory resource configuration information of the electronic device.
[0086] Specifically, in the process of customizing the operating system of the electronic device, the total amount of memory of the electronic device is determined according to the acquired target parameter configuration table of the electronic device, and then the memory mode of the target operating system is configured according to the total amount of memory of the electronic device.
[0087] Step S104b2: configure memory mode information according to the memory range interval where the total memory is located.
[0088] The memory range interval corresponds to the memory mode information.
[0089] Specifically, after determining the total amount of memory of the electronic device according to the target parameter configuration table of the electronic device, the specific value of the total amount of memory is compared with a preset memory range interval, and then the memory mode information of the target operating system is configured according to the comparison result, so that the memory mode information of the target operating system is adapted to the total amount of memory of the electronic device.
[0090] Among them, the memory mode information of the target operating system corresponds to the memory range interval where the total memory is located. Specifically, the memory consumption of the memory mode of the target operating system corresponds to the memory range interval where the total memory is located. The larger the memory range interval where the total memory is located, the greater the memory consumption of the corresponding memory mode.
[0091] Specifically, when the total amount of memory of the electronic device is within a first memory range, the memory mode of the target operating system is configured to a first memory mode; when the total amount of memory of the electronic device is within a second memory range, the memory mode of the target operating system is configured to a second memory mode; when the total amount of memory of the electronic device is within a third memory range, the memory mode of the target operating system is configured to a third memory mode.
[0092] The minimum value of the second memory range interval is greater than or equal to the maximum value of the first memory range interval, and the minimum value of the third memory range interval is greater than or equal to the maximum value of the second memory range interval. The memory consumption of the first memory mode is less than the memory consumption of the second memory mode, and the memory consumption of the second memory mode is less than the memory consumption of the third memory mode.
[0093] That is, when the total amount of memory of the electronic device is within the first memory range, that is, the total amount of memory is small, it means that the electronic device is a microelectronic device, and the memory mode of its operating system is configured as the strict memory mode; when the total amount of memory of the electronic device is within the second memory range, that is, the total amount of memory is moderate, it means that the electronic device is a conventional electronic device, and the memory mode of its operating system is configured as the normal memory mode; and when the total amount of memory of the electronic device is within the third memory range, that is, the memory capacity is large, it means that the electronic device is a large memory device, and the memory mode of its operating system is configured as the loose memory mode.
[0094] In addition, in the actual application process, the developer can also customize the memory mode of the target operating system to personalize the memory mode of the target operating system.
[0095] In the above-mentioned embodiment provided by the present application, the resource allocation information includes memory mode information. When configuring the memory mode information of the target operating system, the total memory of the electronic device is first determined according to the target parameter configuration table, and then the memory mode information of the target operating system is configured according to the memory range interval where the total memory is located, wherein the memory range interval corresponds to the memory mode information. In this way, the memory mode of the corresponding operating system is automatically configured according to the specific memory information of the electronic device, so that the memory mode of the target operating system is adapted to the total memory of the electronic device, thereby optimizing the memory consumption speed of the operating system and improving the customization and modification efficiency of the operating system.
[0096] In the embodiment of the present application, the resource allocation information includes power consumption mode information. On this basis, the above step S104b may further include the following steps S104b3 and S104b4:
[0097] Step S104b3: Determine component configuration information of the electronic device according to the target parameter configuration table.
[0098] The target parameter configuration table includes resource configuration information of the electronic device. The resources to be allocated to the electronic device include power resources, so the resource configuration information specifically includes power resource configuration information of the electronic device.
[0099] Specifically, in the process of customizing the operating system of the electronic device, the component configuration information of the electronic device is determined according to the acquired target parameter configuration table of the electronic device, wherein the component configuration information includes configuration information related to the power consumption of the electronic device, such as battery information and sensor information. On this basis, the power consumption mode of the target operating system is configured according to the determined component configuration information.
[0100] Step S104b4: configuring the power consumption mode information according to the component configuration information.
[0101] The component configuration information includes battery information, sensor information and other configuration information related to the power consumption of the electronic device.
[0102] Specifically, the power consumption of the electronic device is determined based on the component configuration information of the electronic device, including battery information and sensor information, and then the power consumption mode of the corresponding target operating system is configured according to the determined power consumption, so that the power consumption mode of the target operating system can be adapted to the power consumption of the electronic device.
[0103] In addition, in the actual application process, the developer can also customize the power consumption mode of the target operating system to personalize the power consumption mode of the target operating system.
[0104] In the above-mentioned embodiment provided by the present application, the resource allocation information includes power consumption mode information. When configuring the power resource allocation mode of the target operating system, firstly, the battery information, sensor information and other component configuration information related to the power consumption of the electronic device are determined according to the target parameter configuration table, and then the power consumption mode of the target operating system is configured according to the component configuration information. In this way, the power consumption mode of the corresponding operating system is automatically configured according to the component configuration information related to the power consumption of the electronic device, so that the power consumption mode of the target operating system is adapted to the power consumption of the electronic device, the power consumption speed of the operating system is optimized, and the customization and modification efficiency of the operating system is improved.
[0105] In the embodiment of the present application, the component configuration information includes battery information and sensor information. On this basis, the above step S104b4 may specifically include the following steps S104b41 and S104b42:
[0106] Step S104b41: When the electronic device does not have a mobile battery, the target power consumption mode in the target operating system is deleted.
[0107] Among them, the target power consumption mode is the power saving mode.
[0108] Specifically, in the process of configuring the power consumption mode of the target operating system, the component configuration information of the electronic device is determined according to the acquired target parameter configuration table of the electronic device, wherein the component configuration information includes battery information, and the power consumption mode of the target operating system is configured according to the determined battery information.
[0109] Among them, the battery information includes information related to the power consumption of the electronic device, such as the battery type and battery charging method. The power consumption of the electronic device when in use is determined based on the battery information such as the battery type and battery charging method of the electronic device, and then the power consumption mode of the corresponding target operating system is configured based on the power consumption.
[0110] Specifically, when it is determined based on the battery information of the electronic device that the electronic device does not have a mobile battery, that is, when the electronic device can only be used by plugging in, it means that the electronic device consumes less power when in use, and even the electronic device will always be in a fully charged state when plugged in. At this time, the target power consumption mode in the target operating system is deleted, that is, the power saving mode of the electronic device is turned off.
[0111] Step S104b42: When the battery power of the electronic device is within the target range and the electronic device is equipped with a positioning sensor, the target power consumption mode of the target operating system is turned on.
[0112] In the process of configuring the power consumption mode of the target operating system, the component configuration information of the electronic device is determined according to the acquired target parameter configuration table of the electronic device. The component configuration information includes battery information and sensor information, and the power consumption mode of the target operating system is configured according to the determined battery information and sensor information.
[0113] Furthermore, the battery information may specifically include battery power information, and the sensor information may specifically include sensor type. On this basis, when the battery power is large, that is, the battery power is within the target range, and the electronic device has a positioning sensor, it means that the electronic device has off-road related functions. At this time, the target power consumption mode in the target operating system is turned on, that is, a power saving switch is provided for the electronic device to reduce the power consumption speed of the electronic device when used in outdoor, off-road and other situations, thereby improving the performance of the electronic device.
[0114] In addition, in the actual application process, the developer can also customize the power consumption mode of the target operating system to personalize the power consumption mode of the target operating system.
[0115] In the above-mentioned embodiment provided by the present application, when configuring the power consumption mode of the target operating system according to the component configuration information of the electronic device, when the electronic device does not have a mobile battery, the power saving mode in the target operating system is removed, and when the battery power of the electronic device is within the target range and the electronic device has a positioning sensor, the target power consumption mode of the target operating system is turned on. In this way, the power consumption mode of the corresponding operating system is automatically configured according to the component configuration information such as battery information and sensor information related to the power consumption of the electronic device, so that the power consumption mode of the target operating system is adapted to the power consumption of the electronic device, the power consumption mode of the operating system is optimized, and the customization and modification efficiency of the operating system is improved.
[0116] In the embodiment of the present application, the resources that the electronic device needs to allocate also include network resources, and the above-mentioned target parameter configuration table also includes the network resource configuration information of the electronic device. In the actual application process, the server determines the network speed information, networking program information, etc. of the electronic device when it is in use based on the network resource configuration information of the electronic device to determine the network resource usage of the electronic device, and then configures the network mode of the target operating system based on the network resource usage, so that the power consumption mode of the target operating system is adapted to the network usage of the electronic device, and optimizes the network allocation mode of the operating system.
[0117] In addition, in the actual application process, the developer can also customize the network mode of the target operating system to personalize the network mode of the target operating system.
[0118] In the embodiment of the present application, the above step S104d may specifically include the following steps S104d1 and S104d2:
[0119] Step S104d1: parse the picture configuration information and determine the picture type of the picture configuration information.
[0120] The picture configuration information includes specific information such as picture content, picture type, and picture tags. During the application process, the server determines the picture type corresponding to the picture configuration information by parsing the obtained picture configuration information.
[0121] Step S104d2: configuring multiple operation mode information of the target operating system according to the image type.
[0122] Specifically, the pictures in the electronic device may include characters, scenery, animations, etc., and the picture configuration information of the electronic device is parsed to determine the picture type corresponding to the picture configuration information in the electronic device. Among them, the above picture types may specifically include business, entertainment, public service, learning, etc. On this basis, the operation mode information of the target operating system is configured according to the determined picture type.
[0123] Among them, the operating mode of the target operating system may include multiple operating modes such as safety mode, child mode, privacy mode, etc. The picture type corresponds to the operating mode. When it is determined that the picture type of the picture configuration information of the electronic device includes a certain type, the operating mode corresponding to the picture type is added to the target operating system.
[0124] For example, when it is determined that the picture type of the picture configuration information of the electronic device includes business type, the security mode and the privacy mode are added to the operating mode of the target operating system; when it is determined that the picture type of the picture configuration information of the electronic device includes entertainment type, the child mode is added to the operating mode of the target operating system.
[0125] In the actual application process, the developer can also customize the operating mode of the target operating system to personalize the operating mode of the target operating system.
[0126] In the above-mentioned embodiment provided by the present application, when configuring the operation mode information of the target operating system, the picture configuration information of the electronic device is first parsed to determine the picture type of the picture configuration information, and then the operation mode information of the target operating system is automatically configured according to the determined picture type, wherein the picture type corresponds to the operation mode information. In this way, the operation mode (such as safety mode, children's mode, privacy mode, etc.) of the target operating system is configured in a targeted manner according to the picture type corresponding to the picture configuration information of the electronic device, thereby ensuring the pertinence and diversity of the operating mode of the operating system, improving the performance of the electronic device, and improving the customization efficiency of the operating system.
[0127] In the embodiment of the present application, the above step S104e may specifically include the following steps S104e1 and S104e2:
[0128] Step S104e1: parse the picture configuration information and determine the picture content of the picture configuration information.
[0129] The image configuration information includes specific information such as image content, image type, and image tag. During the application process, the server determines the image content corresponding to the image configuration information by parsing the acquired image configuration information.
[0130] Step S104e2: configuring the calling information of the picture configuration information according to the picture content.
[0131] The pictures in the electronic device may include characters, landscapes, animations and the like. By parsing the picture configuration information of the electronic device, the specific picture content corresponding to the picture configuration information in the electronic device can be determined.
[0132] Furthermore, the above-mentioned calling information includes a calling range of the picture configuration information, that is, an application program or a functional module in the electronic device that can call the above-mentioned picture configuration information.
[0133] Specifically, in the process of customizing the operating system of an electronic device, the server determines the picture content corresponding to the picture configuration information based on the analysis results of the picture configuration information of the electronic device, and then configures the calling information of the picture configuration information according to the determined picture content, so as to set the use purpose of the picture configuration information (such as desktop picture, lock screen picture, application picture, etc.) according to the specific picture content of the picture configuration information.
[0134] In addition, in the actual application process, the developer can also customize the calling range of the image configuration information according to the image naming information, so as to personalize the usage of the image configuration information.
[0135] In the above-mentioned embodiment provided by the present application, when configuring the calling information of the picture configuration information of the electronic device, the picture content of the picture configuration information is determined according to the analysis result of the picture configuration information, and then the calling information of the corresponding picture configuration information is called according to the determined picture content. In this way, the use purpose (such as desktop picture, lock screen picture, application picture, etc.) of the picture configuration information is set according to the specific picture content of the picture configuration information, which ensures the diversity and intelligence of the use of the picture configuration information and improves the use performance of the electronic device.
[0136] In the embodiment of the present application, the above step S104f may specifically include the following steps S104f1 to S104f3:
[0137] Step S104f1: Determine the storage information and screen configuration information of the electronic device according to the target parameter configuration table.
[0138] The target parameter configuration table includes configuration information that affects the application installation status of the electronic device, such as storage information and screen configuration information of the electronic device.
[0139] Specifically, the above storage information may include memory capacity information of the electronic device. When the memory capacity of the electronic device is small, the number of applications that can be installed in the electronic device is small, and when the memory capacity of the electronic device is large, the number of applications that can be installed in the electronic device is also large.
[0140] Furthermore, the above-mentioned screen configuration information includes information such as screen type (such as touch input screen, LCD display, etc.) and screen size. When the electronic device does not have a display screen or the display screen is small, it means that the electronic device does not support the installation of applications for playing videos or viewing pictures. When the display screen of the electronic device is large, it means that the electronic device supports the installation of applications for playing videos or viewing pictures.
[0141] Step S104f2: parse the picture configuration information and determine the picture type of the picture configuration information.
[0142] The picture configuration information includes specific information such as picture content, picture type, and picture tags. During the application process, the server determines the picture type corresponding to the picture configuration information by parsing the obtained picture configuration information.
[0143] Specifically, the pictures in the electronic device may include characters, landscapes, animations, etc., and the picture configuration information of the electronic device is parsed to determine the picture type corresponding to the picture configuration information in the electronic device. The above picture types may specifically include games, business, shopping, sports, learning, etc.
[0144] Step S104f3: According to the storage information, screen configuration information and picture type, the preset applications in the target operating system are cut and optimized to obtain application list information.
[0145] The above-mentioned preset applications are a plurality of application program information pre-stored in the target operating system.
[0146] Specifically, in the process of customizing the operating system of an electronic device, the server cuts and optimizes multiple application information in the target operating system according to the storage information, screen configuration information, and image type of the image configuration information of the electronic device, so as to configure the application information in the target operating system according to the specific configuration information of the electronic device to obtain a corresponding application list, optimize the configuration of the operating system's applications, and reduce the memory resources occupied by the generated operating system.
[0147] Specifically, the storage information may include information about the amount of memory of the electronic device. When the amount of memory of the electronic device is large, the number of applications that can be installed in the electronic device is also large. When the amount of memory of the electronic device is small, the number of applications that can be installed in the electronic device is small. At this time, infrequently used applications among the multiple applications preset in the target operating system are deleted, thereby reducing the memory resources occupied by the operating system.
[0148] Furthermore, the above screen configuration information includes information such as screen type (such as touch input screen, LCD display, etc.), screen size, etc. If the electronic device does not have a display screen or the display screen is small, it means that the electronic device does not support the installation of applications for playing videos or viewing pictures. At this time, the applications related to video playing and picture viewing in the multiple applications preset in the target operating system are deleted. If the display screen size of the electronic device is large, it means that the electronic device supports the installation of applications for playing videos or viewing pictures. At this time, the above applications related to video playing and picture viewing in the target operating system are retained.
[0149] Furthermore, the above-mentioned image types may specifically include types such as games, business, shopping, sports, and learning. When cropping multiple applications preset in the target operating system, applications containing the above-mentioned image type labels in the multiple applications may be retained. For example, when the image type of the image configuration information of the electronic device includes games, the applications related to games in the multiple applications preset in the target operating system are retained, and when the image type of the image configuration information of the electronic device includes learning, the applications related to learning in the multiple applications preset in the target operating system are retained.
[0150] In the actual application process, the developer can also customize the application list of the target operating system to personalize the application list of the target operating system.
[0151] In the above-mentioned embodiment provided by the present application, when configuring the application list information of the target operating system according to the target parameter configuration table and the image configuration information, the storage information and screen configuration information of the electronic device are determined according to the target parameter configuration table, and the image configuration information is parsed to determine the image type of the image configuration information, and then according to the storage information, screen configuration information and image type, the preset applications in the target operating system are automatically cut and optimized to obtain the corresponding application list information. In this way, the application list information of the target operating system is automatically configured according to the specific configuration information of the electronic device, so that the application list information of the operating system is adapted to the configuration information of the electronic device, the occupied resources of the operating system are reasonably configured, and the customization efficiency of the operating system is improved, thereby improving the production efficiency of the electronic device.
[0152] The embodiment of the second aspect of the present application proposes a method for generating an operating system. The execution subject of the technical solution of the method for generating an operating system provided in the embodiment of the present application can be a generating device for the operating system, which can be determined according to actual use requirements and is not limited in the embodiment of the present application. In order to more clearly describe the method for generating an operating system provided in the embodiment of the present application, the following method embodiment takes the execution subject of the method for generating an operating system as a generating device for the operating system for exemplary description.
[0153] The following, in conjunction with the accompanying drawings, describes in detail the method for generating an operating system provided in the second aspect of the present application through specific embodiments and their application scenarios.
[0154] like Figure 2 As shown, an embodiment of the present application provides a method for generating an operating system, which is applied to an electronic device. The method may include the following steps S202 to S206:
[0155] Step S202: Obtain the target source code in the server.
[0156] The method for generating an operating system provided in the embodiment of the present application is applicable to electronic devices, which may be smart wearable devices, smart home devices, and other electronic devices that require an independent operating system to ensure their user experience. Specifically, the above electronic devices may be smart bracelets, smart watches, wireless headphones, sweeping robots, and other electronic devices, and are not specifically limited here.
[0157] In the embodiment of the present application, when customizing the operating system of an electronic device, operation steps are included in two aspects: the server side and the electronic device side, wherein the server and the electronic device whose operating system needs to be customized can communicate with each other, and the server is the server in the code generation method provided in the first aspect above. On this basis, the target source code is used to indicate the system information after the target operating system is configured.
[0158] When customizing the operating system of an electronic device, for the electronic device, after the server completes the configuration of the target operating system and generates the corresponding target source code, the electronic device obtains the target source code from the server and generates a target operating system that meets its own usage requirements based on the target source code.
[0159] Step S204: Generate a target operating system data packet according to the target source code and local sensitive data.
[0160] Among them, the target source code is a target source code generated by the server after configuring the system information of the target operating system according to the configuration information of the electronic device obtained, integrating the configuration modification of the system information such as resource allocation information, functional module information, operation mode information, calling information of image configuration information, application list information, etc. of the target operating system, thereby including all the above-mentioned modification configuration operations.
[0161] Furthermore, the above-mentioned local sensitive data may specifically include commercial data such as product models and product prices, keys, personalized UI (User Interface) resources, personalized shortcuts, voice wake-up words and other sensitive data.
[0162] Among them, when customizing the operating system of an electronic device, customized desktop, phone, settings and other system applications can be generated based on the personalized UI resources in the above-mentioned local sensitive data.
[0163] Specifically, when customizing the operating system of an electronic device, the electronic device obtains the target source code in the server, and then generates a target operating system data packet that meets its own usage requirements based on the target source code and local sensitive data, so as to generate the target operating system based on the data packet. In this process, there is no transmission of the above-mentioned local sensitive data between the electronic device and the server, that is, the above-mentioned local sensitive data is always stored in the electronic device, which reduces the risk of leakage and improves the safety of the server.
[0164] Step S206: Generate a target operating system according to the target operating system data packet.
[0165] The target operating system data packet is a target operating system data packet generated by the electronic device according to the target source code in the server and local sensitive data and meets the electronic device's own usage requirements.
[0166] In actual application, the electronic device parses the target operating system data packet to generate and install the corresponding target operating system in the electronic device, thereby controlling the operation of the electronic device through the installed target operating system.
[0167] Through the above-mentioned operating system generation method provided by the embodiment of the present application, the customization steps of the operating system are divided into two aspects: the server side and the electronic device side. On the electronic device side, the target source code in the server is obtained; the target operating system data packet is generated according to the target source code and local sensitive data; the target operating system is generated according to the target operating system data packet; wherein the target source code is used to indicate the system information after the target operating system is configured. Through the above-mentioned operating system generation method, when generating the operating system of the electronic device, the server configures the system information of the target operating system according to the configuration information of the electronic device and generates the corresponding target source code, the electronic device obtains the target source code, and generates the target operating system that meets its own usage requirements according to the local sensitive data. In this way, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets its own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device. At the same time, in the above process, the local sensitive data is always stored in the electronic device, reducing the risk of leakage and improving the use safety of the server.
[0168] In the embodiment of the present application, before the above step S206, the above method for generating the operating system may further include the following steps S208 to S212:
[0169] Step S208: Compile the target operating system data package.
[0170] Step S210: Send the compiled target operating system data package to the server for compatibility testing.
[0171] Step S212: adjusting the target operating system data package according to the compatibility test result.
[0172] Specifically, before generating and installing the target operating system in the electronic device according to the target operating system data package, the generated target operating system package is compiled into a form readable by the server, and then the compiled target operating system data package is sent to the server for compatibility testing. On this basis, the target operating system data package is optimized and adjusted according to the compatibility test results, so that the obtained target operating system package meets the compatibility requirements of the server, that is, it is certified by the server.
[0173] On this basis, the electronic device parses the above-mentioned optimized and adjusted target operating system data packet to generate and install the corresponding target operating system in the electronic device, thereby controlling the electronic device through the installed target operating system.
[0174] In the above embodiment provided by the present application, before generating and installing the target operating system according to the target operating system data package, it is also necessary to perform compatibility testing on the obtained target operating system data package in the server, and adjust and optimize the obtained target operating system data package according to the compatibility test result. In this way, the use compatibility of the target operating system is guaranteed, thereby improving the use scope of the target operating system and improving the product competitiveness of the electronic device.
[0175] In addition, it should be noted that the method for generating the above-mentioned operating system proposed in the embodiment of the present application can also be used for the above-mentioned server, that is, the steps of generating the above-mentioned target source code and the steps of generating the target operating system can be implemented in the server at the same time.
[0176] Specifically, when generating an operating system for an electronic device, the server may first modify the preset target operating system according to the configuration information of the electronic device obtained, and generate a corresponding target source code according to the modified target operating system. Furthermore, the server updates the above target source code according to the local sensitive data of the electronic device, and generates a target operating system data packet according to the updated target source code. Furthermore, the server performs a compatibility test on the generated target operating system data packet, and adjusts and optimizes the target operating system data packet according to the compatibility test results to obtain a data installation package for the target operating system. On this basis, the server can send the data installation package of the target operating system to the corresponding electronic device, and after the electronic device parses the above data installation package, it can install the corresponding target operating system in the electronic device, thereby controlling the operation of the electronic device through the installed target operating system.
[0177] The code generation method provided in the embodiment of the first aspect of the present application can be executed by a code generation device. In the embodiment of the present application, the code generation device executing the above code generation method is taken as an example to illustrate the code generation device provided in the embodiment of the third aspect of the present application.
[0178] like Figure 3 As shown, an embodiment of the present application provides a code generation device 300, which is used in a server. The device may include the following acquisition unit 302 and processing unit 304.
[0179] An acquisition unit 302 is used to acquire configuration information of an electronic device;
[0180] Processing unit 304, configured to configure system information of the target operating system according to the configuration information;
[0181] The processing unit 304 is further used to generate a target source code according to the configured system information;
[0182] The configuration information includes the software and hardware parameter configuration information of the electronic device.
[0183] In the code generation device 300 provided in the embodiment of the present application, the configuration information of the electronic device is obtained by the acquisition unit 302; the system information of the target operating system is then configured by the processing unit 304 according to the configuration information; and the target source code is generated by the processing unit 304 according to the configured system information; wherein the configuration information includes the hardware and software parameter configuration information of the electronic device. Through the above-mentioned code generation device 300, when customizing the operating system of the electronic device, the configuration information of the electronic device is obtained by the acquisition unit 302 on the server side, and then the system information of the target operating system preset in the server is configured by the processing unit 304 according to the acquired configuration information, so as to modify the above-mentioned target operating system to an operating system that basically meets the various functions of the electronic device, and generate the corresponding target source code according to the configured system information, so that the electronic device can call the target source code to generate its specific operating system.
[0184] In this way, when generating the operating system of the electronic device, the code generating device 300 on the server side modifies the preset target operating system according to the configuration information of the electronic device obtained, and generates the corresponding target source code according to the modified target operating system, so that the corresponding electronic device can call the target source code to generate its specific operating system. That is, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets their own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device.
[0185] In an embodiment of the present application, the configuration information also includes image configuration information, and the processing unit 304 is specifically used to: update the configuration template according to the image configuration information and the software and hardware parameter configuration information to obtain a target parameter configuration table for the electronic device; configure the resource allocation information of the target operating system according to the target parameter configuration table, and trim the functional modules in the target operating system to configure the functional module information of the operating system; configure the operating mode information of the target operating system according to the image configuration information, and configure the calling information of the image configuration information; configure the application list information of the target operating system according to the target parameter configuration table and the image configuration information; determine the system information after the configuration of the target operating system according to the configured resource allocation information, functional module information, operating mode information, calling information and application list information.
[0186] In the above embodiment provided by the present application, when generating the operating system of the electronic device, on the server side, the target parameter configuration table of the electronic device is generated by the processing unit 304 according to the software and hardware parameter configuration information and the image configuration information of the electronic device, and then the resource allocation information, function module information, operation mode information, calling information of the image configuration information, application list information and other system information of the target operating system are automatically configured quickly according to the target parameter configuration table and / or the image configuration information, and the configuration results of the system information of the target operating system are integrated to generate a target source code including all the above modification configuration operations, so that the electronic device can call the target source code, thereby quickly and conveniently generating the target operating system required by itself. In this way, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets its own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device.
[0187] In an embodiment of the present application, the processing unit 304 can be specifically used to: determine the matching information between the functional modules in the target operating system and the electronic device according to the target parameter configuration table; and delete the functional modules in the target operating system if the electronic device does not support the functional modules in the target operating system.
[0188] In the above embodiment provided by the present application, when the function modules in the target operating system are cut by the processing unit 304, the processing unit 304 determines the matching information between the function modules in the target operating system and the electronic device according to the target parameter configuration table, and then deletes the function modules in the target operating system when the electronic device does not support the function modules in the target operating system. In this way, the function modules of the corresponding operating system are automatically cut and optimized according to the specific function module configuration information of the electronic device, which reduces the memory resources occupied by the generated operating system and improves the customization and modification efficiency of the operating system.
[0189] In an embodiment of the present application, resource allocation information includes memory mode information, and the processing unit 304 can be specifically used to: determine the total amount of memory of the electronic device according to the target parameter configuration table; configure the memory mode information according to the memory range interval where the total amount of memory is located; wherein the memory range interval corresponds to the memory mode information.
[0190] In the above-mentioned embodiment provided by the present application, the resource allocation information includes memory mode information. When the memory resource allocation information of the target operating system is configured by the processing unit 304, the processing unit 304 determines the total memory of the electronic device according to the target parameter configuration table, and then configures the memory mode information of the target operating system according to the memory range interval where the total memory is located, wherein the memory range interval corresponds to the memory mode information. In this way, the memory mode information of the corresponding operating system is automatically configured according to the specific memory information of the electronic device, so that the memory mode information of the target operating system is adapted to the total memory of the electronic device, which optimizes the memory consumption speed of the operating system and improves the customization and modification efficiency of the operating system.
[0191] In the embodiment of the present application, the resource allocation information includes power consumption mode information, and the processing unit 304 can be specifically used to: determine the component configuration information of the electronic device according to the target parameter configuration table; and configure the power consumption mode information according to the component configuration information.
[0192] In the above-mentioned embodiment provided by the present application, the resource allocation information includes the power consumption mode information. When the power resource allocation information of the target operating system is configured by the processing unit 304, the processing unit 304 determines the battery information, sensor information and other component configuration information related to the power consumption of the electronic device according to the target parameter configuration table, and then configures the power consumption mode information of the target operating system according to the component configuration information. In this way, the power consumption mode of the corresponding target operating system is automatically configured according to the component configuration information related to the power consumption of the electronic device, so that the power consumption mode of the target operating system is adapted to the power consumption of the electronic device, the power consumption speed of the operating system is optimized, and the customization and modification efficiency of the operating system is improved.
[0193] In the embodiment of the present application, the component configuration information includes battery information and sensor information, and the processing unit 304 can be specifically used to: when the electronic device does not have a mobile battery, delete the target power consumption mode in the target operating system; when the battery power of the electronic device is within the target range and the electronic device has a positioning sensor, start the target power consumption mode of the target operating system; wherein the target power consumption mode is a power saving mode.
[0194] In the above-mentioned embodiment provided by the present application, when the power consumption mode information of the target operating system is configured according to the component configuration information of the electronic device by the processing unit 304, when the electronic device does not have a mobile battery, the power saving mode in the target operating system is removed, and when the battery power of the electronic device is within the target range and the electronic device has a positioning sensor, the target power consumption mode of the target operating system is turned on. In this way, the power consumption mode of the corresponding operating system is automatically configured according to the component configuration information such as battery information and sensor information related to the power consumption of the electronic device, so that the power consumption mode of the target operating system is adapted to the power consumption of the electronic device, the power consumption mode of the operating system is optimized, and the customization and modification efficiency of the operating system is improved.
[0195] In the embodiment of the present application, the processing unit 304 can be specifically used to: parse the image configuration information and determine the image type of the image configuration information; configure multiple operating mode information of the target operating system according to the image type; wherein the image type and the operating mode information correspond to each other.
[0196] In the above-mentioned embodiment provided by the present application, when the operating mode information of the target operating system is configured through the processing unit 304, the processing unit 304 first parses the image configuration information of the electronic device to determine the image type of the image configuration information, and then automatically configures the operating mode information of the target operating system according to the determined image type, wherein the image type corresponds to the operating mode information. In this way, the operating mode (such as safety mode, children's mode, privacy mode, etc.) of the target operating system is configured in a targeted manner according to the image type corresponding to the image configuration information of the electronic device, thereby ensuring the pertinence and diversity of the operating mode of the operating system, improving the performance of the electronic device, and improving the customization efficiency of the operating system.
[0197] In the embodiment of the present application, the processing unit 304 can be specifically used to: parse the picture configuration information, determine the picture content of the picture configuration information; and configure the calling information of the picture configuration information according to the picture content.
[0198] In the above-mentioned embodiment provided by the present application, when the calling information of the picture configuration information of the electronic device is configured by the processing unit 304, the processing unit 304 determines the picture content of the picture configuration information according to the analysis result of the picture configuration information, and then calls the calling information of the corresponding picture configuration information according to the determined picture content. In this way, the use purpose (such as desktop picture, lock screen picture, application picture, etc.) of the picture configuration information is set according to the specific picture content of the picture configuration information, which ensures the diversity and intelligence of the use of the picture configuration information and improves the use performance of the electronic device.
[0199] In an embodiment of the present application, the processing unit 304 can be specifically used to: determine the storage information and screen configuration information of the electronic device according to the target parameter configuration table; parse the image configuration information to determine the image type of the image configuration information; and crop and optimize the preset applications in the target operating system according to the storage information, screen configuration information and image type to obtain application list information.
[0200] In the above-mentioned embodiment provided by the present application, when the application list information of the target operating system is configured by the processing unit 304 according to the target parameter configuration table and the image configuration information, the processing unit 304 determines the storage information and screen configuration information of the electronic device according to the target parameter configuration table, and parses the image configuration information to determine the image type of the image configuration information, and then automatically cuts and optimizes the preset applications in the target operating system according to the storage information, screen configuration information and image type to obtain the corresponding application list information. In this way, the application list information of the target operating system is automatically configured according to the specific configuration information of the electronic device, so that the application list information of the operating system is adapted to the configuration information of the electronic device, the occupied resources of the operating system are reasonably configured, and the customization efficiency of the operating system is improved, thereby improving the production efficiency of the electronic device.
[0201] The code generation device 300 in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0202] The code generation device 300 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0203] The code generation device 300 provided in the third aspect of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0204] The operating system generation method provided in the embodiment of the second aspect of the present application can be executed by an operating system generation device. In the embodiment of the present application, the operating system generation device executing the above operating system generation method is taken as an example to illustrate the operating system generation device provided in the embodiment of the fourth aspect of the present application.
[0205] like Figure 4 As shown, an embodiment of the present application provides an operating system generation device 400, which is used in an electronic device. The device may include the following acquisition unit 402 and processing unit 404.
[0206] An acquisition unit 402 is used to acquire a target source code in a server;
[0207] The processing unit 404 is used to generate a target operating system data packet according to the target source code and the local sensitive data;
[0208] The processing unit 404 is further used to generate a target operating system according to the target operating system data packet;
[0209] The target source code is used to indicate the system information after the target operating system is configured.
[0210] In the operating system generation device 400 provided in the embodiment of the present application, the target source code in the server is obtained by the acquisition unit 402, and then the target operating system data packet is generated according to the target source code and the local sensitive data by the processing unit 404, and the target operating system is generated according to the target operating system data packet, wherein the target source code is used to indicate the system information after the target operating system is configured. Through the above-mentioned operating system generation device 400, when generating the operating system of the electronic device, after the server cooperates with the target operating system according to the configuration information of the electronic device and generates the corresponding target source code, the target source code is obtained by the acquisition unit 402 at the electronic device end, and the target operating system that meets the use requirements is generated according to the local sensitive data by the processing unit 404. In this way, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets the needs of the developer according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device. At the same time, in the above process, the local sensitive data is always stored in the electronic device, reducing the risk of leakage and improving the use safety of the server.
[0211] In the embodiment of the present application, the processing unit 404 is further used to: compile a target operating system data packet; send the compiled target operating system data packet to the server for compatibility testing; and adjust the target operating system data packet according to the compatibility test results.
[0212] In the above embodiment provided by the present application, before the target operating system is generated and installed according to the target operating system data packet by the processing unit 404, the obtained target operating system data packet needs to be tested for compatibility in the server, and the obtained target operating system data packet is adjusted and optimized according to the compatibility test result. In this way, the compatibility of the target operating system is guaranteed, thereby improving the scope of use of the target operating system and improving the product competitiveness of the electronic device.
[0213] The operating system generation device 400 in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0214] The operating system generating device 400 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0215] The operating system generation device 400 provided in the fourth aspect of the present application can achieve Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0216] Alternatively, if Figure 5As shown, an embodiment of the present application further provides a server 500, including a processor 502 and a memory 504, wherein the memory 504 stores programs or instructions that can be executed on the processor 502, and when the program or instructions are executed by the processor 502, the various steps of the embodiment of the code generation method of the above-mentioned first aspect are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0217] Alternatively, if Figure 6 As shown, an embodiment of the present application further provides an electronic device 600, including a processor 602 and a memory 604, wherein the memory 604 stores programs or instructions that can be executed on the processor 602, and when the program or instructions are executed by the processor 602, the various steps of the embodiment of the method for generating an operating system of the second aspect described above are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described again here.
[0218] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0219] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0220] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710 and other components.
[0221] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0222] The electronic device 700 of the embodiment of the present application can be used to implement the various steps of the embodiment of the code generation method of the first aspect mentioned above.
[0223] The processor 710 is used to obtain configuration information of the electronic device;
[0224] The processor 710 is further configured to configure system information of the target operating system according to the configuration information;
[0225] The processor 710 is further configured to generate a target source code according to the configured system information;
[0226] The configuration information includes the software and hardware parameter configuration information of the electronic device.
[0227] In the embodiment of the present application, the configuration information of the electronic device is obtained through the processor 710; the system information of the target operating system is configured through the processor 710 according to the configuration information; and the target source code is generated through the processor 710 according to the configured system information; wherein the configuration information includes the hardware and software parameter configuration information of the electronic device. Through the above-mentioned electronic device 700, when customizing the operating system of the electronic device, the configuration information of the electronic device is obtained through the processor 710 on the server side, and the system information of the target operating system preset in the server is configured through the processor 710 according to the obtained configuration information, so as to modify the above-mentioned target operating system to an operating system that basically meets the various functions of the electronic device, and generate the corresponding target source code according to the configured system information, so that the electronic device can call the target source code to generate its specific operating system.
[0228] In this way, when generating the operating system of the electronic device, the code generation device on the server side modifies the preset target operating system according to the configuration information of the electronic device obtained, and generates the corresponding target source code according to the modified operating system, so that the corresponding electronic device can call the target source code to generate its specific operating system. That is, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets their own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and thus improving the product competitiveness of the electronic device.
[0229] Optionally, the configuration information also includes image configuration information, and the processor 710 can be specifically used to: update the configuration template according to the image configuration information and the software and hardware parameter configuration information to obtain a target parameter configuration table for the electronic device; configure the resource allocation information of the target operating system according to the target parameter configuration table, and trim the functional modules in the target operating system to configure the functional module information of the operating system; configure the operating mode information of the target operating system according to the image configuration information, and configure the calling information of the image configuration information; configure the application list information of the target operating system according to the target parameter configuration table and the image configuration information; determine the system information after the configuration of the target operating system according to the configured resource allocation information, functional module information, operating mode information, calling information and application list information.
[0230] In the above embodiment provided by the present application, when generating the operating system of the electronic device, on the server side, the processor 710 generates the target parameter configuration table of the electronic device according to the software and hardware parameter configuration information and the image configuration information of the electronic device, and then automatically configures the resource allocation information, function module information, operation mode information, calling information of the image configuration information, application list information and other system information of the target operating system according to the target parameter configuration table and / or the image configuration information, and integrates the above configuration results of the system information of the target operating system to generate a target source code including all the above modification configuration operations, so that the electronic device can call the target source code, thereby quickly and conveniently generating the target operating system required by itself. In this way, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets its own needs according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device.
[0231] Optionally, the processor 710 may be specifically configured to: determine matching information between a functional module in a target operating system and the electronic device according to a target parameter configuration table; and delete the functional module in the target operating system if the electronic device does not support the functional module in the target operating system.
[0232] In the above embodiment provided by the present application, when the function modules in the target operating system are cut by the processor 710, the processor 710 determines the matching information between the function modules in the target operating system and the electronic device according to the target parameter configuration table, and then deletes the function modules in the target operating system when the electronic device does not support the function modules in the target operating system. In this way, the function modules of the corresponding operating system are automatically cut and optimized according to the specific function module configuration information of the electronic device, which reduces the memory resources occupied by the generated operating system and improves the customization and modification efficiency of the operating system.
[0233] Optionally, the resource allocation information includes memory mode information, and the processor 710 can be specifically used to: determine the total memory of the electronic device according to the target parameter configuration table; configure the memory mode information according to the memory range interval where the total memory is located; wherein the memory range interval corresponds to the memory mode information.
[0234] In the above-mentioned embodiment provided by the present application, the resource allocation information includes memory mode information. When the memory resource allocation information of the target operating system is configured by the processor 710, the processor 710 determines the total memory of the electronic device according to the target parameter configuration table, and then configures the memory mode information of the target operating system according to the memory range interval where the total memory is located, wherein the memory range interval corresponds to the memory mode information. In this way, the memory mode information of the corresponding operating system is automatically configured according to the specific memory information of the electronic device, so that the memory mode information of the target operating system is adapted to the total memory of the electronic device, which optimizes the memory consumption speed of the operating system and improves the customization and modification efficiency of the operating system.
[0235] Optionally, the resource allocation information includes power consumption mode information, and the processor 710 may be specifically configured to: determine component configuration information of the electronic device according to the target parameter configuration table; and configure the power consumption mode information according to the component configuration information.
[0236] In the above-mentioned embodiment provided by the present application, the resource allocation information includes power consumption mode information. When the power resource allocation information of the target operating system is configured by the processor 710, the processor 710 determines the battery information, sensor information and other component configuration information related to the power consumption of the electronic device according to the target parameter configuration table, and then configures the power consumption mode information of the target operating system according to the component configuration information. In this way, the power consumption mode of the corresponding operating system is automatically configured according to the component configuration information related to the power consumption of the electronic device, so that the power consumption mode of the target operating system is adapted to the power consumption of the electronic device, the power consumption speed of the operating system is optimized, and the customization and modification efficiency of the operating system is improved.
[0237] Optionally, the component configuration information includes battery information and sensor information, and the processor 710 can be specifically used to: when the electronic device does not have a mobile battery, delete the target power consumption mode in the target operating system; when the battery power of the electronic device is within the target range and the electronic device has a positioning sensor, turn on the target power consumption mode of the target operating system; wherein the target power consumption mode is a power saving mode.
[0238] In the above-mentioned embodiment provided by the present application, when the power consumption mode information of the target operating system is configured by the processor 710 according to the component configuration information of the electronic device, when the electronic device does not have a mobile battery, the power saving mode in the target operating system is removed, and when the battery power of the electronic device is within the target range and the electronic device has a positioning sensor, the target power consumption mode of the target operating system is turned on. In this way, the power consumption mode of the corresponding operating system is automatically configured according to the component configuration information such as battery information and sensor information related to the power consumption of the electronic device, so that the power consumption mode of the target operating system is adapted to the power consumption of the electronic device, the power consumption mode of the operating system is optimized, and the customization and modification efficiency of the operating system is improved.
[0239] Optionally, the processor 710 may be specifically configured to: parse the image configuration information to determine the image type of the image configuration information; configure multiple operation mode information of the target operating system according to the image type; wherein the image type corresponds to the operation mode information.
[0240] In the above-mentioned embodiment provided by the present application, when the operating mode of the target operating system is configured through the processor 710, the processor 710 first parses the image configuration information of the electronic device to determine the image type of the image configuration information, and then automatically configures the operating mode information of the target operating system according to the determined image type, wherein the image type corresponds to the operating mode information. In this way, the operating mode of the target operating system (such as a safe mode, a children's mode, a privacy mode, etc.) is configured in a targeted manner according to the image type corresponding to the image configuration information of the electronic device, thereby ensuring the pertinence and diversity of the operating mode of the operating system, improving the performance of the electronic device, and improving the customization efficiency of the operating system.
[0241] Optionally, the processor 710 may be specifically configured to: parse the picture configuration information to determine the picture content of the picture configuration information; and configure the calling information of the picture configuration information according to the picture content.
[0242] In the above-mentioned embodiment provided by the present application, when the processor 710 configures the calling information of the picture configuration information of the electronic device, the processor 710 determines the picture content of the picture configuration information according to the analysis result of the picture configuration information, and then calls the calling information of the corresponding picture configuration information according to the determined picture content. In this way, the use purpose (such as desktop picture, lock screen picture, application picture, etc.) of the picture configuration information is set according to the specific picture content of the picture configuration information, which ensures the diversity and intelligence of the use of the picture configuration information and improves the use performance of the electronic device.
[0243] Optionally, the processor 710 can be specifically used to: determine the storage information and screen configuration information of the electronic device according to the target parameter configuration table; parse the image configuration information to determine the image type of the image configuration information; and crop and optimize the preset applications in the target operating system according to the storage information, screen configuration information and image type to obtain application list information.
[0244] In the above-mentioned embodiment provided by the present application, when the application list of the target operating system is configured by the processor 710 according to the target parameter configuration table and the image configuration information, the processor 710 determines the storage information and screen configuration information of the electronic device according to the target parameter configuration table, and parses the image configuration information to determine the image type of the image configuration information, and then automatically cuts and optimizes the preset applications in the target operating system according to the storage information, screen configuration information and image type to obtain the corresponding application list information. In this way, the application list information of the target operating system is automatically configured according to the specific configuration information of the electronic device, so that the application list information of the operating system is adapted to the configuration information of the electronic device, the occupied resources of the operating system are reasonably configured, and the customization efficiency of the operating system is improved, thereby improving the production efficiency of the electronic device.
[0245] The electronic device 700 of the embodiment of the present application can also be used to implement the various steps of the embodiment of the method for generating an operating system in the second aspect described above.
[0246] The processor 710 is used to obtain the target source code in the server;
[0247] The processor 710 is further configured to generate a target operating system data packet according to the target source code and the local sensitive data;
[0248] The processor 710 is further configured to generate a target operating system according to a target operating system data packet;
[0249] The target source code is used to indicate the system information after the target operating system is configured.
[0250] In an embodiment of the present application, the target source code in the server is obtained by the processor 710, and then the target operating system data packet is generated by the processor 710 according to the target source code and local sensitive data, and the target operating system is generated according to the target operating system data packet, wherein the target source code is used to indicate the system information after the target operating system is configured. Through the above-mentioned electronic device 700, when generating the operating system of the electronic device, after the server cooperates with the target operating system according to the configuration information of the electronic device and generates the corresponding target source code, the target source code is obtained by the processor 710 at the electronic device end, and the target operating system that meets the use requirements is generated by the processor 710 according to the local sensitive data. In this way, the developer can quickly and automatically generate the basic code of the operating system through the server, and then obtain the operating system that meets the needs of the developer according to the code, which greatly improves the customization efficiency of the operating system and reduces the customization cost of the operating system, thereby reducing the production cost of the electronic device, improving the production efficiency of the electronic device, and then improving the product competitiveness of the electronic device. At the same time, in the above process, the local sensitive data is always stored in the electronic device, reducing the risk of leakage and improving the use safety of the server.
[0251] Optionally, the processor 710 may also be used to: compile a target operating system data packet; send the compiled target operating system data packet to a server for compatibility testing; and adjust the target operating system data packet according to the compatibility testing result.
[0252] In the above embodiment provided by the present application, before the processor 710 generates and installs the target operating system according to the target operating system data packet, it is necessary to perform a compatibility test on the obtained target operating system data packet in the server, and adjust and optimize the obtained target operating system data packet according to the compatibility test result. In this way, the use compatibility of the target operating system is guaranteed, thereby improving the use scope of the target operating system and improving the product competitiveness of the electronic device.
[0253] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0254] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 709 may include a volatile memory or a non-volatile memory, or the memory 709 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0255] The processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 710.
[0256] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the embodiment of the method for generating a code of the first aspect mentioned above are implemented, and the same technical effect can be achieved. Alternatively, when the program or instruction is executed by a processor, the various processes of the embodiment of the method for generating an operating system of the second aspect mentioned above are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
[0257] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0258] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, which is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the embodiment of the code generation method of the first aspect above, and can achieve the same technical effect, or the processor is used to run programs or instructions to implement the various processes of the embodiment of the operating system generation method of the second aspect above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0259] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0260] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the embodiment of the code generation method of the first aspect mentioned above, and can achieve the same technical effect, or the program product is executed by at least one processor to implement the various processes of the embodiment of the operating system generation method of the second aspect mentioned above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0261] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0262] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0263] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for generating a code, characterized in that: The code generation method is used for a server, and the code generation method includes: Obtaining configuration information of the electronic device; Configure system information of the target operating system according to the configuration information; Generate target source code according to the configured system information; Wherein, the configuration information includes software and hardware parameter configuration information of the electronic device; The configuration information also includes picture configuration information, and configuring the system information of the target operating system according to the configuration information specifically includes: Update the configuration template according to the image configuration information and the software and hardware parameter configuration information to obtain a target parameter configuration table of the electronic device; configuring resource allocation information of the target operating system according to the target parameter configuration table, and tailoring functional modules in the target operating system to configure functional module information of the target operating system; Configuring the operation mode information of the target operating system according to the image configuration information, and configuring the calling information of the image configuration information, wherein the image configuration information includes an image type, and the image type corresponds to the operation mode information; Configuring the application list information of the target operating system according to the target parameter configuration table and the picture configuration information specifically includes: determining the storage information and screen configuration information of the electronic device according to the target parameter configuration table; parsing the picture configuration information to determine the picture type of the picture configuration information; and cutting and optimizing the preset applications in the target operating system according to the storage information, the screen configuration information and the picture type to obtain the application list information; The system information after configuration of the target operating system is determined according to the configured resource allocation information, the functional module information, the operating mode information, the calling information and the application list information.
2. The method for generating a code according to claim 1, characterized in that: The tailoring of the functional modules in the target operating system specifically includes: Determining matching information between the functional modules in the target operating system and the electronic device according to the target parameter configuration table; In the case that the electronic device does not support the functional module in the target operating system, the functional module in the target operating system is deleted.
3. The method for generating a code according to claim 1, characterized in that: The resource allocation information includes memory mode information, and the resource allocation information of the target operating system is configured according to the target parameter configuration table, specifically including: Determining the total amount of memory of the electronic device according to the target parameter configuration table; Configuring the memory mode information according to the memory range interval where the total memory is located; The memory range interval corresponds to the memory mode information.
4. The method for generating a code according to claim 1, characterized in that: The resource allocation information includes power consumption mode information, and the resource allocation information of the target operating system is configured according to the target parameter configuration table, and specifically includes: Determining component configuration information of the electronic device according to the target parameter configuration table; The power consumption mode information is configured according to the component configuration information.
5. The method for generating a code according to claim 4, characterized in that: The component configuration information includes battery information and sensor information, and configuring the power consumption mode information according to the component configuration information specifically includes: In the case where the electronic device does not have a mobile battery, deleting the target power consumption mode in the target operating system; When the battery power of the electronic device is within the target range and the electronic device is equipped with a positioning sensor, starting the target power consumption mode of the target operating system; Wherein, the target power consumption mode is a power saving mode.
6. The method for generating a code according to any one of claims 1 to 5, characterized in that: The configuring the operation mode information of the target operating system according to the image configuration information of the electronic device specifically includes: Parsing the picture configuration information to determine the picture type of the picture configuration information; configuring multiple operation mode information of the target operating system according to the image type; The image type corresponds to the operation mode information.
7. The method for generating a code according to any one of claims 1 to 5, characterized in that: The calling information for configuring the picture configuration information specifically includes: Parsing the picture configuration information to determine the picture content of the picture configuration information; The calling information of the picture configuration information is configured according to the picture content.
8. A method for generating an operating system, characterized in that: The method for generating an operating system is used for an electronic device, and the method for generating an operating system includes: Get the target source code from the server; Generate a target operating system data packet according to the target source code and local sensitive data; Generate a target operating system according to the target operating system data packet; Wherein, the target source code is used to indicate the system information after the target operating system is configured; The target source code is generated by the server in the code generation method according to any one of claims 1 to 7.
9. The method for generating an operating system according to claim 8, characterized in that: Before generating the target operating system according to the target operating system data packet, the operating system generating method further includes: Compiling the target operating system data package; Sending the compiled target operating system data packet to the server for compatibility testing; The target operating system data package is adjusted according to the compatibility test result.
10. A code generating device, characterized in that: The code generating device is used in a server, and the code generating device comprises: An acquisition unit, used to acquire configuration information of the electronic device; A processing unit, configured to configure system information of a target operating system according to the configuration information; The processing unit is further used to generate a target source code according to the configured system information; Wherein, the configuration information includes software and hardware parameter configuration information of the electronic device; The configuration information also includes picture configuration information, and the processing unit is specifically used to: update the configuration template according to the picture configuration information and the software and hardware parameter configuration information to obtain a target parameter configuration table of the electronic device; configuring resource allocation information of the target operating system according to the target parameter configuration table, and tailoring functional modules in the target operating system to configure functional module information of the target operating system; Configuring the operation mode information of the target operating system according to the image configuration information, and configuring the calling information of the image configuration information, wherein the image configuration information includes an image type, and the image type corresponds to the operation mode information; Configuring the application list information of the target operating system according to the target parameter configuration table and the picture configuration information specifically includes: determining the storage information and screen configuration information of the electronic device according to the target parameter configuration table; parsing the picture configuration information to determine the picture type of the picture configuration information; and cutting and optimizing the preset applications in the target operating system according to the storage information, the screen configuration information and the picture type to obtain the application list information; The system information after configuration of the target operating system is determined according to the configured resource allocation information, the functional module information, the operating mode information, the calling information and the application list information.
11. A device for generating an operating system, characterized in that: The operating system generation device is used in an electronic device, and the operating system generation device includes: An acquisition unit, used for acquiring target source code in a server; A processing unit, configured to generate a target operating system data packet according to the target source code and local sensitive data; The processing unit is further used to generate a target operating system according to the target operating system data packet; Wherein, the target source code is used to indicate the system information after the target operating system is configured; The target source code is generated by the server in the code generation method according to any one of claims 1 to 7.
12. A server, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the code generation method according to any one of claims 1 to 7 are implemented.
13. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for generating an operating system as claimed in claim 8 or 9 are implemented.
Citation Information
Patent Citations
Operation system customization method, server and mobile terminal
CN107608743A