Loading method of resource file of motor, electronic equipment and storage medium
By obtaining and verifying the motor attribute information when the electronic device is started and determining the loading path, the problem of loading resource files of different models of motors is solved to ensure the normal operation of the motor and the improvement of user experience.
Patent Information
- Application Number
- CN202410007287.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-01-02
AI Technical Summary
In the prior art, electronic devices use the same motor frame to load motor resource files when they are powered on and started, and cannot adaptively load motor resource files of different models, resulting in the motor being unable to work normally and affecting the user experience.
By obtaining motor attribute information when the electronic device is started, determining its legality, and determining the loading path of resource files based on the motor's power chip manufacturer information and attribute information, ensuring adaptive loading of motor resource files of different models.
It effectively avoids the problem that the motor cannot work normally, improves the user experience, and ensures the full performance of the motor.
Smart Images

Figure CN119248362A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent terminals, and in particular to a method for loading a resource file of a motor, an electronic device, and a storage medium. Background Art
[0002] At present, the vibration reminder function of electronic devices is realized by the vibration of the motor in the electronic device. When the electronic device is turned on, it is necessary to load the resource file of the motor in the electronic device, so that the motor can be controlled to work normally based on the loaded motor resource file during the use of the electronic device. Usually, the same motor framework (which can be called motor service) is used to load the resource file of the motor when the electronic device is turned on, but when different models of electronic devices use motors of different manufacturers, different types and / or different sizes, the motor framework cannot adaptively load the motor resource files of different models of electronic devices, which may cause the motor of the electronic device to not work properly, affecting the user experience. Summary of the invention
[0003] In the related art, the same motor framework is used to load the motor resource file when the electronic device is turned on. The motor resource files of electronic devices of different models cannot be adaptively loaded, which may cause the motor of the electronic device to not work properly and affect the user experience.
[0004] The embodiments of the present application provide a method for loading a motor resource file, an electronic device, and a storage medium, which can meet the demand for loading a motor resource file according to motor attribute information, so that the performance of the motor can be fully utilized and the user experience can be improved.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, the present application provides a method for loading a resource file of a motor, which is applied to an electronic device, and the method includes:
[0007] When the electronic device is started, obtaining motor attribute information and determining the legitimacy of the motor attribute information;
[0008] If the motor attribute information is legal, obtain the power chip manufacturer information of the motor;
[0009] Based on the power chip manufacturer information and motor attribute information of the motor, a first target loading path for loading the resource file of the motor is determined.
[0010] Based on the technical solution provided by the above embodiment, when the electronic device is started, the motor attribute information is obtained, and when the motor attribute information is legal, the power chip manufacturer information of the motor is obtained. And according to the power chip manufacturer information of the motor and the motor attribute information, the first target loading path for loading the resource file of the motor is determined. Since the basis for determining the first target loading path includes the motor attribute information, the motor resource files of electronic devices of different models can be adaptively loaded according to the first target loading path, so as to avoid the motor of the electronic device from not being able to work properly and improve the user experience.
[0011] In a possible design manner of the first aspect, determining the legitimacy of the motor attribute information includes:
[0012] In a case where the motor attribute information includes motor manufacturer information, motor type information, and motor size information, it is determined that the motor attribute information is legal.
[0013] Based on the above scheme, the legality of the motor attribute information can be accurately determined by judging that the motor attribute information includes motor manufacturer information, motor type information and motor size information.
[0014] In a possible design of the first aspect, when the electronic device is started, obtaining motor property information includes:
[0015] When the electronic device starts, the motor kernel driver is loaded;
[0016] Read the motor model from the motor device description file, parse the motor model, and obtain the motor attribute information.
[0017] Based on the above scheme, when the motor model is included in the motor device description file of the electronic device, the motor kernel driver can be loaded when the electronic device is started, and the motor model can be read from the motor device description file when the motor kernel driver is loaded, and the motor model can be parsed to accurately obtain the motor attribute information.
[0018] In a possible design of the first aspect, before obtaining the power chip manufacturer information of the motor, the method further includes: when loading the motor core driver, the motor core driver obtains the power chip manufacturer information of the motor from the motor auxiliary driver;
[0019] If the motor attribute information is legal, obtain the motor power chip manufacturer information, including:
[0020] When the motor attribute information is legal, the power chip manufacturer information of the motor is obtained from the motor core driver.
[0021] Based on the above solution, before obtaining the power chip manufacturer information of the motor, when loading the motor core driver, the motor core driver obtains the power chip manufacturer information of the motor from the motor auxiliary driver. In this way, the motor core driver can obtain the power chip manufacturer information of the motor from the motor core driver if the motor attribute information is legal.
[0022] In a possible design of the first aspect, based on the power chip manufacturer information and motor attribute information of the motor, determining a first target loading path for loading the resource file of the motor includes:
[0023] Acquire multiple groups of first loading paths; the path names of the first loading paths include motor attribute information;
[0024] Based on the power chip manufacturer information and the motor attribute information of the motor, a first target loading path for loading the resource file of the motor is determined from the plurality of groups of first loading paths.
[0025] Based on the above scheme, when the first loading path corresponding to the motor's power chip manufacturer information and motor attribute information is included in multiple groups of first loading paths, the first loading path corresponding to the motor's power chip manufacturer information and motor attribute information can be accurately determined as the first target loading path.
[0026] In a possible design manner of the first aspect, the method further includes:
[0027] When loading the motor core driver, the motor core driver obtains the motor's resonant frequency information from the motor auxiliary driver;
[0028] When the motor attribute information is illegal, the motor resonant frequency information and the motor power chip manufacturer information are obtained from the motor core driver;
[0029] Based on the resonant frequency information of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor is determined.
[0030] Based on the above scheme, when loading the motor core driver, the motor core driver obtains the motor's resonant frequency information from the motor auxiliary driver. In this way, it can be ensured that when the motor attribute information is illegal, the motor's resonant frequency information and the motor's power chip manufacturer information can be obtained from the motor core driver. Furthermore, based on the motor's resonant frequency information and the motor's power chip manufacturer information, the second target loading path for loading the motor's resource file can be determined, thereby completing the loading of the resource file under the second loading path.
[0031] In a possible design of the first aspect, determining a second target loading path for loading a resource file of the motor based on the resonant frequency information of the motor and the manufacturer information of the power chip of the motor includes:
[0032] determining the type of the motor based on the resonant frequency information of the motor;
[0033] Based on the type of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor is determined.
[0034] Based on the above technical solution, the specific type of the motor can be determined according to the resonance yield information of the motor, and then the second target loading path for loading the resource file of the motor can be accurately determined according to the specific class type of the motor and the power chip manufacturer information of the motor, thereby completing the loading of the resource file under the second loading path.
[0035] In a possible design of the first aspect, based on the type of the motor and the manufacturer information of the power chip of the motor, determining a second target loading path for loading the resource file of the motor includes:
[0036] Acquire multiple sets of second loading paths; the names of the second loading paths do not include motor attribute information;
[0037] Based on the type of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor is determined from the plurality of groups of second loading paths.
[0038] Based on the above technical solution, when the second loading paths corresponding to the motor type and the motor power chip manufacturer information are included in multiple groups of second loading paths, the second loading paths corresponding to the motor type and the motor power chip manufacturer information can be accurately determined as the first target loading path.
[0039] In a possible design manner of the first aspect, before obtaining the motor attribute information, the method further includes:
[0040] Determine the validity of motor frequency files in electronic equipment;
[0041] Get motor property information, including:
[0042] When the motor frequency file is valid, obtain the motor attribute information.
[0043] Based on the above technical solution, the validity of the motor frequency file in the electronic device can be determined first, and the motor attribute information can be obtained when the motor frequency file is valid, so as to avoid obtaining the motor attribute information when the motor frequency file in the electronic device is invalid, thereby causing unnecessary overhead.
[0044] In a second aspect, the present application provides an electronic device, comprising: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a method for loading a resource file of a motor as provided in the first aspect and any possible design method thereof.
[0045] In a third aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes a method for loading a resource file of a motor as provided in the first aspect and any possible design method thereof.
[0046] In a fourth aspect, the present application provides a computer program product comprising executable instructions, which, when executed on an electronic device, enables the electronic device to execute a method for loading a resource file of a motor as provided in the first aspect and any possible design thereof.
[0047] In a fifth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the second aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.
[0048] It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the second to fifth aspects provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic block diagram of a resource file for loading a motor provided in an embodiment of the present application;
[0050] Figure 2 A schematic block diagram of another resource file for loading a motor provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0053] Figure 5A flowchart of a method for loading a resource file of a motor provided in an embodiment of the present application;
[0054] Figure 6 A flowchart of another method for loading a motor resource file provided in an embodiment of the present application;
[0055] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0056] Figure 8 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of an association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0058] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0059] The terms "first" and "second" in the following embodiments of the present application are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.
[0060] With the development of electronic equipment technology, motors of various types, manufacturers and sizes have been widely used in electronic equipment to realize the vibration reminder function of electronic equipment. Usually, when the electronic equipment is turned on, it is necessary to load resource files of motors of different types, manufacturers or sizes according to different resource file loading paths so that the electronic equipment can realize the vibration reminder function.
[0061] Currently, the resource files of the motor may include a vibration description file, a motor algorithm file, and a vibration sequence file of the whole system vibration. The vibration description file includes the power chip manufacturer information of the motor, product customization attributes, and motor algorithm parameters. In some examples, if the motor type is an x-axis linear motor, the vibration description file includes the x-axis motor algorithm parameters; if the motor type is a z-axis linear motor, the vibration description file includes the z-axis motor algorithm parameters.
[0062] In some examples, the loading path of the motor resource file in the electronic device can be determined based on the power chip manufacturer information of the motor. The description information of part of the motor vibration data can be generated based on the product customization attributes, motor algorithm parameters and the motor algorithm library in the motor framework.
[0063] In some embodiments, if the motor type is an x-axis linear motor and the motor chip manufacturer is vendor1, the vibration description file includes vendor1 / vibrator_desc_x.xml; if the motor type is an x-axis linear motor and the motor chip manufacturer is vendor2, the vibration description file may include vendor2 / vibrator_desc_x.xml. Among them, the manufacturer of the power chip can be determined as vendor1 through the file directory vendor1 in vendor1 / vibrator_desc_x.xml. The manufacturer of the power chip can be determined as vendor2 through the file directory vendor2 in vendor2 / vibrator_desc_x.xml. Product customization attributes and motor algorithm parameters can be obtained by parsing vibrator_desc_x.xml in vendor1 / vibrator_desc_x.xml and / or vendor2 / vibrator_desc_x.xml.
[0064] In some embodiments, if the motor type is a z-axis linear motor and the motor chip manufacturer is vendor1, the vibration description file may include vendor1 / vibrator_desc_z.xml; if the motor type is a z-axis linear motor and the motor chip manufacturer is vendor2, the vibration description file may include Vendor2 / vibrator_desc_z.xml. Among them, the manufacturer of the power chip can be determined to be vendor1 through the file directory vendor1 in vendor1 / vibrator_desc_z.xml. The manufacturer of the power chip can be determined to be vendor2 through the file directory vendor2 in vendor2 / vibrator_desc_z.xml. Product customization attributes and motor algorithm parameters can be obtained by parsing the vibrator_desc_z.xml in Vendor1 / vibrator_desc_z.xml and / or Vendor2 / vibrator_desc_z.xml. The embodiment of the present application does not limit the motor type, and only takes the vibration description file containing the x-axis linear motor and the z-axis linear motor as an example for exemplary description.
[0065] In some embodiments, if the motor type is an x-axis linear motor, the vibration sequence file containing the vibration of the x-axis whole system may include vibrator_slices_config_x.xml; the algorithm file containing the x-axis motor may include libHapticPlayerTwoKit_x.so and libHapticPlayerOneKit_x.so. If the motor type is a z-axis linear motor, the vibration sequence file for the z-axis whole system vibration may include vibrator_slices_config_z.xml; the file containing the z-axis motor algorithm may include libHapticPlayerTwoKit_z.so and libHapticPlayerOneKit_z.so. The embodiment of the present application does not limit the motor type, and only takes the vibration sequence file containing the x-axis whole system vibration, the vibration sequence file containing the z-axis whole system vibration as an example, the algorithm file containing the x-axis motor, and the algorithm file containing the z-axis motor as an example for exemplary description.
[0066] Figure 1 A schematic block diagram of a resource file for loading a motor provided in an embodiment of the present application. Figure 1 As shown, the loading of the motor resource file can be achieved through the mutual interaction between the motor framework 10 of the HAL layer (hardware abstraction layer) (user mode) and the first motor kernel driver 11 and the second motor kernel driver 12 of the kernel layer.
[0067] Among them, the motor framework 10 includes a parsing module 101 and a vibration algorithm library 102. The parsing module 101 is used to parse the corresponding resource file according to the loading path of the motor resource file, and interact with the vibration algorithm library 102 to output the parsed product customization attributes and motor algorithm parameters to the vibration algorithm library 102. The vibration algorithm library 102 is used to process the product customization attributes and motor algorithm parameters, and output the description information of part of the motor vibration data to the parsing module 101. The first motor core driver 11 can be a motor core driver developed by an electronic device manufacturer, and when the first motor core driver 11 is loaded, the resonant frequency information of the motor and the power chip manufacturer information of the motor can be read from the second motor core driver 12. The second motor core driver 12 can be a third-party motor core driver that stores the resonant frequency information of the motor and the power chip manufacturer information of the motor. The second motor core driver 12 includes the resonant frequency description of the motor and the power chip manufacturer information of the motor.
[0068] Combine the following Figure 1 The method of loading the resource file of the motor is exemplified.
[0069] In the disclosed embodiment, when the electronic device is powered on and the first motor core driver 11 is loaded, the first motor core driver 11 reads the power chip manufacturer information of the motor and the resonant frequency information of the motor from the second motor core driver 12 (② corresponding interaction). When the motor framework 10 is started, the motor framework 10 reads the power chip manufacturer information of the motor and the resonant frequency information of the motor from the first motor core driver 11 (① corresponding interaction), and determines the loading path of the resource file of the motor based on the power chip manufacturer information of the motor and the resonant frequency information of the motor, so as to load the resource file under the loading path.
[0070] In the embodiment of the present application, the HAL layer in the electronic device can store multiple groups of resource file loading paths, and can select a corresponding group of loading paths from the multiple groups of resource file loading paths according to the power chip manufacturer information of the motor and the resonant frequency information of the motor. In some examples, the HAL layer in the electronic device may include the following three groups of resource file loading paths.
[0071] The loading path of the first set of resource files:
[0072] / odm / etc / vibrator / vendor1 / vibrator_desc_x.xml
[0073] / odm / etc / vibrator / vendor2 / vibrator_desc_x.xml
[0074] / odm / etc / vibrator / vibrator_slices_config_x.xml
[0075] / odm / lib64 / libHapticPlayerTwoKit_x.so
[0076] / odm / lib64 / libHapticPlayerOneKit_x.so
[0077] The loading path of the second set of resource files:
[0078] / odm / etc / vibrator / vendor1 / vibrator_desc_z.xml
[0079] / odm / etc / vibrator / vendor2 / vibrator_desc_z.xml
[0080] / odm / etc / vibrator / vibrator_slices_config_z.xml
[0081] / odm / lib64 / libHapticPlayerTwoKit_z.so
[0082] / odm / lib64 / libHapticPlayerOneKit_z.so
[0083] The loading path of the third set of resource files:
[0084] / odm / etc / vibrator / vibrator_desc.xml
[0085] / odm / etc / vibrator / vibrator_effect_config.xml
[0086] In the embodiment of the present application, the type of the motor can be determined according to the resonant frequency information of the motor, and the loading path of the first group of resource files, the loading path of the second group of resource files, or the loading path of the third group of resource files can be selected according to the type of the motor.
[0087] If the motor type is an x-axis linear motor, select the loading path of the first group of resource files; if the motor type is a z-axis linear motor, select the loading path of the second group of resource files; if the motor type is a flat motor, select the loading path of the third group of resource files.
[0088] In some embodiments, the loading path of the first set of resource files and the loading path of the second set of resource files are both loading paths of resource files of linear motors. Since the above-mentioned linear motor includes two power chip manufacturers, and the loading paths of the first set of resource files and the second set of resource files both include vibration description files corresponding to the power chip manufacturers of the two motors (e.g., vendor1 and vendor2), therefore, after determining the loading path of the first set of resource files according to the linear motor being an x-axis linear motor, or determining the loading path of the second set of resource files according to the linear motor being a z-axis linear motor, it is also necessary to determine the loading path of the vibration description file in the resource file of the motor according to the power chip manufacturer information of the motor.
[0089] If the motor is an x-axis linear motor and the manufacturer of the motor power chip is vendor1, the loading path of the motor description file is determined to be / odm / etc / vibrator / vendor1 / vibrator_desc_x.xml. If the motor is a z-axis linear motor and the manufacturer of the motor power chip is vendor1, the loading path of the motor description file is determined to be / odm / etc / vibrator / vendor1 / vibrator_desc_z.xml. If the motor is an x-axis linear motor and the manufacturer of the motor power chip is vendor2, the loading path of the motor description file is determined to be / odm / etc / vibrator / vendor2 / vibrator_desc_x.xml. If the motor is a z-axis linear motor and the manufacturer of the motor power chip is vendor2, the loading path of the motor description file is determined to be / odm / etc / vibrator / vendor2 / vibrator_desc_z.xml.
[0090] pass Figure 1 As can be seen from the above analysis, for a variety of different electronic devices (which may include motors of different manufacturers, different types and / or different sizes), when the electronic device is turned on, the same motor framework is used to determine the loading path of the corresponding resource file based on the motor's resonant frequency information and the motor's power chip manufacturer information to load the corresponding motor resource file. However, when different models of electronic devices use motors of different manufacturers, different types and / or different sizes, the motor framework cannot adaptively load the motor resource files of different models of electronic devices, which may cause the motor of the electronic device to not work properly, affecting the user experience.
[0091] In view of the above problems, the embodiment of the present application provides a method for loading a resource file of a motor, which can be applied to an electronic device. In this technical solution, the motor kernel driver (such as Figure 1When the first motor kernel driver 11) in is loaded, the power chip manufacturer information of the motor, the resonant frequency information of the motor and the pre-stored motor model for representing the motor attributes are read, and the motor model is parsed to obtain the motor attribute information. When the motor framework of the electronic device is started, the loading path of the motor resource file is obtained from the motor kernel driver and determined according to the motor attribute information, the power chip manufacturer information of the motor and the resonant frequency of the motor, so as to load the corresponding resource file. In this way, it can not only meet the demand of adaptively loading the resource file of the motor according to the motor attribute information, but also be compatible with the loading of the resource file of the motor that does not have the motor attribute requirements. It can prevent the motor of the electronic device from not working properly and improve the user experience.
[0092] The technical solution provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0093] Figure 2 A schematic block diagram of another method for loading a motor resource file provided in an embodiment of the present application. Figure 2 As shown, the loading of the motor resource file can be achieved through the mutual interaction between the motor framework 10 of the HAL layer, the first motor kernel driver 11 of the kernel layer, the second motor kernel driver 12 and the motor device description file 13.
[0094] Among them, and Figure 1 Similarly, the motor framework 10 includes a parsing module 101 and a vibration algorithm library 102. The parsing module 101 is used to parse the corresponding resource file according to the loading path of the motor resource file, and interact with the vibration algorithm library 102 to output the parsed product customization attributes and motor algorithm parameters to the vibration algorithm library 102. The vibration algorithm library 102 is used to process the product customization attributes and motor algorithm parameters, and output the description information of part of the motor vibration data to the parsing module 101. The first motor kernel driver 11 can be a motor kernel driver developed by an electronic equipment manufacturer. The second motor kernel driver 12 can be a third-party motor kernel driver that stores the resonant frequency information of the motor and the power chip manufacturer information of the motor. The second motor kernel driver 12 includes the resonant frequency description of the motor and the power chip manufacturer information of the motor. The motor device description file 13 may include the motor model (which can be composed of the size description of the motor, the type description of the motor, and the manufacturer description of the motor).
[0095] In some examples, the motor model number may be x_manufacturer1_0809.
[0096] Among them, the x in the motor model x_manufacturer1_0809 indicates that the motor type is an x-axis linear motor; the manufacturer1 in the motor model x_manufacturer1_0809 indicates that the manufacturer of the motor is the manufacturer name corresponding to manufacturer1; and the 0809 in the motor model x_manufacturer1_0809 indicates that the size of the motor is the size corresponding to 0809.
[0097] In other examples, the motor model number may be z_manufacturer2_9595.
[0098] Among them, the z in the motor model z_manufacturer2_9595 indicates that the motor type is a z-axis linear motor; the manufacturer2 in the motor model z_manufacturer2_9595 indicates that the manufacturer of the motor is the manufacturer name corresponding to manufacturer2; and the 0809 in the motor model x_manufacturer1_0809 indicates that the size of the motor is the size corresponding to 0809.
[0099] In the disclosed embodiment, when loading the first motor core driver 11 , not only the motor's resonant frequency information and the motor's power chip manufacturer information can be read from the second motor core driver 12 , but also the motor model can be read from the motor core description file 13 .
[0100] Combine the following Figure 2 The method of loading the resource file of the motor is exemplified.
[0101] In the disclosed embodiment, when the electronic device is powered on and the first motor core driver 11 is loaded, the first motor core driver 11 reads the power chip manufacturer information and the resonant frequency information of the motor from the second motor core driver 12 (② corresponding interaction), reads the motor model from the motor device description file 13 (④ corresponding interaction), and parses the motor model to obtain the motor's attribute information (including the motor's size information, the motor's manufacturer information, and the motor's type information). When the motor framework 10 is started, the motor framework 10 reads the power chip manufacturer information, the resonant frequency information of the motor, the size information of the motor, the manufacturer information of the motor, and the type information of the motor from the first motor core driver 11, and determines the loading path of the resource file of the motor based on the power chip manufacturer information, the resonant frequency information of the motor, the size information of the motor, the manufacturer information of the motor, and the type information of the motor, so as to load the corresponding resource file. Among them, ① the corresponding interaction is that the motor frame 10 reads the motor's power chip manufacturer information and the motor's resonant frequency information from the motor core driver 11; ③ the corresponding interaction can be that the motor frame 10 reads the motor's size information, motor manufacturer information and motor type information from the motor core driver 11.
[0102] pass Figure 2 It can be seen that when the motor framework is loaded, the loading path of the corresponding resource file can be determined according to the motor's resonant frequency information, the motor's power chip manufacturer information and the motor attribute information to load the corresponding motor's resource file. In this way, it can not only meet the requirements of loading the motor's resource file according to the motor attribute information, but also be compatible with the loading of the motor's resource file that does not have the motor attribute requirements. Thus, the performance of the motor can be fully utilized and the user experience can be improved.
[0103] In the present application, the above-mentioned electronic device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., which adopts a multi-battery series system to supply power. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
[0104] Take the example of a mobile phone being an electronic device. Figure 3 A schematic structural diagram of an electronic device provided in the present application is shown.
[0105] Reference Figure 3As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display screen 193, a subscriber identification module (SIM) card interface 194, and a camera 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0106] The processor 110 may include one or more processing units, for example, the processor 110 may include an AP, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0107] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0108] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In the embodiment of the present application, the processor may be a SOC.
[0109] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an I2C interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0110] The charging management module 140 is used to receive charging input from a power supply device (such as a charger, a laptop, etc.). The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device.
[0111] While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141. The battery 142 can be composed of multiple batteries connected in series. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
[0112] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 193, the camera 195, and the wireless communication module 160. The power management module 141 can also be used to monitor the voltage, current, battery cycle number, battery health status (leakage, impedance) and other parameters of the battery 142. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device, for example, the power management module 141 and the charging management module 140 can be different functional modules in the same chip.
[0113] In the embodiment of the present application, the power management module 141 and / or the charging management module 140 may include a fast charging chip. The power management module 141 and / or the charging management module 140 may use the fast charging chip to realize high-power charging of the battery. In the fast charging chip, there will be corresponding multiple registers for different types of data to store corresponding ADC data.
[0114] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0115] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
[0116] A touch sensor is also called a "touch control device". The touch sensor can be arranged on the display screen 193. The touch sensor and the display screen 193 form a touch screen, also called a "touch control screen". The touch sensor is used to monitor touch operations acting on or near it. The touch sensor can pass the monitored touch operations to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 193. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device, which is different from the position of the display screen 193.
[0117] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 193. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. When a touch operation is applied to the display screen 193, the electronic device monitors the touch operation intensity according to the pressure sensor. The electronic device can also calculate the touch position based on the monitoring signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0118] A temperature sensor is a device used to measure the temperature of an environment or object. It can convert temperature into electrical signals or digital signals so that the temperature can be read and processed by computers or other electronic devices.
[0119] Gyroscope (GYRO-sensor), also known as ground sensor or gyro sensor, has a traditional structure with a gyroscope inside. A three-axis gyroscope can simultaneously measure the position, movement trajectory, and acceleration in six directions. A single-axis gyroscope can only measure quantities in two directions, that is, a system requires three gyroscopes, and a three-axis gyroscope can replace three single-axis gyroscopes. The working principle of a three-axis gyroscope is to measure the angle between the vertical axis of the gyroscope rotor and the device in a three-dimensional coordinate system, and calculate the angular velocity, and use the angle and angular velocity to determine the motion state of the object in three-dimensional space. A three-axis gyroscope can simultaneously measure six directions, including up, down, left, right, front, and back (the composite direction can also be decomposed into three-axis coordinates), and finally determine the movement trajectory and acceleration of the device. In other words, the three-axis gyroscope determines the current motion state of the device by measuring its own rotation state, such as forward, backward, upward, downward, left, or right; whether it is accelerating (angular velocity) or decelerating (angular velocity), etc. In the embodiment of the present application, the gyro sensor in the electronic device is a three-axis gyro sensor. The electronic device can determine the position or area on the electronic device corresponding to the heating feedback operation performed by the user based on the detection data of the gyro sensor.
[0120] The electronic device implements the display function through a GPU, a display screen 193, and an application processor. The GPU is a microprocessor for image editing, connecting the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0121] The electronic device can realize the shooting function through ISP, camera 195, video codec, GPU, display screen 193 and application processor.
[0122] ISP is used to process data fed back by camera 195. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and brightness of the image. ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, ISP can be set in camera 195. Camera 195 is used to capture still images or videos. In some embodiments, the electronic device may include 1 or N cameras, where N is a positive integer greater than 1. Camera 195 can be a front camera or a rear camera.
[0123] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.
[0124] The display screen 193 is used to display images, videos, etc. The display screen 193 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniLED, microLed, micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 193, where N is a positive integer greater than 1.
[0125] In an embodiment of the present application, the display screen 193 can be used to display the interface of the electronic device (for example, a camera preview interface, a video preview interface, a finished film preview interface, etc.), and display images taken from any one or more cameras 195 in the interface.
[0126] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.
[0127] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.
[0128] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0129] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0130] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0131] The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device by inserting it into or removing it from the SIM card interface 194. The electronic device can support one or more SIM card interfaces. The SIM card interface 194 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The SIM card interface 194 can also be compatible with external memory cards. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.
[0132] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0133] Of course, it is understandable that the above Figure 4 The figure is only an exemplary description when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a personal computer (PC), a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include Figure 3 The structure shown in the figure is less than Figure 3 More structures are shown in the figure, which are not limited here.
[0134] It is understandable that, in general, the realization of electronic device functions requires the support of hardware and the cooperation of software. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.
[0135] Figure 4 A schematic diagram of a layered architecture of a software system of an electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces (such as APIs).
[0136] In some examples, reference Figure 5 As shown, in an embodiment of the present application, the software of the electronic device is divided into five layers, namely, from top to bottom, an application layer, a framework layer (or called an application framework layer), a system library and an Android runtime (android runtime), a HAL layer (hardware abstraction layer) and a driver layer (or called a kernel layer).
[0137] The application layer can include a series of applications. Figure 5 As shown, the application layer may include applications (APP) such as camera, gallery, calendar, map, WLAN, Bluetooth, music, video, short message, call, contact, live broadcast, etc. Among them, the call application and contact may be factory preset in the electronic device, or may be a third-party application for user calls provided by the application market.
[0138] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include an activity manager, a window manager, an audio service, a camera service, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc., and the embodiments of the present application do not impose any restrictions on this.
[0139] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0140] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0141] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0142] The phone manager is used to provide communication functions of the electronic device. For example, the phone manager can manage the call status of the call application (including initiation, connection, hang up, etc.).
[0143] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0144] The system library can include multiple functional modules. For example: surface manager, media libraries, OpenGL ES, SGL, etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. SGL is a drawing engine for 2D drawing.
[0145] The Android runtime includes the core library and the ART virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the ART virtual machine. The ART virtual machine executes the Java files of the application layer and the application framework layer as binary files. The ART virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0146] The HAL layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The HAL layer provides a standard interface to display device hardware functions to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as: audio HAL audio module, bluetooth HAL Bluetooth module, camera HAL camera module, sensors HAL sensor module (or Isensor service, sensor service).
[0147] In the embodiment of the present application, the HAL layer may include: Figure 1 or Figure 2 The motor framework 10 shown in the figure determines the absolute path of the resource file of the motor when the motor framework 10 is started, so as to load the resource file under the absolute path.
[0148] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, battery driver, etc., which are not limited in this application.
[0149] In the present application examples, reference Figure 2 As shown, the core layer may also include a motor core driver 11, a motor core driver 12, and a product customization module 13. For example, the motor core driver 11 may be a core driver developed by an electronic device manufacturer, and the motor core driver 12 may be a third-party core driver. This embodiment of the application is not limited to this.
[0150] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure.
[0151] Based on the above hardware architecture and software architecture, a method for loading a resource file of a motor provided in an embodiment of the present application is introduced.
[0152] Based on the above hardware architecture and software structure, the following combination Figure 5 , a method for loading a resource file of a motor provided in an embodiment of the present application is described in detail, and the method can be used in an electronic device. Figure 5 As shown, the method for loading the resource file of the motor provided in the embodiment of the present application may include steps 501 to S505:
[0153] Step S501 : when the electronic device is started and the motor core driver in the electronic device is loaded, the motor core driver obtains motor loading information.
[0154] For example, reference Figure 1 or Figure 2 As shown, the motor core driver may correspond to the first motor core driver 11 , that is, the motor core driver is a core driver developed by the electronic equipment manufacturer.
[0155] Exemplarily, the motor loading information refers to the information required to determine the loading path of the motor's resource file. In some examples, the motor loading information can be determined according to the loading requirements of the motor's resource file. For example, if the loading requirements of the motor's resource file do not require the motor's resource file to be loaded according to the motor attribute information, the motor loading information may include the motor's resonant frequency information and the motor's power chip manufacturer information. For another example, if the loading requirements of the motor's resource file require the motor's resource file to be loaded according to the motor attribute information, the motor loading information may include the motor attribute information corresponding to the motor model, the motor's resonant frequency information, and the motor's power chip manufacturer information.
[0156] For example, reference Figure 2 As shown, the requirement for loading the motor resource file can be determined according to whether the motor model has been set (or added) in the motor device description file 13 of the electronic device. In some examples, if the motor model is not set in the motor device description file 13 of the electronic device, the requirement for loading the motor resource file can be determined as not requiring the motor resource file to be loaded according to the motor attribute information; if the motor model has been set in the motor device description file 13 of the electronic device, the requirement for loading the motor resource file can be determined as requiring the motor resource file to be loaded according to the motor attribute information.
[0157] Exemplarily, the motor model may be added to the motor device description file before the electronic device leaves the factory, and the motor model in the motor description file may be read when the motor kernel driver is loaded.
[0158] For example, reference Figure 2 As shown, when the electronic device is started and the first motor kernel driver 11 is loaded (the electronic device runs in the kernel state), the motor model can be obtained from the motor device description file 13 (corresponding to the third-party motor kernel driver), and the motor signal can be parsed to obtain the motor attribute information. The motor power chip manufacturer information and the motor resonant frequency information are obtained from the second motor kernel driver 12 to obtain the motor loading information.
[0159] Step S502: when the motor framework in the electronic device is loaded, determine whether the electronic device includes a motor frequency file.
[0160] If the electronic device does not include the motor frequency file, then continue to execute step S505 to determine that the type of the motor is a flat motor; if the electronic device includes the motor frequency file, then continue to execute step S503 to determine that the type of the motor is a linear motor.
[0161] Exemplarily, the motor frequency file may be a file for storing the resonant frequency of the motor. In some examples, the motor frequency file may be set in the electronic device and can be accessed when the electronic device runs in the user mode.
[0162] For example, reference Figure 1 or Figure 2 As shown, when the first motor core driver 11 is loaded, the motor frame 10 can be loaded, and when the motor frame 10 is loaded, a query instruction is used to query whether the electronic device includes a motor frequency file.
[0163] In some examples, if the return information of the query instruction indicates that the electronic device does not include a motor frequency file, the type of the motor is determined to be a flat motor, and step S505 is executed to obtain the power chip manufacturer information of the motor, and the loading path of the motor resource file is determined based on the motor type and the power chip manufacturer information of the motor. If the return information of the query instruction indicates that the electronic device includes a motor frequency file, the type of the motor is determined to be a linear motor, and step S503 is executed to determine the legality of the motor attribute information in the motor loading information. When the motor attribute information is illegal, the loading path of the motor resource file is determined based on the read motor power chip manufacturer information and the motor resonant frequency information. When the motor attribute is legal, the loading path of the motor resource file is determined based on the read motor loading information and the motor power chip manufacturer information.
[0164] In other examples, if the return information of the query instruction indicates that the electronic device includes a motor resonance frequency file, the current resonance frequency of the motor can be further read to determine the validity of the current resonance frequency of the motor. If the current resonance frequency of the motor is invalid, the type of the motor is determined to be a flat motor; if the current resonance frequency of the motor is valid, the type of the motor is determined to be a linear motor.
[0165] Step S503 , determining that the type of the motor is a linear motor, obtaining motor attribute information in the motor loading information from the motor kernel driver, and determining the legitimacy of the motor attribute information.
[0166] If the motor attribute information is illegal, continue to execute step S504 to read the motor's resonant frequency information; if the motor attribute information is legal, continue to execute step S506 to obtain the motor's power chip manufacturer information in the motor loading information from the motor core driver.
[0167] For example, reference Figure 2As shown, whether the motor attribute information is legal refers to whether the motor model is included in the motor device description file 13 of the electronic device. In some examples, if the motor model is included in the motor device description file 13, the motor attribute information is determined to be legal; if the motor model is not included in the motor device description file 13, the motor attribute information is determined to be illegal. In other examples, if the motor model is not included in the motor device description file 13, the motor attribute information is determined to be legal; if the motor model is included in the motor device description file 13, the motor attribute information is determined to be illegal. The embodiment of the present application is not specifically limited by comparison. The embodiment of the present application takes the example that the motor device description file includes the motor model, and the motor attribute information is determined to be legal; the motor device description file does not include the motor model, and the motor attribute information is determined to be illegal.
[0168] For example, reference Figure 2 As shown, when the motor frame 10 determines that the type of the motor is a linear motor, the motor attribute information can be read from the first motor core driver 11, and whether the motor attribute information is legal can be determined based on the reading result. In some examples, if the reading result is that the motor attribute information can be read from the first motor core driver 11, the motor attribute information is determined to be legal, that is, the motor device description file 13 includes the motor model; if the reading result is that the motor attribute information cannot be read from the first motor core driver 11, the motor attribute information is determined to be illegal, that is, the motor device description file 13 does not include the motor model.
[0169] Step S504, reading the resonant frequency information of the motor, and determining the type of the motor based on the resonant frequency information of the motor.
[0170] Exemplarily, when the motor framework determines that the motor attribute information is illegal, it can continue to read the motor's resonant frequency information from the motor core driver, and determine the target frequency range of the motor's resonant frequency based on the read motor's resonant frequency information, and determine the type of motor based on the target frequency range of the motor's resonant frequency.
[0171] In some examples, the resonant frequency ranges of different types of linear motors may be different. For example, the resonant frequency range of the x-axis linear motor may be frequency range 1; the resonant frequency range of the y-axis linear motor may be frequency range 2; and the resonant frequency range of the z-axis linear motor may be frequency range 3. Among them, frequency range 1, frequency range 2, and frequency range 3 do not overlap with each other.
[0172] Exemplarily, an implementation method for determining the target frequency range of the resonant frequency of the motor based on the read resonant frequency information of the motor may be to determine multiple resonant frequency ranges corresponding to multiple types of linear motors, determine the frequency range in which the resonant frequency of the motor is located in the multiple resonant frequency ranges as the target frequency range, and determine the type of motor corresponding to the target frequency slope range as the type of motor.
[0173] Step S505, determining that the motor type is a flat motor, reading the power chip manufacturer information of the motor, and determining the target loading path of the motor resource file based on the motor type and the power chip manufacturer information of the motor.
[0174] In some examples, multiple groups of resource file loading paths may be set at the HAL layer of the electronic device before the electronic device leaves the factory. The multiple groups of resource file loading paths may include multiple groups of first loading paths and multiple groups of second loading paths. The path name of the first loading path includes motor attribute information; the name of the second loading path does not include motor attribute information.
[0175] In some examples, since there are many motor manufacturers and the motor sizes are also different, the number of groups in the second loading path is much larger than the number of groups in the first loading path. For example, the number of groups in the first loading path may be 3, and the number of groups in the second loading path may be 100, which is not limited in the embodiments of the present application.
[0176] For example, the first loading path may correspond to the loading path from the first set of resource files to the recording path of the third set of resource files. The second loading path may correspond to the loading path including the motor model corresponding to the motor attribute information.
[0177] In some examples, the second load path may include a new file name formed by concatenating the motor model and the base file name. For example, the motor model is x_manufacturer1_0809. If the base name is vibrator_desc.xml, the base name may be adjusted according to the motor model x_manufacturer1_0809 to obtain a new file name vibrator_desc_x_manufacturer1_0809.xml.
[0178] If the base name is libHapticPlayerTwoKit.so, the corresponding included new file name is libHapticPlayerTwoKit_x_manufacturer1_0809.so;
[0179] If the base name is libHapticPlayerOneKit.so, the corresponding included new file name is libHapticPlayerOneKit_x_manufacturer1_0809.so;
[0180] If the base name is vibrator_slices_config.xml, then the included new file name is vibrator_slices_config_x_manufacturer1_0809.xml.
[0181] In some examples, a second load path including a new file name for motor model x_manufacturer1_0809 may include:
[0182] / odm / etc / vibrator / vendor1 / vibrator_desc_x_manufacturer1_0809.xml;
[0183] / odm / etc / vibrator / vendor2 / vibrator_desc_x_manufacturer1_0809.xml;
[0184] / odm / etc / vibrator / vibrator_slices_config_x_manufacturer1_0809.xml;
[0185] / odm / lib64 / libHapticPlayerTwoKit_x_manufacturer1_0809.so;
[0186] / odm / lib64 / ibHapticPlayerOneKit_x_manufacturer1_0809.so;
[0187] In other examples, a second load path including a new file name for motor model z_manufacturer2_9595 may include:
[0188] / odm / etc / vibrator / vendor1 / vibrator_desc_z_manufacturer2_9595.xml;
[0189] / odm / etc / vibrator / vendor2 / vibrator_desc_z_manufacturer2_9595.xml;
[0190] / odm / etc / vibrator / vibrator_slices_config_z_manufacturer2_9595.xml;
[0191] / odm / lib64 / libHapticPlayerTwoKit_z_manufacturer2_9595.so;
[0192] / odm / lib64 / ibHapticPlayerOneKit_z_manufacturer2_9595.so;
[0193] In the embodiment of the present application, the plurality of sets of second loading paths may include loading paths of each set of resource files corresponding to the motor model of each motor in all motors used in the electronic device. The embodiment of the present application only takes a set of second loading paths corresponding to motor models x_manufacturer1_0809 and z_manufacturer2_9595 as an example for illustrative description.
[0194] For example, reference Figure 2 As shown, the motor framework 10 can read the power chip manufacturer information of the motor from the first motor kernel driver 11, and select a corresponding group of first loading paths from multiple groups of first loading paths according to the type of motor and the power chip manufacturer information of the motor, and use the group of first loading paths as the target loading path of the motor's resource file.
[0195] Step S506, reading the power chip manufacturer information of the motor in the motor loading information, and determining the target loading path of the resource file of the motor based on the power chip manufacturer information of the motor and the motor attribute information.
[0196] For example, reference Figure 2 As shown, the motor framework 10 can read the power chip manufacturer information of the motor from the first motor core driver 11, and select a corresponding set of first loading paths from multiple sets of second loading paths according to the motor attribute information and the power chip manufacturer information of the motor, and use the set of first loading paths as the target loading path of the resource file of the motor. In this way, the target loading path of the corresponding resource file can be adaptively selected for motors of different models.
[0197] In the disclosed embodiment, when the electronic device is started and the motor kernel driver is loaded, the motor kernel driver reads the power chip manufacturer information of the motor, the resonant frequency of the motor and the motor model, and parses the motor model to obtain the motor attribute information. When the motor frame is started, first determine whether the motor is a flat motor or a linear motor. When the motor is a linear motor, determine the legality of the motor attribute information. When the motor attribute information is legal, adaptively determine the target loading path of the resource file based on the power chip manufacturer information and the motor attribute information of the motor. In this way, the loading of the resource file of the motor with the motor resource attribute requirements can be met. When the motor attribute information is illegal, obtain and determine the specific type of the linear motor according to the resonant frequency of the motor, and determine the loading path of the resource file according to the specific type of the linear motor and the power chip manufacturer information of the motor. In this way, according to the first target loading path, the motor resource files of electronic devices of different models can be adaptively loaded to avoid the motor of the electronic device from not working properly and improve the user experience.
[0198] Figure 6 A flow chart of another method for loading a motor resource file provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the method includes the following steps S601 to S603.
[0199] Step S601, when the electronic device is started, motor attribute information is obtained and the legitimacy of the motor attribute information is determined.
[0200] For example, the electronic device may be started in response to a start-up instruction input by the user to the electronic device. The implementation method of obtaining the motor attribute information and the implementation method of determining the legitimacy of the motor attribute information are not described in detail in this embodiment of the application, and the details can be referred to the aforementioned step S503.
[0201] Exemplarily, determining the legitimacy of the motor attribute information may include: when the motor attribute information includes motor manufacturer information, motor type information, and motor size information, determining that the motor attribute information is legitimacy.
[0202] Exemplarily, when the electronic device is started, the motor attribute information is obtained, including: when the electronic device is started, the motor kernel driver is loaded; the motor model is read from the motor device description file, and the motor model is parsed to obtain the motor attribute information.
[0203] Step S602: if the motor attribute information is legal, obtain the power chip manufacturer information of the motor.
[0204] The embodiment of the present application will not describe in detail the method for obtaining the power chip manufacturer information of the motor when the motor attribute information is legal, and please refer to the aforementioned step S506 for details.
[0205] Exemplarily, before obtaining the power chip manufacturer information of the motor, the method further includes: when loading the motor core driver, the motor core driver obtains the power chip manufacturer information of the motor from the motor auxiliary driver. The above-mentioned obtaining the power chip manufacturer information of the motor when the motor attribute information is legal includes: obtaining the power chip manufacturer information of the motor from the motor core driver when the motor attribute information is legal.
[0206] Step S603: determining a first target loading path for loading the resource file of the motor based on the power chip manufacturer information and the motor attribute information of the motor.
[0207] The embodiment of the present application will not describe in detail the implementation method of determining the first target loading path of the resource file for loading the motor based on the power chip manufacturer information and motor attribute information of the motor. For details, please refer to the aforementioned step S506.
[0208] Exemplarily, based on the power chip manufacturer information and motor attribute information of the motor, determining the first target loading path for loading the resource file of the motor includes: obtaining multiple groups of first loading paths; the path name of the first loading path includes the motor attribute information; based on the power chip manufacturer information and motor attribute information of the motor, determining the first target loading path for loading the resource file of the motor from the multiple groups of first loading paths.
[0209] Exemplarily, the method also includes: when loading the motor core driver, the motor core driver obtains the resonant frequency information of the motor from the motor auxiliary driver; when the motor attribute information is illegal, the motor resonant frequency information and the motor power chip manufacturer information are obtained from the motor core driver; based on the motor resonant frequency information and the motor power chip manufacturer information, a second target loading path for loading the resource file of the motor is determined.
[0210] In some examples, based on the resonant frequency information of the motor and the power chip manufacturer information of the motor, a second target loading path for loading the resource file of the motor is determined, including: determining the type of the motor based on the resonant frequency information of the motor; determining the second target loading path for loading the resource file of the motor based on the type of the motor and the power chip manufacturer information of the motor.
[0211] In some examples, based on the type of motor and the power chip manufacturer information of the motor, a second target loading path for loading the resource file of the motor is determined, including: obtaining multiple groups of second loading paths; the name of the second loading path does not include motor attribute information; based on the type of motor and the power chip manufacturer information of the motor, determining the second target loading path for loading the resource file of the motor from the multiple groups of second loading paths.
[0212] Exemplarily, before acquiring the motor attribute information, the method further includes: determining the validity of the motor frequency file in the electronic device. The above-mentioned acquisition of the motor attribute information includes: acquiring the motor attribute information when the motor frequency file is valid.
[0213] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0214] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0215] In the case of dividing each functional module into corresponding functional modules, refer to Figure 7 As shown, an embodiment of the present application provides an electronic device, which can implement the method for loading a motor resource file provided in the above embodiment. The electronic device 700 may include a first determination module 701 , a first acquisition module 702 , and a second determination module 703 .
[0216] The first determination module 701 is used to obtain motor attribute information and determine the legitimacy of the motor attribute information when the electronic device is started;
[0217] The first acquisition module 702 is used to acquire the power chip manufacturer information of the motor when the motor attribute information is legal;
[0218] The second determination module 703 is used to determine a first target loading path for loading the resource file of the motor based on the power chip manufacturer information and motor attribute information of the motor.
[0219] In some embodiments, the first determination module 701 is specifically used to determine whether the motor attribute information is legal when the motor attribute information includes motor manufacturer information, motor type information and motor size information.
[0220] In some embodiments, the first determination module 701 is specifically configured to load a motor kernel driver when the electronic device is started;
[0221] Read the motor model from the motor device description file, parse the motor model, and obtain the motor attribute information.
[0222] In some embodiments, the electronic device 700 further includes:
[0223] The second acquisition module 704 is used for the motor core driver to acquire the power chip manufacturer information of the motor from the motor auxiliary driver when the motor core driver is loaded.
[0224] The first acquisition module 702 is specifically used to acquire the power chip manufacturer information of the motor from the motor core driver when the motor attribute information is legal.
[0225] In some embodiments, the second determination module 703 is specifically used to obtain multiple groups of first loading paths; the path name of the first loading path includes motor attribute information; based on the motor's power chip manufacturer information and motor attribute information, determine the first target loading path of the resource file for loading the motor from the multiple groups of first loading paths.
[0226] In some embodiments, the electronic device 700 further includes:
[0227] The third determination module 705 is used for, when loading the motor core driver, the motor core driver obtains the motor's resonant frequency information from the motor auxiliary driver; when the motor attribute information is illegal, the motor's resonant frequency information and the motor's power chip manufacturer information are obtained from the motor core driver; based on the motor's resonant frequency information and the motor's power chip manufacturer information, a second target loading path for loading the motor's resource file is determined.
[0228] In some embodiments, the third determination module 705 is specifically used to determine the type of the motor based on the resonant frequency information of the motor; based on the type of the motor and the power chip manufacturer information of the motor, determine the second target loading path for loading the resource file of the motor.
[0229] In some embodiments, the third determination module 705 is specifically used to obtain multiple groups of second loading paths; the name of the second loading path does not include motor attribute information; based on the type of motor and the power chip manufacturer information of the motor, determine the second target loading path of the resource file for loading the motor from the multiple groups of second loading paths.
[0230] In some embodiments, the electronic device 700 further includes:
[0231] The fourth determination module 706 is used to determine the validity of the motor frequency file in the electronic device.
[0232] The first determination module 701 is specifically used to obtain motor attribute information when the motor frequency file is valid.
[0233] Regarding the electronic device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the information display method in the above embodiment, and will not be elaborated here. The relevant beneficial effects can also refer to the relevant beneficial effects of the above information display method, and will not be repeated here.
[0234] The present application also provides an electronic device, which includes: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores a computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method for loading the resource file of the motor provided in the above embodiment. The specific structure of the electronic device can be referred to Figure 3 The structure of the electronic device shown in .
[0235] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method for loading the resource file of the motor provided in the above embodiment.
[0236] An embodiment of the present application also provides a computer program product, which includes executable instructions. When the computer program product is run on an electronic device, the electronic device executes the method for loading the resource file of the motor provided in the above embodiment.
[0237] The present application also provides a chip system, such as Figure 8 As shown, the chip system 800 includes at least one processor 801 and at least one interface circuit 802. The processor 801 and the interface circuit 802 can be interconnected through a line. For example, the interface circuit 802 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 802 can be used to send signals to other devices (such as the processor 801).
[0238] Exemplarily, the interface circuit 802 can read the instruction stored in the memory and send the instruction to the processor 801. When the instruction is executed by the processor 801, the electronic device can execute each step in the above embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
[0239] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0240] In the several embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0241] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0242] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0243] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0244] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for loading a motor resource file, characterized in that: Applied to electronic equipment, the method comprises: When the electronic device is started, obtaining motor attribute information and determining the legitimacy of the motor attribute information; If the motor attribute information is legal, obtaining the power chip manufacturer information of the motor; Based on the power chip manufacturer information of the motor and the motor attribute information, a first target loading path for loading the resource file of the motor is determined.
2. The method according to claim 1, characterized in that The determining the legitimacy of the motor attribute information includes: In a case where the motor attribute information includes motor manufacturer information, motor type information, and motor size information, it is determined that the motor attribute information is legal.
3. The method according to claim 1, characterized in that When the electronic device is started, obtaining motor property information includes: When the electronic device is started, loading the motor core driver; The motor model is read from the motor device description file, and the motor model is parsed to obtain the motor attribute information.
4. The method according to claim 3, characterized in that Before obtaining the power chip manufacturer information of the motor, the method further includes: When loading the motor core driver, the motor core driver obtains the power chip manufacturer information of the motor from the motor auxiliary driver; When the motor attribute information is legal, obtaining the power chip manufacturer information of the motor includes: When the motor attribute information is legal, the power chip manufacturer information of the motor is obtained from the motor core driver.
5. The method according to claim 1, characterized in that The determining, based on the power chip manufacturer information of the motor and the motor attribute information, a first target loading path for loading the resource file of the motor comprises: Acquire multiple groups of first loading paths; the path names of the first loading paths include the motor attribute information; Based on the power chip manufacturer information of the motor and the motor attribute information, a first target loading path for loading the resource file of the motor is determined from multiple groups of the first loading paths.
6. The method according to claim 2, characterized in that The method further comprises: When loading the motor core driver, the motor core driver obtains the resonant frequency information of the motor from the motor auxiliary driver; When the motor attribute information is illegal, obtaining the resonant frequency information of the motor and the power chip manufacturer information of the motor from the motor core driver; Based on the resonant frequency information of the motor and the power chip manufacturer information of the motor, a second target loading path for loading the resource file of the motor is determined.
7. The method according to claim 6, characterized in that The determining, based on the resonant frequency information of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor comprises: determining the type of the motor based on the resonant frequency information of the motor; Based on the type of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor is determined.
8. The method according to claim 7, characterized in that The determining, based on the type of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor comprises: Acquire multiple groups of second loading paths; the names of the second loading paths do not include the motor attribute information; Based on the type of the motor and the manufacturer information of the power chip of the motor, a second target loading path for loading the resource file of the motor is determined from a plurality of groups of the second loading paths.
9. The method according to claim 6, characterized in that Before obtaining the motor property information, the method further includes: determining the validity of a motor frequency file in the electronic device; The obtaining of motor attribute information includes: When the motor frequency file is valid, the motor attribute information is obtained.
10. An electronic device, characterized in that: It comprises a display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method for loading the resource file of the motor as claimed in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: It comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method for loading the resource file of the motor as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Motor driving method based on terminal device, storage medium, and terminal device
CN109245635A
Motor driving signal generation method, electronic equipment and storage medium
CN110244838A
Linear motor control method, device and equipment and readable storage medium
CN115378302A
Driving waveform adjusting method, device and equipment and readable storage medium
CN115395827A
Vibration output method and related device
CN115703007A
