CN114780166A - Pin configuration method, related device, equipment and readable storage medium - Google Patents

Pin configuration method, related device, equipment and readable storage medium Download PDF

Info

Publication number
CN114780166A
CN114780166A CN202210304391.0A CN202210304391A CN114780166A CN 114780166 A CN114780166 A CN 114780166A CN 202210304391 A CN202210304391 A CN 202210304391A CN 114780166 A CN114780166 A CN 114780166A
Authority
CN
China
Prior art keywords
target
pin
wake
operating system
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210304391.0A
Other languages
Chinese (zh)
Inventor
刘金彪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Guangtong Yuanchi Technology Co ltd
Original Assignee
Shenzhen Guangtong Yuanchi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Guangtong Yuanchi Technology Co ltd filed Critical Shenzhen Guangtong Yuanchi Technology Co ltd
Priority to CN202210304391.0A priority Critical patent/CN114780166A/en
Publication of CN114780166A publication Critical patent/CN114780166A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake

Abstract

The embodiment of the application provides a method for configuring a pin, a related device, equipment and a readable storage medium, wherein the method is applied to an operating system and comprises the following steps: starting the operating system; configuring a target pin through target configuration information; the target pin is a pin indicated by the target configuration information; and instructing the operating system to sleep/wake up the target electronic device or the target application program based on the configured level value of the target pin.

Description

