A database parameter processing method and related products

By automatically matching and correcting input parameters through the database system, the complexity of calling subroutines with different numbers of parameters in existing technologies is solved, enabling the same call statement to adapt to multiple subroutines, thus improving development efficiency and parameter parsing efficiency.

CN123114589APending Publication Date: 2026-11-17CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611264025.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, when a database system calls a subroutine with different numbers of parameters, it needs to construct a separate call statement for each subroutine. It is difficult to use the same call statement to adapt to multiple subroutines with different numbers of parameters, resulting in high call complexity and low efficiency.

Method used

The database system automatically matches and modifies the input parameter list based on the parameter specifications of the target subroutine, enabling the same call statement to adapt to subroutines with different numbers of parameters. This includes parsing the input parameter list, matching the formal parameter list, determining the target value, and combining the modified parameter list.

Benefits of technology

It reduces the complexity of constructing the calling statement for the caller, improves development efficiency, enables the same calling statement to adapt to multiple subroutines with different numbers of parameters, simplifies the parameter matching process, and improves parameter parsing efficiency and subroutine calling flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114589A_ABST
    Figure CN123114589A_ABST
Patent Text Reader

Abstract

This invention provides a database parameter processing method and related products. The method includes: in response to receiving a call request for a target subroutine, obtaining a list of input parameters carried in the call request and querying the parameter specification information of the target subroutine from the database system; matching each input parameter in the input parameter list with each formal parameter in the formal parameter list, and determining a corresponding target value for each formal parameter based on the matching result; combining the target values ​​of each formal parameter into a modified input parameter list, and executing the target subroutine based on the modified input parameter list. The solution of this invention, by having the database system automatically match and modify the parameters passed in the call request according to the parameter specification information of the target subroutine, eliminates the need for the caller to confirm the parameter definitions of each target subroutine before issuing the call request, as the database system automatically completes the call adaptation, thereby reducing the complexity of the caller constructing the call statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to database technology, and in particular to a database parameter processing method and related products. Background Technology

[0002] When a database system executes a subroutine call, the subroutine name can be passed via a variable. This allows different subroutines to be called using the same call statement by changing the value of that variable, enhancing code polymorphism. However, if different subroutines declare different numbers of parameters, a separate call statement must be constructed for each subroutine, making it difficult to adapt a single call statement to multiple subroutines with different numbers of parameters. Summary of the Invention

[0003] One objective of this invention is to enable the same call statement to adapt to subroutines with different numbers of parameters without changing the existing syntax structure of the call statement.

[0004] Specifically, the present invention provides a parameter processing method for a database, comprising: In response to receiving a call request for a target subroutine, the system obtains the list of input parameters carried in the call request and queries the parameter specification information of the target subroutine from the database system; the parameter specification information includes a list of formal parameters arranged in the order of their declaration. Each input parameter in the input parameter list is matched with each formal parameter in the formal parameter list, and a corresponding target value is determined for each formal parameter based on the matching result; The target values ​​of each of the formal parameters are combined into a modified list of input parameters, and the target subroutine is executed based on the modified list of input parameters.

[0005] Optionally, obtaining the list of input parameters carried in the call request includes: Parse the message body of the call request, and extract the position parameter group and / or name parameter group from the message body as the input parameter list.

[0006] Optionally, matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains only position parameter groups, and the number of position parameters in the position parameter groups is greater than or equal to the number of formal parameters without default values ​​in the formal parameter list, the input parameter list is determined to be a successful match with the formal parameter list; if the number of position parameters in the position parameter groups is less than the number of formal parameters without default values ​​in the formal parameter list, the match is determined to be unsuccessful and an error message is returned.

[0007] Optionally, matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains only named parameter groups, establish the matching relationship between each named parameter and the corresponding formal parameter in the parameter list according to the declaration order; Based on the matching relationship, the matched formal parameters are assigned values ​​according to the current values ​​of each of the named parameters, and the formal parameters that have been assigned values ​​are marked as overridden; If the named parameter group can cover all parameters without default values ​​in the parameter list, it is determined that the input parameter list and the parameter list are successfully matched; If the named parameter group fails to cover all parameters without default values ​​in the parameter list, the matching is deemed to have failed and an error message is returned.

