CN116954942A - Interface calling method, device, vehicle and storage medium - Google Patents

Interface calling method, device, vehicle and storage medium Download PDF

Info

Publication number
CN116954942A
CN116954942A CN202310788181.8A CN202310788181A CN116954942A CN 116954942 A CN116954942 A CN 116954942A CN 202310788181 A CN202310788181 A CN 202310788181A CN 116954942 A CN116954942 A CN 116954942A
Authority
CN
China
Prior art keywords
interface
copy
copies
interfaces
target
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
CN202310788181.8A
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.)
Guangzhou Automobile Group Co Ltd
Original Assignee
Guangzhou Automobile Group 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 Guangzhou Automobile Group Co Ltd filed Critical Guangzhou Automobile Group Co Ltd
Priority to CN202310788181.8A priority Critical patent/CN116954942A/en
Publication of CN116954942A publication Critical patent/CN116954942A/en
Pending legal-status Critical Current

Links

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request

Abstract

The embodiment of the application provides an interface calling method, an interface calling device, a vehicle and a storage medium, and relates to the technical field of Ethernet communication. The method comprises the steps of responding to a calling instruction of a method interface, and exposing a plurality of copy copies of the method interface to an issuer of the calling instruction, wherein the copy copies are split based on the method interface, and the same input parameters of the copy copies are set as different preset parameters; the method comprises the steps of obtaining request parameters input by an issuer aiming at a target copy, combining preset parameters of the target copy with the request parameters to form combined parameters, wherein the target copy is one of multiple copy copies; and calling the method interface according to the combined parameters, and executing the function corresponding to the calling instruction, so that parameter input is reduced, the calling flow is simplified, and the calling efficiency of the interface is improved.

Description

