Method for function calling between components in computing device, apparatus, and device
By configuring the call identification service table and information interaction layer within the computing device, the problem of complexity of function calls between components is solved, efficient and flexible function calls between components is realized, permission management and interaction methods are simplified, and the adaptability and security of the system are improved.
Patent Information
- Application Number
- PCT/CN2024/142027
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-28
- Filing Date
- 2024-12-24
- Publication Date
- 2025-07-03
AI Technical Summary
In computing devices, how to achieve efficient function calls between components, especially when there are multiple interactive channels and permission management, it is difficult for the prior art to effectively solve the problem of function calls between components.
By configuring the call identification service table in each component, recording the correspondence between the function call identification and the interaction channel, using the information interaction layer to query the target interaction channel and sending call requests, it supports multiple interaction methods such as shared storage space and message delivery, realizes function calls between components, and manages permissions through component identification.
It realizes efficient function calls between components in computing devices, simplifies identification management, reduces the modification of call logical code, supports multiple interaction methods, and improves the flexibility and security of the system.
Smart Images

Figure CN2024142027_03072025_PF_FP_ABST
Abstract
Description
Method, device and equipment for calling functions between components in a computing device
[0001] This application claims priority to Chinese patent application No. 202311853169.7 filed on December 28, 2023, entitled “Method, apparatus and device for function calls between components within a computing device”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a method, apparatus, and device for calling functions between components in a computing device. Background Art
[0003] With the advancement of chip technology, more and more computing units are being integrated into a single chip. Each computing unit can run independent firmware. In addition to the independent firmware running on these computing units, computing systems also include traditional baseboard management controller (BMC) / embedded controller (EC) firmware, device firmware, and operating systems. In computing systems, firmware, software, and systems can all be called components. How to implement function calls between components is a key issue in computing systems. Summary of the Invention
[0004] The present invention provides a method, apparatus, and device for inter-component function calls within a computing device. The method, apparatus, and device are capable of implementing inter-component function calls within the computing device. The corresponding technical solutions are as follows:
[0005] In a first aspect, a method for function calling between components in a computing device is provided, the method comprising:
[0006] The source component receives a call identifier of a first function to be called and input parameters of the function of the first function, then determines a target interaction channel corresponding to the call identifier of the first function. Furthermore, the source component sends a call request to the destination component via the target interaction channel, wherein the call request carries the call identifier of the first function and input parameters of the function of the first function.
[0007] In the technical solution provided in the present application, the source component can support multiple interaction channels and other components for function calls. In this way, when it is necessary to make a function call with the destination component, the interaction channels supported by the function to be called can be queried, and then the function call can be made using the interaction channels supported by the function to be called and the destination component.
[0008] In one possible implementation, the method further includes:
[0009] The data to be processed is stored in a shared storage space with the destination component, wherein the input parameter of the function function of the first function includes a parameter for indicating a physical address of the data to be processed in the shared storage space.
[0010] In the technical solution provided in this application, data interaction between the source component and the destination component can be achieved by using a shared storage space.
[0011] In a possible implementation, the call request also carries data to be processed.
[0012] In the technical solution provided in this application, data interaction between the source component and the destination component can be achieved in the form of messages.
[0013] In a possible implementation, each component may be configured with a call identifier service table. Accordingly, the process of determining the target interaction channel corresponding to the call identifier of the first function may be as follows:
[0014] The target component's call identifier service table is obtained, wherein the call identifier service table records the correspondence between the call identifier and the interaction channel. Then, the target component's call identifier service table is searched for the target interaction channel corresponding to the call identifier of the first function.
[0015] In the technical solution provided by this application, each component can be configured with a call identification service table. This table records the correspondence between the call identifications of each function that component can provide and the supported interaction channels. This way, if the functions provided by a component change, only the component's call identification service table needs to be updated, without modifying the call logic code.
[0016] In a possible implementation, each component may be configured with a component identifier. Accordingly, the process of obtaining the call identifier service table of the target component may be as follows:
[0017] Receive the identifier of the target component and obtain the call identifier service table corresponding to the identifier of the target component.
[0018] In the technical solution provided in this application, each component can be configured with a component identifier. In this way, when there are multiple components that can provide the first function, a certain component can be designated as the target component through the component identifier to provide the call of the first function.
[0019] In a possible implementation, obtaining the call identification service table of the target component includes:
[0020] All components that provide the first function are taken as target components, and a call identification service table of the target components is obtained.
[0021] In the technical solution provided in the present application, when there are multiple components that can provide the first function, all components that provide the first function can be used as target components, and the call identification service table of these components can be obtained.
[0022] In a possible implementation, obtaining the call identification service table of the target component includes:
[0023] A component is selected from the components providing the first function as a target component, and a call identification service table of the target component is obtained.
[0024] In the technical solution provided in the present application, when there are multiple components that can provide the first function, a component can be selected from the components providing the first function as the target component, and a call identification service table of the target component can be obtained.
[0025] In a possible implementation, the identifier of the source component is carried in the calling request, and the identifier of the source component is used to instruct the destination component to perform a first function calling authority judgment on the source component.
[0026] In the technical solution provided in this application, the component identifier can be used to implement permission settings for function calls. After receiving a call request, the destination component can determine whether the source component has the authority to call the first function based on the identifier of the source component carried in the call request.
[0027] In one possible implementation, the method further includes:
[0028] A response returned by the destination component is received, wherein the response is the inverse code of the call identifier of the first function.
[0029] In the technical solution provided in the present application, the response to the call request is configured as the inverse code of the call identifier carried in the call request. In this way, there is no need to design a separate response, which reduces the complexity of identifier management.
[0030] In a second aspect, an apparatus for inter-component function call in a computing device is provided, the apparatus comprising:
[0031] A calling module, configured to receive a calling identifier of a first function to be called and an input parameter of a function function of the first function;
[0032] a determination module, configured to determine a target interaction channel corresponding to the call identifier of the first function;
[0033] A sending module is used to send a call request to a destination component through the target interaction channel, wherein the call request carries a call identifier of the first function and input parameters of a function function of the first function.
[0034] In a possible implementation, the apparatus further includes:
[0035] A storage module is used to store the data to be processed in a shared storage space with the target component, wherein the input parameters of the function function of the first function include parameters for indicating the physical address of the data to be processed in the shared storage space.
[0036] In a possible implementation, the call request also carries data to be processed.
[0037] In a possible implementation, the determining module is configured to:
[0038] Obtaining a call identification service table of the target component, wherein the call identification service table records a correspondence between a call identification and an interaction channel;
[0039] In the call identifier service table of the target component, the target interaction channel corresponding to the call identifier of the first function is searched.
[0040] In a possible implementation, the apparatus further includes:
[0041] A receiving module, configured to receive an identifier of a destination component;
[0042] The determining module is configured to:
[0043] Obtain a call identification service table corresponding to the identification of the target component.
[0044] In a possible implementation, the determining module is configured to:
[0045] All components that provide the first function are taken as target components, and a call identification service table of the target components is obtained.
[0046] In a possible implementation, the determining module is configured to:
[0047] A component is selected from the components providing the first function as a target component, and a call identification service table of the target component is obtained.
[0048] In a possible implementation, the calling request carries an identifier of a source component, and the identifier of the source component is used to instruct the destination component to perform a first function calling authority judgment on the source component.
[0049] In a possible implementation, the apparatus further includes:
[0050] A receiving module is used to receive a response returned by the destination component, wherein the response is the inverse code of the call identifier of the first function.
[0051] In a third aspect, a computing device cluster is provided, comprising at least one computing device, each computing device including a processor and a memory. The processor of at least one computing device is configured to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs the method for invoking functions between components within computing devices as described in the first aspect and / or any implementable embodiment of the first aspect.
[0052] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed by a computing device, enables the computing device to execute a method for function calls between components within a computing device as described in the first aspect and / or any achievable method of the first aspect.
[0053] In a fifth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method for function calls between components within a computing device as described in the first aspect and / or any achievable method in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] FIG1 is a schematic diagram of a component provided in an embodiment of the present application;
[0055] FIG2 is a schematic diagram of a system architecture provided by an embodiment of the present application;
[0056] FIG3 is a flow chart of a method for calling functions between components in a computing device according to an embodiment of the present application;
[0057] FIG4 is a schematic diagram of a format of a user identification provided in an embodiment of the present application;
[0058] FIG5 is a schematic diagram of an address mapping provided in an embodiment of the present application;
[0059] FIG6 is a schematic diagram of a device structure for function calling between components in a computing device according to an embodiment of the present application;
[0060] FIG7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0062] An embodiment of the present application provides a method for function calling between components in a computing device. The method can be applied to a computing device and can implement function calling between components in the computing device.
[0063] Referring to Figure 1, various components in a computing device are shown. These components are software, systems, or firmware in the computing device, and there are function calls between the components. As shown in Figure 1, a computing device may include the following components:
[0064] Main System: Refers to the main computing system in a computing device. It can run on a System on Chip (SoC).
[0065] Operating System (OS): Generally refers to the operating system in a computing device, including the hypervisor, host OS, guest OS, etc., running on the main system.
[0066] Subsystem: A computing unit outside the main system that has the ability to independently fetch and execute instructions. It is usually designed to implement a specific function and can run on a system on a chip (SoC).
[0067] Main System Firmware Normal: Normal privileged firmware running on the Main System in the Basic Input Output System (BIOS).
[0068] Main System Firmware high privilege level (high privilege): High privilege level firmware running on the Main System in the BIOS.
[0069] Subsystem Firmware: The firmware that runs on the subsystem in the BIOS.
[0070] BMC / EC / ...Firmware: Firmware or software running on a board management chip (Board Manager) such as a BMC / EC.
[0071] Device Firmware: The firmware or software that runs on a peripheral device.
[0072] The components shown in FIG1 are only one possible scenario. In actual implementation, there may be more or fewer components in a computing device. The embodiment of the present application does not limit the number, type, etc. of components. The solution provided by the embodiment of the present application can implement function calls including but not limited to the function calls between the components shown in FIG1.
[0073] In the implementation of the embodiment of the present application, a software program may be deployed in each component participating in a function call. The software program may be an interface program, which may be called an information interaction layer.
[0074] Referring to Figure 2, a system architecture is provided in an embodiment of the present application. The source component in Figure 2 refers to the component that initiates the call, which may be any component in Figure 1, and the destination component refers to the component being called, which may be any component in Figure 1, but is not limited to. The information interaction layer in the source component of the source operating system's caller sends the call identifier (call id) of the function to be called and the input parameters of the function function of the function. The information interaction layer in the source component queries the call identifier service table (Call ID Service Table) of the destination component to determine the interaction channel corresponding to the function to be called. The Call ID Service Table records the correspondence between the call id and interaction channel of each function that the destination component can provide. Furthermore, the information interaction layer of the source component sends a call request to the information interaction layer of the destination component through the interaction channel corresponding to the function to be called. After receiving the call request, the information interaction layer of the destination component queries the corresponding function function according to the call id carried in the call request, sends the input parameters carried in the call request to the function function, and the function function performs the corresponding processing. FIG2 shows that the functional interface layer of the source component includes at least one functional function of the function that the source component can provide, and the functional interface layer of the destination component includes at least one functional function of the function that the source component can provide.
[0075] 3 is a flowchart of a method for calling functions between components in a computing device according to an embodiment of the present application. As shown in FIG3 , the method may include the following processing steps:
[0076] Step 301: The caller in the source component sends a call identifier (call id) of a first function to be called and input parameters of a function function of the first function to the information interaction layer in the source component.
[0077] The caller can be any functional module in the source component, and the input parameters include input parameters (input), input size parameters (inputSize), output parameters (output), and output size (outputSize). Call ID is used to identify the functions that a component can provide. Each function corresponds to a call ID. The call IDs of the same function provided by different components are the same, but the call IDs of different functions are different.
[0078] In implementation, when a function module in the source component needs to call the first function, it acts as a caller and sends the call identifier (call id) of the first function and the input parameters of the function function of the first function to the information interaction layer in the source component through the first interface. For example, the first interface can be as follows:
[0079] int Call(unsigned int callId,const void*input,unsigned int inputSize,void*output,unsigned int*outputSize)
[0080] Step 302: The information interaction layer in the source component queries the target interaction channel corresponding to the call identifier of the first function.
[0081] In practice, step 302 may be implemented in the following situations:
[0082] Case 1: The source component will only call functions with one component, which is the destination component.
[0083] In this case, the information interaction layer in the source component can obtain the call ID service table (Call ID Service Table) of the destination component. The Call ID Service Table can also be called a function configuration table. The Call ID Service Table records the correspondence between the call IDs and interaction channels of each function that can be called (or provided) by the destination component. The specific naming of the Call ID Service Table is not limited in this application. The Call ID Service Table of the destination component can be shown in Table 1 below:
[0084] Table 1
[0085] The interaction channel may include local calls, chip instruction set architecture (ISA) cross-level calls, virtual bus calls, other protocol calls, etc.
[0086] There are many ways for a source component to obtain the Call ID Service Table of a destination component. The following are some examples:
[0087] Acquisition method 1: The Call ID Service Table of the target component is directly written in the source component. Accordingly, the information interaction layer of the target component can directly obtain the Call ID Service Table of the target component locally in the source component.
[0088] Acquisition method 2: The information interaction layer of the source component sends a request to obtain the Call ID Service Table to the information interaction layer of the destination component, and the information interaction layer of the destination component sends the Call ID Service Table of the destination component to the information interaction layer of the source component.
[0089] Acquisition method three: There is a designated component used to manage the Call ID Service Table of each component. Accordingly, the information interaction layer of the source component can send an acquisition request for the Call ID Service Table of the target component to the designated component, and the designated component returns the Call ID Service Table of the target component to the source component.
[0090] After obtaining the target component's Call ID Service Table, query the target component's Call ID Service Table. If the call ID of the first function is found, query the target interaction channel corresponding to the call ID of the first function. If the call ID of the first function is not found, return a message to the caller indicating that the call is not supported.
[0091] Case 2: The source component can perform function calls with multiple components, and one or more of these components can be the destination component.
[0092] In the second case, there are multiple implementation methods, and several of them are listed below for illustration.
[0093] Implementation method 1: assign an identifier to each component. The identifier is unique within the computing system and can be called a user ID.
[0094] In the first implementation, the caller may send the user ID of the destination component to the information interaction layer of the source component. Accordingly, the information interaction layer of the source component may obtain the Call ID Service Table of the component corresponding to the user ID.
[0095] In the first implementation, the user ID may be designed by combining a type and an index. The format of the user ID may be as shown in FIG4 , including 32 bits, where bit 0 to bit 23 are indexes and bit 24 to bit 31 are types.
[0096] Type: Indicates the component type. Each component must have a unique type. Based on computer components, types can include BIOS, Host OS, Guest OS, BMC, and peripheral component interconnect express (PCIe) devices. Registration is required for each additional type.
[0097] Index: represents the serial number within a certain type. The serial number is arbitrary, as long as it is unique within the same type. Uniqueness within a type can be implemented differently for different types of components:
[0098] For components within the BIOS, user IDs can be configured in a manner arranged by the BIOS developer.
[0099] For components within the OS, the process identifier (id) can be reused as the index of the component within the type.
[0100] For components within a PCIe device, a combination of bus number, device number, and function number can be used to ensure that the index of components within the PCIe device is unique. If necessary, the low bit of the segment number can be added.
[0101] The embodiment of the present application does not limit the specific implementation of the user ID of the component, and it is only necessary that the user IDs of different components are different.
[0102] Implementation method 2: All components that can provide the first function are used as target components.
[0103] In the second implementation, the information interaction layer of the source component obtains the Call ID Service Table of all components that can provide the first function, and uses these components as destination components.
[0104] Implementation method three: selecting a component as a destination component from among all components that can provide the first function.
[0105] In the third implementation method, the information interaction layer of the source component obtains the Call ID Service Table containing the call ID of the first function, and uses the components corresponding to the Call ID Service Table containing the call ID of the first function as the destination components.
[0106] Alternatively, in the third implementation method, the information interaction layer of the source component obtains the Call ID Service Table containing the call ID of the first function, and uses the component corresponding to the first obtained Call ID Service Table containing the call ID of the first function as the destination component.
[0107] Alternatively, in the third implementation method, the information interaction layer of the source component obtains the Call ID Service Table containing the call ID of the first function, and randomly selects at least one component from the components corresponding to the obtained Call ID Service Table containing the call ID of the first function as the destination component.
[0108] Step 303: The information interaction layer of the source component sends a call request to the information interaction layer of the destination component through the target interaction channel.
[0109] The calling request carries the calling identifier of the first function to be called and the input parameters of the function function of the first function.
[0110] During implementation, the information interaction layer of the source component sends a call request to the information interaction layer of the destination component according to the protocol requirements of the target interaction channel.
[0111] Depending on the interaction channel, the information interaction layer of the source component and the information interaction layer of the destination component can use different data exchange methods. For example, for interaction channels such as chip ISA cross-layer calls and virtual bus calls, data can be exchanged using shared storage space. For interaction channels such as the Intelligent Platform Management Interface (IPMI), data can be exchanged using messages. Specifically, the data to be processed can also be included in the call request and sent to the information interaction layer of the destination component.
[0112] There are many ways to implement shared storage space, which are described below as examples.
[0113] Case 1: For the same storage area in the shared storage space, the logical addresses seen by the source component and the destination component are consistent.
[0114] In this case, the caller of the source component stores the data to be processed in the shared storage space, wherein the input in the input parameter of the function function of the first function is used to indicate the logical address of the data to be processed in the shared storage space that the source component can see, and the output is used to indicate the logical address of the execution result in the shared storage space that the source component can see.
[0115] Case 2: For the same storage area in the shared storage space, the logical addresses seen by the source component and the destination component are inconsistent. Referring to Figure 5, it shows the mapping relationship between the logical addresses seen by the components and the physical addresses of the shared storage space in case 2.
[0116] In the second case, the caller of the source component stores the data to be processed in the shared storage space. The information interaction layer of the source component updates the input and output in the input parameters sent by the caller to the corresponding physical addresses based on the correspondence between the logical address of the source component and the physical address of the shared storage space, and carries the call identifier of the first function to be called and the updated input parameters in the call request and sends it to the information interaction layer of the target component.
[0117] Case 3: For the same storage area in the shared storage space, the logical addresses seen by the source component and the destination component are inconsistent, and different components have different access rights to the shared storage space.
[0118] In this case, there are many ways to implement it. The following are some examples to illustrate:
[0119] Implementation Method 1: The caller determines the accessible address range of the target component in the shared storage space, requests memory within this accessible address range, and stores the data to be processed. The source component's information interaction layer updates the input and output parameters sent by the caller to the corresponding physical addresses based on the correspondence between the source component's logical address and the physical address of the shared storage space. It then sends the call request, along with the call identifier of the first function to be called and the updated input parameters, to the target component's information interaction layer.
[0120] Implementation method 2: The caller does not care about the accessible address range of the target component in the shared storage space. The source component's information interaction layer transfers the data to be processed to the target component's accessible storage space in the shared storage space and updates the input parameter to the physical address of the data to be processed in the accessible storage space. Based on the correspondence between the source component's logical address and the physical address of the shared storage space, the output parameter sent by the caller is updated to the corresponding physical address. The call identifier of the first function to be called and the updated input parameter are carried in the call request and sent to the target component's information interaction layer.
[0121] In one possible implementation, the information interaction layer of the source component can also carry the user ID of the source component in the call request. Correspondingly, the information interaction layer of the destination component can provide a query of the Call ID Service Table of the destination component to determine whether the source component has the authority to call the first function. In addition, in order to avoid forging the user ID, the information interaction layer in the source component can perform a security review and sign the user ID, and the information interaction layer in the destination component can perform security authentication based on the trust root. Specifically, security processing such as security review, signature, and security authentication can be implemented in a variety of ways, and the embodiments of the present application do not limit this.
[0122] Step 304: The information interaction layer of the target component sends the input parameter to the function function of the first function of the target component.
[0123] During implementation, in the case of situation 1 when shared storage space is used to implement data interaction in step 303, the information interaction layer of the target component can parse the call request according to the protocol requirements of the target interaction channel, obtain the call ID carried in the call request, and query whether the Call ID Service Table of the target component supports the call ID. If supported, the input parameters carried in the call request are sent to the function function of the first function corresponding to the call ID carried in the call request through the second interface. Here, the information interaction layer can use the second interface when sending input parameters to each function function of this component.
[0124] The second interface may be as follows:
[0125] int Function(const void*input,unsigned int inputSize,void*output,unsigned int*outputSize)
[0126] In case 2 or 3 when shared storage space is used to implement data interaction in step 303, the destination component updates the input and output in the input parameters carried in the call request to the corresponding logical addresses based on the correspondence between the logical address of the destination component and the physical address of the shared storage space, and then sends the updated input parameters to the function function of the first function.
[0127] When data interaction is realized by using messages in step 303, the information interaction layer of the target component can obtain not only the input parameters but also the data to be processed by parsing the call request. Then, the information interaction layer of the target component sends the input parameters and the data to be processed carried in the call request to the function function of the first function of the target component.
[0128] In one possible implementation, when the call request carries the user ID of the source component, the information interaction layer of the destination component can obtain the user ID of the source component carried in the call request, and query the function call permission table of the destination component whether the source component has the authority to call the first function. If the source component has the authority to call the first function, step 305 is executed. If the source component does not have the authority to call the first function, step 305 is not executed.
[0129] The function call permission table of the destination component may record the correspondence between the call ID of the function that the destination component can provide and the user ID of the component that has the permission to call the function. Accordingly, when determining whether the source component has the permission to call the first function, the function call permission table of the destination component may be queried to see whether the user ID of the source component and the call ID of the first function are recorded in correspondence. If the user ID of the source component and the call ID of the first function are recorded in correspondence, it is determined that the source component has the permission to call the first function. If the user ID of the source component and the call ID of the first function are not recorded in correspondence, it is determined that the source component does not have the permission to call the first function.
[0130] Step 305: The destination component returns the execution result to the source component.
[0131] In implementation, in case 1 of using shared storage space for data interaction in step 303, the first function of the destination component stores the execution result in the storage space corresponding to the input parameter output in the shared storage space. The information interaction layer of the destination component returns the input parameter carried in the call request to the information interaction layer of the source component via the target interaction channel.
[0132] In case of case 2 or case 3 when shared storage space is used to implement data interaction in step 303, the first function of the destination component stores the execution result in the storage space corresponding to the output in the input parameter in the shared storage space. The information interaction layer of the destination component updates the input and output in the input parameters updated in step 304 to the corresponding physical addresses based on the correspondence between the logical address of the destination component and the physical address of the shared storage space, and returns the updated input parameters to the information interaction layer of the source component through the target interaction channel.
[0133] When data interaction is implemented by using messages in step 303, the information interaction layer of the destination component returns the input parameters and execution results carried in the call request to the information interaction layer of the source component.
[0134] In addition, in the case of implementation method 2 of situation three when shared storage space is used to implement data interaction in step 303, the information interaction layer of the source component needs to transfer the data to be processed to the storage space indicated by the input in the input parameter sent by the caller to the shared storage space of the source component after receiving the input parameter returned by the information interaction layer of the destination component.
[0135] In one possible implementation, after receiving the call request sent by the source component, the information interaction layer of the destination component will also return a response to the information interaction layer of the source component. In an embodiment of the present application, the inverse of the call ID carried in the call request can be used as the corresponding response. In this implementation, it is necessary to ensure that the inverse of the call ID does not repeat the call ID. For example, the design of the call ID can be: using 32 bits as the length of the call ID, where the highest 2 bits are all 1. This ensures that the inverse of the call ID and the call ID do not repeat, and there is no need to set an additional ID specifically for the response.
[0136] FIG6 is a schematic diagram of a device structure for inter-component function call in a computing device according to an embodiment of the present application. The device may be an information interaction layer in a source component. As shown in FIG6 , the device includes:
[0137] A calling module 610 is configured to receive a calling identifier of a first function to be called and an input parameter of a function function of the first function;
[0138] A determination module 620 is configured to determine a target interaction channel corresponding to the call identifier of the first function;
[0139] The sending module 630 is configured to send a call request to a destination component through the target interaction channel, wherein the call request carries a call identifier of the first function and input parameters of a function function of the first function.
[0140] In a possible implementation, the apparatus further includes:
[0141] A storage module is used to store the data to be processed in a shared storage space with the target component, wherein the input parameters of the function function of the first function include parameters for indicating the physical address of the data to be processed in the shared storage space.
[0142] In a possible implementation, the call request also carries data to be processed.
[0143] In a possible implementation, the determining module 620 is configured to:
[0144] Obtaining a call identification service table of the target component, wherein the call identification service table records a correspondence between a call identification and an interaction channel;
[0145] In the call identifier service table of the target component, the target interaction channel corresponding to the call identifier of the first function is searched.
[0146] In a possible implementation, the apparatus further includes:
[0147] A receiving module, configured to receive an identifier of a destination component;
[0148] The determining module 620 is configured to:
[0149] Obtain a call identification service table corresponding to the identification of the target component.
[0150] In a possible implementation, the determining module 620 is configured to:
[0151] All components that provide the first function are taken as target components, and a call identification service table of the target components is obtained.
[0152] In a possible implementation, the determining module 620 is configured to:
[0153] A component is selected from the components providing the first function as a target component, and a call identification service table of the target component is obtained.
[0154] In a possible implementation, the calling request carries an identifier of a source component, and the identifier of the source component is used to instruct the destination component to perform a first function calling authority judgment on the source component.
[0155] In a possible implementation, the apparatus further includes:
[0156] A receiving module is used to receive a response returned by the destination component, wherein the response is the inverse code of the call identifier of the first function.
[0157] It should be noted that the apparatus for calling functions between components within a computing device provided in the above embodiments is only exemplified by the division of the above-mentioned functional modules when performing image decoding. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the computing device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for calling functions between components within a computing device provided in the above embodiments and the method embodiment for calling functions between components within a computing device are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0158] This application also provides a computing device 100. As shown in FIG7 , computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. Processor 104, memory 106, and communication interface 108 communicate with each other via bus 102. Computing device 100 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 100.
[0159] Bus 102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG7 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 102 may include a path for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, and communication interface 108).
[0160] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0161] The memory 106 may include volatile memory, such as random access memory (RAM). The memory 106 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0162] The memory 106 stores executable program codes, and the processor 104 executes the executable program codes to implement the aforementioned method for calling functions between components in the computing device. That is, the memory 106 stores instructions for executing the method for calling functions between components in the computing device.
[0163] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.
[0164] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute a method for calling functions between components within the computing device.
[0165] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute a method for calling functions between components within the computing device.
[0166] 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 them. 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 protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for function calls between components within a computing device, characterized in that, The method is applied to a source component, and the method includes: Receiving a call identifier of a first function to be called and input parameters of a function of the first function; Determining a target interaction channel corresponding to the call identifier of the first function; Sending a call request to a destination component through the target interaction channel, where the call request carries the call identifier of the first function and the input parameters of the function of the first function.
2. The method according to claim 1, characterized in that, The method further includes: Storing data to be processed in a shared storage space with the destination component, where the input parameters of the function of the first function include a parameter for indicating a physical address of the data to be processed in the shared storage space.
3. The method according to claim 1, wherein The call request further carries the data to be processed.
4. The method according to any one of claims 1 to 3, characterized in that, The determining the target interaction channel corresponding to the call identifier of the first function includes: Obtaining a call identifier service table of the destination component, where the call identifier service table records a correspondence between call identifiers and interaction channels; Querying, in the call identifier service table of the destination component, the target interaction channel corresponding to the call identifier of the first function.
5. The method according to claim 4, wherein The method further includes: Receiving an identifier of the destination component; The obtaining the call identifier service table of the destination component includes: Obtaining the call identifier service table corresponding to the identifier of the destination component.
6. The method according to claim 4, characterized in that The obtaining the call identifier service table of the destination component includes: Regarding all components providing the first function as the destination component and obtaining the call identifier service table of the destination component.
7. The method according to claim 4, characterized in that, The obtaining the call identifier service table of the destination component includes: Selecting one component from the components providing the first function as the destination component and obtaining the call identifier service table of the destination component.
8. The method according to any one of claims 1-7, characterized in that, The call request carries an identifier of the source component, and the identifier of the source component is used to indicate that the destination component performs a first function call permission judgment on the source component.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: Receiving a response returned by the destination component, where the response is the inverse code of the call identifier of the first function.
10. A device for function calls between components within a computing device, characterized in that, The device includes: A receiving module, configured to receive a call identifier of a first function to be called and input parameters of a function of the first function; A determining module, configured to determine a target interaction channel corresponding to the call identifier of the first function; A sending module, configured to send a call request to a destination component through the target interaction channel, where the call request carries the call identifier of the first function and the input parameters of the function of the first function.
11. The device according to claim 10, wherein, The device further includes: A storage module, configured to store data to be processed in a shared storage space with the destination component, where the input parameters of the function of the first function include a parameter for indicating a physical address of the data to be processed in the shared storage space.
12. The device according to claim 10, characterized in that, The call request further carries the data to be processed.
13. The device according to any one of claims 10 - 12, characterized in that, The determining module is configured to: Obtain a call identifier service table of the destination component, where the call identifier service table records a correspondence between call identifiers and interaction channels; Query, in the call identifier service table of the destination component, the target interaction channel corresponding to the call identifier of the first function.
14. The device according to claim 13, characterized in that, The device further includes: A receiving module, configured to receive an identifier of the destination component; The determining module is configured to: Obtain a call identification service table corresponding to the identification of the target component.
15. The device according to claim 13, characterized in that, The determining module is configured to: Use all components providing the first function as the target component, and obtain the call identification service table of the target component.
16. The device according to claim 13, characterized in that, The determining module is configured to: Select one component from the components providing the first function as the target component, and obtain the call identification service table of the target component.
17. The device according to any one of claims 10-16, characterized in that, The call request carries the identification of the source component, and the identification of the source component is used to instruct the target component to perform a first function call permission determination on the source component.
18. The device according to any one of claims 10-17, characterized in that, The device further includes: A receiving module, configured to receive a response returned by the target component, where the response is the inverse code of the call identification of the first function.
19. A computing device, characterized in that, The computing device includes a processor and a memory; The processor of the computing device is configured to execute instructions stored in the memory of the computing device, so that the computing device executes the method as described in claims 1 to 9.
20. A computer program product comprising instructions, characterized in that, When the instructions are run by the computing device, the computing device executes the method as described in claims 1 to 9.
21. A computer-readable storage medium, characterized in that, Including computer program instructions, when the computer program instructions are executed by the computing device, the computing device executes the method as described in claims 1 to 9.
Citation Information
Patent Citations
Method, device and equipment for calling functions among components in computing equipment
CN120234105A
Service processing method and device, computer equipment and storage medium
CN113448594A
Calling method and device of algorithm model, computer equipment and storage medium
CN114385268A
Network request processing method and device, equipment and storage medium
CN114448998A
Method and device for realizing interaction between components, electronic equipment and storage medium
CN115757263A