[0008] Optionally, matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains both position parameter groups and named parameter groups, and the number of position parameters in the position parameter groups is greater than or equal to the total number of formal parameters in the formal parameter list, the named parameter groups are ignored, and the input parameter list is determined to be a successful match with the formal parameter list. If the number of positional parameters in the positional parameter group is less than the total number of parameters in the formal parameter list, after performing positional parameter matching, starting from the first formal parameter in the formal parameter list that is not marked as covered, a matching relationship is established between each named parameter and the remaining uncovered formal parameters according to the declaration order; based on the matching relationship, the values ​​of each named parameter are assigned to the matched formal parameters, and the assigned formal parameters are marked as covered; if the named parameter group can cover all formal parameters that are not covered by the positional parameter group and have no default value, it is determined that the input parameter list and the formal parameter list match successfully; if the named parameter group fails to cover all formal parameters that are not covered by the positional parameter group and have no default value, it is determined that the matching fails and an error message is returned.

[0009] Optionally, determining the corresponding target value for each of the formal parameters based on the matching results includes: In response to a successful match between the input parameter list and the formal parameter list, each formal parameter in the formal parameter list is traversed according to the declaration order, and it is determined whether the traversed formal parameter is marked as overridden. If the formal parameter is marked as covered, the current value of the matched positional parameter or named parameter is used as the target value of the formal parameter; If the parameter is not marked as covered, and the parameter specification information indicates that the parameter has a default value, the default value is used as the target value of the parameter, and the parameter is marked as filled, wherein the covered state and the filled state are mutually exclusive; If the parameter is not marked as covered, obtain the default value identifier of the parameter; if the default value identifier indicates that the parameter has a default value, use the default value as the target value; if the default value identifier indicates that the parameter does not have a default value, terminate the traversal and return an error message.

[0010] Optionally, combining the target values ​​of each of the formal parameters into a modified list of input parameters includes: After traversing all parameters in the parameter list, the target values ​​of each parameter are extracted sequentially according to the declaration order, and the extracted target values ​​are arranged in the declaration order to form a corrected input parameter list.

[0011] According to another aspect of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the parameter processing method for the database described above.

[0012] According to another aspect of the present invention, a computer program product is also provided, comprising a computer program that, when executed by a processor, implements the steps of the parameter processing method for the database described above.

[0013] According to another aspect of the present invention, a computer device is also provided, which includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any database parameter processing method.

[0014] The parameter processing method of the database in this invention automatically matches and corrects the parameters passed in the call request according to the parameter specifications of the target subroutine by the database system. The caller does not need to confirm the parameter definitions of each target subroutine before issuing the call request; the database system automatically completes the call adaptation, thereby reducing the complexity of constructing the call statement and improving development efficiency. By having the database system determine the corresponding target values ​​for each formal parameter according to the parameter specifications, even if there are differences between the parameter list passed by the caller and the formal parameter list of the target subroutine, the database system can still complete the call through matching and correction. The caller does not need to construct different call statements for subroutines with different parameter definitions, thus enabling the adaptation of the same call statement to multiple subroutines with different numbers of parameters.

[0015] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0016] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic flowchart of a database parameter processing method according to an embodiment of the present invention; Figure 2 This is a schematic flowchart of a database parameter processing method according to an embodiment of the present invention, which includes only a matching operation of named parameter groups; Figure 3 This is a schematic flowchart illustrating the determination of a target value in a database parameter processing method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a computer program product according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0017] When a database system executes a subroutine call, the subroutine name can be passed via a variable. This allows different subroutines to be called using the same call statement by changing the value of that variable, enhancing code polymorphism. However, this approach has the following problems: The call statement syntactically fixes the number and order of input parameters. When subroutine names are dynamically specified via variables, if different subroutines declare different numbers of parameters, the number of parameters passed to the call statement cannot simultaneously accommodate all possible subroutines. If the number of input parameters is consistent with the number of formal parameters of a certain subroutine, then it will inevitably be inconsistent with the number of formal parameters of other subroutines with different numbers of parameters, causing the database system to be unable to establish a complete formal-actual parameter correspondence for that subroutine. Therefore, a separate call statement needs to be constructed for each subroutine, making it difficult to use a single call statement to accommodate multiple subroutines with different numbers of parameters.