Interface calling method, device, vehicle and storage medium
Technical Field
The present application relates to the field of ethernet communications technologies, and in particular, to an interface calling method, an apparatus, a vehicle, and a storage medium.
Background
The extensible Service-oriented middleware (SOME/IP) protocol based on the Internet protocol (Internet Protocol, IP) is the most widely used Service-oriented architecture (SOA) communication protocol in the vehicle-mounted Ethernet, and the core of the SOME/IP protocol is a Service which can comprise three types of interfaces, namely a Method, an Event and a process (Field).
The Field interface includes three types of interfaces, namely, an acquisition interface (Getter), a setup interface (Setter), and a notification interface (Notifier).
In practical business applications, there are three main operating requirements for data: modifying, actively inquiring and monitoring changes. The data is modified by a Method interface, actively inquired by a Getter interface, and passively acquired by an Event interface or a Notifier interface.
The Method interface includes an indefinite number of input parameters, when the Method interface is called, all the input parameters need to be input according to a certain rule (for example, input parameters of the Method interface are input sequentially), and the input format must be all correct, which is troublesome in calling. Therefore, how to reduce parameter input when the Method interface is called and simplify the call flow of the Method interface is a problem to be solved.
Disclosure of Invention
The embodiment of the application provides an interface calling method, an interface calling device, a vehicle and a storage medium, so as to solve the problems.
In a first aspect, an embodiment of the present application provides an interface calling method, where the method includes: responding to a call instruction of a method interface, and exposing a plurality of copy copies of the method interface to an issuer of the call instruction, wherein the copy copies are split based on the method interface, and the same input parameters of the copy copies are set as different preset parameters; acquiring request parameters input by the sender aiming at a target copy, and combining preset parameters of the target copy with the request parameters to form combined parameters, wherein the target copy is one of the plurality of copy copies; and calling the method interface according to the combination parameters, and executing the function corresponding to the calling instruction.
In a second aspect, an embodiment of the present application provides an interface calling device, where the device includes: the parameter setting module is used for responding to a calling instruction of a method interface and exposing a plurality of copy copies of the method interface to an issuer of the calling instruction, wherein the copy copies are split based on the method interface, and the same input parameters of the copy copies are set as different preset parameters; the parameter combination module is used for acquiring a request parameter input by the sender aiming at a target copy, combining a preset parameter of the target copy with the request parameter to form a combination parameter, wherein the target copy is one of the plurality of copy copies; and the interface calling module is used for calling the method interface according to the combination parameter and executing the function corresponding to the calling instruction.
In a third aspect, an embodiment of the present application provides a vehicle including: one or more processors; a memory; one or more applications, wherein one or more of the applications are stored in the memory and configured to be executed by one or more of the processors, the one or more applications configured to perform the method as described above.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having program code stored thereon, the program code being invoked by a processor to perform a method as described above.
According to the interface calling method, device, vehicle and storage medium provided by the embodiment of the application, the multiple copies of the method interface are exposed to the sender of the calling instruction through responding to the calling instruction of the method interface, the request parameter input by the sender for the target copy is obtained, the preset parameter of the target copy is combined with the request parameter to form the combined parameter, the method interface is called according to the combined parameter, the function corresponding to the calling instruction is executed, and as the multiple copies are obtained based on the splitting of the method interface, the same input parameter of the multiple copies is set as different preset parameters, the sender of the calling instruction can select one of the copies as the target copy according to the function requirement, and only the other input parameters except the preset parameter are input without inputting the preset parameter, so that the number of the input parameters of the method interface can be reduced, the calling flow is simplified, and the calling efficiency of the interface is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram illustrating the structure of interfaces included in a service provided by an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating an interface calling method according to an embodiment of the present application;
FIG. 3 illustrates a schematic diagram of a method interface in a "modify window position" service provided by an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of the structure of a duplicate copy and preselected interface correspondence provided by an exemplary embodiment of the application;
FIG. 5 is a flow chart illustrating a method for obtaining duplicate copies provided by an exemplary embodiment of the application;
FIG. 6 illustrates a schematic diagram of a plurality of preselected interfaces associated with the method interface of FIG. 3, in accordance with an exemplary embodiment of the present application;
FIG. 7 is a flow chart illustrating a method of invoking an interface to implement corresponding functionality provided by an exemplary embodiment of the present application;
FIG. 8 is a schematic diagram showing an association between a method interface and a preselected interface in a rollback operation according to an exemplary embodiment of the present application;
FIG. 9 is a flowchart of an interface calling method according to another embodiment of the present application;
FIG. 10 illustrates a schematic diagram of a configuration of a duplicate copy associated with a corresponding preselected interface provided by an exemplary embodiment of the application;
FIG. 11 illustrates a flow chart of a service rollback functionality provided by an exemplary embodiment of the present application;
fig. 12 is a schematic structural diagram of an interface calling device according to an embodiment of the present application;
fig. 13 shows a schematic structural diagram of a vehicle according to an embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, a clear and complete description of the technical solution in the present embodiment will be provided below with reference to the accompanying drawings in the present embodiment. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The SOME/IP protocol is the most widely used SOA architecture communication protocol in the vehicle-mounted Ethernet, the core of the SOME/IP protocol is a service, and a Server and a Client (Client) usually exist in each service, and the Server provides the service and the Client calls the service. The services may include three types of interfaces, method (Method), event (Event), and process (Field).
A service may be understood approximately as a function, for example, a service may be to modify a window position, or to activate an exhaust fan to exhaust, etc., each service corresponds to having a control object, for example, when a service is "modify window position", the control object of the service may be "front left window, front right window, rear left window, and rear right window".
The Method interface is typically initiated by Client and replied to by Server, and is commonly used to modify data in the service. After the Method interface is called, whether the Server replies or not is determined according to the calling mode, and the Method interface can generally contain an indefinite number of input parameters and output parameters.
The Event interface usually only comprises 1 output parameter, and after the Event interface is subscribed by the Client, when a certain preset condition is met, the Server actively transmits data corresponding to the Event interface to the Client. The preset condition may be to transmit according to a certain period, or to transmit when data changes, or to set according to actual service design requirements.
The Field interfaces include three types of interfaces, namely: an acquisition interface (Getter), a setup interface (Setter), and a notification interface (Notifier).
The Client can request to acquire corresponding data from the Server through the Getter interface. The Client can modify data of the Server corresponding to the Client interface through the Client interface. The Notifier interface only comprises one output parameter, and after the Client subscribes to the Notifier interface on the Server, the Notifier interface immediately acquires data corresponding to the Notifier interface in one service and sends the data to the Client, and then acquires data corresponding to the Notifier interface every time a certain preset condition is met, and sends the acquired data to the Client. For example, assuming that the service is "adjust window position", when the Client subscribes to the Notifier interface corresponding to the left front window, the Notifier interface immediately sends the current position of the front left window; after that, assuming that the preset condition is "send once per second", the Notifier interface will acquire the position of the front left window once per second, and send the acquired position of the front left window to the Client.
Because one Field interface operates on the same control object in service, the parameter formats of the get interface, the set interface and the Notifier interface in the same file interface are all identical.
It should be noted that, as shown in fig. 1, a service may include an indefinite number of Method interfaces, event interfaces, and Field interfaces, and the number of Method interfaces, event interfaces, and Field interfaces is related to the complexity of the functions implemented when designing the service, which is not limited herein.
In practical business applications, there are three main operating requirements for data: modifying, actively inquiring and monitoring changes. The data is modified by a Method interface, actively inquired by a Getter interface, and passively acquired by an Event interface or a Notifier interface.
Since most business functions need to input multiple parameters, and the Method interface includes multiple input parameters and multiple output parameters, when the functions are actually implemented, the Method interface is called to modify data in the service. However, the format of each input parameter of the Method interface may be different, and when the Method interface is called, all the input parameters need to be input according to a certain rule (for example, input sequentially according to the input parameter sequence of the Method interface), and the input format must be all correct, which is troublesome. Therefore, how to reduce parameter input as much as possible and simplify the call flow while ensuring the accuracy and completeness of parameters when the Method interface is called is a problem to be solved.
Based on the above analysis, the inventor has provided the interface calling method, the device, the vehicle and the storage medium provided by the embodiment of the application through multiple experiments, through responding to the calling instruction of the method interface, multiple copies of the method interface are exposed to the sender of the calling instruction, the request parameter input by the sender for the target copy is obtained, the preset parameter of the target copy is combined with the request parameter to form a combined parameter, the method interface is called according to the combined parameter, the function corresponding to the calling instruction is executed, and because the multiple copies are split based on the method interface, and the same input parameter of the multiple copies is set as different preset parameters, the sender of the calling instruction can select one of the copies as the target copy according to the function requirement, and only the other input parameters than the preset parameters need to be input, but the preset parameters need not to be input, so that the number of the input parameters of the method interface can be reduced, the calling flow is simplified, and the calling efficiency of the interface is improved.
Referring to fig. 2, fig. 2 is a flow chart illustrating an interface calling method according to an embodiment of the application. The interface calling method can be applied to an interface calling device or a vehicle. The interface calling method may specifically include the following steps S110 to S130.
Step S110: and responding to the call instruction of the method interface, and exposing a plurality of copy copies of the method interface to an issuer of the call instruction, wherein the copy copies are split based on the method interface, and the same input parameters of the copy copies are set as different preset parameters.
The Server provides services such as "modify window position" services. A service is composed of a set of service interfaces, which may include the above-described Method type, event type, and Field type interfaces, and the number of interfaces of each type in a set of service interfaces may be determined according to the complexity of the service corresponding to the set of service interfaces. The Client can use the service corresponding to the service interface to realize a certain function by calling the service interface, for example, when the service is a 'modify window position' service, the Client can call a Method interface in the window position service to modify the position of a certain window. In this embodiment, the method interface corresponds to a service, and the sender of the call instruction may be a Client that uses the service, where the Client may be some device of a vehicle, such as a processor or controller. The Client may also be a functional system, such as an intelligent ventilation system, which may automatically control the opening of the vehicle window upon detecting that the smoke concentration value in the vehicle reaches a set concentration value. The functional system may be understood as an actual application system of a certain service or an actual application system formed by combining a plurality of services, for example, the intelligent ventilation system may be an actual application system formed by combining a smoke detection service, a window service and an air conditioning service.
In an embodiment of the present application, exposing the plurality of replication copies to the sender refers to making the plurality of replication copies in a state that can be known to the sender, and the sender can perform certain operations (e.g., inputting request parameters) on the plurality of replication copies.
The multiple copies are obtained by splitting the method interface before the call instruction is issued by the issuer. For example, the method interface may be replicated to obtain multiple replicated copies, and for each replicated copy, a certain input parameter of the replicated copy is set as a preset parameter, where the preset parameters of different replicated copies are different. The input parameters set as preset parameters in the duplicate copy are determined according to preset splitting rules for splitting the method interface in practice.
In some embodiments, in a scenario where service restoration is not required, the preset splitting rule may be based on an input parameter in the method interface for distinguishing the control object, and splitting the method interface. For example, referring to fig. 3 and fig. 4, if the input parameter for distinguishing the control object is "the control object", the method interface shown in fig. 3 may be split into four copies shown in fig. 4, where the input parameters for distinguishing the control object in the four copies are set to different preset parameters respectively, where the control object corresponding to the preset parameter 1 is a front left window, the control object corresponding to the preset parameter 2 is a front right window, the control object corresponding to the preset parameter 3 is a rear left window, and the control object corresponding to the preset parameter 4 is a rear right window.
In other embodiments, in a scenario where service restoration is not required, the preset splitting rule may be based on an input parameter used to set an operation type in the method interface, and split the method interface.
In still other embodiments, in a scenario where service restoration is required, the preset splitting rule may further be splitting the method interface based on splitting logic of a plurality of preselected interfaces (for example, a plurality of Event interfaces, or a plurality of get interfaces, or a plurality of Notifier interfaces) that are matched with the method interface and belong to the same specified type. For example, referring to fig. 5, splitting the method interface based on splitting logic of a plurality of pre-selected interfaces (e.g., a plurality of Event interfaces, or a plurality of get interfaces, or a plurality of Notifier interfaces) mated with the method interface may include the following steps S111 and S112.
Step S111: and acquiring a plurality of preselected interfaces which are matched with the method interfaces and belong to the same appointed type, wherein the operation data and the data formats of the matched method interfaces and the preselected interfaces are the same and are in the same service, and the appointed type comprises one of an Event interface type (namely an Event interface type), a notification interface type (namely a Notifier interface type) and an acquisition interface type (namely a get interface type).
For example, referring to fig. 3, in the service of "modifying window position", the method interface of fig. 3 has four input parameters, including: an input parameter for determining a control object, an input parameter for determining a type of operation, an input parameter for determining a position of a control object, and an input parameter for determining a control priority. Referring to fig. 6, the method interface shown in fig. 3 is matched with four get interfaces, four Event interfaces and four Notifier interfaces, and the plurality of pre-selected interfaces may be four get interfaces, four Event interfaces or four Notifier interfaces.
Step S112: based on the splitting logic of the plurality of preselected interfaces, the method interfaces are split to obtain a plurality of copy copies.
Wherein the method interface has a plurality of input parameters. The first characteristic values of the preselected interfaces can be determined according to the splitting logic of the preselected interfaces to obtain a plurality of first characteristic values, and different preselected interfaces correspond to different first characteristic values; determining a target input parameter from a plurality of input parameters of a method interface, wherein a plurality of first characteristic values correspond to the same target input parameter; copying the method interfaces to obtain a plurality of copy copies, wherein the number of the copy copies is the same as that of the preselected interfaces; and setting target input parameters in the plurality of copies to different preset parameters based on the plurality of first characteristic values, wherein each preset parameter corresponds to one first characteristic value, and each preset parameter corresponds to one copy.
The plurality of preselect interfaces of the same type are provided with certain splitting logic, and the plurality of preselect interfaces can be distinguished according to the splitting logic. When the method interface is duplicated, the input parameters included in each duplicated copy are consistent with the input parameters included in the method interface, and as shown in fig. 4, in each duplicated copy split by the method interface shown in fig. 3, the input parameters include a control object, an operation type, a target position and a control priority, and the meaning of the input parameters included in the method interface shown in fig. 3 and the data format are consistent; after setting the target input parameters in the multiple copies as different preset parameters, each copy has one input parameter which is already set as a preset parameter, as shown in fig. 4, the input parameters for distinguishing the control objects in the four copies are respectively set as different preset parameters 1, 2, 3 and 4, wherein the control object corresponding to the copy with the preset parameter of 1 is a front left window, the control object corresponding to the copy with the preset parameter of 2 is a front right window, the control object corresponding to the copy with the preset parameter of 3 is a rear left window, and the control object corresponding to the copy with the preset parameter of 4 is a rear right window.
It should be noted that, when the service is designed, the splitting logic of the multiple pre-selected interfaces of the same type in the service is determined by the specific function to be implemented by the service, and the relationships among the multiple first feature values of the multiple pre-selected interfaces of the same type correspond to the splitting logic.
For ease of understanding, referring to fig. 3, 4 and 6, the method interfaces shown in fig. 3 and the services corresponding to the plurality of pre-selected interfaces shown in fig. 6 are all "modified window positions", and based on the actual application scenario of the service, when designing the service, the splitting logic, i.e. "control object", of the plurality of pre-selected interfaces has been determined in advance. Based on the splitting logic, determining first characteristic values of the plurality of preselected interfaces as: front left window, front right window, back left window, and back right window. In the method interface, the input parameters corresponding to the first characteristic values are found to be control objects, the method interface is used for copying four copy copies shown in fig. 4, the control objects of the four copy copies are respectively set to be 1, 2, 3 and 4 to correspond to the four different first characteristic values, wherein 1 corresponds to a front left window, 2 corresponds to a front right window, 3 corresponds to a rear left window, and 4 corresponds to a rear right window, so that the final four copy copies are obtained.
In some implementations, all input parameters for multiple duplicate copies may be exposed to the issuer; in this case, the sender can only input other parameters than the preset parameters, and the preset parameters cannot be input.
In some embodiments, considering that the number of the copy copies of the method interface is larger and the storage space is occupied, in order to save the storage space, a part of the copy copies except for a preset parameter can be exposed to an issuer based on the identification information of the copy copies, and by hiding the preset parameter in the copy copies, only the part of the copy copies except for the preset parameter is displayed, so that the storage space can be saved to a certain extent, and meanwhile, the content of the copy copies exposed to the issuer can be reduced, thereby reducing the 'seen' information of the issuer.
The multiple copies have different identification information that may be set prior to exposing the multiple copies to the issuer. The identification information of each copy corresponds to a preset parameter in the copy or corresponds to a first characteristic value corresponding to the copy. The identification information is used to uniquely identify the duplicate copies to distinguish between the different duplicate copies so that the sender can identify the different duplicate copies based on the identification information to input the request parameters for the duplicate copies corresponding to the control object to be controlled. The identification information may be the name of the duplicate copy, or may be an identification number (IdentityDocument, ID), or may be other information that can be used to uniquely identify the duplicate copy, which is not limited herein. The setting form of the identification information is preferably that the sender of the call instruction can accurately identify the call instruction.
Step S120: and acquiring request parameters input by an issuer aiming at the target copy, combining preset parameters of the target copy with the request parameters to form combined parameters, wherein the target copy is one of a plurality of copy copies.
After exposing the plurality of copy copies to the sender, the sender can identify control objects corresponding to different copy copies through the identification information, and the sender selects one copy of the plurality of copy copies as a target copy according to the control object which is actually wanted to be controlled, and inputs request parameters to the target copy. The request parameters refer to other input parameters input by the sender besides preset parameters. As shown in fig. 4, the request parameters may be an operation type, a target position, and a control priority other than the control object.
And responding to an ending instruction of the request parameters input by the sender aiming at the target copy, and acquiring the request parameters input by the sender aiming at the target copy. The ending instruction may be a preset character, and when detecting that the sender inputs the preset character, the ending instruction determines that the sender inputs the preset character, and takes a character before the preset character as a request parameter.
Step S130: and calling the method interface according to the combined parameters, and executing the function corresponding to the calling instruction.
It should be noted that, because the duplicate copy itself does not have the function of the method interface, and the method interface needs to be invoked with complete input parameters, after the request parameters are obtained, the request parameters and the preset parameters of the target copy need to be combined to form combined parameters, and the original method interface is invoked by using the combined parameters, so as to implement the corresponding function. For example, assume that the target copy is the copy in fig. 7, and the preset parameter in the target copy is "1" for characterizing the control object as the front left window. When the target copy is called, the "control object" is hidden, and the issuer can only input other parts than the "control object". Assuming that the operation type is "1", the target position is "20%", and the control priority is "1" in the request parameters of the target copy, the combination parameters in the target copy are: the method comprises the steps of sequentially inputting 1, 20 percent and 1 in combination parameters into a method interface as input parameters of the method interface, namely calling an original method interface, and realizing the function of modifying the window position of a left front window.
According to the interface calling method provided by the embodiment of the application, the multiple copies of the method interface are exposed to the sender of the calling instruction through responding to the calling instruction of the method interface, the request parameter input by the sender aiming at the target copy is obtained, the preset parameter of the target copy is combined with the request parameter to form the combined parameter, the method interface is called according to the combined parameter, the function corresponding to the calling instruction is executed, and as the multiple copies are obtained by splitting the method interface, the same input parameter of the multiple copies is set to be different preset parameters, the sender of the calling instruction can select one of the copies as the target copy according to the function requirement, and only the other input parameters except the preset parameter are input without inputting the preset parameter, so that the number of the input parameters of the method interface can be reduced, the calling process is simplified, and the calling efficiency of the interface is improved.
In the related art, when the service involves automatic rollback or restoration, that is, in a scenario where service restoration is required, before the method interface is called to modify data, the initial state of the control object needs to be acquired through the pre-selected interface, after modification is finished, the initial state is then used as an input parameter to be transferred into the method interface, and the method interface is called again to complete rollback.
However, in the method interface, "the input parameter for determining the control object" generally has a plurality of values, that is, when the same method interface is called, the control object is different according to the input "the input parameter for determining the control object". Each pre-selection interface (for example, event interface or Notifier interface or get interface) only corresponds to one control object, only has one output parameter, the output parameter of the pre-selection interface is input into the method interface, and the method interface cannot identify the corresponding control object, so that the service rollback or restoration is difficult to realize.
For example, the pre-selection interface (e.g., event interface or Notifier interface or get interface) shown in fig. 6 has only the target position (e.g., 50%) of the output parameter, and the method interface only obtains the target position (e.g., 50%), which is the control object that cannot determine the target position, so that the pre-selection interface cannot be directly associated with the method interface, that is, the service cannot be rolled back or restored.
In order to realize the rollback or restoration of the service, as shown in fig. 8, in the related art, a method interface and a pre-selected interface are manually judged, and the corresponding relationship is written into a code to perform fixed definition, so that output parameters acquired by the pre-selected interface can be used as input parameters to enter the method interface, and a control object can be correctly identified by the method interface. However, for higher complexity services, this approach consumes excessive resources, is costly and inefficient to implement.
In some embodiments, to enable more efficient rollback or restoration of the service, referring to fig. 9, before step S130, the interface calling method further includes step S140, and after step S130, the interface calling method further includes step S150 to implement a rollback operation of the service.
Step S140: and acquiring an initial state value of the control object corresponding to the target preselection interface through the target preselection interface associated with the target copy.
In some embodiments, considering that some services need to be restored after use or after a period of use, multiple copies and multiple pre-selected interfaces may be associated, where each copy corresponds to one pre-selected interface, so that output parameters of the pre-selected interfaces serve as input parameters of the copy, and meanwhile, control objects of the copy are preset, that is, operations of rollback or restoration can be correctly performed on the services, so that efficiency is improved.
The method comprises the steps that a plurality of copy copies and a plurality of pre-selected interfaces can be matched according to first characteristic values of the plurality of pre-selected interfaces and preset parameters of the plurality of copy copies, and the preset parameters of the copy copies and the first characteristic values of the pre-selected interfaces have corresponding relations in the matched copy copies and the pre-selected interfaces; determining a second characteristic value according to output parameters of a plurality of preselected interfaces, wherein the preselected interfaces correspond to the same second characteristic value; for each of the plurality of duplicate copies, determining an input parameter corresponding to the second characteristic value in the input parameters of the current duplicate copy as an associated parameter of the current duplicate copy; and associating the preselected interface matched with the current copy based on the association parameters.
For ease of understanding, referring to fig. 10, for the four copies obtained in the example, since the preset parameters of the four copies are set according to the first characteristic values of the four preselected interfaces, respectively, the four copies may be matched with the four preselected interfaces one by one. Since the type of the pre-selected interface is one of a get, event, or Notifier, the pre-selected interface has only one output parameter. And acquiring a second characteristic value, namely a 'position', according to the output parameters of the four preselected interfaces. As shown in fig. 10, in the duplicate copy, the input parameter corresponding to the "position" is found as the "target position" as the associated parameter of the duplicate copy.
In this embodiment, since the control object of each copy is unique, the preselected interface that cannot be directly associated with the method interface may be directly associated with the copy, that is, the rollback or restoration of the service may be efficiently performed.
In some embodiments, in the process of calling the method interface, the real-time state value of the control object corresponding to the target pre-selection interface can be obtained through the target pre-selection interface associated with the target copy, so as to monitor the state change condition of the control object corresponding to the target pre-selection interface. The type of the target pre-selection interface may be one of a Getter, an Event, or a Notifier, which is not limited herein. For example, when the method interface is called to adjust the position of the vehicle window, the adjusted position of the vehicle window can be acquired for multiple times in a certain time period through an Event and fed back to the user in a visual mode, so that the user can monitor the state of the vehicle window.
The target pre-selection interface may be a Getter interface or a Notifier interface corresponding to the target copy.
It should be noted that, in the service, the control object in the service receives a state of being objectively present, for example, in the service of "adjusting the window positions", each window has an objectively present position. The "initial state value" is the current state value of the control object corresponding to the target pre-selection interface before the method interface is called by the calling instruction, for example, the control object of the target copy is the left front window, the current window position of the left front window is 50%, and the obtained initial state value is 50%.
Step S150: based on the initial state value of the control object and the target copy, the state of the control object is restored to the initial state.
In some embodiments, the initial state values may be assigned to associated parameters in the target copy, and other input parameters in the target copy are along with the request parameters, and recombined to form the rollback parameters.
For example, as shown in fig. 11, assuming that the control object is a front left window, the current position (i.e. the initial state value) of the front left window may be obtained and stored through a corresponding target pre-selection interface (e.g. a Getter interface) of the front left window position, after the function is implemented by calling the instruction calling method interface, the stored current position of the front left window is assigned to the associated parameters of the target copy for use, and parameter combination is performed again to form a rollback parameter, and the function of recovering the window position is implemented by calling the method interface using the rollback parameter.
Based on step S140 and step S150, after the method interface is called for data modification, the target copy is used, that is, the unique control object is determined, so that the rollback parameter can be formed by combining the temporarily stored initial state value, the preset parameter in the target copy and the other used request parameter, and the method interface is called again, thereby more efficiently completing the rollback operation on the service.
Referring to fig. 12, fig. 12 is a schematic structural diagram of an interface calling device 100 according to an embodiment of the application. The interface call apparatus 100 may include the following components: a parameter setting module 110, configured to respond to a call instruction of a method interface, and expose multiple copies of the method interface to an issuer of the call instruction, where the multiple copies are split based on the method interface, and the same input parameters of the multiple copies are set to different preset parameters; the parameter combination module 120 is configured to obtain a request parameter input by an issuer for a target copy, combine a preset parameter of the target copy with the request parameter to form a combined parameter, where the target copy is one of multiple copy copies; the interface calling module 130 is configured to call the method interface according to the combination parameter, and execute the function corresponding to the calling instruction.
In some embodiments, the interface call apparatus 100 further includes a copy acquisition module. The copy acquisition module is used for acquiring a plurality of preselected interfaces which are matched with the method interfaces and belong to the same appointed type, wherein the operation data and the data format of the matched method interfaces and the preselected interfaces are the same and are in the same service, and the appointed type comprises one of an event interface type, a notification interface type and an acquisition interface type; splitting the method interface based on splitting logic of a plurality of preselected interfaces to obtain a plurality of copy copies; and associating a plurality of duplicate copies with a plurality of preselected interfaces, each duplicate copy corresponding to one preselected interface.
In some embodiments, the method interface has a plurality of input parameters, and the splitting association module is further configured to determine first feature values of a plurality of pre-selected interfaces according to splitting logic of the plurality of pre-selected interfaces, so as to obtain a plurality of first feature values, where different pre-selected interfaces correspond to different first feature values; determining a target input parameter from a plurality of input parameters of a method interface, wherein a plurality of first characteristic values correspond to the same target input parameter; copying the method interfaces to obtain a plurality of copy copies, wherein the number of the copy copies is the same as that of the preselected interfaces; and setting target input parameters in the plurality of copies to different preset parameters based on the plurality of first characteristic values, wherein each preset parameter corresponds to one first characteristic value, and each preset parameter corresponds to one copy.
In some embodiments, the splitting association module is further configured to match the plurality of copies with the plurality of pre-selected interfaces according to the first feature values of the plurality of pre-selected interfaces and the preset parameters of the plurality of copies, where the preset parameters of the copies have a corresponding relationship with the first feature values of the pre-selected interfaces; determining a second characteristic value according to output parameters of a plurality of preselected interfaces, wherein the preselected interfaces correspond to the same second characteristic value; for each of the plurality of duplicate copies, determining an input parameter corresponding to the second characteristic value in the input parameters of the current duplicate copy as an associated parameter of the current duplicate copy; and associating the preselected interface matched with the current copy based on the association parameters.
In some embodiments, the plurality of copies have different identification information, and the parameter setting module 110 is further configured to expose a portion of the plurality of copies other than the preset parameter to the issuer based on the identification information of the plurality of copies, so that the issuer identifies the plurality of copies based on the identification information of the plurality of copies.
In some embodiments, the plurality of preselected interfaces are all acquisition interfaces, and the interface calling device 100 further includes a service rollback module. The service rollback module is used for acquiring an initial state value of a control object corresponding to the target acquisition interface through the target acquisition interface associated with the target copy before the method interface is called according to the combination parameters and the step of executing the function corresponding to the calling instruction; after the method interface is called according to the combination parameters and the step of calling the function corresponding to the instruction is executed, the state of the control object is restored to the initial state based on the initial state value of the control object and the target copy.
In some embodiments, the plurality of pre-selected interfaces are all acquisition interfaces, or are all notification interfaces, or are all event interfaces, and the interface calling device 100 further includes a status monitoring module. The state monitoring module is used for acquiring a real-time state value of a control object corresponding to the target acquisition interface through the target acquisition interface associated with the target copy in the process of calling the method interface so as to monitor the state change condition of the control object corresponding to the target acquisition interface; or in the process of calling the method interface, acquiring a real-time state value of a control object corresponding to the target notification interface through the target notification interface associated with the target copy so as to monitor the state change condition of the control object corresponding to the target notification interface; or in the process of calling the method interface, acquiring the real-time state value of the control object corresponding to the target event interface through the target event interface associated with the target copy so as to monitor the state change condition of the control object corresponding to the target event interface.
Those skilled in the art can clearly understand that the interface calling device provided by the embodiment of the application can implement the interface calling method provided by the embodiment of the application. The specific working process of the above modules may refer to the process corresponding to the interface calling method in the embodiment of the present application, which is not described in detail herein.
In the embodiments of the present application, the modules shown or discussed are coupled or directly coupled or communicatively coupled to each other via some interfaces, devices or modules, which may be electrical, mechanical or otherwise.
In addition, each functional module in the embodiment of the present application may be integrated in one processing module, or each module may exist alone physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software as functional modules, which are not limited in this embodiment of the present application.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a vehicle according to an embodiment of the present application. The vehicle may include the following components: one or more processors 210, memory 220; one or more applications stored in the memory 220 and configured to be executed by the one or more processors 210, the one or more applications for performing the methods as described in the above embodiments.
Wherein the processor 210 may include one or more processing cores. The processor 210 utilizes various interfaces and lines to connect various portions of the overall vehicle 200, perform various functions of the vehicle and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 220, and invoking data stored in the memory 220. The processor 210 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 210 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), and a modem, etc. It will be appreciated that the modem may not be integrated into the processor 210 and may be implemented solely by a single communication chip.
The Memory 220 may include a random access Memory (Random Access Memory, RAM) or a Read Only Memory (ROM). Memory 220 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 220 may include a stored program area and a stored data area. The storage program area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, and the like. The storage data area may store data created by the vehicle 200 in use, etc.
The embodiments of the present application also provide a computer readable storage medium having stored therein a program code for performing the method as described in the method embodiments described above when being called by a processor.
The computer readable storage medium may be an electronic Memory such as flash Memory, electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read Only Memory, EEPROM), electrically programmable Read-Only Memory (Electrical Programmable Read Only Memory, EPROM), hard disk, or Read Only Memory (ROM). In some implementations, the computer readable storage medium may include a non-volatile computer readable medium (NTRSM). The computer readable storage medium has storage space for program code to perform any of the method steps described above. The program code can be read from or written to one or more computer program products. The program code may be compressed in a suitable form.
Although the present application has been described in terms of the preferred embodiments, it should be understood that the present application is not limited to the specific embodiments, but is capable of numerous modifications and equivalents, and alternative embodiments and modifications of the embodiments described above, without departing from the spirit and scope of the present application.

