Fast charging protocol event processing method and device
By implementing user-defined event processing logic and functions on the fast charging protocol chip, the problem that users cannot modify or add application code in the existing technology is solved, which improves flexibility and applicability and broadens usage scenarios.
Patent Information
- Application Number
- CN202311652085.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2043-12-04
AI Technical Summary
During the custom programming process of existing fast charging protocol chips, users cannot modify or add application code on software systems that have implemented basic functions, resulting in low flexibility in modifying or adding application codes and being unable to personalize them on their own. It is applicable. Limited scenarios.
Provide a fast charging protocol event processing method and device, allowing users to modify or add application code on a software system that has implemented basic functions based on their own needs, receive target input and determine whether to take over event control, based on custom processing logic and Functions handle target events and realize special functional requirements.
On the basis of reducing the original chip development cost, it improves the flexibility of users to modify or add application code, allows users to personalize and customize on their own, and broadens usage scenarios, especially in the case of PD protocol version updates or special applications, without frequent modifications. Response policy code.
Smart Images

Figure CN117675945B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of fast charging protocol, and in particular, to a method and device for processing fast charging protocol events. Background Art
[0002] With the widespread application of fast charging protocols, there are more and more fast charging protocol chips on the market. Users hope to be able to modify or add application codes to meet special needs during actual use. In commonly used fast charging protocol chips, users often provide a list of requirements, and then the chip manufacturer performs customized programming. The commonly used fast charging protocol event processing method cannot modify or add application codes on software systems that have implemented basic functions. With the increase in customization requirements, the customization process requires a lot of manpower and time costs from the chip manufacturer. Users have low flexibility in modifying or adding application codes, and cannot perform personalized customization by themselves, and the applicable scenarios are limited. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a method and device for processing fast charging protocol events, which enables users to modify or add application codes based on their own needs on a software system that has implemented basic functions to achieve special functional requirements. On the basis of reducing the manpower and time costs of the chip manufacturer to develop user solutions, users have higher flexibility in modifying or adding application codes, can customize them by themselves, and broaden the usage scenarios.
[0004] In a first aspect, the present application provides a method for processing a fast charging protocol event, the method comprising:
[0005] Receive a target input from a user, the target input is used to insert a target module, and / or to input a first processing function corresponding to a default module; the target module is used to execute a first processing logic, and the processing logic corresponding to the target module is different from that corresponding to the default module; the first processing function is used to modify the default processing logic corresponding to the default module; the target input is used to process a target event;
[0006] Based on the target input and the processing status of the previous event corresponding to the target event, determining whether it is necessary to take over the control right corresponding to the target event;
[0007] When it is determined that the control right needs to be taken over and the previous event has been processed, the target event is processed based on the first processing logic and / or the first processing function in response to the target input.
[0008] According to the fast charging protocol event processing method provided in the embodiment of the present application, by inserting the target module, the target event can be processed based on the first processing logic, and the user can modify or add application code based on his own needs on the software system that has realized the basic functions to realize special functional requirements; when the first processing function corresponding to the default module is input, the reply content and response strategy in the PD protocol communication process can be modified and implemented based on the first processing function input by the user. When the content of the PD protocol version is updated or the user has special applications, there is no need for the original manufacturer to frequently modify the response strategy code of the PD protocol. On the basis of reducing the manpower and time costs of the chip original manufacturer to develop user solutions, the user has a higher flexibility in modifying or adding application code, can be customized by himself, and broadens the usage scenarios.
[0009] In a fast charging protocol event processing method according to an embodiment of the present application, when the target input is used to input the first processing function corresponding to the default module, processing the target event based on the first processing logic and / or the first processing function includes:
[0010] Based on the first processing function, a target task node is determined from a plurality of first task nodes corresponding to the fast charging protocol; the first processing function is determined based on the second processing logic, the target task node is a task node that needs to be processed based on the second processing logic, and the default module corresponds to the plurality of first task nodes;
[0011] In the case of determining to take over the target event corresponding to the target task node based on the first processing function, processing the target event based on the first processing function; and processing the first events corresponding to other task nodes except the target task node among the multiple first task nodes based on the default processing logic corresponding to the other task nodes.
[0012] In a fast charging protocol event processing method according to an embodiment of the present application, the multiple first task nodes include: nodes corresponding to adjusting output voltage and output current, nodes corresponding to connecting and removing Type-C, nodes corresponding to processing power transmission protocol, and nodes corresponding to processing DPDM protocol.
[0013] In a fast charging protocol event processing method according to an embodiment of the present application, processing the target event based on the first processing function includes:
[0014] Assigning the address of the first processing function to a default pointer variable to obtain a first pointer variable; the address of the default pointer variable is 0;
[0015] When the first pointer variable is a legal value, calling the first processing function;
[0016] The target event is processed based on the first processing function.
[0017] The fast charging protocol event processing method of an embodiment of the present application further includes:
[0018] When the target input is not received and / or when it is determined based on the first processing function not to take over the control right corresponding to the target event, the target event is processed based on the default processing logic.
[0019] In a fast charging protocol event processing method according to an embodiment of the present application, after the default processing logic corresponding to other task nodes other than the target task node among the multiple first task nodes is used to process the first event corresponding to other task nodes, the method further includes:
[0020] In the case where there is an abnormal situation processing node, a second input from a user is received, and based on the second input, it is determined to take over a second event corresponding to the abnormal situation processing node, in response to the second input, the second event is processed based on a second processing function; the second input is used to input the second processing function;
[0021] When the processing task corresponding to the abnormal situation processing node is completed, a third input from the user is received, and the target application code corresponding to the third input is determined to be executed based on the third input, the target application code is processed based on a third processing function in response to the third input; the third input is used to input the third processing function.
[0022] In a fast charging protocol event processing method according to an embodiment of the present application, before processing the target event based on the first processing logic and / or the first processing function in response to the target input, the method further includes:
[0023] The event flag corresponding to the target event is cleared, and a target message is returned; the target message is used to indicate that the control right corresponding to the target event needs to be taken over.
[0024] In a second aspect, the present application provides a fast charging protocol event processing device, the device comprising:
[0025] A first processing module is used to receive a target input from a user, wherein the target input is used to insert a target module and / or to input a first processing function corresponding to a default module; the target module is used to execute a first processing logic, and the processing logic corresponding to the target module is different from that corresponding to the default module; the first processing function is used to modify the default processing logic corresponding to the default module; the target input is used to process a target event;
[0026] A second processing module, configured to determine whether it is necessary to take over the control right corresponding to the target event based on the target input and the processing status of the previous event corresponding to the target event;
[0027] The third processing module is used to process the target event based on the first processing logic and / or the first processing function in response to the target input when it is determined that the control right needs to be taken over and the previous event has been processed.
[0028] According to the fast charging protocol event processing device provided in the embodiment of the present application, by inserting the target module, the target event can be processed based on the first processing logic. On the software system that has realized the basic functions, the user can modify or add application code based on his own needs to realize special functional requirements; when the first processing function corresponding to the default module is input, the reply content and response strategy in the PD protocol communication process can be modified and realized based on the first processing function input by the user. When the content of the PD protocol version is updated or the user has special applications, there is no need for the original manufacturer to frequently modify the response strategy code of the PD protocol. On the basis of reducing the manpower and time costs of the chip original manufacturer to develop user solutions, the user has higher flexibility in modifying or adding application code, can be customized by himself, and broadens the usage scenarios.
[0029] In a third aspect, the present invention provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the fast charging protocol event processing method as described in the first aspect above.
[0030] In a fourth aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the fast charging protocol event processing method as described in the first aspect above is implemented.
[0031] In a fifth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the fast charging protocol event processing method as described in the first aspect above.
[0032] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the fast charging protocol event processing method as described in the first aspect above.
[0033] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0034] By inserting the target module, the target event can be processed based on the first processing logic. On the software system that has realized the basic functions, the user can modify or add application code based on his own needs to realize special functional requirements. When the first processing function corresponding to the default module is input, the reply content and response strategy in the PD protocol communication process can be modified and implemented based on the first processing function input by the user. When the content of the PD protocol version is updated or the user has special applications, the original manufacturer does not need to frequently modify the response strategy code of the PD protocol. On the basis of reducing the manpower and time costs of the chip original manufacturer to develop user solutions, the user has higher flexibility in modifying or adding application code, can perform personalized customization by himself, and broadens the usage scenarios.
[0035] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0037] Figure 1 This is one of the flow charts of the fast charging protocol event processing method provided in the embodiment of the present application;
[0038] Figure 2 This is the second flow chart of the fast charging protocol event processing method provided in the embodiment of the present application;
[0039] Figure 3 It is a structural diagram of a fast charging protocol event processing device provided in an embodiment of the present application;
[0040] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0042] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0043] Combine the following Figure 1 to Figure 2 Describe the fast charging protocol event processing method of the embodiment of the present application.
[0044] It should be noted that the executor of the fast charging protocol event processing method can be a server, or a fast charging protocol event processing device, or a user's terminal, including but not limited to mobile terminals and non-mobile terminals.
[0045] For example, mobile terminals include but are not limited to mobile phones, PDA smart terminals, tablet computers, and vehicle-mounted smart terminals, etc.; non-mobile terminals include but are not limited to PC terminals, etc.
[0046] like Figure 1 As shown, the fast charging protocol event processing method includes: step 110, step 120 and step 130.
[0047] It should be noted that the fast charging protocol event processing method can be applied to the charging protocol software system.
[0048] The charging protocol software system may include: a default module.
[0049] By default, the module holds the control of the events corresponding to the task node.
[0050] If the user does not have special application requirements, the events corresponding to each task node are processed based on the default module by default.
[0051] Step 110, receiving the user's target input, the target input is used to insert the target module, and / or to input the first processing function corresponding to the default module; the target module is used to execute the first processing logic, and the processing logic corresponding to the target module is different from that of the default module; the first processing function is used to modify the default processing logic corresponding to the default module; the target input is used to process the target event.
[0052] In this step, the target events may include: adjusting output voltage and output current, connecting and removing Type-C, processing power transmission protocol, processing DPDM protocol, and processing abnormal events, etc.
[0053] Target input is used to process target events. During the process of processing fast charging protocol events, the user's target input can be received.
[0054] The target input may be used to insert the target module, or may be used to input the first processing logic corresponding to the default module, or may be used to both insert the target module and input the first processing function.
[0055] The target input may be in at least one of the following ways:
[0056] First, the target input may be a touch operation, including but not limited to a click operation, a slide operation, and a press operation.
[0057] In this implementation, receiving the user's target input may be receiving a touch operation of the user in the display area of the terminal display screen.
[0058] In order to reduce the user error operation rate, the effective area of the target input can be limited to a specific area, such as the upper middle area of the target module insertion and / or input first processing function interface; or when the target module insertion and / or input first processing function interface are displayed, the target control is displayed on the current interface, and the target input can be achieved by touching the target control; or the target input can be set to a continuous multiple tapping operation on the display area within a target time interval.
[0059] Secondly, the target input may be a physical key input.
[0060] In this embodiment, the terminal body is provided with a physical button corresponding to the target module and / or the first processing function, and receiving the user's target input can be an operation of receiving the user pressing the corresponding physical button; the target input can also be a combination operation of pressing multiple physical buttons at the same time.
[0061] Third, the target input may be voice input.
[0062] In this implementation, the terminal may trigger display of the insert target module interface upon receiving a voice message such as "insert target module".
[0063] Of course, in other embodiments, the target input may also be in other forms, including but not limited to character input, etc., which can be determined according to actual needs and is not limited in this embodiment of the present application.
[0064] The target module is used to execute the first processing logic.
[0065] The first processing logic can be customized based on user needs.
[0066] The default module corresponds to a default processing logic, and the first processing logic is different from the default processing logic.
[0067] In some embodiments, without receiving a target input from a user, the target event is processed based on default processing logic.
[0068] Step 120: Based on the target input and the processing status of the previous event corresponding to the target event, determine whether it is necessary to take over the control right corresponding to the target event.
[0069] In this step, in the process of implementing the fast charging protocol, multiple events need to be processed sequentially. Before processing the target event, it is necessary to determine whether it is necessary to take over the control of the target event based on the target input and the processing status of the previous event of the target event.
[0070] In some embodiments, when the target input user inserts the target module, the target module is used to execute the first processing logic. When the priority of the first logic is higher than the default processing logic, it can be determined that the control right corresponding to the target event needs to be taken over.
[0071] On the basis of determining that the control right of the target event needs to be taken over based on the target input, it can be further determined whether the control right of the target event needs to be taken over based on the processing status of the previous event.
[0072] The processing status of the previous event may include: there is a default processing logic to process the previous event, or there is no processing logic to process the previous event.
[0073] For example, in the case where there is default processing logic to handle the previous event, it may be determined that it is not necessary to take over control of the target event.
[0074] When it is determined based on the target input that the control right of the target event needs to be taken over and there is no processing logic to process the previous event, it can be determined that the control right of the target event needs to be taken over.
[0075] Step 130: When it is determined that control needs to be taken over and the previous event has been processed, in response to the target input, the target event is processed based on the first processing logic and / or the first processing function.
[0076] In this step, in the process of implementing the fast charging protocol, multiple events need to be processed sequentially. When the processing of the previous event of the target event is completed, the target event can be processed based on the first processing logic and / or the first processing function.
[0077] When the target module is inserted and the previous event is processed and it is determined that the control right of the target event needs to be taken over, the target event can be processed based on the first processing logic.
[0078] When the first processing function is input, and the previous event is processed, and it is determined that the control right of the target event needs to be taken over, the target event can be processed based on the first processing function.
[0079] When the target module is inserted and the first processing function is input, the target event can be processed together based on the first processing logic and the first processing function.
[0080] In some embodiments, where the target input is used to insert a target module, step 130 may include:
[0081] The target module obtains the control right corresponding to the target event, and processes the target event based on the first processing logic.
[0082] In this embodiment, when the target input is used to insert a target module and it is determined that the control right corresponding to the target event needs to be taken over, the control right corresponding to the target event can be transferred to the target module.
[0083] The target module may process the target event based on the first processing logic.
[0084] In some embodiments, after determining that control needs to be taken over and before processing the target event based on the first processing logic and / or the first processing function in response to the target input, the method may further include:
[0085] Clear the event flag corresponding to the target event and return the target message; the target message is used to indicate the need to take over the control corresponding to the target event.
[0086] In this embodiment, when it is determined that the control right corresponding to the target event needs to be taken over, a target message may be sent to the microcontroller module.
[0087] The target message can be used to indicate the need to take over the control corresponding to the target event.
[0088] Target messages can be used to inform the system of the current feedback communicated by external input.
[0089] If it is determined that control needs to be taken over, the user can obtain the processing rights of the target event.
[0090] Before processing the target event, the event flag corresponding to the target event may also be cleared.
[0091] Clearing the event flag corresponding to the target event may be setting the event flag corresponding to the target event to 0.
[0092] During the research and development process, the inventors discovered that in commonly used fast charging protocol chips, users often provide a list of requirements, which are then customized and programmed by the chip manufacturer. The commonly used fast charging protocol event handling method cannot modify or add application code on a software system that has already implemented basic functions. As the number of customized requirements increases, the customization process requires a large amount of manpower and time costs from the chip manufacturer. Users have low flexibility in modifying or adding application code, and are unable to perform personalized customization on their own, and the applicable scenarios are limited.
[0093] In the present application, when the target module is inserted, the target event can be processed based on the first processing logic, and the user can modify or add application code based on his own needs on the software system that has realized the basic functions to realize special functional requirements;
[0094] When the first processing function corresponding to the default module is input, the reply content and response strategy in the PD protocol communication process can be modified and implemented based on the first processing function input by the user. When the content of the PD protocol version is updated or the user has special applications, there is no need for the original manufacturer to frequently modify the response strategy code of the PD protocol. On the basis of reducing the manpower and time costs of the chip original manufacturer to develop user solutions, users have higher flexibility in modifying or adding application codes, can customize them themselves, and broaden the usage scenarios.
[0095] In some embodiments, when the target input is used to input a first processing function corresponding to a default module, processing the target event based on the first processing logic and / or the first processing function may include:
[0096] Based on the first processing function, a target task node is determined from a plurality of first task nodes corresponding to the fast charging protocol; the first processing function is determined based on the second processing logic, and the target task node is a task node that needs to be processed based on the second processing logic; the default module corresponds to the plurality of first task nodes;
[0097] When the target event corresponding to the target task node to be taken over is determined based on the first processing function, the target event is processed based on the first processing function; based on the default processing logic corresponding to other task nodes except the target task node among multiple first task nodes, the first events corresponding to other task nodes are processed.
[0098] In this embodiment, the first processing function may be determined based on the second processing logic.
[0099] The second processing logic is determined based on the special needs of the user.
[0100] The second processing logic is additional processing logic input by the user when the software system has implemented basic functions.
[0101] The second processing logic is different from the first processing logic.
[0102] When the user needs additional processing logic for the communication process of the fast charging protocol, the first processing function can be written by the user based on the second processing logic.
[0103] The first task node is a task node used to implement the fast charging protocol.
[0104] The default module may correspond to multiple first task nodes.
[0105] The fast charging protocol is a battery charging technology that shortens device charging time by improving charging efficiency.
[0106] The fast charging protocol is a communication mechanism established between the charger and the device. The charger can adjust the output voltage and current based on the needs and status of the device.
[0107] The target task node is any task node among the multiple first task nodes, and the target task node is a task node that needs to be processed based on the second processing logic.
[0108] Based on the first processing function, a target task node may be determined from a plurality of first task nodes.
[0109] For example, when the user requires the software system to output a higher voltage, the target task node may be a node corresponding to adjusting the output voltage and the output current.
[0110] In some embodiments, the plurality of first task nodes may include: nodes corresponding to adjusting output voltage and output current, nodes corresponding to connecting and removing Type-C, nodes corresponding to processing power transmission protocols, and nodes corresponding to processing DPDM protocols.
[0111] In this embodiment, the program code corresponding to the default processing logic when processing each first task node may be written by the chip manufacturer.
[0112] Each first task node corresponds to a first event.
[0113] The first event may include: adjusting output voltage and output current, connecting and removing Type-C, processing power transmission protocol, processing DPDM protocol, etc.
[0114] In the case where the target input is used to input the first processing function corresponding to the default module, the target event may be any event among the multiple first events.
[0115] When executing each first task node, it is necessary to execute the first event corresponding to each first task node.
[0116] For example, when executing the nodes corresponding to the output voltage and output current regulation, the voltage and current need to be output regulated, and the corresponding regulation tasks can be completed based on the user's configuration parameters, for example, adjusting the corresponding slope during the output voltage regulation process.
[0117] When executing the connection removal of the node corresponding to Type-C, it is necessary to detect the connection and removal of the Type-C port, and the corresponding processing logic can be completed based on the user's configuration parameters, such as the offline time of Type-C.
[0118] When executing the node corresponding to the PD protocol (USB Power Delivery, power transmission protocol), it is necessary to process the related transactions of the PD protocol, and the corresponding processing logic can be completed based on the user's configuration parameters, such as protocol switch and output voltage and current.
[0119] When executing the node corresponding to the DPDM protocol, related transactions of the DPDM protocol such as QC (Quick Charge) and SCP (Super Charge Protocol) need to be processed, and the corresponding processing logic can be completed based on the user's configuration parameters, such as protocol switch and output power.
[0120] After determining the target task node from the plurality of first task nodes, it may be determined whether it is necessary to take over the target event corresponding to the target task node based on the first processing function.
[0121] When it is necessary to take over the target event, the target event is processed based on the first processing function.
[0122] The target event is the task event under the target task node.
[0123] For example, when the target task node is a node corresponding to adjusting the output voltage and the output current, the target event may be adjusting the output voltage and the output current.
[0124] After determining the target task node, the default processing logic corresponding to other task nodes among the plurality of first task nodes except the target task node is obtained.
[0125] The default program code corresponding to the first event can be executed, and the first events corresponding to other task nodes can be processed based on the default processing logic.
[0126] like Figure 2 As shown, during the actual execution process, the first processing function input by the user to the software system can be received, and then based on the first processing function, the target task node that needs to be processed based on the second processing logic corresponding to the first processing function is determined from multiple first task nodes.
[0127] Then, when the target event corresponding to the takeover target task node is determined based on the first processing function, the target event is processed based on the first processing function, and the first events corresponding to other task nodes are processed based on the default processing logic corresponding to other task nodes.
[0128] During the actual execution process, the user may write a first processing function based on actual needs to determine the target task node that requires additional processing logic.
[0129] For example, when the target task node is a node corresponding to adjusting the output voltage and output current, and the sink device applies for an output voltage of 9V and an output current of 3A through the pd fix protocol, the user hopes to actually output a higher voltage, such as 9.6V. The user can write the first processing function by himself, input the first processing function into the software system, modify the voltage adjustment value to 9.6V, and execute the first processing function before the target task node starts, so that the voltage adjustment value is modified to 9.6V, thereby finally realizing the special functional requirement of actually outputting 9.6V.
[0130] Then, based on the default processing logic for processing Type-C, the node corresponding to the Type-C is removed from the connection, and then based on the default processing logic for processing the PD protocol, the node corresponding to the PD protocol is processed, and then based on the default processing logic for processing the DPDM protocol, the node corresponding to the DPDM protocol is processed.
[0131] It should be noted that, the logic of the nodes corresponding to the above-mentioned adjustment of the output voltage and output current is the same. Before executing the connection removal of the node corresponding to Type-C, processing the node corresponding to the power transmission protocol, and processing the node corresponding to the DPDM protocol, it is necessary to determine whether each node corresponds to additional processing logic, which will not be elaborated here.
[0132] In the present application, a first processing function written by the user is input into a software system that has implemented basic functions, and then the target task node is determined from multiple first task nodes based on the first processing function, and then the first events corresponding to other task nodes are processed based on the default processing logic to implement the basic functions required by the software system; and when the target event corresponding to the takeover target task node is determined, the target event is processed based on the first processing function. On the software system that has implemented basic functions, the user can modify or add application code based on his or her own needs to implement special functional requirements. On the basis of reducing the manpower and time costs of the chip manufacturer to develop user solutions, the user has a higher flexibility in modifying or adding application code, can perform personalized customization by himself or herself, and broadens the usage scenarios.
[0133] In some embodiments, processing the target event based on the first processing function may include:
[0134] Assign the address of the first processing function to the default pointer variable to obtain the first pointer variable; the address of the default pointer variable is 0;
[0135] When the first pointer variable is a legal value, calling the first processing function;
[0136] The target event is processed based on the first processing function.
[0137] In this embodiment, the default pointer variable may be a global function pointer variable defined in the system.
[0138] When a global function pointer variable is initialized, the global function pointer variable points to address 0.
[0139] The first pointer variable is a pointer variable obtained after processing the default pointer variable.
[0140] The address of the first pointer variable may be a legal value, or may be an illegal value.
[0141] When the first pointer variable has a legal value, the first processing function is called.
[0142] When the user needs additional processing logic for the communication process of the fast charging protocol, the first processing function can be encoded by the user.
[0143] Then, the function address of the first processing function is assigned to the default pointer variable to obtain the first pointer variable.
[0144] In some embodiments, the fast charge protocol event processing method may further include:
[0145] If the target input is not received and / or if it is determined based on the first processing function not to take over the control right corresponding to the target event, the target event is processed based on the default processing logic.
[0146] In this embodiment, when the user does not input a target input, the target event may be directly processed based on the default processing logic.
[0147] After the first pointer variable is obtained based on the first processing function, if the first pointer variable is still 0, the control right corresponding to the target event is not taken over.
[0148] Or there is application code in the first pointer variable, but you don’t need to pay attention to it, so you can directly skip the user’s application code and the user does not need to take over the target event.
[0149] In the case where it is determined not to take over the control right corresponding to the target event, the target event can be directly processed based on the default processing logic.
[0150] like Figure 2As shown, in some embodiments, after processing the first events corresponding to other task nodes based on the default processing logic corresponding to other task nodes except the target task node among the multiple first task nodes, the fast charging protocol event processing method may also include:
[0151] In the case where there is an abnormal situation processing node, a second input from a user is received, and a second event corresponding to the abnormal situation processing node is determined to be taken over based on the second input, in response to the second input, the second event is processed based on a second processing function; the second input is used to input the second processing function;
[0152] When the processing task corresponding to the abnormal situation processing node is completed, the user's third input is received, and the target application code corresponding to the third input is determined to be executed based on the third input, in response to the third input, the target application code is processed based on the third processing function; the third input is used to input the third processing function.
[0153] In this embodiment, there is an abnormal situation processing node, which may be an abnormal situation occurring in the system, for example, the abnormal situation may be an undervoltage abnormality.
[0154] The second input is used to input a second processing function.
[0155] The second input may be a touch operation, physical key input, voice input, or any other feasible input method that is the same as the target input, which will not be elaborated in this application.
[0156] The second processing function is written by the user himself, and the user can write it based on actual needs.
[0157] The second event corresponding to the abnormal situation processing node may be performing abnormal situation processing on the system.
[0158] Based on the second processing function input by the user, it can be determined whether it is necessary to take over the second event corresponding to the abnormal situation processing node.
[0159] If it is necessary to take over the second event, the second event may be processed based on the second processing function.
[0160] For example, in the event of an undervoltage exception, the user needs to raise the level of the GPIO (General Purpose I / O Ports). The user can write a second processing function by himself, process the second event based on the second processing function to raise the GPIO level, and process the second event based on the second processing function before the undervoltage exception processing begins. Ultimately, the special functional requirement of the GPIO outputting a high level when an undervoltage exception occurs can be achieved.
[0161] When the second processing function based on the user input completes processing of the second event, a default program code corresponding to the exception processing may also be executed.
[0162] The default program code for exception handling is used to handle exception occurrence and exception contact situations. The default program code is written based on the chip manufacturer, and the source code is packaged and invisible.
[0163] The third input is used to input a third processing function.
[0164] The third input may be a touch operation, physical key input, voice input, or any other feasible input method that is the same as the target input, which will not be elaborated in this application.
[0165] The third processing function is written by the user himself, and the user can write it based on actual needs.
[0166] The target application code corresponds to the third processing function.
[0167] The target application code is written by the user based on the third processing logic, and the target application code is used to implement the special functions required by the user.
[0168] Based on the third input, it can be determined whether to execute the target application code corresponding to the third input.
[0169] When the abnormal situation processing is completed and the target application code needs to be executed, the target application code can be processed based on the third processing function.
[0170] For example, when the undervoltage exception is resolved, the user needs to lower the GPIO level. The user can write a third processing function by himself, and execute the target application code based on the third processing function to lower the GPIO level. After the undervoltage exception processing is completed, the target application code is executed, and finally the special functional requirement of GPIO outputting a low level after the undervoltage exception is resolved can be achieved.
[0171] like Figure 2 As shown, in the actual execution process, after the GPIO level is pulled low, the system can start processing other processing tasks of the user.
[0172] Among them, other processing tasks may include lighting display, multi-chip interaction, and power distribution.
[0173] After processing other processing tasks of the user, the relevant processing of the system can be exited and the system enters sleep mode.
[0174] The default program code for hibernation processing is based on the chip manufacturer's original code, and the source code is packaged and invisible.
[0175] After the default program code for the sleep process is executed, the process can return to the node corresponding to the output voltage and the output current and enter the next round of loop execution.
[0176] Continue to refer Figure 2 In some embodiments, before determining the target task node from a plurality of first task nodes corresponding to the fast charging protocol based on the first processing function, the fast charging protocol event processing method may further include:
[0177] receiving a fourth input from the user;
[0178] In response to the fourth input, initializing configuration parameters corresponding to each first task node;
[0179] Based on the configuration parameters after initialization, the hardware configuration of the target software system is set, and the hardware configuration includes at least one of an analog-to-digital converter and a digital-to-analog converter; the target software system is used to execute the fast charging protocol.
[0180] In this embodiment, the fourth input is used to input configuration parameters corresponding to each first task node.
[0181] The fourth input may be a touch operation, physical key input, voice input, or any other feasible input method that is the same as the target input, which will not be elaborated in this application.
[0182] When the system is powered on for the first time, all configuration parameters can be initialized based on the user's fourth input, such as enabling the fast charging protocol and the output voltage overvoltage and undervoltage thresholds.
[0183] The configuration parameters corresponding to each first task node are global variables. For events corresponding to the same task node, different configuration parameters may result in different processing flows and results.
[0184] Based on the values of the configuration parameters, corresponding hardware configurations, such as analog-to-digital converters and digital-to-analog converters, etc., may be set.
[0185] For example, write the undervoltage threshold of the output voltage in the configuration parameters into the corresponding register.
[0186] After setting up the hardware configuration of the target software system, you can start executing the nodes corresponding to adjusting the output voltage and output current.
[0187] The fast charging protocol event processing device provided in the present application is described below. The fast charging protocol event processing device described below and the fast charging protocol event processing method described above can be referenced to each other.
[0188] The fast charging protocol event processing method provided in the embodiment of the present application can be executed by a fast charging protocol event processing device. In the embodiment of the present application, the fast charging protocol event processing method executed by the fast charging protocol event processing device is taken as an example to illustrate the fast charging protocol event processing device provided in the embodiment of the present application.
[0189] An embodiment of the present application also provides a fast charging protocol event processing device.
[0190] like Figure 3 As shown, the fast charging protocol event processing device includes: a first processing module 310, a second processing module 320 and a third processing module 330.
[0191] The first processing module 310 is used to receive a target input from a user, the target input is used to insert a target module, and / or to input a first processing function corresponding to a default module; the target module is used to execute a first processing logic, and the processing logic corresponding to the target module is different from that corresponding to the default module; the first processing function is used to modify the default processing logic corresponding to the default module; the target input is used to process a target event;
[0192] The second processing module 320 is used to determine whether it is necessary to take over the control right corresponding to the target event based on the target input and the processing status of the previous event corresponding to the target event;
[0193] The third processing module 330 is used to process the target event based on the first processing logic and / or the first processing function in response to the target input when it is determined that the control right needs to be taken over and the previous event has been processed.
[0194] According to the fast charging protocol event processing device provided in the embodiment of the present application, by inserting the target module, the target event can be processed based on the first processing logic. On the software system that has realized the basic functions, the user can modify or add application code based on his own needs to realize special functional requirements; when the first processing function corresponding to the default module is input, the reply content and response strategy in the PD protocol communication process can be modified and realized based on the first processing function input by the user. When the content of the PD protocol version is updated or the user has special applications, there is no need for the original manufacturer to frequently modify the response strategy code of the PD protocol. On the basis of reducing the manpower and time costs of the chip original manufacturer to develop user solutions, the user has higher flexibility in modifying or adding application code, can be customized by himself, and broadens the usage scenarios.
[0195] In some embodiments, when the target input is used to input the first processing function corresponding to the default module, the third processing module 330 may also be used to:
[0196] Based on the first processing function, a target task node is determined from a plurality of first task nodes corresponding to the fast charging protocol; the first processing function is determined based on the second processing logic, the target task node is a task node that needs to be processed based on the second processing logic, and the default module corresponds to a plurality of first task nodes;
[0197] When the target event corresponding to the target task node to be taken over is determined based on the first processing function, the target event is processed based on the first processing function; based on the default processing logic corresponding to other task nodes except the target task node among multiple first task nodes, the first events corresponding to other task nodes are processed.
[0198] In some embodiments, the fast charging protocol event processing device may also include a fourth processing module, which is used to set multiple first task nodes including: nodes corresponding to adjusting output voltage and output current, nodes corresponding to connecting and removing Type-C, nodes corresponding to processing power transmission protocols, and nodes corresponding to processing DPDM protocols.
[0199] In some embodiments, the third processing module 330 may also be used to:
[0200] Assign the address of the first processing function to the default pointer variable to obtain the first pointer variable; the address of the default pointer variable is 0;
[0201] When the first pointer variable is a legal value, calling the first processing function;
[0202] The target event is processed based on the first processing function.
[0203] In some embodiments, the fast charge protocol event processing device may further include a fifth processing module for:
[0204] When the target input is not received and / or when it is determined based on the first processing function not to take over the control right corresponding to the target event, the target event is processed based on the default processing logic.
[0205] In some embodiments, the fast charge protocol event processing device may further include a sixth processing module for:
[0206] After processing the first events corresponding to the other task nodes based on the default processing logic corresponding to the other task nodes except the target task node among the plurality of first task nodes, if there is an abnormal situation processing node, a second input from the user is received, and based on the second input, it is determined to take over the second event corresponding to the abnormal situation processing node, in response to the second input, the second event is processed based on the second processing function; the second input is used to input the second processing function;
[0207] When the processing task corresponding to the abnormal situation processing node is completed, the user's third input is received, and the target application code corresponding to the third input is determined to be executed based on the third input, in response to the third input, the target application code is processed based on the third processing function; the third input is used to input the third processing function.
[0208] In some embodiments, when the target input is used to insert a target module, the third processing module 330 may also be used to:
[0209] The target module obtains the control right corresponding to the target event, and processes the target event based on the first processing logic.
[0210] In some embodiments, the fast charging protocol event processing device may also include a seventh processing module, which is used to clear the event flag corresponding to the target event and return a target message after determining that control needs to be taken over and before processing the target event based on the first processing logic and / or the first processing function in response to the target input; the target message is used to indicate the need to take over control corresponding to the target event.
[0211] The fast charge protocol event processing device in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0212] The fast charge protocol event processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0213] The fast charging protocol event processing device provided in the embodiment of the present application can achieve Figure 1 to Figure 2To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0214] In some embodiments, Figure 4 As shown, an embodiment of the present application also provides an electronic device 400, including a processor 401, a memory 402, and a computer program stored in the memory 402 and executable on the processor 401. When the program is executed by the processor 401, the various processes of the above-mentioned fast charging protocol event processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0215] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0216] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the various processes of the above-mentioned fast charging protocol event processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0217] On the other hand, the present application also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the various processes of the above-mentioned fast charging protocol event processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0218] On the other hand, an embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned fast charging protocol event processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0219] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0220] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0221] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0222] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A fast charging protocol event processing method, characterized in that: include: Receive a target input from a user, where the target input is used to insert a target module and / or to input a first processing function corresponding to a default module; The target module is used to execute a first processing logic, and the processing logic corresponding to the target module is different from that corresponding to the default module; the first processing function is used to modify the default processing logic corresponding to the default module; the target input is used to process a target event; Based on the target input and the processing status of the previous event corresponding to the target event, determining whether it is necessary to take over the control right corresponding to the target event; In the case where it is determined that the control right needs to be taken over and the previous event has been processed, in response to the target input, processing the target event based on the first processing logic and / or the first processing function; Processing the target event based on the first processing logic and / or the first processing function includes: When the target module is inserted, processing the target event based on the first processing logic; When the first processing function is input, processing the target event based on the first processing function; When the target module is inserted and the first processing function is input, the target event is processed based on the first processing logic and the first processing function; In a case where the target input is used to input a first processing function corresponding to the default module, processing the target event based on the first processing logic and / or the first processing function includes: Based on the first processing function, a target task node is determined from a plurality of first task nodes corresponding to the fast charging protocol; the first processing function is determined based on the second processing logic, the target task node is a task node that needs to be processed based on the second processing logic, and the default module corresponds to the plurality of first task nodes; the second processing logic is an additional processing logic determined based on the special needs of the user; The plurality of first task nodes include: a node corresponding to adjusting output voltage and output current, a node corresponding to connecting and removing Type-C, a node corresponding to processing power transmission protocol, and a node corresponding to processing DPDM protocol; In the case of determining to take over the target event corresponding to the target task node based on the first processing function, processing the target event based on the first processing function; processing the first events corresponding to other task nodes except the target task node among the multiple first task nodes based on the default processing logic corresponding to the other task nodes; The processing of the target event based on the first processing function includes: Assigning the address of the first processing function to a default pointer variable to obtain a first pointer variable; the address of the default pointer variable is 0; When the first pointer variable is a legal value, calling the first processing function; The target event is processed based on the first processing function.
2. The fast charge protocol event processing method according to claim 1, characterized in that: After processing the first events corresponding to other task nodes based on the default processing logic corresponding to other task nodes among the multiple first task nodes except the target task node, the method further includes: In the case where there is an abnormal situation processing node, a second input from a user is received, and based on the second input, it is determined to take over a second event corresponding to the abnormal situation processing node, in response to the second input, the second event is processed based on a second processing function; the second input is used to input the second processing function; When the processing task corresponding to the abnormal situation processing node is completed, a third input from the user is received, and the target application code corresponding to the third input is determined to be executed based on the third input, the target application code is processed based on a third processing function in response to the third input; the third input is used to input the third processing function.
3. The fast charging protocol event processing method according to claim 1 or 2, characterized in that: The method further comprises: When the target input is not received and / or when it is determined based on the first processing function not to take over the control right corresponding to the target event, the target event is processed based on the default processing logic.
4. The fast charging protocol event processing method according to claim 1 or 2, characterized in that: After determining that the control right needs to be taken over and before processing the target event based on the first processing logic and / or the first processing function in response to the target input, the method further includes: The event flag corresponding to the target event is cleared, and a target message is returned; the target message is used to indicate that the control right corresponding to the target event needs to be taken over.
5. A fast charging protocol event processing device, characterized in that: include: A first processing module, used for receiving a target input from a user, wherein the target input is used for inserting a target module and / or for inputting a first processing function corresponding to a default module; The target module is used to execute a first processing logic, and the processing logic corresponding to the target module is different from that corresponding to the default module; the first processing function is used to modify the default processing logic corresponding to the default module; the target input is used to process a target event; A second processing module, configured to determine whether it is necessary to take over the control right corresponding to the target event based on the target input and the processing status of the previous event corresponding to the target event; A third processing module is used for processing the target event based on the first processing logic and / or the first processing function in response to the target input when it is determined that the control right needs to be taken over and the previous event has been processed; The third processing module is further configured to process the target event based on the first processing logic when the target module is inserted; When the first processing function is input, processing the target event based on the first processing function; When the target module is inserted and the first processing function is input, the target event is processed based on the first processing logic and the first processing function; The third processing module is further configured to determine, when the target input is used to input the first processing function corresponding to the default module, a target task node from a plurality of first task nodes corresponding to the fast charging protocol based on the first processing function; The first processing function is determined based on the second processing logic, the target task node is a task node that needs to be processed based on the second processing logic, and the default module corresponds to the multiple first task nodes; The second processing logic is an additional processing logic determined based on the special needs of the user; The plurality of first task nodes include: a node corresponding to adjusting output voltage and output current, a node corresponding to connecting and removing Type-C, a node corresponding to processing power transmission protocol, and a node corresponding to processing DPDM protocol; In the case of determining to take over the target event corresponding to the target task node based on the first processing function, processing the target event based on the first processing function; processing the first events corresponding to other task nodes except the target task node among the multiple first task nodes based on the default processing logic corresponding to the other task nodes; The processing of the target event based on the first processing function includes: Assigning the address of the first processing function to a default pointer variable to obtain a first pointer variable; the address of the default pointer variable is 0; When the first pointer variable is a legal value, calling the first processing function; The target event is processed based on the first processing function.
6. A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, characterized in that: The processor is used to run a program or instruction, and when the processor executes the program or instruction, it implements the fast charging protocol event processing method as described in any one of claims 1-4.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the fast charging protocol event processing method as described in any one of claims 1-4 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fast charging protocol event processing method as described in any one of claims 1 to 4 is implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by the processor, the fast charging protocol event processing method as described in any one of claims 1 to 4 is implemented.