[0018] In named parameter passing, the caller can establish a correspondence between input parameters and subroutine parameters through parameter naming, which can reduce the constraint of parameter order to some extent. However, the number of input parameters in named parameter passing still needs to match the number of formal parameters in the target subroutine. When the number of input named parameters exceeds the number of formal parameters, there may be redundant named parameters that cannot be matched with any formal parameter; when the number of input named parameters is less than the number of formal parameters, there may be formal parameters that are not covered by any input parameters. Both of these situations will cause the database system to determine that the match has failed and refuse to execute the call. Therefore, although named parameter passing alleviates the constraint of parameter order, it does not solve the problem of call failure caused by the difference in the number of parameters.

[0019] In a hybrid parameter passing method (positional and named parameters), some parameters are passed positionally, while others are passed by name. This combination of both methods increases the flexibility of the call. However, the database system needs to process positional and named parameters sequentially, making parameter matching rules more complex. Even after combining positional and named parameters, there may still be parameters not covered by any input parameters, or redundant input parameters that cannot be matched with any parameter. Either of these situations will cause the database system to determine a matching failure and refuse to execute the call. Therefore, while the hybrid parameter passing method improves the flexibility of the call, the caller must still ensure that a complete correspondence is established between the input parameters and the formal parameters of the target subroutine; otherwise, the call will also be rejected by the database system.

[0020] Figure 1 This is a schematic flowchart of a database parameter processing method according to an embodiment of the present invention. Figure 1 As shown, the parameter processing methods for this database can generally include: Step S101: In response to receiving a call request for the target subroutine, obtain the list of input parameters carried in the call request, and query the parameter specification information of the target subroutine from the database system; the parameter specification information includes a list of formal parameters arranged in the order of declaration. Step S102: Match each input parameter in the input parameter list with each formal parameter in the formal parameter list, and determine the corresponding target value for each formal parameter based on the matching result; Step S103: Combine the target values ​​of each formal parameter into a corrected list of input parameters, and execute the target subroutine based on the corrected list of input parameters.

[0021] In this embodiment, the database system listens for database call requests from clients or the application layer. If a call request for a target subroutine is received, the database system parses the message body of the call request and extracts the list of input parameters passed by the caller from the message body. Each parameter in the input parameter list is organized according to the parameter passing format specified by the caller.

[0022] The database system uses the identifier of the target subroutine to perform metadata retrieval in the database system directory, querying the parameter specification information of the target subroutine. The parameter specification information includes the declaration order, parameter name, data type, parameter mode, and default value identifier of each formal parameter declared in the definition of the target subroutine. The database system arranges the retrieved formal parameters in their declaration order to form a parameter list, which serves as a reference for subsequent parameter matching.

[0023] In this embodiment, the database system establishes a correspondence between each input parameter in the input parameter list and each formal parameter in the formal parameter list according to the parameter passing format and the matching rules corresponding to the parameter passing format, and marks the formal parameters that have established a correspondence as covered.

[0024] After matching is complete, the database system iterates through the parameter list and determines the target value for each parameter: if the parameter is marked as covered, the value of the matched input parameter is used as the target value of the parameter; if the parameter is not marked as covered and has a default value, the default value is used as the target value of the parameter; if the parameter is not marked as covered and does not have a default value, the matching is determined to be unsuccessful and an error message is returned.

[0025] In this embodiment, after determining the target values ​​of all formal parameters, the database system combines the target values ​​of each formal parameter into a revised input parameter list according to the order of the parameter list. The database system then passes the revised input parameter list to the execution module of the database engine. The execution module uses this revised parameter list as the actual input parameters, calls the execution entry point of the target subroutine, and executes the target subroutine. After execution, the database system collects execution result information, including return values, output parameters (final values ​​of OUT and IN OUT mode parameters), and execution status, and returns this information to the caller.

[0026] Based on the above steps, the database system automatically matches and corrects the parameters passed in the call request according to the parameter specifications of the target subroutine. The caller does not need to confirm the parameter definitions of each target subroutine before issuing the call request; the database system automatically completes the call adaptation, thereby reducing the complexity of constructing the call statement and improving development efficiency. By having the database system determine the corresponding target values ​​for each formal parameter based on the parameter specifications, even if there are differences between the parameter list passed by the caller and the formal parameter list of the target subroutine, the database system can still complete the call through matching and correction. The caller does not need to construct different call statements for subroutines with different parameter definitions, thus enabling the same call statement to adapt to multiple subroutines with different numbers of parameters.

