Program interface parameter generation method and device, computer equipment and storage medium
By determining the digital twin object and operation type to generate API parameters and performing parameter compensation, the problem of irregular API parameters is solved, the standardization and integrity of parameters are achieved, and the efficiency of API specification generation is improved.
Patent Information
- Application Number
- CN202411995686.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing API specifications are mainly formulated manually based on experience, resulting in quality problems such as irregular API parameters, affecting the open efficiency of network capabilities.
By determining at least one digital twin object and its operation type, program interface parameters are generated, and parameter compensation is performed through preset candidate program interface templates to obtain target program interface parameters.
The parameter input for standardized generation of program interface parameters is realized, ensuring the clarity of parameter hierarchy relationships, and improving the integrity and accuracy of parameters through parameter compensation, reducing configuration workload, and improving the efficiency of API specification generation.
Smart Images

Figure CN119917157A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a method, device, computer equipment, and storage medium for generating program interface parameters. Background Art
[0002] With the acceleration of network capability opening and digital transformation, the demand for API (Application Programming Interface) is endless, which puts higher requirements on API specification quality and iterative optimization.
[0003] However, current API specifications are mainly formulated manually based on experience. Therefore, there are quality issues such as non-standard API parameters, which restrict the open efficiency of network capabilities. Summary of the invention
[0004] Based on this, it is necessary to provide a program interface parameter generation method, device, computer equipment, and storage medium that can prevent quality problems such as non-standard API parameters from occurring in response to the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a method for generating program interface parameters. The method comprises:
[0006] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0007] Program interface parameters are generated according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain first program interface parameters.
[0008] According to the preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain target program interface parameters.
[0009] In one embodiment, the first program interface parameter is compensated according to the preset candidate program interface template, the at least one digital twin object, and the operation type corresponding to the at least one digital twin object to obtain the target program interface parameter, including:
[0010] Selecting a target program interface template from candidate program interface templates according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object;
[0011] The first program interface parameters are compensated according to the target program interface template to obtain target program interface parameters.
[0012] In one embodiment, the step of performing parameter compensation on the first program interface parameter according to the target program interface template to obtain the target program interface parameter includes:
[0013] By performing parameter generation on the target program interface template, a second program interface parameter is obtained;
[0014] The first program interface parameter and the second program interface parameter are combined to obtain a target program interface parameter.
[0015] In one of the embodiments, generating a program interface parameter according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain a first program interface parameter includes:
[0016] Determining object property parameters of the at least one digital twin object;
[0017] Determining, according to a relationship between different digital twin objects in the at least one digital twin object, a parameter nesting structure generated between the at least one digital twin object;
[0018] The object attribute parameter and the parameter nested structure are combined to obtain a first program interface parameter.
[0019] In one embodiment, the combining the object attribute parameter and the parameter nested structure to obtain the first program interface parameter includes:
[0020] Combining the object attribute parameters and the parameter nested structure to obtain initial program interface parameters;
[0021] The initial program interface parameters are normalized to obtain first program interface parameters.
[0022] In one of the embodiments, the object attribute parameter description includes at least one of an attribute name, an attribute code, an attribute value range, an attribute enumeration value, and an attribute description.
[0023] In a second aspect, the present application also provides a program interface parameter generation device. The device comprises:
[0024] A determination module, configured to construct requirements according to program interface parameters, determine at least one digital twin object, and an operation type corresponding to the at least one digital twin object; wherein the operation type includes at least one of adding, modifying, querying, and deleting;
[0025] A generation module is used to generate program interface parameters according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain a first program interface parameter.
[0026] A compensation module is used to perform parameter compensation on the first program interface parameters according to a preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain target program interface parameters.
[0027] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0028] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0029] Program interface parameters are generated according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain first program interface parameters.
[0030] According to the preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain target program interface parameters.
[0031] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0032] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0033] Program interface parameters are generated according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain first program interface parameters.
[0034] According to the preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain target program interface parameters.
[0035] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0036] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0037] Program interface parameters are generated according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain first program interface parameters.
[0038] According to the preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain target program interface parameters.
[0039] The above-mentioned program interface parameter generation method, device, computer equipment, and storage medium realize program interface parameter generation for at least one digital twin object by determining at least one digital twin object and the operation type corresponding to at least one digital twin object, and obtain the first program interface parameter. Then, according to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to at least one digital twin object, the first program interface parameter is compensated to obtain the target program interface parameter. According to the above content, it can be known that in the process of producing program interface parameters, the present application selects at least one digital twin object based on the actual program interface parameter construction requirements to realize the standardized generation of program interface parameter parameter input, and generates program interface parameters and parameter nested structure in combination with the object attributes and object relationships of the digital twin object to realize the generation of the first program interface parameters, thereby ensuring the standardization of program interface parameter generation and clarifying the parameter hierarchical relationship; and, subsequently, the program interface parameter generation is further standardized through the preset candidate program interface template, and the first program interface parameter is compensated for by the operation type corresponding to at least one digital twin object and at least one digital twin object, thereby improving the parameter integrity and accuracy, thereby reducing the configuration workload while flexibly responding to various program interface creation scenarios and improving the efficiency of program interface specification generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 An application environment diagram of a method for generating program interface parameters provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a flow chart of a first method for generating program interface parameters provided in an embodiment of the present application;
[0042] Figure 3 A flowchart of a second method for generating program interface parameters provided in an embodiment of the present application;
[0043] Figure 4 A flowchart of a third method for generating program interface parameters provided in an embodiment of the present application;
[0044] Figure 5 A flowchart of a fourth method for generating program interface parameters provided in an embodiment of the present application;
[0045] Figure 6 A structural block diagram of a program interface parameter generating device provided in an embodiment of the present application;
[0046] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] 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.
[0048] The program interface parameter generation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. By determining at least one digital twin object and the operation type corresponding to at least one digital twin object, at least one digital twin object is generated for program interface parameters to obtain a first program interface parameter, and then, according to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to at least one digital twin object, the first program interface parameter is parameter compensated to obtain the target program interface parameter. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0049] In one embodiment, Figure 2 As shown, a method for generating program interface parameters is provided, and the method is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0050] S201, building requirements according to program interface parameters, determining at least one digital twin object, and an operation type corresponding to at least one digital twin object.
[0051] The operation type includes at least one of adding, modifying, querying and deleting;
[0052] It should be noted that when it is necessary to determine at least one digital twin object, the program interface parameter construction requirements can be obtained in advance. The program interface parameter construction requirements record at least one digital twin object identifier required to construct the program interface parameters. Then, based on the at least one digital twin object identifier, at least one digital twin object is determined.
[0053] It is further explained that the program interface parameter construction requirements also record the operation type corresponding to at least one digital twin object.
[0054] In one embodiment of the present application, when it is necessary to determine at least one digital twin object, at least one digital twin object identifier required for constructing the program interface parameters is recorded in the program interface parameter construction requirements, and at least one digital twin object is selected from the digital twin object list, wherein the digital twin object list records at least one candidate object and the object identifier of each candidate object;
[0055] Specifically, if the object identifier of a candidate object in the digital twin object list is the same as at least one digital twin object identifier required to construct the program interface parameters, the candidate object is used as the digital twin object.
[0056] S202: Generate program interface parameters according to at least one digital twin object and an operation type corresponding to at least one digital twin object to obtain a first program interface parameter.
[0057] It should be noted that when it is necessary to generate program interface parameters based on at least one digital twin object and the operation type corresponding to at least one digital twin object to obtain the first program interface parameters, the object attribute parameters of at least one digital twin object and the association relationship between at least one digital twin object can be determined respectively, and then, the first program interface parameters can be generated based on the object attribute parameters of at least one digital twin object and the association relationship between at least one digital twin object.
[0058] In one embodiment of the present application, when generating the first program interface parameters, the following contents may be included: determining the object attribute parameters of at least one digital twin object; determining the parameter nested structure generated between at least one digital twin object based on the relationship between different digital twin objects in at least one digital twin object; combining the object attribute parameters and the parameter nested structure to obtain the first program interface parameters.
[0059] S203: According to a preset candidate program interface template, at least one digital twin object, and an operation type corresponding to at least one digital twin object, parameter compensation is performed on the first program interface parameters to obtain target program interface parameters.
[0060] The target program interface parameters include target program interface output parameters and target program interface input parameters.
[0061] In one embodiment of the present application, when it is necessary to perform parameter compensation on the first program interface parameters based on a preset candidate program interface template, at least one digital twin object, and an operation type corresponding to at least one digital twin object, a target program interface template can be selected from the preset candidate program interface templates; then, based on the target program interface template, at least one digital twin object, and the operation type corresponding to at least one digital twin object, the first program interface parameters are compensated to obtain the target program interface parameters.
[0062] The above-mentioned program interface parameter generation method realizes program interface parameter generation for at least one digital twin object by determining at least one digital twin object and the operation type corresponding to at least one digital twin object, obtains the first program interface parameter, and then, according to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to at least one digital twin object, performs parameter compensation on the first program interface parameter to obtain the target program interface parameter. According to the above content, in the process of producing program interface parameters, the present application selects at least one digital twin object according to the actual program interface parameter construction requirements to realize the parameter input of the standardized generation of program interface parameters, and generates program interface parameters and parameter nested structures in combination with the object attributes and object relationships of the digital twin object, realizes the generation of the first program interface parameters, ensures the standardization of program interface parameter generation, and clarifies the parameter hierarchical relationship; and, subsequently, the program interface parameter generation is further standardized through the preset candidate program interface template, and the first program interface parameter is compensated for by the operation type corresponding to at least one digital twin object and at least one digital twin object, which improves the parameter integrity and accuracy, and realizes the flexible response to the diverse program interface creation scenarios while reducing the configuration workload, and improves the efficiency of program interface specification generation.
[0063] In one embodiment, if Figure 3 As shown, when it is necessary to perform parameter compensation on the first program interface parameters according to the preset candidate program interface template, at least one digital twin object, and the operation type corresponding to the at least one digital twin object to obtain the target program interface parameters, the following contents may be included:
[0064] S301, selecting a target program interface template from candidate program interface templates according to at least one digital twin object and an operation type corresponding to at least one digital twin object.
[0065] In one embodiment of the present application, a mapping relationship between the operation types corresponding to the digital twin object and at least one digital twin object and the candidate program interface templates can be pre-specified, and the mapping relationship records different digital twin objects and operation types, and different candidate program interface templates corresponding to them. Therefore, after determining at least one digital twin object and the operation type corresponding to at least one digital twin object, the present application can determine the candidate program interface template corresponding to the operation type corresponding to at least one digital twin object and at least one digital twin object from the mapping relationship, and use the candidate program interface template corresponding to the operation type corresponding to at least one digital twin object and at least one digital twin object in the mapping relationship as the target program interface template.
[0066] S302: Perform parameter compensation on the first program interface parameters according to the target program interface template to obtain target program interface parameters.
[0067] It should be noted that when it is necessary to perform parameter compensation on the first program interface parameters according to the target program interface template to obtain the target program interface parameters, the following contents may be included: obtaining the second program interface parameters by generating parameters for the target program interface template; and obtaining the target program interface parameters by combining the first program interface parameters and the second program interface parameters.
[0068] Among them, the second program interface parameters may include header information, synchronous / asynchronous interaction mode, program interface common parameters, program interface input and output parameter framework, etc.
[0069] The above-mentioned program interface parameter generation method selects a target program interface template from candidate program interface templates to realize parameter generation for the target program interface template and obtain the second program interface parameters; then, the first program interface parameters and the second program interface parameters are combined to obtain the target program interface parameters, thereby ensuring the integrity of the target program interface parameters.
[0070] In one embodiment, if Figure 4As shown, when it is necessary to generate program interface parameters according to at least one digital twin object and the operation type corresponding to at least one digital twin object to obtain the first program interface parameter, the following contents may be included:
[0071] S401, determining object property parameters of at least one digital twin object.
[0072] The object attribute parameter description includes at least one of the attribute name, attribute code, attribute value range, attribute enumeration value and attribute description.
[0073] For example, obtain the attribute name, attribute code, attribute value range, attribute enumeration value, attribute description, etc. of the slice object and DNN object in the digital twin object.
[0074] S402: Determine a parameter nesting structure generated between at least one digital twin object according to a relationship between different digital twin objects in at least one digital twin object.
[0075] In one embodiment of the present application, when it is necessary to determine the parameter nesting structure corresponding to at least one digital twin object, it can be determined whether there is an association relationship between different digital twin objects. If so, the associated object is nested under the associated object. If there is no association relationship between the two digital twin objects, the two digital twin objects are flattened at the same level. Then, after completing the nesting processing for each digital twin object, the parameter nesting structure corresponding to at least one digital twin object can be obtained.
[0076] As an example, the DNN object slice object in the digital twin object generates a nested structure of parameters as follows:
[0077] {slice object / ns:
[0078] {
[0079] DNN object / dnn:{}
[0080] }
[0081] }
[0082] If there is no association between the slice and the DNN, the generated object structure is:
[0083] {slice object / ns:{}
[0084] DNN object / dnn:{}
[0085] }
[0086] S403: Combine the object attribute parameter and the parameter nested structure to obtain a first program interface parameter.
[0087] It should be noted that when it is necessary to combine the object attribute parameters and the parameter nested structure to obtain the first program interface parameters, the following contents may be included: combining the object attribute parameters and the parameter nested structure to obtain the initial program interface parameters; normalizing the initial program interface parameters to obtain the first program interface parameters.
[0088] The above-mentioned program interface parameter generation method determines the object attribute parameters and the parameter nested structure to combine the object attribute parameters and the parameter nested structure to obtain the first program interface parameters, and realizes the generation of program interface parameters and parameter nested structure by combining the object attributes and object relationships of the digital twin object, thereby realizing the generation of the first program interface parameters, ensuring the standardization of program interface parameter generation and clarifying the parameter hierarchical relationship.
[0089] In one embodiment, if Figure 5 As shown, when it is necessary to generate target program interface parameters, the following contents may be included:
[0090] S501, building requirements according to program interface parameters, determining at least one digital twin object, and an operation type corresponding to at least one digital twin object.
[0091] S502: Determine object property parameters of at least one digital twin object.
[0092] S503: Determine a parameter nesting structure generated between at least one digital twin object according to a relationship between different digital twin objects in at least one digital twin object.
[0093] S504, combining the object attribute parameters and the parameter nested structure to obtain initial program interface parameters.
[0094] S505: normalize the initial program interface parameters to obtain first program interface parameters.
[0095] S506: Select a target program interface template from candidate program interface templates based on at least one digital twin object and an operation type corresponding to at least one digital twin object.
[0096] S507, obtaining second program interface parameters by generating parameters for the target program interface template.
[0097] S508: Combine the first program interface parameter and the second program interface parameter to obtain a target program interface parameter.
[0098] In one embodiment, a slice object and a DNN object that meet the program interface parameter construction requirements and the operation types corresponding to the slice object and the DNN object are selected from the digital twin object list; object attribute parameters of the slice object and the DNN object are obtained, and the object attribute parameters include attribute name, attribute code, attribute value range, attribute enumeration value, attribute description, etc.;
[0099] Specifically, the object attribute parameters are as follows:
[0100]
[0101]
[0102] Furthermore, the DNN object is associated with the slice object, and the generated object structure is:
[0103]
[0104] If there is no association between the slice and the DNN, the generated object structure is:
[0105] {slice object / ns:{}
[0106] DNN object / dnn:{}
[0107] }
[0108] Obtain slice object attributes to generate a parameter nested structure of slice object parameters, obtain DNN object attributes to generate a parameter nested structure of DNN object parameters, fill the object attribute parameters into the corresponding positions of the generated parameter nested structure to obtain the initial program interface parameters; normalize the initial program interface parameters to obtain the first program interface parameters. The first program interface parameters are as follows:
[0109]
[0110]
[0111]
[0112]
[0113] A target program interface template is selected from the candidate program interface templates, and second program interface parameters such as header information, synchronous / asynchronous interaction mode, program interface common parameters, program interface input and output parameter framework, etc. are generated according to the target program interface template.
[0114] The header information is as follows:
[0115]
[0116] The common parameters of the program interface are as follows:
[0117]
[0118]
[0119] The automatically generated parameters are as follows:
[0120]
[0121] The first program interface parameter and the second program interface parameter are combined to obtain a target program interface parameter.
[0122] The target program interface input parameters in the target program interface parameters are as follows:
[0123]
[0124]
[0125] The target program interface output parameters in the target program interface parameters are as follows:
[0126]
[0127] Request message sample:
[0128]
[0129] "hasVpnIpv6":"DISABLE",
[0130] "vpnInstanceIpv6":""
[0131] }
[0132] }
[0133] Response message sample:
[0134] {
[0135] "resultCode":"0000",
[0136] "resultMsg":"Processing successful"
[0137] }
[0138] The above-mentioned program interface parameter generation method realizes program interface parameter generation for at least one digital twin object by determining at least one digital twin object and the operation type corresponding to at least one digital twin object, obtains the first program interface parameter, and then, according to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to at least one digital twin object, performs parameter compensation on the first program interface parameter to obtain the target program interface parameter. According to the above content, in the process of producing program interface parameters, the present application selects at least one digital twin object according to the actual program interface parameter construction requirements to realize the parameter input of the standardized generation of program interface parameters, and generates program interface parameters and parameter nested structures in combination with the object attributes and object relationships of the digital twin object, realizes the generation of the first program interface parameters, ensures the standardization of program interface parameter generation, and clarifies the parameter hierarchical relationship; and, subsequently, the program interface parameter generation is further standardized through the preset candidate program interface template, and the first program interface parameter is compensated for by the operation type corresponding to at least one digital twin object and at least one digital twin object, which improves the parameter integrity and accuracy, and realizes the flexible response to the diverse program interface creation scenarios while reducing the configuration workload, and improves the efficiency of program interface specification generation.
[0139] 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.
[0140] Based on the same inventive concept, the embodiment of the present application also provides a program interface parameter generation device for implementing the program interface parameter generation method involved above. 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 one or more program interface parameter generation device embodiments provided below can refer to the limitations of the program interface parameter generation method above, and will not be repeated here.
[0141] In one embodiment, Figure 6 As shown, a program interface parameter generating device is provided, comprising: a determination module 10, a generation module 20 and a compensation module 30, wherein:
[0142] A determination module 10 is used to build requirements according to program interface parameters, determine at least one digital twin object, and an operation type corresponding to at least one digital twin object; wherein the operation type includes at least one of adding, modifying, querying, and deleting;
[0143] The generation module 20 is used to generate program interface parameters according to at least one digital twin object and an operation type corresponding to at least one digital twin object to obtain a first program interface parameter.
[0144] The compensation module 30 is used to perform parameter compensation on the first program interface parameters according to a preset candidate program interface template, at least one digital twin object and an operation type corresponding to at least one digital twin object to obtain target program interface parameters.
[0145] The above-mentioned program interface parameter generation device, by determining at least one digital twin object and the operation type corresponding to at least one digital twin object, realizes the generation of program interface parameters for at least one digital twin object, obtains the first program interface parameter, and then, according to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to at least one digital twin object, performs parameter compensation on the first program interface parameter to obtain the target program interface parameter. According to the above content, in the process of producing program interface parameters, the present application selects at least one digital twin object according to the actual program interface parameter construction requirements to realize the parameter input of the standardized generation of program interface parameters, and generates program interface parameters and parameter nested structures in combination with the object attributes and object relationships of the digital twin object, realizes the generation of the first program interface parameter, ensures the standardization of the generation of program interface parameters, and clarifies the parameter hierarchical relationship; and, subsequently, the program interface parameter generation is further standardized through the preset candidate program interface template, and the first program interface parameter is compensated for by the operation type corresponding to at least one digital twin object and at least one digital twin object, which improves the parameter integrity and accuracy, and realizes the flexible response to the diverse program interface creation scenarios while reducing the configuration workload, and improves the efficiency of program interface specification generation.
[0146] Each module in the above-mentioned program interface parameter generation 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 the operations corresponding to each of the above modules.
[0147] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, 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. Among them, 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, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for generating program interface parameters is 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 Figure 7 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 provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0150] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0151] Program interface parameters are generated according to at least one digital twin object and an operation type corresponding to at least one digital twin object to obtain first program interface parameters.
[0152] According to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain the target program interface parameters.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] Selecting a target program interface template from candidate program interface templates according to at least one digital twin object and an operation type corresponding to at least one digital twin object;
[0155] The first program interface parameters are compensated according to the target program interface template to obtain the target program interface parameters.
[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0157] By performing parameter generation on the target program interface template, a second program interface parameter is obtained;
[0158] The first program interface parameter and the second program interface parameter are combined to obtain a target program interface parameter.
[0159] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0160] determining object property parameters of at least one digital twin object;
[0161] Determining a parameter nesting structure generated between at least one digital twin object according to a relationship between different digital twin objects in at least one digital twin object;
[0162] The object attribute parameter and the parameter nested structure are combined to obtain a first program interface parameter.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0164] Combine the object attribute parameters and the parameter nested structure to obtain the initial program interface parameters;
[0165] The initial program interface parameters are normalized to obtain first program interface parameters.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] The object attribute parameter description includes at least one of the attribute name, attribute code, attribute value range, attribute enumeration value and attribute description.
[0168] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0169] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0170] Program interface parameters are generated according to at least one digital twin object and an operation type corresponding to at least one digital twin object to obtain first program interface parameters.
[0171] According to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain the target program interface parameters.
[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0173] Selecting a target program interface template from candidate program interface templates according to at least one digital twin object and an operation type corresponding to at least one digital twin object;
[0174] The first program interface parameters are compensated according to the target program interface template to obtain the target program interface parameters.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] By performing parameter generation on the target program interface template, a second program interface parameter is obtained;
[0177] The first program interface parameter and the second program interface parameter are combined to obtain a target program interface parameter.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] determining object property parameters of at least one digital twin object;
[0180] Determining a parameter nesting structure generated between at least one digital twin object according to a relationship between different digital twin objects in at least one digital twin object;
[0181] The object attribute parameter and the parameter nested structure are combined to obtain a first program interface parameter.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] Combine the object attribute parameters and the parameter nested structure to obtain the initial program interface parameters;
[0184] The initial program interface parameters are normalized to obtain first program interface parameters.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] The object attribute parameter description includes at least one of the attribute name, attribute code, attribute value range, attribute enumeration value and attribute description.
[0187] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0188] According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting;
[0189] Program interface parameters are generated according to at least one digital twin object and an operation type corresponding to at least one digital twin object to obtain first program interface parameters.
[0190] According to the preset candidate program interface template, at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain the target program interface parameters.
[0191] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0192] Selecting a target program interface template from candidate program interface templates according to at least one digital twin object and an operation type corresponding to at least one digital twin object;
[0193] The first program interface parameters are compensated according to the target program interface template to obtain the target program interface parameters.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0195] By performing parameter generation on the target program interface template, a second program interface parameter is obtained;
[0196] The first program interface parameter and the second program interface parameter are combined to obtain a target program interface parameter.
[0197] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0198] determining object property parameters of at least one digital twin object;
[0199] Determining a parameter nesting structure generated between at least one digital twin object according to a relationship between different digital twin objects in at least one digital twin object;
[0200] The object attribute parameter and the parameter nested structure are combined to obtain a first program interface parameter.
[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0202] Combine the object attribute parameters and the parameter nested structure to obtain the initial program interface parameters;
[0203] The initial program interface parameters are normalized to obtain first program interface parameters.
[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0205] The object attribute parameter description includes at least one of the attribute name, attribute code, attribute value range, attribute enumeration value and attribute description.
[0206] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0207] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods 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 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), magnetoresistive 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, etc., but are not limited to this.
[0208] 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 specification.
[0209] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations 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.
Claims
1. A method for generating program interface parameters, characterized in that: The method comprises: According to the program interface parameter construction requirements, at least one digital twin object and an operation type corresponding to the at least one digital twin object are determined; wherein the operation type includes at least one of adding, modifying, querying and deleting; Generating program interface parameters according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain first program interface parameters; According to the preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object, the first program interface parameters are compensated to obtain target program interface parameters.
2. The method according to claim 1, characterized in that The performing parameter compensation on the first program interface parameters according to the preset candidate program interface template, the at least one digital twin object, and the operation type corresponding to the at least one digital twin object to obtain the target program interface parameters includes: Selecting a target program interface template from candidate program interface templates according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object; The first program interface parameters are compensated according to the target program interface template to obtain target program interface parameters.
3. The method according to claim 2, characterized in that The step of performing parameter compensation on the first program interface parameter according to the target program interface template to obtain the target program interface parameter includes: By performing parameter generation on the target program interface template, a second program interface parameter is obtained; The first program interface parameter and the second program interface parameter are combined to obtain a target program interface parameter.
4. The method according to claim 1, characterized in that: The generating of program interface parameters according to the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain a first program interface parameter includes: Determining object property parameters of the at least one digital twin object; Determining, according to a relationship between different digital twin objects in the at least one digital twin object, a parameter nesting structure generated between the at least one digital twin object; The object attribute parameter and the parameter nested structure are combined to obtain a first program interface parameter.
5. The method according to claim 4, characterized in that The combining of the object attribute parameter and the parameter nested structure to obtain the first program interface parameter includes: Combining the object attribute parameters and the parameter nested structure to obtain initial program interface parameters; The initial program interface parameters are normalized to obtain first program interface parameters.
6. The method according to claim 4, characterized in that The object attribute parameter description includes at least one of an attribute name, an attribute code, an attribute value range, an attribute enumeration value, and an attribute description.
7. A program interface parameter generating device, characterized in that: The device comprises: A determination module, configured to construct requirements according to program interface parameters, determine at least one digital twin object, and an operation type corresponding to the at least one digital twin object; wherein the operation type includes at least one of adding, modifying, querying, and deleting; A generation module, configured to generate a program interface parameter according to the at least one digital twin object and an operation type corresponding to the at least one digital twin object, to obtain a first program interface parameter; A compensation module is used to perform parameter compensation on the first program interface parameters according to a preset candidate program interface template, the at least one digital twin object and the operation type corresponding to the at least one digital twin object to obtain target program interface parameters.
8. 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 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, 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 6 are implemented.
10. 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 6 are implemented.