Claims (10)

1. An interface calling method, the method comprising:
responding to a call instruction of a method interface, and exposing a plurality of copy copies of the method interface to an issuer of the call instruction, wherein the copy copies are split based on the method interface, and the same input parameters of the copy copies are set as different preset parameters;
acquiring request parameters input by the sender aiming at a target copy, and combining preset parameters of the target copy with the request parameters to form combined parameters, wherein the target copy is one of the plurality of copy copies;
And calling the method interface according to the combination parameters, and executing the function corresponding to the calling instruction.
2. The method of claim 1, wherein the step of exposing a plurality of duplicate copies of the method interface to an issuer of a call instruction in response to the call instruction of the method interface, the method further comprises:
acquiring a plurality of preselected interfaces which are matched with the method interfaces and belong to the same appointed type, wherein the operation data and the data formats of the matched method interfaces and the preselected interfaces are the same and are in the same service, and the appointed type comprises one of an event interface type, a notification interface type and an acquisition interface type;
splitting the method interface based on splitting logic of the plurality of preselected interfaces to obtain a plurality of copy copies;
and associating the plurality of duplicate copies with the plurality of preselected interfaces, wherein each duplicate copy corresponds to one preselected interface.
3. The method of claim 2, wherein the method interface has a plurality of input parameters, and wherein the step of splitting the method interface based on splitting logic of the plurality of preselected interfaces to obtain a plurality of duplicate copies comprises:
Determining first characteristic values of the plurality of preselected interfaces according to the splitting logic of the plurality of preselected interfaces to obtain a plurality of first characteristic values, wherein different preselected interfaces correspond to different first characteristic values;
determining a target input parameter from a plurality of input parameters of the method interface, wherein the plurality of first characteristic values correspond to the same target input parameter;
copying the method interfaces to obtain a plurality of copy copies, wherein the number of the copy copies is the same as that of the preselected interfaces;
and setting target input parameters in the plurality of copies to different preset parameters based on the plurality of first characteristic values, wherein each preset parameter corresponds to one first characteristic value, and each preset parameter corresponds to one copy.
4. The method of claim 3, wherein the step of associating the plurality of duplicate copies with the plurality of preselected interfaces, each duplicate copy corresponding to one preselected interface comprises:
matching the plurality of copies with the plurality of preselect interfaces according to the first characteristic values of the plurality of preselect interfaces and the preset parameters of the plurality of copies, wherein the preset parameters of the copies have a corresponding relation with the first characteristic values of the preselect interfaces in the matched copies and preselect interfaces;
Determining a second characteristic value according to the output parameters of the plurality of preselected interfaces, wherein the plurality of preselected interfaces correspond to the same second characteristic value;
for each of the plurality of duplicate copies, determining an input parameter corresponding to the second characteristic value in the input parameters of the current duplicate copy as an associated parameter of the current duplicate copy; and associating a preselected interface matched with the current copy based on the association parameters.
5. The method of claim 1, wherein the plurality of duplicate copies have different identifying information, the step of exposing the plurality of duplicate copies of the method interface to the issuer of the call instruction comprising:
and exposing a portion of the plurality of duplicate copies other than a preset parameter to the issuer based on the identification information of the plurality of duplicate copies, so that the issuer identifies the plurality of duplicate copies based on the identification information of the plurality of duplicate copies.
6. The method of claim 4, wherein each of the plurality of preselected interfaces is an acquisition interface, the method further comprising:
before the method interface is called according to the combination parameters and the step of executing the function corresponding to the calling instruction, acquiring an initial state value of a control object corresponding to the target acquisition interface through a target acquisition interface associated with the target copy;
And after the method interface is called according to the combination parameter and the step of executing the function corresponding to the calling instruction, restoring the state of the control object to an initial state based on the initial state value of the control object and the target copy.
7. The method of claim 4, wherein the plurality of preselected interfaces are each an acquisition interface, or are each a notification interface, or are each an event interface, the method further comprising:
in the process of calling the method interface, acquiring a real-time state value of a control object corresponding to the target acquisition interface through a target acquisition interface associated with the target copy so as to monitor the state change condition of the control object corresponding to the target acquisition interface; or alternatively
In the process of calling the method interface, acquiring a real-time state value of a control object corresponding to the target notification interface through a target notification interface associated with the target copy so as to monitor the state change condition of the control object corresponding to the target notification interface; or alternatively
And in the process of calling the method interface, acquiring a real-time state value of a control object corresponding to the target event interface through a target event interface associated with the target copy so as to monitor the state change condition of the control object corresponding to the target event interface.
8. An interface calling device, comprising:
the parameter setting module is used for responding to a calling instruction of a method interface and exposing a plurality of copy copies of the method interface to an issuer of the calling instruction, wherein the copy copies are split based on the method interface, and the same input parameters of the copy copies are set as different preset parameters;
the parameter combination module is used for acquiring a request parameter input by the sender aiming at a target copy, combining a preset parameter of the target copy with the request parameter to form a combination parameter, wherein the target copy is one of the plurality of copy copies;
and the interface calling module is used for calling the method interface according to the combination parameter and executing the function corresponding to the calling instruction.
9. A vehicle, characterized by comprising:
one or more processors;
a memory;
one or more applications, wherein one or more of the applications are stored in the memory and configured to be executed by one or more of the processors, the one or more applications configured to perform the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code, which is called by a processor to perform the method according to any of claims 1 to 7.
CN202310788181.8A 2023-06-29 2023-06-29 Interface calling method, device, vehicle and storage medium Pending CN116954942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310788181.8A CN116954942A (en) 2023-06-29 2023-06-29 Interface calling method, device, vehicle and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310788181.8A CN116954942A (en) 2023-06-29 2023-06-29 Interface calling method, device, vehicle and storage medium