[0027] In the implementation of step S101, obtaining the list of input parameters carried in the call request includes: Parse the message body of the call request and extract the positional parameter group and / or named parameter group from the message body as the input parameter list.

[0028] In this embodiment, after receiving a call request, the communication layer of the database system delivers the request data packet to the call processing module. The call processing module parses the request data packet according to the protocol, identifies the request type, and after confirming that the current request is a subroutine call request, proceeds to the process of obtaining the input parameter list.

[0029] The message body of the call request is organized according to the structured format of the database communication protocol. The message body contains header information and a parameter area. The header information records the encoding method of the message body, the starting position of the parameter area, and the length of the parameter area. The database system reads the header information, determines the starting position and length of the parameter area based on the header information, extracts the parameter area content from the message body, and generates an input parameter list based on the parameter area content. If the parameter area length is zero or the message body does not contain a parameter area, the input parameter list is set to empty.

[0030] If the parameter area length is greater than zero, the database system reads each parameter data unit sequentially from the beginning of the parameter area, according to the parameter data unit format agreed upon in the database communication protocol. Each parameter data unit contains at least a parameter name field, a parameter type identifier, and a parameter value field. The parameter value field stores the actual value of the parameter, including a data type identifier and the specific data content. The parameter name field stores the name identifier of the parameter; if the caller includes the parameter name when passing the parameter, the parameter name field is non-empty; otherwise, it is empty. The parameter type identifier indicates the organization method of the parameter data unit, which can be either by position or by name.

[0031] After reading, the database system categorizes the read parameters based on the parameter type identifier in each parameter data unit. If the parameter type identifier of a parameter data unit indicates that it is organized by position, the parameter is assigned to the position parameter group, and the order of the parameter in the position parameter group is determined by its order of appearance in the message body parameter area. If the parameter type identifier of a parameter data unit indicates that it is organized by name, the parameter is assigned to the named parameter group, and the correspondence between the parameter name and the parameter value is preserved.

[0032] After classification, the database system stores the location parameter group and / or the named parameter group together as part of the input parameter list; if both the location parameter group and the named parameter group are empty, the input parameter list is empty.

[0033] In the implementation of step S102, matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains only positional parameter groups, and the number of positional parameters in the positional parameter groups is greater than or equal to the number of formal parameters without default values ​​in the formal parameter list, the input parameter list and the formal parameter list are considered to be successfully matched; if the number of positional parameters in the positional parameter groups is less than the number of formal parameters without default values ​​in the formal parameter list, the match is considered to be unsuccessful and an error message is returned.

[0034] In this implementation, after completing parameter acquisition and parameter specification query, the database system iterates through the list of input parameters to identify the parameter passing method. If the list of input parameters contains only positional parameter groups and not named parameter groups, the database system determines that the current parameter passing method is positional parameter passing.

[0035] The database system iterates through the parameter list based on the retrieved parameter specifications, reading the default value identifier for each parameter. It then filters out parameters without default value identifiers and counts the number of these filtered parameters, which is taken as the number of positional parameters.

[0036] The database system compares the number of positional parameters with the number of parameters without default values ​​in the parameter list. If the number of positional parameters is greater than or equal to the number of parameters without default values, a match is considered successful. Following the declaration order in the parameter list, each parameter in the positional parameter group is sequentially matched with its corresponding position in the parameter list. Matched parameters are marked as overridden, and their values ​​are stored as the values ​​to be assigned to that parameter. If the number of positional parameters is less than the number of parameters without default values, a match is considered unsuccessful, the current call flow is terminated, and an error message is returned.

[0037] After a successful match, the database system enters the process of determining the target values ​​for each parameter based on the matching results.

[0038] Based on the above implementation method, the matching determination is completed by comparing the number of positional parameters with the number of parameters without default values. There is no need to perform parameter name traversal and matching operations, thereby reducing the computational overhead of parameter matching and improving the parameter parsing efficiency when calling subroutines.