Pin configuration method, related device, equipment and readable storage medium
Technical Field
The present invention relates to the field of pin configuration, and in particular, to a method for pin configuration, a related apparatus, a device, and a computer-readable storage medium.
Background
Currently, a sleep/wake-up of a vehicle-mounted operating system to related vehicle-mounted devices and applications is to configure a sleep/wake-up pin through a device tree, then register the sleep/wake-up pin in a kernel, and use the pin as the sleep/wake-up pin. According to customer requirements, the module is in the awakening state in a mode of holding the awakening lock in the kernel, or the awakening lock is released to enable the module to enter the dormancy state, so that the vehicle-mounted equipment and the application program are determined to enter the dormancy state or the working state.
However, the pins are configured in the form of the device tree file, one software version can only adapt to the requirement of one client, and when the used pins are not consistent in the face of different clients, multiple development is needed, so that the maintenance cost is increased. In addition, different customers have own schemes for controlling dormancy/awakening, and if the mode of holding an awakening lock and releasing the lock is carried out according to the pin state through registering pins in a kernel, most of the modes do not meet the requirements of the customers, so that the development amount is increased, and the communication and maintenance cost is increased.
Disclosure of Invention
The embodiment of the application provides a pin configuration method, a related device, equipment and a readable storage medium, and solves the problem that a great amount of manpower and time resources are wasted when the function configuration is performed on pins through a traditional equipment tree.
In a first aspect, an embodiment of the present application provides a method for configuring a pin, which is applied to an operating system, and the method includes: starting an operating system; configuring a target pin through target configuration information; the target pin is a pin indicated by the target configuration information; and instructing the operating system to sleep/wake up the target electronic device or the target application program based on the configured level value of the target pin.
In the above embodiment, after each startup, the operating system automatically reads the configuration file, and performs sleep/wake function configuration on the pin according to the pin indicated by the configuration file, so that the operating system can determine to hold/release the wake lock based on the level value of the configured pin, thereby implementing sleep/wake control on the application program or the vehicle-mounted device related to the wake lock. Compared with the traditional method for performing awakening/dormancy function configuration on the pins of the vehicle-mounted chip by compiling the equipment tree, the method for performing awakening/dormancy function configuration on the pins of the vehicle-mounted chip is simpler and more convenient, when the user wants to modify the pin function of the vehicle-mounted chip, the modified configuration file is only required to be introduced into the memory, and the vehicle-mounted operating system can automatically read the configuration file after being started, so that the configuration of the pin function is completed, technical personnel do not need to compile the equipment tree again, the human resources and the time resources are greatly saved, and the later maintenance is facilitated.
In a possible implementation manner, the target configuration information is obtained by parsing the first configuration information, or is default configuration information of the operating system.
In one possible implementation manner, the operating system includes a Kernel and a power management service module, and the configuring the target pin by the target configuration information includes: reading target configuration information through a power management service module; sending the target configuration information to Kernel through a power management service module; configuring the target pin based on the target configuration information through Kernel; the configured level value of the target pin is used for instructing the operating system to sleep/wake up the target electronic device or the target application program.
In a possible implementation manner, the operating system further includes a user service module, which instructs the operating system to sleep/wake up a target electronic device or a target application based on a level value of the configured target pin, including: under the condition that a sleep instruction is received, setting a level value of a target pin to be a first numerical value through Kernel; reading a first numerical value based on the Kernel through a user service module; switching the state of the target electronic equipment/the target application program into a dormant state based on the first value through the user service module; setting the level value of the target pin to be a second numerical value through Kernel under the condition that a wake-up instruction is received; reading the second numerical value based on Kernel through a user service module; and switching the state of the target electronic equipment/target application program into a working state based on the second value through the user service module.
In one possible implementation manner, the switching, by the user service module, the state of the target electronic device/target application to the dormant state based on the first value includes: releasing the wake-up lock through the user service module under the condition that the level value of the target pin is determined to be a first value; the wake lock is used to control the state of the target electronic device/target application, the electronic device/application of the target electronic device/target application associated with the wake lock.
In one possible implementation manner, switching the state of the target electronic device/target application into the working state based on the second value by the user service module includes: under the condition that the level value of the target pin is determined to be the second numerical value, the user service module holds the wake-up lock; the wake-up lock is used for controlling the state of the target electronic equipment/target application program; the electronic device/application of the target electronic device/target application that is associated with the wake lock.
In a second aspect, an embodiment of the present application provides an apparatus for pin configuration, where the apparatus includes: start unit, Kernel, wherein:
the starting module is used for starting the operating system;
and the Kernel is used for configuring the pin indicated by the target configuration information.
And the user service module is used for sleeping/awakening the target electronic equipment or the target application program based on the configured level value of the target pin.
In one possible implementation, the apparatus further includes:
the power management module is used for reading the target configuration information and sending the target configuration information to the Kernel;
kernel for configuring the target pin based on the target configuration information.
In one possible implementation manner, Kernel is further configured to set a level value of the target pin to a first value in a case where a sleep instruction is received;
under the condition that a wake-up instruction is received, setting the level value of the target pin to be a second numerical value through the Kernel;
in a possible implementation manner, the user service module is further configured to read the first value based on the Kernel, or read the second value based on the Kernel.
In one possible approach, the user service module is further configured to: under the condition that the first numerical value is read, switching the state of the target electronic equipment/the target application program to a dormant state based on the first numerical value;
and under the condition that the second numerical value is read, switching the state of the target electronic equipment/target application program to a working state based on the second numerical value.
In one possible approach, the user service module further comprises:
the release unit is used for releasing the wake-up lock under the condition that the level value of the target pin is determined to be a first value;
and the holding unit is used for holding the wake-up lock under the condition that the level value of the target pin is determined to be a second value.
In a third aspect, an embodiment of the present application provides a device for configuring a pin, including: a memory and a processor; wherein:
the memory for storing a computer program, the computer program comprising program instructions;
the processor is configured to call the program instructions to cause the pin-configured device to perform: starting an operating system; configuring a target pin through target configuration information; the target pin is a pin indicated by the target configuration information; and indicating the operating system to sleep/wake the target electronic device or the target application program on the configured level value of the target pin.
In one possible implementation, the processor is configured to call the program instructions to cause the pin-configured device to perform: reading target configuration information through a power management service module; sending the target configuration information to Kernel through a power management service module; configuring the target pin based on the target configuration information through Kernel; the configured level value of the target pin is used for instructing the operating system to sleep/wake up the target electronic device or the target application program.
In one possible implementation, the processor is configured to invoke the program instructions to cause the pin-configured device to perform: under the condition that a sleep instruction is received, setting a level value of a target pin to be a first numerical value through Kernel; reading a first numerical value based on the Kernel through a user service module; switching the state of the target electronic equipment/the target application program to a dormant state based on the first numerical value through the user service module; setting the level value of the target pin to be a second numerical value through Kernel under the condition that a wake-up instruction is received; reading the second numerical value based on Kernel through a user service module; and switching the state of the target electronic equipment/target application program into a working state based on the second value through the user service module.
In one possible implementation, the processor is configured to invoke the program instructions to cause the pin-configured device to perform: releasing the wake-up lock through the user service module under the condition that the level value of the target pin is determined to be a first value; the wake lock is used to control the state of the target electronic device/target application, the electronic device/application of the target electronic device/target application associated with the wake lock.
In one possible implementation, the processor is configured to call the program instructions to cause the pin-configured device to perform: under the condition that the level value of the target pin is determined to be the second numerical value, the user service module holds the wake-up lock; the wake-up lock is used for controlling the state of the target electronic equipment/target application program; the electronic device/application of the target electronic device/target application that is associated with the wake lock.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for configuring pins in the first aspect and various possible implementation manners thereof is implemented.
In a fifth aspect, the present application provides a computer program, where the computer program includes instructions, and when the computer program is executed by a computer, the apparatus for pin configuration may perform the procedures performed by the apparatus for pin configuration in the foregoing first aspect and various possible implementation manners thereof.
Drawings
The drawings used in the embodiments of the present application are described below.
Fig. 1 is a schematic view of an application scenario of a pin configuration method according to an embodiment of the present application;
fig. 2 is a flowchart of a pin configuration method according to an embodiment of the present disclosure;
FIG. 3 is an exemplary diagram of the user interface 31 of the electronic device 100;
fig. 4 is a schematic structural diagram of a pin configuration apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a pin configuration device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be apparent that the described embodiments are only a few embodiments of the present application, and not all embodiments. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. The terms "first," "second," "third," and the like in the description and claims of this application and in the accompanying drawings are used differently than to describe a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, article, or apparatus that comprises a list of steps or elements, or alternatively, a list of steps or elements not expressly listed or inherent to such process, method, article, or apparatus may also be included. Only some, but not all, of the material relevant to the present application is shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but could have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
As used in this specification, the terms "component," "module," "system," "unit," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a unit may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or distributed between two or more computers. In addition, these units can execute from various computer readable media having various data structures stored thereon. The units may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., from a second unit of data interacting with a local system, distributed system, and/or across a network such as the internet with other systems by way of the signal).
Referring to fig. 1, fig. 1 is a schematic application scenario diagram of a pin configuration method provided in the embodiment of the present application, and it should be understood that the schematic application scenario diagram is only an exemplary illustration of one application scenario of the pin configuration method described in the embodiment of the present application, and should not limit the scope of the embodiment of the present application.
As shown in fig. 1, the scene schematic diagram includes an on-board chip 101, an on-board operating system 102, and a drive recorder 103. The vehicle-mounted chip 101 includes a plurality of pins, and the vehicle-mounted operating system 102 performs a sleep/wake-up operation on the automobile data recorder 103 by applying a level value to the pins in the vehicle-mounted chip 101.
When a user starts the vehicle-mounted system, the vehicle-mounted operating system reads a pre-stored configuration file and analyzes the configuration file, so that function allocation information of each pin in the vehicle-mounted chip 101 is acquired. After the vehicle-mounted operating system analyzes the configuration file, the vehicle-mounted operating system sends the function allocation information of the pins to the system kernel, and the system kernel performs function configuration on the pins of the vehicle-mounted chip 101 based on the function allocation information.
For example, in the embodiment of fig. 1, the function allocation information indicates that the function of the pin 1011 of the on-board chip 101 is a wake-up/sleep function pin, and the core will perform wake-up/sleep function configuration on the pin 1011 after receiving the function allocation information. When the in-vehicle operating system receives an input operation of starting the in-vehicle device by a user, the in-vehicle operating system changes the level of the pin 1011 to a low level (at this time, the level of the pin 1011 is 0) in response to the input operation. Then, the User System module 1021(User System, US) reads the level of the pin 1011, and if the level of the pin 1011 is read to be 0, the User System module 1021 holds a wake _ lock to wake up the car recorder 103. After the vehicle-mounted System receives an input operation of a User sleeping the vehicle-mounted device, in response to the input operation, the vehicle-mounted System changes the level of the pin 1011 to a high level (at this time, the level of the pin 1011 is 1), then, a User System module (User System, US) reads the level of the pin 1011, and if the level of the pin 1011 is read to be 1, the User System module releases a wake _ lock to sleep the drive recorder 103, so that the drive recorder 103 is switched from a working state to a sleeping state.
Fig. 1 illustrates an application scenario of the pin configuration method according to the embodiment of the present application by way of example, and fig. 2 is combined to describe a pin configuration method according to the embodiment of the present application in detail. The pin configuration method is applied to a first operating system, and the first operating system comprises a user service module power supply, a power management service module (PowerManage service module) and a system Kernel (Kernel). Referring to fig. 2, fig. 2 is a flowchart of a pin configuration method according to an embodiment of the present application, where the specific flowchart is as follows:
step S201: the operating system is started.
Specifically, the operating System may be a vehicle-mounted operating System (AOS) or other operating systems, and the embodiment of the present application does not limit the type of the first operating System. The embodiment of the present application takes the operating system as a vehicle-mounted operating system as an example, and description is given.
The AOS is an interface between a user and vehicle-mounted hardware and is also an interface between the vehicle-mounted hardware and upper-layer software. The AOS functions include managing hardware, software and data resources of a vehicle-mounted system, controlling program operation, improving a human-computer interface, providing support for upper software, enabling resources of the vehicle-mounted system to play a role to the maximum extent when receiving data, signals, audio and video, providing User Interfaces (UIs) in various forms, enabling a driver to have a good driving environment, and effectively providing auxiliary driving, semi-automatic driving and even automatic driving.
The vehicle-mounted operating system in the embodiment of the present application may be a WinCE operating system, a Linux operating system, an Android operating system, or other operating systems, which is not limited in the embodiment of the present application. The vehicle-mounted operating system in the embodiment of the present application is a Linux system as an example, and description is given.
Step S202: and configuring a target pin through target configuration information, wherein the target pin is the pin indicated by the target configuration information.
Specifically, the target configuration information is used for configuring a sleep/wake function for a specific pin in the vehicle-mounted chip, so that the vehicle-mounted operating system can judge whether to perform sleep/wake operation on related vehicle-mounted devices/applications (for example, a driving recorder) controlled by the vehicle-mounted chip according to the level state of the pin.
For example, the vehicle-mounted chip comprises 48 pins, each Pin corresponds to a Pin number (Pin ID), and the value range of the Pin ID is 001-048. When the target configuration information indicates that the pin with the pin number of 10 is the sleep/wake-up pin, the vehicle-mounted operating system enables the pin with the pin number of 10, so that the vehicle-mounted operating system can determine whether to release/hold the wake-up lock according to the level state of the pin, and the control function of sleeping and waking up the vehicle-mounted device/application program related to the wake-up lock is realized.
The target configuration information includes a pin number of the target pin, first indication information, and second indication information. The first indication information is used for indicating the meaning of the pin level, for example, when the level value of the target pin is 1 (high level), it indicates that the target pin is a dormant pin, and at this time, the vehicle-mounted operating system may release the wake-up lock, so that the vehicle-mounted device/application program related to the wake-up lock enters a dormant state and is dormant; when the level value of the target pin is 0 (low level), it indicates that the target pin is a wake-up pin. At this time, the in-vehicle operating system may hold the wake lock, so that the in-vehicle device/application program related to the wake lock is switched from the sleep state to the working state. For example, the vehicle-mounted device may be the automobile data recorder 103 in the embodiment of fig. 1.
The second indication information is used for indicating the function type of the target pin. In the embodiment of the present application, the second indication information is used to indicate that the function type of the target pin is a sleep/wake function, for example, and the description is given. For example, the second indication information may be fields, each field has a mapping relationship with a function of the pin, and the in-vehicle operating system determines the function of the target pin based on a field-function mapping relationship table stored in the memory in advance after reading the second indication information. For example, the field-function mapping table may be as shown in table 1 below:
TABLE 1
Field(s) Function(s)
A11 Sleep/wake-up
A12 In-vehicle light on/off
…… ……
For example, if the vehicle os reads that the second indication information is a11, the vehicle os may know that the function corresponding to the field a11 is a hibernation/wake-up function according to the table 1.
The target configuration information may be obtained by analyzing the first configuration information, or may be default configuration information of the vehicle-mounted operating system. The first configuration information is configuration information dynamically written into the in-vehicle operating system and is stored in a specific folder, for example, in powermanagement. The embodiment of the present application takes the first configuration information written in PowerManage, conf as an example, and is described.
Optionally, after the in-vehicle operating system is started, the first configuration information is parsed in powermanagement. An instruction is then sent to the user indicating whether the user chooses to use the first configuration information. Illustratively, as shown in fig. 3, the electronic device 100 is an in-vehicle device, and after the in-vehicle operating system parses the first configuration information, the electronic device 100 displays the user interface 31, where the user interface 31 includes a first prompt box 311, and the first prompt box 311 includes text information of "whether to use the first configuration information", and the text information is used to prompt a user whether to use the first configuration information. If the single-click operation for the control 3111 is detected, the in-vehicle operating system determines to use the first configuration information in response to the single-click operation. At this time, the first configuration information is target configuration information. If the single-click operation for the control 3112 is detected, the in-vehicle operating system determines not to use the first configuration information in response to the single-click operation. At this time, the in-vehicle operating system reads system default configuration information as target configuration information.
It should be understood that, in the embodiment of the present application, only an exemplary description is given to a manner in which the in-vehicle operating system determines whether to use the first configuration information, and the embodiment of the present application is not limited to the manner in which the in-vehicle operating system determines whether to use the first configuration information.
After determining the target configuration information, the vehicle-mounted operating system reads the target configuration information through a power management Service (powermanagement Service) module and sends the first configuration information to a system Kernel. After receiving the target configuration information sent by the power management service module, the Kernel configures the dormant/awakening function of the target pin based on the target configuration information, thereby establishing a mapping relationship between the target pin and the dormant/dormant awakening function. For example, when the in-vehicle operating system receives a sleep instruction of the in-vehicle device from a user, the kernel assigns a level value of the target pin to be a first value (for example, the first value is 0, which represents a low level) based on the first indication information. For example, when the first indication information is: when the level value is 1, the state corresponds to the awakening state, and when the level value is 0, the state corresponds to the sleeping state. If the vehicle-mounted operating system receives a sleep instruction of a user on the vehicle-mounted device/application program, a first numerical value is given to the target pin through the kernel, and at the moment, the level value of the target pin is 0; when the vehicle-mounted operating system receives a wake-up instruction of a user for the vehicle-mounted device/application program, the level value given to the target pin by the kernel is a second numerical value (for example, the second numerical value is 1, which represents a high level), and at this time, the level value of the target pin is 1.
Step S203: and instructing the operating system to sleep/wake up the target electronic device or the target application program based on the configured level value of the target pin.
Specifically, after Kernel performs function configuration on the target pin based on the target configuration information, when a sleep/wake instruction for the user is detected, the Kernel assigns a level value (a first value or a second value) related to the target pin. Then, the user system module can read the level value of the target pin through the kernel based on the target configuration information, and then determine to hold/release the wake-up lock based on the level value of the target pin and the first indication information in the target configuration information, so as to wake up and sleep the vehicle-mounted device/application program related to the wake-up lock.
When the user system module reads that the level value of the target pin is a first value, the user system module releases the wake-up lock, and when the user system module reads that the level value of the target pin is a second value, the user system module holds the wake-up lock. When the user system module releases the wake-up lock, the vehicle-mounted operating system can sleep the vehicle-mounted equipment/application program related to the wake-up lock, so that the vehicle-mounted equipment/application program is switched from the working state to the dormant state, power supply and computing resources are saved, and the working efficiency of the vehicle-mounted system is improved. The vehicle-mounted device/application program related to the wake lock may be a vehicle-mounted device/application program whose state (dormant state/working state) is controlled by the wake lock.
For example, assume that in the target configuration information, the pin number of the target pin is 25, the second indication information is field a11, a11 indicates the sleep/wake function, and the first indication information is: in a dormant state, the level value of a pin is 1; and in the wake-up state, the level value of the pin is 0. After the vehicle-mounted operating system receives a sleep instruction of a user (for example, the user clicks a sleep control of a sleep in a vehicle), the vehicle-mounted operating system sends first prompt information to the Kernel, and the prompt information is used for indicating that the vehicle-mounted device/application program related to the wake-up lock is switched to a sleep state. After receiving the first prompt message, Kernel assigns a high level to pin 25, so that the level value of pin 25 is 1. Meanwhile, the vehicle-mounted operating System sends second prompt information of the User to a User System module (User System), the prompt information is used for indicating that the current vehicle-mounted equipment/application program related to the wake-up lock is switched to a dormant state, the User System module reads the level value of the No. 25 pin through the kernel after receiving the second prompt information, and the User System module determines to release the wake-up lock according to the first prompt information because the level value of the pin is 1, so that the function of sleeping the vehicle-mounted equipment/application program related to the wake-up lock is realized.
According to the embodiment of the application, after the operating system is started each time, the pin is subjected to sleep/wake-up function configuration according to the pin indicated by the target configuration file, so that the operating system can decide to hold/release the wake-up lock based on the level value of the configured pin, and sleep/wake-up control over an application program or vehicle-mounted equipment related to the wake-up lock is realized. Compared with the traditional method for performing awakening/dormancy function configuration on the pins of the vehicle-mounted chip through compiling the equipment tree, the method for performing awakening/dormancy function configuration on the pins of the vehicle-mounted chip is simpler and more convenient. When a user wants to modify the pin function of the vehicle-mounted chip, the modified configuration file is only needed to be imported into the memory, and the vehicle-mounted operating system can automatically read the configuration file after being started, so that the pin function is configured without technical personnel compiling the equipment tree again, manpower resources and time resources are greatly saved, and later maintenance is facilitated.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a pin configuration apparatus according to an embodiment of the present application, where the apparatus 40 includes: a starting unit 401, a Kernel402 and a user service module 403, wherein:
a starting module 401, configured to start an operating system;
and the Kernel402 is used for configuring the pin indicated by the target configuration information.
And the user service module 403 is configured to sleep/wake up the target electronic device or the target application program based on the configured level value of the target pin.
In one possible implementation, the apparatus further includes:
the power management module is used for reading the target configuration information and sending the target configuration information to the Kernel;
kernel for configuring the target pin based on the target configuration information.
In one possible implementation manner, Kernel is further configured to set a level value of the target pin to a first value in a case where a sleep instruction is received;
under the condition that a wake-up instruction is received, setting the level value of the target pin to be a second numerical value through the Kernel;
in a possible implementation manner, the user service module is further configured to read the first value based on the Kernel, or read the second value based on the Kernel.
In one possible approach, the user service module is further configured to: under the condition that the first numerical value is read, switching the state of the target electronic equipment/the target application program to a dormant state based on the first numerical value;
and under the condition that the second numerical value is read, switching the state of the target electronic equipment/target application program to a working state based on the second numerical value.
In one possible approach, the user service module further comprises:
the release unit is used for releasing the wake-up lock under the condition that the level value of the target pin is determined to be a first value;
and the holding unit is used for holding the wake-up lock under the condition that the level value of the target pin is determined to be a second value.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a pin configuration device. As shown in fig. 5, the pin configuration apparatus 50 includes: at least one processor 501, a memory 502. Optionally, the pin-configured device 50 may further include a network interface 503, and the processor 501, the network interface 503 and the memory 502 are connected to each other through an internal bus 504. The processor 501, the memory 502 and the network interface 503 can exchange data with each other, the network interface 503 is controlled by the processor 501 for sending and receiving messages, the memory 502 is used for storing a computer program, the computer program comprises program instructions, and the processor 501 is used for executing the program instructions stored in the memory 502. Wherein the processor 501 invokes the computer instructions to cause the apparatus to perform the steps of: starting an operating system; configuring a target pin through target configuration information; the target pin is a pin indicated by the target configuration information; and indicating the operating system to sleep/wake the target electronic device or the target application program on the configured level value of the target pin.
In one possible implementation manner, the processor 501 calls the computer instruction to enable the device 50 to perform configuration of the target pin by the target configuration information, including: reading target configuration information through a power management service module; sending the target configuration information to Kernel through a power management service module; configuring a target pin based on the target configuration information through Kernel; the configured level value of the target pin is used for instructing the operating system to sleep/wake up the target electronic device or the target application program.
In one possible implementation, the processor 501 invokes the computer instructions to cause the device 50 to perform: under the condition that a sleep instruction is received, setting a level value of a target pin to be a first numerical value through Kernel; reading a first numerical value based on the Kernel through a user service module; switching the state of the target electronic equipment/the target application program to a dormant state based on the first numerical value through the user service module; setting the level value of the target pin to be a second numerical value through Kernel under the condition that a wake-up instruction is received; reading the second numerical value based on Kernel through a user service module; and switching the state of the target electronic equipment/target application program into a working state based on the second value through the user service module.
In one possible implementation, the processor 501 invokes the computer instructions to cause the device 50 to perform: releasing the wake-up lock through the user service module under the condition that the level value of the target pin is determined to be a first value; the wake lock is used to control the state of the target electronic device/target application, the electronic device/application of the target electronic device/target application associated with the wake lock.
In one possible implementation, the processor 501 invokes the computer instructions to cause the device 50 to perform: under the condition that the level value of the target pin is determined to be the second numerical value, the user service module holds the wake-up lock; the wake-up lock is used for controlling the state of the target electronic equipment/target application program; a target electronic device/target application associated with the wake lock.
The present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements a method for adjusting performance parameters in the foregoing embodiments and various possible implementations thereof.
The embodiment of the present application provides a computer program, which includes instructions, and when the computer program is executed by a computer, the communication device may execute the procedures executed by the communication device in the above-mentioned embodiment and various possible implementations thereof.
It should be noted that the Memory in the above embodiments may be a Read-Only Memory (ROM) or other types of static Memory devices that can store static information and instructions, a Random Access Memory (RAM) or other types of dynamic Memory devices that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact disk Read-Only Memory (CD-ROM) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory may be self-contained and coupled to the processor via a bus. The memory may be integral to the processor.
The processor in the above embodiments may be a general purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more ics for controlling the execution of the program according to the above schemes.
For simplicity of explanation, the foregoing method embodiments are presented as a series of interrelated acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present application may be essentially or partially contributed by the prior art, or all or part of the technical solution may be embodied in the form of software, where the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. Among them, the aforementioned storage medium may include: a U disk, a removable hard disk, a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present application.