Publications (1)

Publication Number Publication Date
CN116954942A true CN116954942A (en) 2023-10-27

Family

ID=88443647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310788181.8A Pending CN116954942A (en) 2023-06-29 2023-06-29 Interface calling method, device, vehicle and storage medium

Country Status (1)

Country Link
CN (1) CN116954942A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150154113A1 (en) * 2012-05-12 2015-06-04 Volkswagen Ag Functionally expandable vehicle control device and method for supplementing the functionality of a vehicle control device
CN112527420A (en) * 2020-12-23 2021-03-19 平安普惠企业管理有限公司 Interface data flow processing method and device, computer equipment and medium
CN113360300A (en) * 2021-06-29 2021-09-07 平安普惠企业管理有限公司 Interface calling link generation method, device, equipment and readable storage medium
CN115022398A (en) * 2022-07-14 2022-09-06 中国工商银行股份有限公司 Interface calling method and device based on API open platform and electronic equipment
CN115285139A (en) * 2022-08-04 2022-11-04 中国第一汽车股份有限公司 Intelligent cabin control method, device, equipment and medium
CN115576217A (en) * 2022-09-30 2023-01-06 中国第一汽车股份有限公司 Vehicle testing method, device, equipment and medium
CN116028025A (en) * 2023-02-28 2023-04-28 重庆长安汽车股份有限公司 Method, device, equipment and medium for generating automobile service model frame
CN116248699A (en) * 2023-03-14 2023-06-09 安超云软件有限公司 Data reading method, device, equipment and storage medium in multi-copy scene

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150154113A1 (en) * 2012-05-12 2015-06-04 Volkswagen Ag Functionally expandable vehicle control device and method for supplementing the functionality of a vehicle control device
CN112527420A (en) * 2020-12-23 2021-03-19 平安普惠企业管理有限公司 Interface data flow processing method and device, computer equipment and medium
CN113360300A (en) * 2021-06-29 2021-09-07 平安普惠企业管理有限公司 Interface calling link generation method, device, equipment and readable storage medium
CN115022398A (en) * 2022-07-14 2022-09-06 中国工商银行股份有限公司 Interface calling method and device based on API open platform and electronic equipment
CN115285139A (en) * 2022-08-04 2022-11-04 中国第一汽车股份有限公司 Intelligent cabin control method, device, equipment and medium
CN115576217A (en) * 2022-09-30 2023-01-06 中国第一汽车股份有限公司 Vehicle testing method, device, equipment and medium
CN116028025A (en) * 2023-02-28 2023-04-28 重庆长安汽车股份有限公司 Method, device, equipment and medium for generating automobile service model frame
CN116248699A (en) * 2023-03-14 2023-06-09 安超云软件有限公司 Data reading method, device, equipment and storage medium in multi-copy scene