[0039] Figure 2 This is a schematic flowchart illustrating a database parameter processing method according to an embodiment of the present invention, which includes only a matching operation for named parameter groups. Figure 2 As shown, matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: Step S201: If the input parameter list only contains named parameter groups, establish the matching relationship between each named parameter and the corresponding formal parameter in the formal parameter list according to the declaration order; Step S202: Based on the matching relationship, assign values ​​to the matched formal parameters according to the current values ​​of each named parameter, and mark the formal parameters that have been assigned as overridden; Step S203: If the named parameter group can cover all the parameters without default values ​​in the parameter list, it is determined that the input parameter list and the parameter list match successfully. Step S204: If the named parameter group fails to cover all parameters without default values ​​in the parameter list, the matching is deemed to have failed and an error message is returned.

[0040] In this embodiment, after the database system completes parameter acquisition and parameter specification query, it iterates through the list of input parameters to identify the parameter passing method. If each parameter in the list of input parameters contains a parameter name field and the position parameter group is empty, the database system determines that the current parameter passing method is named parameter passing.

[0041] The database system iterates through the formal parameters in the order they are declared in the parameter list. For each parameter encountered, its name is read, and the system checks if a named parameter with the same name exists in the named parameter group. If the query finds a match, the named parameter is matched with the current parameter, the current value is extracted from the named parameter and assigned to the current parameter, and the parameter is marked as overridden. If the query fails to find a match, the current parameter is not matched and remains in its initial state, and the system continues iterating through the next parameter. During the iteration process, each named parameter is matched with at most one other parameter.

[0042] After iterating through all formal parameters, the database system iterates through each parameter in the parameter list, reads the default value identifier for each parameter, and checks whether all parameters without default values ​​have been marked as overridden. If all parameters without default values ​​have been overridden, the match is considered successful. If any parameter without a default value is not overridden, the match is considered unsuccessful, the current call flow is terminated, and an error message is returned.

[0043] Based on the above steps, the naming parameter and formal parameter name matching mechanism enables the caller to pass parameters regardless of the parameter declaration order, improving the flexibility of subroutine calls and code readability; by verifying whether the named parameter group can cover all formal parameters without default values, it ensures that all necessary parameters have been passed, avoiding program execution exceptions caused by missing parameters.

[0044] In the implementation of step S102, matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains both positional parameter groups and named parameter groups, and the number of positional parameters in the positional parameter groups is greater than or equal to the total number of formal parameters in the formal parameter list, the named parameter group is ignored, and the input parameter list and the formal parameter list are considered to match successfully. If the number of positional parameters in the positional parameter group is less than the total number of parameters in the parameter list, after performing positional parameter matching, starting from the first parameter in the parameter list that is not marked as covered, the matching relationship between each named parameter and the remaining uncovered parameters is established according to the declaration order. Based on the matching relationship, the values ​​of each named parameter are assigned to the matched parameters, and the assigned parameters are marked as covered. If the named parameter group can cover all parameters that are not covered by the positional parameter group and have no default value, the input parameter list and the parameter list are considered to have matched successfully. If the named parameter group fails to cover all parameters that are not covered by the positional parameter group and have no default value, the matching is considered to have failed and an error message is returned.

[0045] In this embodiment, after the database system completes parameter acquisition and specification query, if the input parameter list contains both position parameter groups and named parameter groups, it determines that the current parameter transmission method is mixed parameter transmission.

[0046] If the number of positional parameters in the positional parameter group is greater than or equal to the total number of formal parameters in the parameter list, the database system ignores the named parameter group and does not include it in subsequent matching and assignment processing, even if the parameter names in the named parameter group are the same as the parameter names in the parameter list. The database system then establishes a one-to-one correspondence between each parameter in the positional parameter group and its corresponding formal parameter according to the declaration order in the parameter list, marking the matched formal parameter as overridden, and assigning the value of the corresponding positional parameter to that formal parameter as its input value. If the number of positional parameters exceeds the total number of formal parameters, the excess parameters are not matched with any formal parameter and are automatically ignored by the database system. After completing the above matching and assignment operations, the database system determines that the match is successful.

[0047] If the number of positional parameters in the positional parameter group is less than the total number of parameters in the formal parameter list, the database system, according to the declaration order of the formal parameter list, establishes a matching relationship between each parameter in the positional parameter group and the corresponding formal parameter in the formal parameter list. The matched formal parameter is marked as covered, and the value of the corresponding positional parameter is assigned to that formal parameter as its input value. After the positional parameter matching is complete, the database system starts from the first formal parameter in the formal parameter list that is not marked as covered, and traverses the remaining uncovered formal parameters according to the declaration order. For the currently traversed formal parameter, the database system reads its parameter name and checks if a named parameter with the same name exists in the named parameter group. If the query matches, the named parameter is matched with the current formal parameter, the value of the named parameter is assigned to the formal parameter, and the formal parameter is marked as covered. If the query does not match, the current formal parameter is skipped, and the traversal continues to the next uncovered formal parameter. During the named parameter matching process, each named parameter establishes a matching relationship with at most one formal parameter.

