OEM customization method and device, OEM equipment and computer storage medium
By reserving a customized partition on OEM devices and mounting only the file system, the problem of low customization efficiency of OEM device in existing technologies has been solved, and customization is realized without updating the system software, improving production efficiency and improving production efficiency and improving Resource utilization.
Patent Information
- Application Number
- CN202411193343.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-24
AI Technical Summary
When solving the problem of customization of OEM equipment, the existing technology needs to update the system software, resulting in low production efficiency and large investment in R&D resources.
By reserving a special customized partition (OEM partition) on the OEM device, the customized information is stored in the preset directory format, and the read-only file system is mounted when the device is powered on again to realize the dynamic application of customized information and avoid Modifications to system software.
Achieve the solution of OEM customization problems on the basis of not updating system software, improve production efficiency, reduce investment in R & D resources, and ensure the independence, security and consistency of customized information.
Smart Images

Figure CN119356642A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an OEM customization method, device, OEM equipment and computer storage medium. Background Art
[0002] OEM (Original Equipment Manufacturer) is a kind of embedded system software. System equipment manufacturers often have different OEM requirements, but the equipment manufactured by OEM does not have trademarks, names or logos, so when the equipment flows into the market, agents or sellers need to add or modify the name, trademark or logo of the equipment.
[0003] Currently, most software requirements are based on basic functions and appearance, and new customized software is obtained by adding, deleting, or modifying some functions and factory configurations or UI. This requires R&D resources to recompile and generate OEM system software, and the testing department also needs to invest testing resources to verify it, which affects production efficiency. Summary of the invention
[0004] In order to overcome the deficiencies of the prior art, the present invention provides an OEM customization method, an apparatus, an OEM device and a computer storage medium, which solve the OEM customization problem without updating the system software and improve the production efficiency.
[0005] A first aspect of the present application provides an OEM customization method, the method comprising: Determine the first target customized information required for the first target customer; storing the first target customized information in an OEM partition according to a preset directory format, wherein the OEM partition is a customized partition reserved on the OEM device; When it is detected that the OEM device is powered on again, the read-only file system of the OEM partition is mounted to the OEM directory; Check whether the OEM directory is not empty; When it is determined that the OEM directory is not empty, the initial file in the read-only file system is updated using the first target customization information.
[0006] In an optional implementation, before using the first target customization information to update the initial file in the read-only file system in the OEM partition, the method further includes: Determining an operating mode of the OEM device, the operating mode comprising a factory environment mode and a production environment mode; When it is determined that the working mode is the factory environment mode, performing the operation of updating the initial file in the read-only file system in the OEM partition by using the first target customization information; When it is determined that the working mode is the production environment mode, performing identity authentication on the first target customer; When the verification result is successful and the target key is received, the OEM device is switched from the production environment mode to the working mode.
[0007] In an optional embodiment, the method further comprises: When it is determined that the OEM directory is not empty, loading a necessary driver for the OEM device; After determining that the necessary driver has been loaded, starting the system service function of the OEM device; After determining that the system service function is started, the operation of detecting whether the OEM directory is non-empty is performed.
[0008] In an optional embodiment, the method further comprises: After determining that the system service function is started, controlling the OEM device to enter the system command line; Switching the OEM device from the production environment mode to the factory environment mode according to the system command line; Upload the pre-generated OEM.bin file to the OEM device, and write the OEM.bin file to the OEM partition; When it is determined that the OEM.bin file is written successfully, the system command line is executed to close the factory environment mode, so that the OEM device switches to the production environment mode.
[0009] In an optional embodiment, the method further comprises: Using the mksquashfs tool to package the OEM partition directory into a first image file in a squashfs format, wherein the OEM partition directory includes the first target customized information stored according to the preset directory format; After the first image file is created, the first image file is determined as the OEM.bin file.
[0010] In an optional implementation, before mounting the read-only file system of the OEM partition to the OEM directory, the method further includes: Determining a root file system of the OEM device using a device driver; The root file system is loaded into the root directory.
[0011] In an optional embodiment, the method further comprises: When receiving the second target customization information required to be customized by the second target customer, identifying whether the second target customization information exists in the OEM partition; Creating an incremental update package corresponding to the second target customization information according to the identification result; Determine the working state of the OEM partition, where the working state includes a writable state and a read-only state; When it is determined that the working state is the writable state, copying the incremental update package to the OEM partition; When it is determined that the working state is the read-only state, merging the incremental update package with the image file in the squashfs format of the OEM partition to obtain a second image file; The second image file is written to the OEM partition.
[0012] A second aspect of the present application provides an OEM customization device, the device comprising: A determination module, used to determine the first target customized information required to be formulated by the first target customer; A storage module, used for storing the first target customized information into an OEM partition according to a preset directory format, wherein the OEM partition is a customized partition reserved on the OEM device; A mounting module, used for mounting the read-only file system of the OEM partition to the OEM directory when detecting that the OEM device is powered on again; A detection module, used for detecting whether the OEM directory is not empty; An updating module is used to update the initial file in the read-only file system using the first target customization information when it is determined that the OEM directory is not empty.
[0013] A third aspect of the present application provides an OEM device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the OEM customization method when executing the computer program.
[0014] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned OEM customization method when the computer program is executed by a processor.
[0015] In summary, the OEM customization method, apparatus, OEM device, and computer storage medium provided by the present application ensure the independence and security of customized information by reserving a special customized partition (OEM partition) on the OEM device and storing the customized information in the OEM partition according to a preset directory format. In addition, when the OEM device is powered on again, the read-only file system in the OEM partition is mounted to the OEM directory, ensuring that the system files will not be accidentally modified during operation, thereby improving the stability and security of the system. At the same time, by presenting the customized information to the OEM device in a read-only manner, the consistency and reliability of the customized information are ensured. After mounting the read-only file system, the OEM device will detect whether the OEM directory is non-empty. If it is detected that it is not empty, that is, there is customized information, the customized information is used to update the initial file in the read-only file system, thereby realizing the dynamic application of customized information, so that the OEM device can be personalized according to the specific needs of the customer. In general, by separating customization information from system software, and the updating and application process of customization information is relatively independent and simple, the customization cycle can be greatly shortened and the customization cost can be reduced. At the same time, there is no need to modify or recompile the system software, so that when receiving different customization requirements from different customers, OEM customization problems can be solved without updating the system software, effectively reducing R&D resource investment, reusing system software, quickly forming new orders, and significantly improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of an OEM customization method shown in an embodiment of the present application; Figure 2 This is a second flow chart of an OEM customization method shown in an embodiment of the present application; Figure 3 is a flow chart of a method for switching working modes of OEM equipment shown in an embodiment of the present application; Figure 4 is a flow chart of a method for generating an OEM.bin file shown in an embodiment of the present application; Figure 5 This is the third flow chart of an OEM customization method shown in the embodiment of the present application; Figure 6 is an example diagram of an OEM customization method shown in an embodiment of the present application; Figure 7 It is a functional module diagram of an OEM customization device shown in an embodiment of the present application; Figure 8 It is a structural schematic diagram of an OEM device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0018] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.
[0019] Reference Figure 1 As shown, it is a flow chart of an OEM customization method shown in an embodiment of the present application, and the OEM customization method includes the following steps.
[0020] S11, determining the first target customized information required by the first target customer.
[0021] Since the information required by each customer may be different, the information required by the customer can be obtained in advance before the OEM equipment is completed and shipped. This information is called customized information. The customized information may include, but is not limited to: customized function files and customized configuration information.
[0022] During the customization process, a custom partition is first reserved on the OEM device as the OEM partition to store function and information customization data, that is, customized function files and customized configuration information, such as customized web pages, account password configuration, display or hiding of specific functions, etc.
[0023] S12: storing the first target customized information into an OEM partition according to a preset directory format, where the OEM partition is a customized partition reserved on the OEM device.
[0024] When the first target customized information customized by the first target customer is received, the first target customized information is stored in the OEM partition according to the preset directory format. Specifically, the storage directory format of each customized information in the first target customized information is determined, each customized information in the first target customized information and its corresponding storage directory format are traversed, the storage directory format of the OEM partition is set according to the storage directory format corresponding to the customized information, and the customized information is stored in the OEM partition according to the storage directory format corresponding to the customized information. Exemplarily, the web page data directory of the OEM system software is / www / html, then the customized web page information stored in the OEM partition is also stored as / www / html, and for another example, the default account of the OEM device is stored in / default.conf, and the default configuration file of the OEM partition is also stored as / default.conf.
[0025] Through the above optional implementation, the storage directory format of customized information in the OEM partition is consistent with the device operating system or software environment, which is easy to integrate and manage, so that OEM devices can more easily provide customized software and data for different customers without worrying about compatibility issues.
[0026] S13, when it is detected that the OEM device is powered on again, the read-only file system of the OEM partition is mounted to the OEM directory.
[0027] Refer to Figure 2 , when the customer's customized information has been stored in the OEM partition according to the preset directory format, it is necessary to drive the OEM device to power on again and enter the hardware initialization and self-test to ensure the normal operation of the hardware device. After the hardware self-test is completed, the BIOS / UEFI will load the boot program (such as GRUB, LILO, etc.) from the preset boot device (such as hard disk, USB drive, network, etc.). The boot program loads the operating system kernel into the memory. After the kernel is started, a series of initialization operations will be performed, including memory management, device driver loading, file system initialization, etc., to prepare for mounting the root file system and other system services. After confirming that the OEM device has been started, the read-only file system of the OEM partition is mounted to a specific directory (such as the OEM directory) in read-only mode to prevent the customer process from tampering with the customized information.
[0028] Through the above optional implementation, the automated process after the OEM device is powered on again ensures the effective application of the customized information in the OEM partition. Secondly, the stable startup of the system is ensured through the hardware self-check and the correct loading of the BIOS / UEFI boot program. Subsequently, the kernel starts and initializes key system services, especially mounting the read-only file system of the OEM partition to the OEM directory, so that the customized information can be accessed and applied at the initial startup of the OEM device, which improves the flexibility and customization capabilities of the system.
[0029] In an optional implementation, before mounting the read-only file system of the OEM partition to the OEM directory, the method further includes: Determining a root file system of the OEM device using a device driver; The root file system is loaded into the root directory.
[0030] In some embodiments, the kernel finds the device storing the root file system through the device driver according to the preset parameters (such as the startup parameters passed by GRUB) or the information in the configuration file (such as / etc / fstab). Then, the kernel checks the file system type on the device (such as ext4, xfs, etc.), creates a new root file system instance, and allocates memory and resources to it. Finally, the root file system is mounted to the specified mount point (usually " / "), that is, the root file system is mounted to the root directory, so that the kernel can access the files and directories therein.
[0031] Furthermore, the OEM device mounts the read-only file system (e.g., squashfs file system) in the OEM partition to the OEM directory (i.e., the / OEM directory) to ensure that the OEM device can access the customized information stored in the OEM partition. Through the above optional implementation, the OEM device root file system is accurately located through the OEM device driver, and is safely mounted, and then the OEM partition read-only file system is loaded to the OEM directory, which enhances the flexibility and customization of the system, while ensuring the secure access to OEM information and improving the reliability and stability of system startup.
[0032] S14, detecting whether the OEM directory is not empty.
[0033] In order to determine whether the customized information in the OEM partition is ready, if the first target customized information of the first target customer is being customized, it is necessary to determine whether the first target customized information is ready, and it is necessary to determine whether the OEM directory exists, that is, to determine whether the OEM directory is not empty. If the OEM directory exists, it indicates that there is OEM data (first target customized information) that needs to be processed, and step S15 is executed; if the OEM directory does not exist, it may indicate that the OEM device is started for the first time or the OEM partition is not configured.
[0034] In an optional embodiment, the method further comprises: When it is determined that the OEM directory is not empty, loading a necessary driver for the OEM device; After determining that the necessary driver has been loaded, starting the system service function of the OEM device; After determining that the system service function is started, the operation of detecting whether the OEM directory is non-empty is performed.
[0035] Refer to Figure 2 In some embodiments, when it is determined that the OEM directory is not non-empty, the OEM device performs system startup system operations, including loading necessary drivers and starting system service functions. Specifically, after confirming that the OEM device can continue to be started, according to the same embodiment as the above step S13, the OEM device driver system starts to load necessary hardware drivers. These drivers are necessary for the normal operation of the system and are used to communicate and control hardware devices. After the driver is loaded, the system starts to start various services, including network services, file system services, customer authentication services, etc., to provide the system with necessary background support and functions. In the process of starting the system service function, the system will first start the core services that do not depend on other services, and then gradually start other dependent services. The system completes all initial startup related operations, including completing the initial configuration of the device, starting the necessary customer interface components, etc. When all initial startup operations are completed, the system startup process ends and the OEM device enters a normal operating state. At this point, you can start using the OEM device to execute various applications and services.
[0036] When the OEM device is started, you can re-execute the operation of mounting the file system and mounting the read-only system in the OEM partition to the OEM directory, and determine whether the OEM directory is not empty, until the customized information in the OEM directory is updated to complete the initial file in the read-only file system.
[0037] S15: When it is determined that the OEM directory is not empty, the initial file in the read-only file system is updated using the first target customization information.
[0038] When it is determined that the OEM directory is not empty, it means that there is customized information that needs to be loaded. The OEM device uses overlay technology to mount the customized information (first target customized information) in the OEM partition as upperdir of rootfs in read-only mode, that is, the first target customized information overwrites the initial file of the read-only file system, so that the first target customized information updates the initial file. Among them, overlay technology is a file system technology that allows changes in one file system (called "upperdir") to be superimposed on another file system (called "lowerdir") without any modification to lowerdir. It can maintain the integrity and stability of the basic system (lowerdir) while allowing flexible customization in the upper layer (upperdir).
[0039] For example, assume that the configuration file ( / OEM / default.conf) of the customer's login account is stored in the OEM partition. After the overlay operation is performed, the embedded system software will overwrite the system default configuration file / default.conf with the file containing the custom account information. When the system reads the login account, it will use the login account in the custom partition for verification.
[0040] Refer to Figure 2 , after completing the customization and updating of the first target customized information, the OEM device performs a system startup operation.
[0041] Through the above optional implementation, the customized information in the OEM directory can be flexibly overlaid on the system through overlay technology without modifying the original read-only file system, thus realizing flexible customization of the system configuration. This not only ensures the integrity and stability of the underlying file system of the system, but also supports the rapid deployment and application of upper-level customized information, enhances the maintainability and user experience of the system, and enables the system to more flexibly meet the diverse needs of customers.
[0042] In an optional implementation, before using the first target customization information to update the initial file in the file system in the OEM partition, the method further includes: Determining an operating mode of the OEM device, the operating mode comprising a factory environment mode and a production environment mode; When it is determined that the working mode is the factory environment mode, performing the operation of updating the initial file in the read-only file system in the OEM partition by using the first target customization information; When it is determined that the working mode is the production environment mode, performing identity authentication on the first target customer; When the verification result is successful and the target key is received, the OEM device is switched from the production environment mode to the working mode.
[0043] In some embodiments, in order to protect the OEM data (customized information) in the OEM device from unauthorized modification, two working modes are pre-set for the OEM device, namely the factory environment mode and the production environment mode. Among them, the factory environment mode is a special mode used under the control of the production line or manufacturer, which is used to perform key operations including OEM partition erasure, firmware update, configuration adjustment, etc. In the factory environment mode, the OEM device allows write operations to sensitive areas such as the OEM partition, but needs to be activated by entering specific instructions or keys to ensure that only authorized personnel can perform these operations. The production environment mode is the state of the OEM device after it is delivered to the customer. In the production environment mode, the OEM device is generally only allowed to perform operations required for daily use by the customer, and modifications to key areas such as the OEM partition are prohibited to prevent customers or third parties from modifying OEM data without authorization, thereby protecting the stability and security of the OEM device.
[0044] Therefore, when the first target customized information is required to overwrite the initial file in the read-only file system in the OEM partition, the working mode of the OEM device can be obtained to determine whether the OEM device is in the factory environment mode or the production environment mode. When it is determined that the OEM device is in the factory environment mode, it means that the OEM device allows the write operation to the OEM partition, and at this time, the first target customized information can be directly used to update the initial file in the read-only file system. When it is determined that the OEM device is in the production environment mode, it means that the OEM device does not allow the write operation to the OEM partition, and at this time, the OEM device needs to be switched from the production environment mode to the factory environment mode. Specifically, the OEM device first needs to authenticate the first target customer to ensure that the first target customer is a customer who is allowed to perform the write operation of the OEM partition. When the first target customer's identity authentication is passed, a one-time key (target key) needs to be generated based on the identity of the first target customer. When the OEM device receives the target key input by the first target customer, the key is verified using the built-in key verification algorithm to ensure the authenticity and validity of the key. When it is determined that the target key is correct, the OEM device performs the switching of the working mode so that the OEM device switches from the production environment mode to the factory environment mode. Once the working mode switch is completed, further modifications to the OEM partition are immediately locked unless the authentication and key verification process is passed again.
[0045] Through the above optional implementation, by introducing the distinction between factory environment mode and production environment mode, the security and controllability of OEM equipment at different stages are ensured. In the factory environment mode, modifications to the OEM partition are allowed to facilitate customized production; while in the production environment mode, modifications are strictly restricted to protect the stability and security of OEM equipment. Through identity authentication and key verification mechanisms, security is further enhanced to prevent unauthorized access and modification, providing reliable protection for the customized production and use of OEM equipment.
[0046] In an optional embodiment, the method further comprises: After determining that the system service function is started, controlling the OEM device to enter the system command line; Switching the OEM device from the production environment mode to the factory environment mode according to the system command line; Upload the pre-generated OEM.bin file to the OEM device, and write the OEM.bin file to the OEM partition; When it is determined that the OEM.bin file is written successfully, the system command line is executed to close the factory environment mode, so that the OEM device switches to the production environment mode.
[0047] Refer to Figure 3 In some embodiments, after the OEM device completes the system startup, the customer uses the command line interface to switch the OEM device from the default production environment mode to the factory environment mode, so that the customer can perform the write operation of the OEM partition. When it is determined that the OEM device has successfully switched to the factory environment mode, the pre-generated OEM.bin file is uploaded to the OEM device, and the flash command is executed to write the OEM.bin file to the OEM partition as read only. After the writing of the OEM.bin file is completed, the OEM device executes the command to close the factory environment mode, so that the OEM device is restored to the production environment mode when it leaves the factory.
[0048] In an optional embodiment, the method further comprises: Using the mksquashfs tool to package the OEM partition directory into a first image file in a squashfs format, wherein the OEM partition directory includes the first target customized information stored according to the preset directory format; After the first image file is created, the first image file is determined as the OEM.bin file.
[0049] Refer to Figure 4, when receiving the customized information that the customer needs to customize, it is necessary to start making the image file of the OEM partition. Specifically, according to the same embodiment as step S12, the OEM device first organizes and stores the customized information in the directory format required by the system software, such as placing it in a specific path (such as / www / html / logo), ensuring the structure and order of the customized information, and then uses the mksquashfs tool to package the organized OEM partition directory into an image file (first image file) in squashfs format. It should be noted that the OEM partition directory includes the first target customized information stored according to the preset directory format. The mksquashfs tool will recursively traverse the OEM directory, include all files, subdirectories and their metadata (such as file permissions, owners, timestamps, etc.) included in the OEM directory, and compress them into a single and read-only squashfs image, that is, the first image file. In addition to using the mksquashfs tool, the OEM device can also use jffs2 or other formats, the most important of which is that squashfs has a high compression ratio and has a read-only feature. After the first image file is created, the first image file is named OEM.bin file.
[0050] In some embodiments, after the OEM device is restored to the production environment mode, the OEM partition is immediately locked to prevent unauthorized modification, thereby further improving the security of the system.
[0051] Through the above optional implementation, through flexible working mode switching, customers are supported to safely customize the OEM partition content in the factory environment mode. The mksquashfs tool is used to efficiently package the OEM partition into an OEM.bin file in squashfs format, ensuring a high file compression ratio and read-only, enhancing system security and storage efficiency. At the same time, customers are allowed to switch back to the production environment mode when needed, ensuring the safe, controllable and efficient customization of OEM devices at different stages.
[0052] In an optional embodiment, the method further comprises: When receiving the second target customization information required to be customized by the second target customer, identifying whether the second target customization information exists in the OEM partition; Creating an incremental update package corresponding to the second target customization information according to the identification result; Determine the working state of the OEM partition, where the working state includes a writable state and a read-only state; When it is determined that the working state is the writable state, copying the incremental update package to the OEM partition; When it is determined that the working state is the read-only state, merging the incremental update package with the image file in the squashfs format of the OEM partition to obtain a second image file; The second image file is written to the OEM partition.
[0053] In some embodiments, when the same OEM device receives customized information (second target customized information) that needs to be customized by the second target user, it is first necessary to determine whether the second target customized information has been stored in the OEM partition. When it is determined that the OEM partition has stored the second target customized information, it means that the second target customized information has been customized. When it is determined that the OEM partition does not store at least one of the customized information in the second target customized information, it means that the second target customized information that is not stored has not been customized, so the second target customized information that is not stored in the OEM partition is integrated into an incremental update package, and the second target customized information in the incremental update package is stored in the OEM partition according to a preset format, so that the initial file in the read-only file system or the customized live broadcast information can be updated later according to the second target customized information in the incremental update package. When it is necessary to write the second target customized information in the incremental update package to the OEM partition, it is also necessary to determine the working state of the OEM partition to determine whether the OEM partition is in a writable state or a read-only state. When it is determined that the OEM partition is in a writable state, the OEM device can directly copy the second target customized information in the incremental update package to the OEM partition. When it is determined that the OEM partition is in a read-only state, the OEM device uses the unsquashfs tool or other similar tools to decompress the existing squashfs image into a temporary directory, and copies the second target customization information in the incremental update package to the decompressed temporary directory to overwrite the initial files in the temporary directory. Then, the mksquashfs tool or other similar tools are used to repackage the temporary directory merged with the incremental update package into a new squashfs image (second image file), and the second image file is written to the OEM partition.
[0054] Through the above optional implementation, the incremental update mechanism effectively reduces the amount of data and time for OEM partition updates, and improves customization efficiency. At the same time, the incremental update package is flexibly processed according to the read and write status of the OEM partition, ensuring data consistency and system stability. Secondly, it also supports multiple rounds of customization, which is convenient for customers to gradually adjust the functions and configurations of OEM devices according to their needs.
[0055] Refer to Figure 5In some embodiments, in order to prevent the customized information from being tampered with, the OEM information data file (customized information) that the customer wants to customize is organized according to the overlayfs directory format, including confirming the file structure, permissions and dependencies, ensuring that the OEM information data file meets the requirements of overlayfs, and then using compression tools (such as tar, gzip, etc.) to package the OEM information data file into a compressed file to reduce storage space usage and speed up transmission. During OEM customization, it is also necessary to ensure that the OEM device is in factory environment mode. In factory environment mode, the OEM device identifies and mounts the OEM partition to a specific directory (such as / OEM) of the root file system, and uses the network, interface or other methods to transfer the compressed OEM information data file to the OEM device, and decompress it in the OEM directory, and update the decompressed OEM information data file to the OEM directory. When the update of the OEM information data file is completed, the OEM device restarts and automatically enters the production environment mode. In production environment mode, the OEM device will run according to the OEM configuration corresponding to the production environment mode. After the OEM device starts, the contents of the OEM partition are read and loaded as part of the system configuration. If the OEM partition contains customized data, the OEM device uses overlayfs technology to overwrite the customized data on the initial file of the system software in a read-only manner, allowing OEM customization to be achieved using the customized data without modifying the original file. The OEM device then continues the initialization process and completes system startup using the new OEM data (customized data).
[0056] In an embodiment of the present application, first, according to the requirements and functions of the OEM device, an OEM partition for storing customer customized information is created, and the directory structure of the OEM partition is designed. Then, you can also choose to select a suitable file system to manage the OEM partition, such as ext4, squashfs, etc. Configuring overlay technology on the OEM device usually includes one or more lower directories and an upper directory, and using the mount command or other tools to mount the overlay file system to a directory in the system. When mounting, you need to specify the path of the lower directory and the upper directory, as well as a working directory (Workdir) for storing metadata of the overlay file system. Further, according to customer needs, prepare corresponding customized data, such as the web page logo of customer A, the web page logo of customer B, and login account information, and deploy the customized data to the upper directory of the OEM partition. Since this application uses a read-only file system such as squashfs, it is necessary to first decompress the original image, modify it, and then repackage it. By comparing the old and new contents of the OEM partition, only the changed files or directories are copied to the upper directory of the OEM partition, or the squashfs image is updated, which significantly improves the efficiency and flexibility of OEM device updates and reduces unnecessary data transmission and storage space usage. When the update is completed, restart the OEM device to make the new OEM partition configuration effective. For example, assuming that customer A only requires to modify the webpage logo, it is only necessary to store customer A's logo in the OEM partition; assuming that customer B needs to modify the webpage logo and change the login password, it is only necessary to store customer B's logo and the login account information required by customer B in the OEM partition. The OEM customization provided by this application is flexible and convenient and can be adjusted as needed. Therefore, even when receiving different customization requirements from different customers, it is only necessary to write the customer's customized information into the OEM partition and overwrite the initial file in the file system with the customized information. There is no need to modify the system software, which effectively reduces the investment in R&D resources, reuses the system software, and quickly forms new orders. Even in the face of high-frequency customization needs, it only needs to be controlled by OEM partition data, which greatly improves R&D and production efficiency.
[0057] In order to facilitate understanding of the inventive concept of the present application, an example is given below to describe the practical application of the embodiment of the present application. Figure 6, take file3 as an example, assuming that file3 in the lowerdir_1 layer (file3 in the dark box on the third row) is the logo file of customer A of the OEM agent / seller, and when the agent / seller needs to sell the OEM device carrying file3 to another customer B, customer B also has a logo requirement. At this time, you only need to upload customer B's logo file and overwrite it to the file3 directory in the upper directory of the OEM partition. There is no need to modify the code logic. After the OEM device is restarted, file3 in the merged directory after overlay will be used as the logo file, thereby achieving OEM customization of replacing the logo.
[0058] Reference Figure 7 The figure shows a functional module diagram of an OEM customization device according to an embodiment of the present application.
[0059] In some embodiments, the OEM customization device 70 may include a plurality of functional modules composed of computer program segments. The computer programs of the various program segments of the OEM customization device 70 may be stored in the memory of the OEM device and executed by at least one processor to perform (see Figure 1 Description) OEM customized function.
[0060] In this embodiment, the OEM customization device 70 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a determination module 701, a storage module 702, a mounting module 703, a detection module 704, an update module 705 and a switching module 706. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can perform fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0061] The determination module 701 is used to determine the first target customized information that needs to be formulated for the first target customer.
[0062] The storage module 702 is used to store the first target customized information into an OEM partition according to a preset directory format, where the OEM partition is a customized partition reserved on an OEM device.
[0063] The mounting module 703 is used to mount the read-only file system of the OEM partition to the OEM directory when it is detected that the OEM device is powered on again.
[0064] The detection module 704 is used to detect whether the OEM directory is not empty.
[0065] The updating module 705 is configured to update the initial file in the read-only file system using the first target customization information when it is determined that the OEM directory is not empty.
[0066] The switching module 706 is used to: determine the working mode of the OEM device, the working mode including the factory environment mode and the production environment mode; when the working mode is determined to be the factory environment mode, perform the operation of updating the initial file in the read-only file system in the OEM partition using the first target customization information; when the working mode is determined to be the production environment mode, authenticate the first target customer; when the verification result is successful and the target key is received, switch the OEM device from the production environment mode to the working mode.
[0067] The detection module 704 is also used to: when it is determined that the OEM directory is not non-empty, load the necessary driver of the OEM device; after it is determined that the necessary driver has been loaded, start the system service function of the OEM device; after it is determined that the system service function has been started, perform the operation of detecting whether the OEM directory is non-empty.
[0068] The switching module 706 is also used to: after determining that the system service function is started, control the OEM device to enter the system command line; switch the OEM device from the production environment mode to the factory environment mode according to the system command line; upload the pre-generated OEM.bin file to the OEM device, and write the OEM.bin file to the OEM partition; when determining that the OEM.bin file is written successfully, execute the system command line to close the factory environment mode, so that the OEM device switches to the production environment mode.
[0069] The determination module 701 is further used to: use the mksquashfs tool to package the OEM partition directory into a first image file in squashfs format, wherein the OEM partition directory includes the first target customization information stored according to the preset directory format; after the first image file is produced, determine the first image file as the OEM.bin file.
[0070] The mounting module 703 is further used to: determine the root file system of the OEM device using the device driver; and load the root file system into the root directory.
[0071] The update module 705 is also used for: when receiving the second target customization information that needs to be customized by the second target customer, identifying whether the OEM partition has the second target customization information; creating an incremental update package corresponding to the second target customization information according to the identification result; determining the working status of the OEM partition, the working status including a writable status and a read-only status; when it is determined that the working status is the writable status, copying the incremental update package to the OEM partition; when it is determined that the working status is the read-only status, merging the incremental update package with the image file in the squashfs format of the OEM partition to obtain a second image file; and writing the second image file to the OEM partition.
[0072] It should be understood that the various variations and specific embodiments of the OEM customization method provided in the above embodiments are also applicable to the OEM customization device of this embodiment. Through the above detailed description of the OEM customization method, those skilled in the art can clearly know the implementation method of the OEM customization device in this embodiment. For the sake of brevity of the specification, it will not be described in detail here.
[0073] See also Figure 8 FIG. 8 is a schematic diagram of the structure of the OEM device shown in the embodiment of the present application. In a preferred embodiment of the present application, the OEM device 8 includes a memory 81 , at least one processor 82 and at least one communication bus 83 .
[0074] Those skilled in the art should understand that Figure 8 The structure of the OEM device shown does not constitute a limitation of the embodiments of the present application, and can be either a bus structure or a star structure. The OEM device 8 can also include more or less other hardware or software than shown in the figure, or a different component arrangement.
[0075] In some embodiments, the OEM device 8 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The OEM device 8 may also include customer devices, which include but are not limited to any electronic product that can interact with customers through keyboards, mice, remote controls, touch pads, or voice-controlled devices, such as personal computers, tablet computers, smart phones, digital cameras, etc.
[0076] In the above embodiments provided in the present application, it should be understood that the disclosed methods, devices, computer-readable storage media, and OEM equipment can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or components or modules, which can be electrical, mechanical or other forms.
[0077] The components described as separate components may or may not be physically separated, and the components shown as components may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0078] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0079] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0080] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0081] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0082] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. An OEM customization method, characterized in that: The method comprises: Determine the first target customized information required for the first target customer; storing the first target customized information in an OEM partition according to a preset directory format, wherein the OEM partition is a customized partition reserved on the OEM device; When it is detected that the OEM device is powered on again, the read-only file system of the OEM partition is mounted to the OEM directory; Check whether the OEM directory is not empty; When it is determined that the OEM directory is not empty, the initial file in the read-only file system is updated using the first target customization information.
2. The OEM customization method according to claim 1, characterized in that: Before updating the initial file in the read-only file system in the OEM partition using the first target customization information, the method further includes: Determining an operating mode of the OEM device, the operating mode comprising a factory environment mode and a production environment mode; When it is determined that the working mode is the factory environment mode, performing the operation of updating the initial file in the read-only file system in the OEM partition by using the first target customization information; When it is determined that the working mode is the production environment mode, performing identity authentication on the first target customer; When the verification result is successful and the target key is received, the OEM device is switched from the production environment mode to the working mode.
3. The OEM customization method according to claim 2, characterized in that: The method further comprises: When it is determined that the OEM directory is not empty, loading a necessary driver for the OEM device; After determining that the necessary driver has been loaded, starting the system service function of the OEM device; After determining that the system service function is started, the operation of detecting whether the OEM directory is non-empty is performed.
4. The OEM customization method according to claim 3, characterized in that: The method further comprises: After determining that the system service function is started, controlling the OEM device to enter the system command line; Switching the OEM device from the production environment mode to the factory environment mode according to the system command line; Upload the pre-generated OEM.bin file to the OEM device, and write the OEM.bin file to the OEM partition; When it is determined that the OEM.bin file is written successfully, the system command line is executed to close the factory environment mode, so that the OEM device switches to the production environment mode.
5. The OEM customization method according to claim 4, characterized in that: The method further comprises: Using the mksquashfs tool to package the OEM partition directory into a first image file in a squashfs format, wherein the OEM partition directory includes the first target customized information stored according to the preset directory format; After the first image file is created, the first image file is determined as the OEM.bin file.
6. The OEM customization method according to claim 1, characterized in that: Before mounting the read-only file system of the OEM partition to the OEM directory, the method further includes: Determining a root file system of the OEM device using a device driver; The root file system is loaded into the root directory.
7. The OEM customization method according to any one of claims 1 to 6, characterized in that: The method further comprises: When receiving the second target customization information required to be customized by the second target customer, identifying whether the second target customization information exists in the OEM partition; Creating an incremental update package corresponding to the second target customization information according to the identification result; Determine the working state of the OEM partition, where the working state includes a writable state and a read-only state; When it is determined that the working state is the writable state, copying the incremental update package to the OEM partition; When it is determined that the working state is the read-only state, merging the incremental update package with the image file in the squashfs format of the OEM partition to obtain a second image file; The second image file is written to the OEM partition.
8. An OEM customized device, characterized in that: The device comprises: A determination module, used to determine the first target customized information required to be formulated by the first target customer; A storage module, used for storing the first target customized information into an OEM partition according to a preset directory format, wherein the OEM partition is a customized partition reserved on the OEM device; A mounting module, used for mounting the read-only file system of the OEM partition to the OEM directory when detecting that the OEM device is powered on again; A detection module, used for detecting whether the OEM directory is not empty; An updating module is used to update the initial file in the read-only file system using the first target customization information when it is determined that the OEM directory is not empty.
9. An OEM device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the OEM customization method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the OEM customization method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Android starting method supporting multi-client differentiated customization
CN121387390A