Similar Documents

Publication Publication Date Title
CN109450771B (en) Method and device for adding friends, computer equipment and storage medium
EP0845742A2 (en) Methods and systems for booting a computer in a distributed computing system
CN112737922B (en) Communication method, communication device, computer equipment and storage medium
JPH06509431A (en) Computer system monitoring method and device
US20220052866A1 (en) Smart home system control method and apparatus, electronic device
WO2021203848A1 (en) Device state identification method and apparatus, and smart terminal
CN106656622A (en) Method and device for configuring interface call tasks
CN115437933A (en) Automatic testing method and device, computer equipment and storage medium
CN114237676A (en) FPGA (field programmable Gate array) logic updating method, device, equipment and readable storage medium
CN112579455A (en) Interface automatic testing method and device, electronic equipment and storage medium
CN115495142A (en) Cloud resource arranging method and device, computer equipment and storage medium
CN111078424A (en) Information interaction method and device, computer equipment and storage medium
CN109409948B (en) Transaction abnormity detection method, device, equipment and computer readable storage medium
CN112130491B (en) Device state control method and device, storage medium and electronic device
CN116954942A (en) Interface calling method, device, vehicle and storage medium
CN111651494A (en) Data processing method, device, equipment and computer readable storage medium
CN112988482B (en) Server operation management method, device, terminal, server and storage medium
CN114327709A (en) Control page generation method and device, intelligent device and storage medium
CN114661569A (en) Dynamic embedded point acquisition method for user behavior data
CN111737036A (en) Service processing method and device based on robot process automation
CN112055058A (en) Data storage method and device and computer readable storage medium
CN111679899A (en) Task scheduling method, device, platform equipment and storage medium
CN111124832A (en) Data monitoring method and device, electronic equipment and storage medium
CN116955093B (en) CPU state monitoring method, device, system, equipment and storage medium
JP3012366B2 (en) Remote file access method

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