[0048] After completing positional and named parameter matching, the database system checks whether all parameters without default values ​​have been marked as overridden. If all parameters without default values ​​are overridden, the match is considered successful. If any parameter without a default value is not overridden, the match is considered unsuccessful, the current call flow is terminated, and an error message is returned.

[0049] Based on the above implementation, by adopting the position parameter priority processing strategy, when the position parameter covers all formal parameters, the named parameter group is directly ignored, which simplifies the parameter matching process in mixed parameter passing scenarios and improves the matching efficiency; when the position parameter partially covers, the named parameter matching is automatically connected from the first uncovered formal parameter, which ensures the complete coverage of necessary parameters and avoids parameter redundancy and conflicts, thus balancing parameter passing efficiency and verification accuracy.

[0050] Figure 3 This is a schematic flowchart illustrating the determination of a target value in a database parameter processing method according to an embodiment of the present invention. Figure 3 As shown, the target values ​​for each formal parameter are determined based on the matching results, including: Step S301: In response to the successful matching of the input parameter list and the formal parameter list, traverse each formal parameter in the formal parameter list according to the declaration order, and determine whether the traversed formal parameter is marked as overridden. Step S302: If the formal parameter is marked as covered, the current value of the matched positional parameter or named parameter is used as the target value of the formal parameter. Step S303: If the formal parameter is not marked as covered, obtain the default value identifier of the formal parameter; if the default value identifier indicates that the formal parameter has a default value, use the default value as the target value of the formal parameter, and mark the formal parameter as filled, wherein the covered state and the filled state are mutually exclusive; if the default value identifier indicates that the formal parameter does not have a default value, terminate the traversal and return an error message.

[0051] In this embodiment, after the database system completes the matching judgment and confirms that the input parameter list and the formal parameter list match successfully, it enters the target value determination stage.

[0052] The database system iterates through the parameter list sequentially, starting from the first parameter and working its way up to the last, according to the declaration order. For each parameter encountered, the database system reads its status flag field and determines whether the flag is in an overridden state. The overridden state is set during the matching process; when a parameter successfully matches an input parameter, the database system marks the parameter as overridden and records the storage location of the matched input parameter.

[0053] If the status of the currently traversed parameter is marked as covered, the database system reads the storage location of the corresponding input parameter (positional parameter or named parameter) from the matching record, reads the current value from that storage location, determines that value as the target value of the parameter, and stores it in the corresponding position in the target value list. In the case of being covered, the database system directly uses the parameter value passed by the caller as the target value.

[0054] If the status flag of the currently traversed formal parameter is not overridden, the database system enters the default value processing procedure. The database system reads the default value identifier of the formal parameter from the parameter specification information. The default value identifier indicates whether the formal parameter has a default value.

[0055] If the default value identifier indicates that the parameter has a default value, the database system reads the default value of the parameter from the parameter specification information, determines the default value as the target value of the parameter, stores it in the corresponding position in the target value list, and updates the status flag of the parameter to the filled state.

[0056] If the default value flag indicates that the parameter does not have a default value, the database system determines that the parameters passed in the current call request are incomplete and lack necessary parameters. It then terminates the current parameter traversal process, generates an error message indicating the missing necessary parameter name, and returns it to the caller, without executing subsequent subroutine calls. The covered and filled states are semantically mutually exclusive. "Covered" indicates that the parameter's target value comes from the parameter passed in by the caller, while "filled" indicates that the parameter's target value comes from the default value defined in the subroutine. Both will not appear simultaneously on the same parameter.

[0057] After all formal parameters have been processed, the database system obtains a list of target values ​​for each formal parameter, which is used to construct the subsequent modified parameter list.

[0058] Based on the above steps, by determining the value of each formal parameter according to its overridden state and default value configuration, and in accordance with the order of formal parameter declaration, multiple value sources are uniformly incorporated into the traversal assignment process, ensuring that all formal parameters have definite parameter values ​​before the subroutine is executed; through state mutual exclusion design and exception handling mechanism for missing necessary parameters, parameter conflicts and program exceptions caused by missing parameters are avoided.