Claims (10)

1. A method for configuring pins, applied to an operating system, the method comprising:
starting the operating system;
configuring a target pin through target configuration information; the target pin is a pin indicated by the target configuration information;
and instructing the operating system to sleep/wake up the target electronic device or the target application program based on the configured level value of the target pin.
2. The method of claim 1, wherein the target configuration information is obtained by parsing first configuration information or is default configuration information of the operating system.
3. The method of claim 1, wherein the operating system includes a Kernel and a power management service module, and the configuring the target pin with the target configuration information comprises:
reading the target configuration information through the power management service module;
sending the target configuration information to the Kernel through the power management service module;
configuring, by the Kernel, the target pin based on the target configuration information; the configured level value of the target pin is used for indicating the operating system to sleep/wake up the target electronic device or the target application program.
4. The method of claim 3, wherein the operating system further comprises a user service module, the instructing the operating system to sleep/wake a target electronic device or a target application based on the configured level value of the target pin comprises:
setting a level value of the target pin to be a first numerical value through the Kernel under the condition that a sleep instruction is received;
reading, by the user service module, the first value based on the Kernel;
switching, by the user service module, a state of the target electronic device/target application to a dormant state based on the first value;
under the condition that a wake-up instruction is received, setting the level value of the target pin to be a second numerical value through the Kernel;
reading, by the user service module, the second value based on the Kernel;
switching, by the user service module, a state of the target electronic device/target application to an operational state based on the second value.
5. The method of claim 4, wherein the switching, by the user service module, the state of the target electronic device/target application to the dormant state based on the first value comprises:
releasing a wake-up lock through the user service module under the condition that the level value of the target pin is determined to be the first numerical value; the wake-up lock is used for controlling the state of the target electronic device/target application program, and the electronic device/application program related to the wake-up lock of the target electronic device/target application program.
6. The method of claim 4, wherein the switching, by the user service module, the state of the target electronic device/target application to an operational state based on the second value comprises:
holding a wake-up lock through the user service module under the condition that the level value of the target pin is determined to be the second numerical value; the wake-up lock is used for controlling the state of the target electronic equipment/target application program; the target electronic device/target application program is the electronic device/application program related to the wake-up lock.
7. An apparatus for pin configuration, the apparatus comprising:
the starting module is used for starting the operating system;
the Kernel is used for configuring the pins indicated by the target configuration information;
and the user service module is used for sleeping/awakening the target electronic equipment or the target application program based on the configured level value of the target pin.
8. An apparatus for pin configuration, comprising: a memory and a processor; wherein:
the memory for storing a computer program, the computer program comprising program instructions;
the processor is configured to invoke the program instructions to cause the pin-configured device to perform the method of any of claims 1-6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
10. A computer program product comprising instructions for causing an electronic device to perform the method according to any one of claims 1-6 when the computer program product is run on the electronic device.
CN202210304391.0A 2022-03-26 2022-03-26 Pin configuration method, related device, equipment and readable storage medium Pending CN114780166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210304391.0A CN114780166A (en) 2022-03-26 2022-03-26 Pin configuration method, related device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210304391.0A CN114780166A (en) 2022-03-26 2022-03-26 Pin configuration method, related device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114780166A true CN114780166A (en) 2022-07-22

