Compiling method, calling method, device, equipment and program product of classification parameters
By classifying and collecting parameters at compile time, it solves the problem of difficult maintenance of complex parameter transfer and calling logic in statically typed language systems, and achieves the effects of simplifying coding and improving operating efficiency.
Patent Information
- Application Number
- CN202411405893.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-10
AI Technical Summary
The prior art is difficult to maintain and error prone to when handling complex parameter transfer and calling logic in statically typed language systems, and the RTTI library brings additional encoding and runtime overhead.
By obtaining the parameter packaging device during the compilation period, and using the recursive template function to categorize the call parameter, the multi -group and instantiated parameter collector are generated to achieve the classification and collection of the parameters.
Simplified coding, improved operating efficiency, reduced the expenses of parameter classification logic, and avoided additional overhead during runtime.
Smart Images

Figure CN118939275B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of metaprogramming technology, and in particular to a compilation method, a calling method, a device, a equipment and a program product for classification parameters. Background Art
[0002] Static type language systems need to determine the specific type of the runtime at compile time. RTTI (Run Time Type Identification) technology usually brings runtime overhead and risks in static language systems, and is prohibited in various coding specifications.
[0003] Therefore, in traditional technologies, when differentiating and calling various types of parameters according to their types at the application layer, it is usually necessary to rely on manual coding, stable RTTI libraries, or code generation tools. Manual coding is often difficult to maintain and prone to errors when dealing with complex parameter passing, large projects, and complex call logic. RTTI libraries bring additional coding and runtime overhead, and code generation tools require additional IDL (Interactive Data Language) and specially designed generation tools.
[0004] First, IDL is a method for defining interfaces, parameters, and data types across different programming languages. In the RPC framework, input and output parameters can be distinguished. Different programs rely on the same IDL, so that different programs can call each other's logical interfaces and implement data exchange. The IDL-based code generator system can realize the automatic generation of client stub and server stub code, so that developers do not need to manually write cumbersome communication code.
[0005] Secondly, the code generator needs to parse a specific file and translate it into the code required by the target programming language based on the information in the file. The file needs to comply with specific grammatical rules. A good code generator can accurately point out the defects in the user's coding and give suggestions for corrections. However, there are many cases where the user may give a code that does not comply with specific grammatical rules. Therefore, the code generator needs to implement parsing based on specific rules and generate code that complies with the support of various programming languages. Based on the above description, the code generator is very complex in design.
[0006] Therefore, these methods lack versatility and cannot simplify coding and improve operating efficiency in batch processing of different types of parameter scenarios. Summary of the invention
[0007] Based on this, it is necessary to provide a compilation method, calling method, device, equipment and program product for classified parameters that can classify parameters during compilation, simplify encoding and improve operating efficiency in response to the above technical problems.
[0008] In a first aspect, the present application provides a method for compiling classification parameters, the method comprising:
[0009] Obtaining a parameter wrapper obtained by wrapping the parameters to be called during compile time, wherein the parameter wrapper includes a parameter type;
[0010] During the compile time, the parameters to be called that are wrapped by the parameter wrapper are classified by recursive template functions and parameter types to obtain at least one tuple, and the at least one tuple is instantiated to obtain each instantiated parameter collector, each tuple storing a type of parameters to be called.
[0011] In one embodiment, before obtaining the parameter wrapper obtained by wrapping the parameter to be called, the method includes:
[0012] The parameter to be called is packaged to obtain a parameter wrapper including reference information and parameter type of the parameter to be called, wherein the parameter type is only retained during compilation.
[0013] In one embodiment, the method of classifying the parameters to be called wrapped by the parameter wrapper by using a recursive template function and a parameter type to obtain at least one tuple, and instantiating the at least one tuple to obtain each instantiated parameter collector includes:
[0014] Based on the parameter wrapper, storing the parameters to be called into the target parameter part;
[0015] Acquire the current parameter to be called from the target parameter part, add the current parameter to be called to the tuple part based on the parameter type, and then instantiate the tuple part to obtain a currently instantiated parameter collector;
[0016] Generate a next parameter calling function based on the remaining parameters to be called in the target parameter part;
[0017] Based on the next parameter, the function is called to obtain the next parameter to be called from the target parameter part as the current parameter to be called, and continues to add the current parameter to be called to the tuple part based on the parameter type, and then instantiates the tuple part to obtain the currently instantiated parameter collector, until all the parameters to be called in the target parameter part are classified, generate a termination condition, and obtain each instantiated parameter collector.
[0018] In one embodiment, adding the current parameter to be called to the tuple part based on the parameter type includes:
[0019] In the case where the current parameter to be called is the first parameter to be called, based on the parameter type of the current parameter to be called, the current parameter to be called is added to an empty tuple of the tuple part to obtain a first target tuple, and the parameter type of the first target tuple is modified;
[0020] In the case where the current parameter to be called is not the first parameter to be called, and the parameter types of the tuples in the instantiated tuple part are all different from the type of the current parameter to be called, based on the parameter type of the current parameter to be called, the current parameter to be called is added to a new empty tuple in the tuple part to obtain a second target tuple, and the parameter type of the second target tuple is modified;
[0021] When the current parameter to be called is not the first parameter to be called, and there is a third target tuple in the instantiated tuple part whose parameter type is the same as the type of the current parameter to be called, the current parameter to be called is added to the third target tuple.
[0022] In one embodiment, the method further comprises:
[0023] Instantiating a user program, wherein the user program is used to call each instantiated parameter collector;
[0024] Based on the at least one tuple, instantiate a corresponding type of calling function to obtain each instantiated parameter executor; the calling function in each instantiated parameter executor is used to call the corresponding type of the to-be-called parameter;
[0025] A compilation result is obtained based on the instantiated user program, each instantiated parameter collector, and each instantiated parameter executor.
[0026] In one embodiment, instantiating a corresponding type of calling function based on the at least one tuple to obtain each instantiated parameter executor includes:
[0027] Obtaining a current tuple from the tuple part, and calling a template function inside the parameter executor based on the current tuple;
[0028] Instantiating the template function based on the current tuple to obtain a calling function, and obtaining an instantiated parameter executor based on the calling function;
[0029] The next tuple is obtained as the current tuple, and the step of calling the template function inside the parameter executor through the current tuple is continued until all the tuples are processed.
[0030] In one embodiment, before instantiating the user program, the method further includes:
[0031] Configure the calling order and calling status of each instantiated parameter executor in the user program;
[0032] Obtain the configured user program.
[0033] In a second aspect, the present application also provides a classification parameter calling method, the method comprising:
[0034] Call each instantiated parameter collector obtained by the compilation method based on the classification parameters described in any of the above embodiments to obtain at least one tuple, wherein each of the tuples stores a class of collected parameters to be called, and the type of parameters to be called corresponding to each of the tuples is different.
[0035] In one embodiment, the calling of each instantiated parameter collector obtains at least one tuple, including:
[0036] Obtain the current parameters to be called, and call the currently instantiated parameter collector to process the current parameters to be called to obtain the current tuple;
[0037] Get the next parameter collector as the currently instantiated parameter collector;
[0038] The remaining parameters to be called are passed to the currently instantiated parameter collector, and the step of obtaining the currently instantiated parameters to be called is continued until the termination condition of the instantiated parameter collector is met, and the obtained tuple is obtained.
[0039] In one embodiment, calling each instantiated parameter collector to obtain at least one tuple further includes:
[0040] At least one tuple is obtained by cyclically calling each instantiated parameter collector through an instantiated user program, wherein the instantiated user program is triggered based on the interface calling instruction after receiving the interface calling instruction.
[0041] In one embodiment, the method further comprises:
[0042] Each instantiated parameter executor is called in sequence through the instantiated user program, and the tuple of corresponding parameter types is processed to obtain a calling result.
[0043] In one of the embodiments, the termination condition of the instantiated parameter collector is the parameter collector termination condition function, and the parameter collector termination condition function is generated after all the parameters to be called in the target parameter part are classified when the parameter collector is compiled.
[0044] In a third aspect, the present application further provides a classification parameter compilation device, the device comprising:
[0045] A parameter wrapper acquisition module, used to acquire a parameter wrapper obtained by wrapping the parameters to be called during compilation, wherein the parameter wrapper includes a parameter type;
[0046] The parameter collector instantiation module is used to classify the parameters to be called wrapped by the parameter wrapper through recursive template functions and parameter types during compilation to obtain at least one tuple, and instantiate the at least one tuple to obtain each instantiated parameter collector, each tuple storing a type of parameters to be called.
[0047] In a fourth aspect, the present application further provides a classification parameter calling device, the device comprising:
[0048] A parameter collector calling module is used to call each instantiated parameter collector obtained by the compilation device based on the classification parameters in any of the above embodiments to obtain at least one tuple, wherein each of the tuples stores a class of collected parameters to be called, and the type of parameters to be called corresponding to each tuple is different.
[0049] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in any one of the above embodiments when executing the computer program.
[0050] In a sixth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in any one of the above embodiments.
[0051] The above-mentioned compilation method, calling method, device, equipment and program product for classification parameters, the compilation method for classification parameters, the calling method for classification parameters, the compilation device, the calling device, the computer equipment and the computer program product obtain a parameter wrapper obtained by packaging the parameters to be called during the compilation period, and the parameter wrapper includes the parameter type; during the compilation period, the parameters to be called packaged by the parameter wrapper are classified by recursive template functions and parameter types to obtain at least one tuple, and at least one tuple is instantiated to obtain each instantiated parameter collector, and a type of parameters to be called is stored in each tuple, so that the classification of calling parameters is realized during the compilation period, which simplifies the coding and improves the operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 An application environment diagram of a method for compiling classification parameters in one embodiment;
[0054] Figure 2 A schematic diagram of a flow chart of a method for compiling classification parameters in one embodiment;
[0055] Figure 3 A schematic diagram of parameter wrapper compilation information and memory layout in one embodiment;
[0056] Figure 4 is a schematic diagram of a recursive template function in one embodiment;
[0057] Figure 5 A flowchart of the steps for instantiating a parameter collector in one embodiment;
[0058] Figure 6 This is a schematic diagram of the type of parameters assumed to be called in an embodiment;
[0059] Figure 7 A workflow diagram for the transformation of tuple type along with recursive call type in one embodiment;
[0060] Figure 8 A flowchart of a function specialization process for parameter executor multi-tuple parameter passing in one embodiment;
[0061] Fig. 9 is a compile-time flow chart in one embodiment;
[0062] Fig.10 A schematic diagram of processing different types of parameters by template metaprogramming technology in one embodiment;
[0063] Fig.11 A schematic diagram of a flow chart of a method for calling a classification parameter in one embodiment;
[0064] Fig.12 A user program workflow diagram instantiated in one embodiment;
[0065] Fig.13 is a runtime workflow diagram in one embodiment;
[0066] Fig.14 This is a schematic diagram of the operation of the main logic RPC application in one embodiment;
[0067] Fig.15 is a structural block diagram of a compiling device for classification parameters in one embodiment;
[0068] Fig.16 It is a structural block diagram of a classification parameter calling device in one embodiment;
[0069] Fig.17 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] The classification parameter compilation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The compiler in this embodiment includes a parameter wrapper, a parameter collector, a parameter executor and a logic executor. The parameter wrapper is used to add additional compile-time information to the parameters to be called, and the compile-time information includes the parameter type, and the parameter type is used to classify the calling parameters. After the parameters to be called are packaged, they are passed to the parameter collector for processing. The parameter collector is a recursive template function, which classifies one parameter to be called each time and recursively passes the remaining parameters to be called to itself until all parameters to be called are classified and the termination recursion condition of the parameter collector is met. At this time, the parameter set is stored in a tuple, and the parameter collector that meets the termination recursion condition passes the tuple of the target type to the parameter executor. At this time, the template-based metaprogramming method has recursively obtained all parameter types and all calling functions that need to be called in the end.
[0072] During the actual code execution, the parameter executor will be dynamically bound to a specific calling function. The logic executor is responsible for calling the parameter executor method according to the user's expected logic. This method can change the execution order or choose not to call in certain cases, thereby stripping the binding of parameter passing and calling. For ease of understanding, the instantiated logic executor in this application is an instantiated user program. The above compiler implements parameter compilation classification and determines parameter calling during logic runtime.
[0073] In an exemplary embodiment, Figure 2 As shown, a method for compiling classification parameters is provided, including the following steps 202 to 204. Among them:
[0074] S202: Obtain a parameter wrapper obtained by wrapping the parameters to be called during compilation, where the parameter wrapper includes a parameter type.
[0075] Parameter wrappers are used to wrap different types of parameters. Parameter wrappers can be called parameter wrapper classes. Parameter wrappers actually store the application corresponding to the target and only retain the parameter type at compile time, which can also be called wrapper class information.
[0076] In one of the optional embodiments, before obtaining the parameter wrapper obtained by wrapping the parameter to be called, it includes: wrapping the parameter to be called to obtain a parameter wrapper including reference information and parameter type of the parameter to be called, wherein the parameter type is only retained at compile time.
[0077] Specifically, combined Figure 3 As shown, Figure 3 The diagram is a parameter wrapper compilation information and memory layout diagram in an embodiment. In this embodiment, the wrapper class complies with the zero-overhead abstract design principle, and its memory layout only contains reference information of a parameter to be called, such as the address of the parameter to be called. Therefore, the memory occupied is only the address of the parameter to be called. Its runtime overhead is equal to the parameter to be called, that is, the memory occupied at runtime is the parameter to be called. And the parameter wrapper class information, that is, the parameter type, is only retained at compile time. The parameter type is a compilation symbol, has no memory occupation, and only exists at compile time.
[0078] S204: Classify the parameters to be called wrapped by the parameter wrapper through the recursive template function and the parameter type during the compile time to obtain at least one tuple, and instantiate at least one tuple to obtain each instantiated parameter collector, each tuple storing a type of parameters to be called.
[0079] The recursive template function is implemented based on template metaprogramming technology. The recursive template function is used to classify and collect the parameters to be called wrapped by different parameter wrappers, and call the corresponding processing function.
[0080] Optionally, the recursive template function is a variable parameter template that can receive any number of parameters to be called. Figure 4 As shown, Figure 4 It is a schematic diagram of a recursive template function in an embodiment. The parameter list includes two parts, the first part is a tuple part, and the second part is a target parameter part.
[0081] The tuple part is used to collect the parameters to be called. The tuple part of the recursive template function can include at least one tuple (i.e. Figure 4In the generic tuple 1, generic tuple 2, etc.), the number of tuples can be set at initialization, and the number of tuples is based on the number of parameter types corresponding to the parameter wrapper, for example, the two are equal. Each tuple in the tuple part is responsible for collecting one parameter type. When a tuple collects parameters, its type changes, so this operation must be implemented using compile-time syntax. Tuples can include tuples and multituples. A tuple stores one parameter, and a multituple stores multiple parameters. Both tuples and multituples store the same type of parameters to be called.
[0082] The target parameter part is used to divide the parameters to be called into the parameters to be called for this processing (i.e. Figure 4 The target parameter in the recursive call) and the parameters to be called for the next recursive call (i.e. Figure 4 The remaining parameters to be processed in the target parameter part). Because in the recursive template function, only one category of the parameter to be called is processed each time. When processing each specific parameter to be called, the compile-time syntax should be used to implement conditional processing to avoid useless code expansion caused by unnecessary code calls. The parameters to be called in the target parameter part can be of multiple types, for example, multiple parameters to be called can be of the same type, or multiple parameters to be called can be of different types. The number of types of the parameters to be called is less than or equal to the number of tuples in the tuple part.
[0083] Among them, the recursive template function in this embodiment only classifies one parameter to be called each time and obtains the corresponding instantiated parameter collector. Specifically, after classifying the parameter to be called into the corresponding tuple, the tuple part is instantiated to obtain the corresponding instantiated parameter collector, and finally several instantiated parameter collectors are obtained to complete the classification of the parameter to be called. Subsequently, at runtime, these instantiated parameter collectors are directly called to obtain the classified parameters to be called.
[0084] The compilation method of the above-mentioned classified parameters obtains a parameter wrapper obtained by wrapping the parameters to be called during the compilation period, and the parameter wrapper includes the parameter type; during the compilation period, the parameters to be called wrapped by the parameter wrapper are classified through the recursive template function and the parameter type to obtain at least one tuple, and at least one tuple is instantiated to obtain each instantiated parameter collector, and each tuple stores a class of parameters to be called, so that the classification of the parameters to be called is realized during the compilation period, which simplifies the coding and improves the operation efficiency.
[0085] In one of the optional embodiments, in combination Figure 5 As shown, Figure 5The flowchart of the parameter collector instantiation step in one embodiment. In this embodiment, the parameter collector instantiation step, i.e., classifying the parameters to be called wrapped by the parameter wrapper by the recursive template function and the parameter type to obtain at least one tuple, and instantiating at least one tuple to obtain each instantiated parameter collector, includes:
[0086] S502: Based on the parameter wrapper, store the parameters to be called into the target parameter part.
[0087] The parameters to be called wrapped by each parameter wrapper are stored in the target parameter part, combined with Figure 6 As stated, Figure 6 This is a schematic diagram of the types of parameters assumed to be passed in for calling in an embodiment, and the target parameter part of the parameter list includes various parameter wrapper classes. Figure 6 There are two types of parameter wrappers, namely parameter wrapper A and parameter wrapper B. Parameter 1 int and parameter 2 double belong to the same parameter type, and parameter 3 bool belongs to another parameter type.
[0088] S504: Obtain the current to-be-called parameter from the target parameter part, add the current to-be-called parameter to the tuple part based on the parameter type, and then instantiate the tuple part to obtain the currently instantiated parameter collector.
[0089] Among them, in general, the empty tuple is one of the default input parameters for the first recursive call. For example, the initialized tuple part is first recursively called; then the current parameter to be called is obtained from the target parameter part, and the current parameter to be called is added to the tuple part based on the parameter type to implement the recursive call. The tuple part will be transformed into various types of tuples. A tuple is an object for temporary storage after multiple parameters of the same type to be called are collected. Type transformation is also the main feature that distinguishes interface metaprogramming from general runtime code. In static type system languages, arbitrary type transformation cannot be implemented through runtime code.
[0090] Recursive template functions are classified according to the type provided by the parameter wrapper, which requires the incoming parameters to be wrapped or not. The wrapped parameters retain the original data reference and are additionally accompanied by specific wrapper class information, that is, the parameter type. After the recursive template function compares the type of the first input parameter to be called, it decides to connect the parameters in a specific tuple based on the comparison result, and then instantiates the tuple part to obtain the corresponding instantiated parameter collector.
[0091] Optionally, adding the current parameter to be called to the tuple part based on the parameter type includes: when the current parameter to be called is the first parameter to be called, based on the parameter type of the current parameter to be called, adding the current parameter to be called to an empty tuple in the tuple part to obtain a first target tuple, and modifying the parameter type of the first target tuple; when the current parameter to be called is not the first parameter to be called, and the parameter types of the tuples in the instantiated tuple part are different from the parameter types of the current parameter to be called, based on the parameter type of the current parameter to be called, adding the current parameter to be called to a new empty tuple in the tuple part to obtain a second target tuple, and modifying the parameter type of the second target tuple; when the current parameter to be called is not the first parameter to be called, and there is a third target tuple in the instantiated tuple part whose parameter type is the same as the type of the current parameter to be called, adding the current parameter to be called to the third target tuple.
[0092] When the current parameter to be called is the first parameter to be called, the current parameter to be called is directly stored in the first empty tuple of the tuple part to obtain the first target tuple, and the parameter type of the first target tuple is modified.
[0093] When the current parameter to be called is not the first parameter to be called, confirm whether there is a third target tuple with the same parameter type as the current parameter to be called in the target tuple part. If so, directly add the parameter to be called to the third target tuple. If not, store the current parameter to be called in the second empty tuple of the tuple part to obtain the second target tuple, and modify the parameter type of the second target tuple.
[0094] S506: Generate the next parameter calling function based on the remaining parameters to be called in the target parameter part.
[0095] S508: Based on the next parameter, the function is called to obtain the next parameter to be called from the target parameter part as the current parameter to be called, and continue to add the current parameter to be called to the tuple part based on the parameter type, and then instantiate the tuple part to obtain the currently instantiated parameter collector, until all the parameters to be called in the target parameter part are classified, generate a termination condition, and obtain each instantiated parameter collector.
[0096] After processing the current parameter to be called, the recursive template function generates the next parameter calling function based on the remaining parameters to be called in the target parameter part, and then obtains the next parameter to be called from the target parameter part as the current parameter to be called based on the next parameter calling function, and continues to execute the above steps. Finally, after all the parameters to be called in the target parameter part are classified, the termination condition is generated, and the recursive termination function is responsible for retaining the recursively passed parameters to be called. The recursive template termination function passes the collected and classified parameters to be called to the corresponding function in the parameter executor.
[0097] For ease of understanding, combined Figure 7 As shown, Figure 7 The following is a workflow diagram of the transformation of tuple types with recursive call types in an embodiment. First, the parameter collector is instantiated using zero tuples A and B, and then the first parameter to be called is processed, and the zero tuple A is changed to a one-tuple A according to the parameter type. <int>, and then use the tuple A1 and the zero tuple B to instantiate the parameter collector; then call the function based on the parameter to get the next parameter, that is, process the second parameter to be called, and change the tuple A1 to the tuple A2tupe according to the parameter type.<int,double> , instantiate the parameter collector using the two-tuple A2 and the zero-tuple B, and then continue to process the third parameter, changing the zero-tuple B to a one-tuple B1tupe according to the parameter type <bool>, and then use the two-tuple A2 and the one-tuple B1 to instantiate the parameter collector; when there are no parameters to process, it enters the termination condition, and then uses the two-tuple A2 and the one-tuple B1 to instantiate the parameter executor.
[0098] In the above embodiment, template metaprogramming technology is used to realize the collection of different types of parameters during compilation, and a more general function calling method such as parameter binding delayed calling is realized. This method improves the maintainability and readability of the code, and at the same time reduces the logical overhead of parameter classification and transfers it to the compilation period without runtime overhead, which has a wide application prospect in library programming.
[0099] In one of the optional embodiments, the method also includes: instantiating a user program, the user program is used to call each instantiated parameter collector; based on at least one tuple, instantiating a corresponding type of calling function to obtain each instantiated parameter executor; the calling function in each instantiated parameter executor is used to call a corresponding type of parameter to be called; and obtaining a compilation result based on the instantiated user program, each instantiated parameter collector and each instantiated parameter executor.
[0100] The user program can be used to define the execution order of the main logic, and call the instantiated parameter collector and the instantiated parameter executor respectively according to the designer's predetermined logic. The designer can design the execution logic according to actual needs.
[0101] The parameter executor is a function that processes the classified parameters to be called. The parameter executor can store function pointers and pass the classified parameters to be called to the corresponding calling function through the function pointer, so that the parameters to be called can be processed by the calling function.
[0102] The parameter executor accepts tuples of any number and type. The parameter executor unpacks the tuple internally and passes the parameters to the target calling function, flexibly supporting compile-time and runtime calls.
[0103] In this embodiment, the instantiated user program can cyclically call each instantiated parameter collector to realize parameter classification, and then call the instantiated parameter executor corresponding to each parameter type to process the classified parameters to be called to complete the calling of the parameters to be called.
[0104] In one of the optional embodiments, before instantiating the user program, the method further includes: configuring the calling order and calling status of each instantiated parameter executor in the user program; and obtaining the configured user program.
[0105] In this embodiment, the user program can call the instantiated parameter executor. The calling order of the instantiated parameter executor is the calling order of each instantiated parameter executor. The calling order of each parameter executor can be defined in the user program. The calling condition includes whether the instantiated parameter executor is called or not. The calling condition of each parameter executor can also be set in the user program.
[0106] The above method can change the calling order of the parameter executor or choose not to call the parameter executor in certain cases, thereby stripping the binding between parameter passing and calling.
[0107] In one of the optional embodiments, based on at least one tuple, a calling function of a corresponding type is instantiated to obtain each instantiated parameter executor, including: obtaining a current tuple from a tuple part, and calling a template function inside the parameter executor based on the current tuple; instantiating a template function based on the current tuple to obtain a calling function, and obtaining an instantiated parameter executor based on the calling function; obtaining a next tuple as the current tuple, and continuing to execute the step of calling the template function inside the parameter executor through the current tuple until all tuples are processed.
[0108] Specifically, combined Figure 8 As shown, Figure 8 The present invention is a flowchart of a function specialization process of a parameter executor tuple parameter passing in an embodiment. In this embodiment, the tuple part includes multiple tuples, each of which is called by a calling function. Therefore, a specific tuple can be used to call a template function inside the parameter executor, for example, calling a template function inside the parameter executor based on the current tuple, for example, determining a function pointer inside the parameter executor based on the current tuple, and then calling the template function inside the parameter executor based on the function pointer, instantiating the template function based on the current tuple to obtain a calling function, for example, the internal template function of the parameter executor instantiates a function that supports the tuple, the parameter executor stores the packaged calling function, and then processes the next tuple until all tuples are processed. That is, each instantiated parameter executor is stored as a specific calling function, thereby realizing the instantiation of each parameter executor.
[0109] For ease of understanding, combined Fig. 9 and Fig.10 As shown, Fig. 9 is a compile-time flow chart in one embodiment, Fig.10 A schematic diagram of processing different types of parameters by template metaprogramming technology in one embodiment.
[0110] exist Fig. 9 During compilation, the parameters to be called are first packaged to obtain parameter wrappers. Each parameter wrapper includes the parameter type and a reference to the parameter to be called. The parameter type only exists during compilation and is a compilation symbol.
[0111] Then start compiling the current target interface, instantiate the user program, and then instantiate a specific parameter collector to generate the target calling function of the next parameter until the termination condition of the parameter collector is met. Instantiate the parameter executor based on the tuple obtained from the last instantiated parameter collector, and determine whether all interfaces have been compiled. If not, get the next interface and continue the above compilation process, that is, instantiate the user program, etc., to complete the compilation of the interface.
[0112] Among them combined Fig.10 As shown, first, the parameter wrapper wraps the parameters to be called to obtain the parameter wrappers corresponding to the parameters to be called, and the parameter wrapper includes the parameter type. Then, the user program is instantiated for the first time to obtain the logic executor, that is, the compile-time target function C is instantiated to obtain the logic executor, that is, the instantiated user program, where the target function C is also the user program.
[0113] The compile-time target function cluster D is instantiated for the second time, and finally each instantiated parameter collector is obtained. The target function cluster D includes each parameter collector for classifying the parameters to be called. In this application, the parameters to be called corresponding to each parameter wrapper are classified in turn until the termination condition of the parameter collector is met, and the final tuple cluster An and tuple cluster Bm are obtained. The recursive call process includes the following. Figure 7 As shown, no further description is given here.
[0114] The third instantiation is the parameter executor, that is, the compile-time objective functions E and F. In this application, only the parameter executor including two objective functions E and F is used as an example for explanation. In other embodiments, the number of objective functions corresponding to the parameter executor can be other values, and no specific limitation is made here.
[0115] In an exemplary embodiment, Fig.11 As shown, a method for calling a classification parameter is provided, comprising the following steps 1102. Among them:
[0116] S1102: calling each instantiated parameter collector to obtain at least one tuple, wherein each tuple stores a type of collected parameters to be called, and each tuple corresponds to a different type of parameter to be called.
[0117] This embodiment is a processing process at runtime. At runtime, each instantiated parameter collector is called to obtain at least one tuple. Since each instantiated parameter collector is used to classify a parameter to be called, at runtime, the instantiated parameter collectors are executed in sequence to achieve the classification of the calling parameters.
[0118] The classification result is at least one tuple, each of which may include at least one parameter to be called, and the type of the parameter to be called corresponding to each tuple is different.
[0119] The above-mentioned calling method of classified parameters obtains a parameter wrapper obtained by wrapping the parameters to be called during compilation, and the parameter wrapper includes the parameter type; during compilation, the parameters to be called wrapped by the parameter wrapper are classified through recursive template functions and parameter types to obtain at least one tuple, and at least one tuple is instantiated to obtain each instantiated parameter collector, each tuple stores a class of parameters to be called, so that the classification of the parameters to be called is realized during compilation, and the parameter collector is directly called at runtime to obtain the parameter classification result, which simplifies coding and improves operating efficiency.
[0120] In one of the optional embodiments, each instantiated parameter collector is called to obtain at least one tuple, including: obtaining the current parameter to be called, and calling the currently instantiated parameter collector to process the current parameter to be called to obtain the current tuple; obtaining the next parameter collector as the currently instantiated parameter collector; passing the remaining parameters to be called to the currently instantiated parameter collector, and continuing to execute the step of obtaining the current parameter to be called until the termination condition of the instantiated parameter collector is met, and obtaining the obtained tuple.
[0121] Specifically, at runtime, the instantiated parameter collector that processes the first parameter is first called, and then the remaining parameters are passed to the next instantiated parameter collector to obtain the current tuple, and the next parameter collector is continued to be obtained as the current instantiated parameter collector until the termination condition of the instantiated parameter collector is met, and the obtained tuple is obtained.
[0122] Optionally, the termination condition of the instantiated parameter collector is a parameter collector termination condition function, which is generated after all the parameters to be called in the target parameter part are classified when the parameter collector is compiled.
[0123] In one of the optional embodiments, calling each instantiated parameter collector to obtain at least one tuple also includes: looping calling each instantiated parameter collector through an instantiated user program to obtain at least one tuple, wherein the instantiated user program is triggered based on an interface call instruction after receiving the interface call instruction.
[0124] In one of the optional embodiments, the method further includes: calling each instantiated parameter executor in sequence through an instantiated user program, and processing a tuple of corresponding parameter types to obtain a calling result.
[0125] Combination Fig.12 As shown, Fig.12 The instantiated user program workflow diagram in an embodiment is shown, wherein after the interface is triggered, the instantiated user program is called first, and each instantiated parameter collector is called cyclically by the instantiated user program to obtain at least one tuple, so that each parameter to be called is classified and collected, and then each instantiated parameter executor is called in turn by the instantiated user program, and the tuples of corresponding parameter types are processed to obtain the calling result.
[0126] Combination Fig.13 As shown, Fig.13 The present invention is a runtime workflow diagram in an embodiment. In this embodiment, each instantiated parameter collector is cyclically called by the instantiated user program to obtain at least one tuple, including calling the instantiated parameter collector to process the first parameter, then passing the remaining parameters to the next instantiated parameter collector, judging whether the termination condition function of the instantiated parameter collector is satisfied, and if so, continuing to call the instantiated parameter executor with the tuple after parameter collection, and finally calling the instantiated parameter executor according to the instantiated user program.
[0127] Among them, for the convenience of understanding, combined Fig.14 As shown in the figure, the input and output parameters in the remote procedure call are classified and processed separately, and the input parameters are serialized and the output parameters are deserialized. Due to the existence of serialization and deserialization, two parameter executors can be defined, the serialization executor and the deserialization executor, and parameters are passed to them in the parameter collector terminal processing function. The specific process includes: calling the logic executor with 5 specific parameter instantiations, that is, the instantiated user program, calling the parameter collector for processing the first parameter, and the remaining 4 parameters are passed to the next specific instantiation parameter collector; calling the parameter collector for processing the second parameter, and the remaining 3 The parameters are passed to the parameter collector of the next specific instantiation; the parameter collector for processing the third parameter is called, and the remaining two parameters are passed to the parameter collector of the next specific instantiation; the parameter collector for processing the fourth parameter is called, and the remaining one parameter is passed to the parameter collector of the next specific instantiation; the parameter collector for processing the fifth parameter is called, and the remaining zero parameters are passed to the parameter collector of the next specific instantiation, and the grouped specific tuples to be serialized are obtained and passed into the serialization executor, and the grouped specific tuples to be deserialized are passed into the deserialization executor, serialization is performed, and the RPC framework is waited for to obtain data and deserialization is performed. The parameter collectors used in the calling process are all instantiated parameter collectors. Similarly, the parameter executors used in the calling process are all instantiated parameter executors.
[0128] In the above embodiment, template metaprogramming technology is used to realize the collection of different types of parameters during compilation, and a more general function calling method such as parameter binding delayed calling is realized. This method improves the maintainability and readability of the code, and at the same time reduces the logical overhead of parameter classification and transfers it to the compilation period without runtime overhead, which has a wide application prospect in library programming.
[0129] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0130] Based on the same inventive concept, the embodiment of the present application also provides a classification parameter compilation device for implementing the classification parameter compilation method involved above, and a classification parameter calling device for the classification parameter calling method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more classification parameter compilation devices and classification parameter calling devices provided below can refer to the limitations of the classification parameter compilation method above, and will not be repeated here.
[0131] In an exemplary embodiment, Fig.15 As shown, a classification parameter compilation device is provided, including: a parameter wrapper acquisition module 1501 and a parameter collector instantiation module 1502, wherein:
[0132] The parameter wrapper acquisition module 1501 is used to obtain the parameter wrapper obtained by wrapping the parameters to be called during compilation, and the parameter wrapper includes the parameter type;
[0133] The parameter collector instantiation module 1502 is used to classify the parameters to be called wrapped by the parameter wrapper through recursive template functions and parameter types during compilation to obtain at least one tuple, and instantiate at least one tuple to obtain each instantiated parameter collector, each tuple storing a type of parameters to be called.
[0134] In one of the optional embodiments, the above-mentioned device also includes: a parameter packaging module, which is used to package the parameters to be called to obtain a parameter wrapper including reference information and parameter types of the parameters to be called, wherein the parameter type is only retained during compilation.
[0135] In one of the optional embodiments, the parameter collector instantiation module 1502 is specifically used to store the parameters to be called in the target parameter part based on the parameter wrapper; obtain the current parameters to be called from the target parameter part, and add the current parameters to be called to the tuple part based on the parameter type, and then instantiate the tuple part to obtain the currently instantiated parameter collector; generate the next parameter calling function based on the remaining parameters to be called in the target parameter part; obtain the next parameter to be called from the target parameter part as the current parameter to be called based on the next parameter calling function, and continue to execute the steps of adding the current parameters to be called to the tuple part based on the parameter type, and then instantiate the tuple part to obtain the currently instantiated parameter collector, until all the parameters to be called in the target parameter part are classified, generate a termination condition, and obtain each instantiated parameter collector.
[0136] In one of the optional embodiments, the parameter collector instantiation module 1502 is specifically used to add the current parameter to be called to an empty tuple in the tuple part to obtain a first target tuple based on the parameter type of the current parameter to be called when the current parameter to be called is the first parameter to be called, and modify the parameter type of the first target tuple; when the current parameter to be called is not the first parameter to be called, and the parameter types of the tuples in the instantiated tuple part are different from the types of the current parameter to be called, based on the parameter type of the current parameter to be called, add the current parameter to be called to a new empty tuple in the tuple part to obtain a second target tuple, and modify the parameter type of the second target tuple; when the current parameter to be called is not the first parameter to be called, and there is a third target tuple in the instantiated tuple part whose parameter type is the same as the type of the current parameter to be called, add the current parameter to be called to the third target tuple.
[0137] In one of the optional embodiments, the user program instantiation module is specifically used to instantiate the user program, and the user program is used to call each instantiated parameter collector; based on at least one tuple, the calling function of the corresponding type is instantiated to obtain each instantiated parameter executor; the calling function in each instantiated parameter executor is used to call the corresponding type of parameter to be called; and the compilation result is obtained based on the instantiated user program, each instantiated parameter collector and each instantiated parameter executor.
[0138] In one of the optional embodiments, the above-mentioned user program instantiation module is specifically used to obtain the current tuple from the tuple part, and call the template function inside the parameter executor based on the current tuple; instantiate the template function based on the current tuple to obtain the calling function, and obtain the instantiated parameter executor based on the calling function; obtain the next tuple as the current tuple, and continue to execute the step of calling the template function inside the parameter executor through the current tuple until all tuples are processed.
[0139] In one of the optional embodiments, the above-mentioned device also includes a configuration module, which is used to configure the calling order and calling status of each instantiated parameter executor in the user program; and obtain the configured user program.
[0140] In an exemplary embodiment, Fig.16 As shown, a classification parameter calling device is provided, including: a parameter collector calling module 1601, wherein:
[0141] The parameter collector calling module 1601 is used to call each instantiated parameter collector to obtain at least one tuple, wherein each tuple stores a type of collected parameters to be called, and each tuple corresponds to a different type of parameters to be called.
[0142] In one of the optional embodiments, the parameter collector calling module 1601 is specifically used to obtain the current parameters to be called, and call the currently instantiated parameter collector to process the current parameters to be called to obtain the current tuple; obtain the next parameter collector as the currently instantiated parameter collector; pass the remaining parameters to be called to the currently instantiated parameter collector, and continue to execute the step of obtaining the current parameters to be called until the termination condition of the instantiated parameter collector is met, and the obtained tuple is obtained.
[0143] In one of the optional embodiments, the parameter collector calling module 1601 is specifically used to cyclically call each instantiated parameter collector through an instantiated user program to obtain at least one tuple, wherein the instantiated user program is triggered based on an interface call instruction after receiving the interface call instruction.
[0144] In one of the optional embodiments, the parameter executor calling module is specifically used to call each instantiated parameter executor in sequence through an instantiated user program, and process the tuple of corresponding parameter types to obtain a calling result.
[0145] In one of the optional embodiments, the termination condition of the instantiated parameter collector is a parameter collector termination condition function, and the parameter collector termination condition function is generated after all the to-be-called parameters of the target parameter part are classified when the parameter collector is compiled.
[0146] Each module in the above-mentioned classification parameter compilation device and classification parameter calling device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0147] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.17 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for compiling classification parameters and a method for calling classification parameters are implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0148] Those skilled in the art will understand that Fig.17 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0149] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0150] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0151] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0152] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0153] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0154] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.< / bool> < / int>
Claims
1. A method for compiling classification parameters, characterized in that: The method comprises: Obtaining a parameter wrapper obtained by wrapping the parameters to be called during compile time, wherein the parameter wrapper includes a parameter type; The parameters to be called wrapped by the parameter wrapper are classified during the compile time by using the recursive template function and the parameter type to obtain at least one tuple, and the at least one tuple is instantiated to obtain each instantiated parameter collector, each tuple storing a type of parameters to be called; wherein the parameter list of the recursive template function includes a tuple part and a target parameter part, the tuple part is used to realize the collection of the parameters to be called, and the target parameter part is used to divide the parameters to be called into the parameters to be called for this processing and the parameters to be called for the next processing of the recursive call.
2. The method according to claim 1, characterized in that: Before obtaining the parameter wrapper obtained by wrapping the parameter to be called, the following steps are included: The parameter to be called is packaged to obtain a parameter wrapper including reference information and parameter type of the parameter to be called, wherein the parameter type is only retained during compilation.
3. The method according to claim 1, characterized in that The method classifies the parameters to be called wrapped by the parameter wrapper by using the recursive template function and the parameter type to obtain at least one tuple, and instantiates the at least one tuple to obtain each instantiated parameter collector, including: Based on the parameter wrapper, storing the parameters to be called into the target parameter part; Acquire the current parameter to be called from the target parameter part, add the current parameter to be called to the tuple part based on the parameter type, and then instantiate the tuple part to obtain a currently instantiated parameter collector; Generate a next parameter calling function based on the remaining parameters to be called in the target parameter part; Based on the next parameter, the function is called to obtain the next parameter to be called from the target parameter part as the current parameter to be called, and continues to add the current parameter to be called to the tuple part based on the parameter type, and then instantiates the tuple part to obtain the currently instantiated parameter collector, until all the parameters to be called in the target parameter part are classified, generate a termination condition, and obtain each instantiated parameter collector.
4. The method according to claim 3, characterized in that The adding the current parameter to be called to the tuple part based on the parameter type includes: In the case where the current parameter to be called is the first parameter to be called, based on the parameter type of the current parameter to be called, the current parameter to be called is added to an empty tuple of the tuple part to obtain a first target tuple, and the parameter type of the first target tuple is modified; In the case where the current parameter to be called is not the first parameter to be called, and the parameter types of the tuples in the instantiated tuple part are all different from the parameter type of the current parameter to be called, based on the parameter type of the current parameter to be called, the current parameter to be called is added to a new empty tuple in the tuple part to obtain a second target tuple, and the parameter type of the second target tuple is modified; When the current parameter to be called is not the first parameter to be called, and there is a third target tuple in the instantiated tuple part whose parameter type is the same as the parameter type of the current parameter to be called, the current parameter to be called is added to the third target tuple.
5. The method according to claim 3, characterized in that: The method further comprises: Instantiating a user program, wherein the user program is used to call each instantiated parameter collector; Based on the at least one tuple, instantiate a corresponding type of calling function to obtain each instantiated parameter executor; the calling function in each instantiated parameter executor is used to call the corresponding type of the to-be-called parameter; A compilation result is obtained based on the instantiated user program, each instantiated parameter collector, and each instantiated parameter executor.
6. The method according to claim 5, characterized in that The instantiating a corresponding type of calling function based on the at least one tuple to obtain each instantiated parameter executor includes: Obtaining a current tuple from the tuple part, and calling a template function inside the parameter executor based on the current tuple; Instantiating the template function based on the current tuple to obtain a calling function, and obtaining an instantiated parameter executor based on the calling function; The next tuple is obtained as the current tuple, and the step of calling the template function inside the parameter executor through the current tuple is continued until all the tuples are processed.
7. The method according to claim 5, characterized in that Before instantiating the user program, the method further includes: Configure the calling order and calling status of each instantiated parameter executor in the user program; Obtain the configured user program.
8. A classification parameter calling method, characterized in that: The method comprises: Call each instantiated parameter collector obtained by the compilation method based on the classification parameters described in any one of claims 1 to 7 to obtain at least one tuple, wherein each of the tuples stores a class of collected parameters to be called, and the type of parameters to be called corresponding to each of the tuples is different.
9. The method according to claim 8, characterized in that The calling of each instantiated parameter collector obtains at least one tuple, including: Obtain the current parameters to be called, and call the currently instantiated parameter collector to process the current parameters to be called to obtain the current tuple; Get the next parameter collector as the currently instantiated parameter collector; The remaining parameters to be called are passed to the currently instantiated parameter collector, and the step of obtaining the currently instantiated parameters to be called is continued until the termination condition of the instantiated parameter collector is met, and the obtained tuple is obtained.
10. The method according to claim 8, characterized in that The calling of each instantiated parameter collector to obtain at least one tuple further includes: At least one tuple is obtained by cyclically calling each instantiated parameter collector through an instantiated user program, wherein the instantiated user program is triggered based on the interface calling instruction after receiving the interface calling instruction.
11. The method according to claim 10, characterized in that The method further comprises: Each instantiated parameter executor is called in sequence through the instantiated user program, and the tuple of corresponding parameter types is processed to obtain a calling result.
12. The method according to claim 8, characterized in that The termination condition of the instantiated parameter collector is the parameter collector termination condition function, and the parameter collector termination condition function is generated after all the parameters to be called in the target parameter part are classified when the parameter collector is compiled.
13. A device for compiling classification parameters, characterized in that: The device comprises: A parameter wrapper acquisition module, used to acquire a parameter wrapper obtained by wrapping the parameters to be called during compilation, wherein the parameter wrapper includes a parameter type; A parameter collector instantiation module is used to classify the parameters to be called wrapped by the parameter wrapper through the recursive template function and the parameter type during the compilation period to obtain at least one tuple, and to instantiate the at least one tuple to obtain each instantiated parameter collector, each tuple storing a type of parameters to be called; wherein the parameter list of the recursive template function includes a tuple part and a target parameter part, the tuple part is used to realize the collection of parameters to be called, and the target parameter part is used to divide the parameters to be called into the parameters to be called for this processing and the parameters to be called for the next processing of the recursive call.
14. A classification parameter calling device, characterized in that: The device comprises: A parameter collector calling module is used to call each instantiated parameter collector obtained by the compilation device based on the classification parameters described in claim 13 to obtain at least one tuple, wherein each of the tuples stores a class of collected parameters to be called, and the type of parameters to be called corresponding to each tuple is different.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 or 8 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 or 8 to 12 are implemented.
Citation Information
Patent Citations
Category based execution scheduling
CN108633310A
Computer-implemented method, computer-readable medium and heterogeneous computing system
CN110383247A