[0059] In the implementation of step S103, combining the target values ​​of each formal parameter into a corrected list of input parameters includes: After iterating through all the parameters in the parameter list, the target values ​​of each parameter are extracted in the order of declaration, and the extracted target values ​​are arranged in the order of declaration to form the corrected input parameter list.

[0060] In this embodiment, after completing the formal parameter traversal and target value determination process, the database system enters the modified input parameter list construction stage.

[0061] The database system retrieves the declaration order of the parameter list, which records the order in which each parameter is arranged in the subroutine definition. Following this declaration order, the database system reads the target values ​​already determined for each parameter in the target value determination process, starting from the first parameter, and arranges each read target value according to the current traversal order.

[0062] The database system arranges the target values ​​sequentially according to the extraction order, forming a new sequence of parameter values. Each value in the sequence corresponds to a parameter in the parameter list, and the value at the i-th position in the sequence corresponds to the target value of the i-th parameter, where i is an integer from 1 to the total number of parameters in the parameter list. The sequence length is the same as the number of parameters in the parameter list. The database system stores this sequence of parameter values ​​as a modified input parameter list. The order of this input parameter list is completely consistent with the declaration order of the parameter list. Each position has a definite value, there are no null or uninitialized parameters, and each value in the list has passed type validation and matches the data type of the corresponding parameter.

[0063] The database system passes the revised list of input parameters to the execution module as the actual input parameters for calling the target subroutine, and the execution module then completes the final subroutine call.

[0064] Based on the above implementation method, by combining the target values ​​of each formal parameter into a modified input parameter list according to the order of the formal parameter declaration, the formal parameter values ​​determined from different sources (positional parameters, named parameters, default values) are uniformly organized into a standardized parameter list consistent with the order of the formal parameter declaration. Subsequent subroutine execution is based on this modified input parameter list, without needing to distinguish the original parameter type, thereby reducing the processing complexity of the execution engine.

[0065] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.

[0066] It should be understood that in some embodiments, the components may be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.

[0067] This embodiment also provides a computer program product 10, a computer-readable storage medium 20, and a computer device 30. Figure 4 This is a schematic diagram of a computer program product 10 according to an embodiment of the present invention. Figure 5 This is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention. Figure 6 This is a schematic diagram of a computer device 30 according to an embodiment of the present invention. Figure 4 As shown, the computer program product 10 includes a computer program 11, which, when executed by the processor 32, implements the steps of any of the above-described database parameter processing methods. For example... Figure 5 As shown, a computer-readable storage medium 20 stores the aforementioned computer program 11, which, when executed by the processor 32, implements the steps of the database parameter processing method of any of the above embodiments. Figure 6 As shown, the computer device 30 may include a memory 31, a processor 32, and a computer program 11 stored on the memory 31 and running on the processor 32.

[0068] The computer program 11 used to perform the operations of this invention may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages ​​and procedural programming languages. The computer program 11 may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer. In some embodiments, to perform aspects of this invention, electronic circuits, including, for example, programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), may execute computer-readable program instructions to personalize the electronic circuits by utilizing status information of the computer-readable program instructions.

[0069] For the purposes of this embodiment, computer program product 10 is a related product that includes computer program 11.

[0070] For the purposes of this embodiment, computer-readable storage medium 20 is a tangible device capable of holding and storing a computer program 11. It can be any device capable of containing, storing, communicating, propagating, or transmitting the program 11 for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable storage medium 20 include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable optical disc read-only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical encoding device, and any suitable combination thereof.

[0071] Computer device 30 can be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, computer device 30 can be a cloud computing node. Computer device 30 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types. Computer device 30 can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can reside on local or remote computing system storage media, including storage devices.

[0072] Computer device 30 may include a processor 32 adapted to execute stored instructions and a memory 31 that provides temporary storage space for the operation of said instructions during operation. The processor 32 may be a single-core processor, a multi-core processor, a computing cluster, or any other configuration. The memory 31 may include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.

[0073] Computer device 30 may also include a network adapter / interface and an input / output (I / O) interface. The I / O interface allows external devices that can be connected to the computer device to input and output data. The network adapter / interface provides communication between the computer device and a network, typically represented as a communication network.

[0074] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.

Claims

1. A parameter processing method for a database, characterized in that, include: In response to receiving a call request for a target subroutine, the system obtains the list of input parameters carried in the call request and queries the parameter specification information of the target subroutine from the database system; the parameter specification information includes a list of formal parameters arranged in the order of their declaration. Each input parameter in the input parameter list is matched with each formal parameter in the formal parameter list, and a corresponding target value is determined for each formal parameter based on the matching result; The target values ​​of each of the formal parameters are combined into a modified list of input parameters, and the target subroutine is executed based on the modified list of input parameters.

2. The database parameter processing method according to claim 1, characterized in that, Obtaining the list of input parameters carried in the call request includes: Parse the message body of the call request, and extract the position parameter group and / or name parameter group from the message body as the input parameter list.

3. The parameter processing method for a database according to claim 1, characterized in that, Matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains only position parameter groups, and the number of position parameters in the position parameter groups is greater than or equal to the number of formal parameters without default values ​​in the formal parameter list, the input parameter list is determined to be a successful match with the formal parameter list; if the number of position parameters in the position parameter groups is less than the number of formal parameters without default values ​​in the formal parameter list, the match is determined to be unsuccessful and an error message is returned.

4. The parameter processing method for a database according to claim 1, characterized in that, Matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains only named parameter groups, establish the matching relationship between each named parameter and the corresponding formal parameter in the parameter list according to the declaration order; Based on the matching relationship, the matched formal parameters are assigned values ​​according to the current values ​​of each of the named parameters, and the formal parameters that have been assigned values ​​are marked as overridden; If the named parameter group can cover all parameters without default values ​​in the parameter list, it is determined that the input parameter list and the parameter list are successfully matched; If the named parameter group fails to cover all parameters without default values ​​in the parameter list, the matching is deemed to have failed and an error message is returned.

5. The parameter processing method for a database according to claim 1, characterized in that, Matching each input parameter in the input parameter list with each formal parameter in the formal parameter list includes: If the input parameter list contains both position parameter groups and named parameter groups, and the number of position parameters in the position parameter groups is greater than or equal to the total number of formal parameters in the formal parameter list, the named parameter groups are ignored, and the input parameter list is determined to be a successful match with the formal parameter list. If the number of positional parameters in the positional parameter group is less than the total number of parameters in the formal parameter list, after performing positional parameter matching, starting from the first formal parameter in the formal parameter list that is not marked as covered, a matching relationship is established between each named parameter and the remaining uncovered formal parameters according to the declaration order; based on the matching relationship, the values ​​of each named parameter are assigned to the matched formal parameters, and the assigned formal parameters are marked as covered; if the named parameter group can cover all formal parameters that are not covered by the positional parameter group and have no default value, it is determined that the input parameter list and the formal parameter list match successfully; if the named parameter group fails to cover all formal parameters that are not covered by the positional parameter group and have no default value, it is determined that the matching fails and an error message is returned.

6. The parameter processing method for a database according to claim 1, characterized in that, Based on the matching results, the target values ​​for each of the formal parameters are determined as follows: In response to a successful match between the input parameter list and the formal parameter list, each formal parameter in the formal parameter list is traversed according to the declaration order, and it is determined whether the traversed formal parameter is marked as overridden. If the formal parameter is marked as covered, the current value of the matched positional parameter or named parameter is used as the target value of the formal parameter; If the parameter is not marked as covered, obtain the default value identifier of the parameter; if the default value identifier indicates that the parameter has a default value, use the default value as the target value of the parameter, and mark the parameter as filled, wherein the covered state and the filled state are mutually exclusive; if the default value identifier indicates that the parameter does not have a default value, terminate the traversal and return an error message.

7. The database parameter processing method according to claim 1, characterized in that, The target values ​​of each of the formal parameters are combined into a corrected list of input parameters, including: After traversing all parameters in the parameter list, the target values ​​of each parameter are extracted sequentially according to the declaration order, and the extracted target values ​​are arranged in the declaration order to form a corrected input parameter list.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the parameter processing method for the database according to any one of claims 1 to 7.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the parameter processing method for the database as described in any one of claims 1 to 7.

10. A computer device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the parameter processing method for the database according to any one of claims 1 to 7.