Family

ID=82424909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210304391.0A Pending CN114780166A (en) 2022-03-26 2022-03-26 Pin configuration method, related device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114780166A (en)

Similar Documents

Publication Publication Date Title
US9558016B2 (en) Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product
CN115658160B (en) Multi-operating system upgrading method, device and system based on multi-core heterogeneous SOC
CN111475218A (en) Server starting method, server and computer readable storage medium
CN111475215A (en) Server starting method, device and related equipment
CN112667442B (en) Control method, device and equipment based on nonvolatile memory device starting system
CN106155713B (en) Startup information management method and device
CN103455288A (en) Information processing apparatus and control method
CN111045789B (en) Virtual machine starting method and device, electronic equipment and storage medium
CN114048465B (en) Stack state detection method, device, equipment and storage medium
CN114780166A (en) Pin configuration method, related device, equipment and readable storage medium
CN115878327A (en) Bus reservation method, device, server, electronic equipment and storage medium
CN116450046A (en) Cloud disk implementation method and device, intelligent network card, server and storage medium
CN110018911B (en) Process management and inter-process communication method and device, computing equipment and storage medium
KR20100050098A (en) Image processing apparatus and control method thereof
CN114461462A (en) BIOS debugging information output method, device, equipment and storage medium
CN112732562A (en) Computer test method, system and related device
CN110618791B (en) CFS storage domain configuration method, device, equipment and readable storage medium
CN113656085B (en) Meter starting method, apparatus, device, storage medium and program product
CN116243994B (en) Driving loading method of storage device, operating system starting method and system
CN113312095B (en) Method, device, terminal and storage medium for managing plug event of display equipment
CN112540889B (en) Method, device, equipment and medium for adjusting hard disk starting sequence in user mode
CN117909272A (en) Method and device for setting transmission rate of serial bus and image signal generator
CN115664953B (en) Resource allocation method and related device of external equipment
CN111124882B (en) Method and device for realizing application test, computer storage medium and terminal
CN111538540B (en) Method for accelerating starting speed of embedded system and embedded system thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination