Remote procedure call method and apparatus, server, and storage medium
By acquiring and determining the rules and variables of gRPC requests, the limitations of gRPC request invocation conditions and the fixed information are resolved, enabling flexible rule and variable configuration that is applicable to gRPC requests in more application scenarios.
Patent Information
- Application Number
- CN202111481326.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-12-06
AI Technical Summary
The existing Google Remote Procedure Call (GRPC) request has limited conditions, fixed return information, does not support variable calls, and cannot be flexibly configured.
By obtaining the GRPC request, determining the rules and/or variables required for the request, and returning the results including the rules and/or variables, the MOCK-server module receives the request and searches the database based on the rule or variable replacement module to determine and return the corresponding rules and/or variables.
It enables flexible configuration of different gRPC requests, is applicable to more application scenarios with more variables and rules, and dynamically obtains functional information in gRPC requests.
Smart Images

Figure CN114490109B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to, but is not limited to, the technical field of computer, and particularly relates to a remote procedure call method and device, a server and a storage medium. BACKGROUND
[0002] Google Remote Procedure Call (GRPC) is an effective solution for network performance measurement proposed by Google Company; GRPC defines an open general Remote Procedure Call (RPC) framework for high-performance connection distributed system. In GRPC, a client can directly call an object of a server on another machine as if calling a local object; however, the current GRPC request call is usually limited in conditions, the returned information is fixed, and variable call is not supported. SUMMARY
[0003] The present disclosure provides a remote procedure call method, device, server and storage medium.
[0004] According to a first aspect of the present disclosure, a remote procedure call method is provided, the method comprising:
[0005] obtaining a Google Remote Procedure Call (GRPC) request;
[0006] determining rules and / or variables required by the GRPC request based on the GRPC request;
[0007] returning a return result comprising the rules and / or the variables.
[0008] In some embodiments, the determining the rules and / or the variables required by the GRPC request based on the GRPC request comprises one of:
[0009] in response to the GRPC request being used for requesting configuration rules, determining the rules required by the GRPC request;
[0010] in response to the GRPC request being used for requesting configuration variables, determining the variables required by the GRPC request;
[0011] in response to the GRPC request being used for requesting configuration rules and variables, determining the rules and the variables required by the GRPC request.
[0012] In some embodiments, the determining the rules and / or the variables required by the GRPC request based on the GRPC request comprises:
[0013] determining, based on the GRPC request, whether the GRPC request requests a configuration rule;
[0014] if yes, querying a database based on the GRPC request to determine the rule required by the GRPC request.
[0015] In some embodiments, the determining, based on the GRPC request, the rule and / or the variable required by the GRPC request comprises:
[0016] if it is determined that the GRPC request does not request a configuration rule, determining whether the GRPC request requests a configuration variable;
[0017] if yes, determining, based on the GRPC request, the variable required by the GRPC request.
[0018] In some embodiments, the determining, based on the GRPC request, the variable required by the GRPC request comprises:
[0019] if the variable requested for configuration by the GRPC request does not need to be applied to the GRPC request, determining, based on the GRPC request, the variable required.
[0020] In some embodiments, the method further comprises:
[0021] if the variable requested for configuration by the GRPC request needs to be applied to the GRPC request, determining, based on the GRPC request, the variable required and updating the variable into the GRPC request;
[0022] the return result including the rule and / or the variable comprises:
[0023] returning the updated GRPC request as the return result.
[0024] In some embodiments, the method further comprises at least one of:
[0025] displaying the return result on a client;
[0026] storing the variable and / or the rule in a database;
[0027] updating the variable and / or the rule in a database.
[0028] In some embodiments, the method is applied to a first server;
[0029] the obtaining a Google Remote Procedure Call (GRPC) request comprises:
[0030] receive the GRPC request sent by the second server by using a MOCK-server module;
[0031] The rule and / or the variable required by the GRPC request are determined based on the GRPC request, including:
[0032] The rule and / or the variable required by the GRPC request are determined based on the GRPC request by using a rule or variable replacement module to search a database;
[0033] The return result including the rule and / or the variable is returned, including:
[0034] The return result including the rule and / or the variable is sent to the second server by using the MOCK-server module.
[0035] According to a second aspect of the present disclosure, a remote procedure calling device is provided, and the device includes:
[0036] The obtaining module is configured to obtain a Google remote procedure calling (GRPC) request;
[0037] The processing module is configured to determine a rule and / or a variable required by the GRPC request based on the GRPC request;
[0038] The return module is configured to return a return result including the rule and / or the variable.
[0039] In some embodiments, the processing module is configured to perform one of:
[0040] In response to the GRPC request being used to request a configuration rule, the rule required by the GRPC request is determined;
[0041] In response to the GRPC request being used to request a configuration variable, the variable required by the GRPC request is determined;
[0042] In response to the GRPC request being used to request a configuration rule and a variable, the rule and the variable required by the GRPC request are determined.
[0043] In some embodiments, the processing module is configured to determine whether the GRPC request requests a configuration rule based on the GRPC request; if yes, the rule required by the GRPC request is determined by searching a database based on the GRPC request.
[0044] In some embodiments, the processing module is configured to determine whether the GRPC request requests a configuration variable if it is determined that the GRPC request does not request a configuration rule; if yes, the variable required by the GRPC request is determined based on the GRPC request.
[0045] In some embodiments, the processing module is configured to determine the required variable based on the GRPC request if the GRPC request is for requesting a configured variable that does not need to be applied to the GRPC request.
[0046] In some embodiments, the processing module is configured to determine the required variable based on the GRPC request and update the variable into the GRPC request if the GRPC request is for requesting a configured variable that needs to be applied to the GRPC request.
[0047] The returning module is configured to return the updated GRPC request as the return result.
[0048] In some embodiments, the apparatus further comprises a displaying module configured to display the return result on a client.
[0049] and / or,
[0050] The processing module is configured to store the variable and / or the rule in a database.
[0051] and / or,
[0052] The processing module is configured to update the variable and / or the rule in a database.
[0053] According to a third aspect of the present disclosure, there is provided a GRPC apparatus applied to a first server, the apparatus comprising:
[0054] A mock service (MOCK-server) module configured to receive a GRPC request sent by a second server;
[0055] A rule or variable replacement module configured to search a database based on the GRPC request to determine a rule and / or a variable required by the GRPC request.
[0056] The MOCK-server module is configured to send a return result comprising the rule and / or the variable to the second server by using the MOCK-server module.
[0057] According to a fourth aspect of the present disclosure, there is provided a server comprising:
[0058] A processor;
[0059] A memory for storing processor-executable instructions;
[0060] The processor is configured to implement the remote procedure call method of any embodiment of the present disclosure when the processor executes the executable instructions.
[0061] According to a fifth aspect of the present disclosure, a computer readable storage medium is provided, the readable storage medium storing an executable program, wherein the executable program, when executed by a processor, implements the remote procedure calling method according to any of the embodiments of the present disclosure.
[0062] The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects:
[0063] In the embodiments of the present disclosure, the server can obtain a GRPC request, determine rules and / or variables required by the GRPC request based on the GRPC request, and return a return result including the rules and / or the variables. In this way, the required rules and / or variables corresponding to different GRPC requests can be determined, thereby realizing flexible configuration of the return result, and further applying to more variable and / or rule request application scenarios.
[0064] In addition, the embodiments of the present disclosure can also obtain the result of each GRPC request, and dynamically obtain some function information in some GRPC requests.
[0065] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0066] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0067] Figure 1 is a flowchart of a remote procedure calling method according to an exemplary embodiment.
[0068] Figure 2 is a schematic diagram of a GRPC MOCK architecture according to an exemplary embodiment.
[0069] Figure 3 is a flowchart of a remote procedure calling method according to an exemplary embodiment.
[0070] Figure 4 is a flowchart of a remote procedure calling method according to an exemplary embodiment.
[0071] Figure 5 is a block diagram of a remote procedure calling device according to an exemplary embodiment.
[0072] Figure 6 is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION
[0073] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements throughout the several figures. The following exemplary embodiments are not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0074] With regard to the apparatuses in the above embodiments, the specific manner in which the various modules perform operations has been described in detail in the embodiments related to the methods, and will not be described in detail here.
[0075] As shown in Figure 1 The present disclosure provides a remote procedure calling method, which comprises:
[0076] Step S11: obtaining a Google remote procedure calling (GRPC) request;
[0077] Step S12: determining rules and / or variables required by the GRPC request based on the GRPC request;
[0078] Step S13: returning a return result comprising the rules and / or the variables.
[0079] The remote procedure calling method provided by the present disclosure can be applied to a server; the server can be various types of servers, for example, can be a local server or a cloud server, etc.; the server can also be a single server or a server cluster. Of course, the remote procedure calling method provided by the present disclosure can also be applied to other terminals except servers; for example, can be a calculator, a mobile phone, a medical device, etc.
[0080] In some embodiments of the present disclosure, as shown in Figure 2 The server can comprise at least one of the following modules: a service MOCK-server module 21, a rule or variable replacement module 22, a database module 23, a return information management module 24, and a result display module 25. In an embodiment, the database module 23 can be a mysql database module. Here, Figure 2 As shown in the server, it can also be considered as a Google remote procedure calling simulation (GRPC MOCK) architecture.
[0081] The MOCK-server module 21 of the first server is configured to receive a GRPC request and send the GRPC request to the rule or variable replacement module 22.
[0082] The rule or variable replacement module 22 is configured to obtain the rules and / or variables from the database module 23, and return the rules and / or variables to the MOCK-server module 21 and / or the return information management module 24.
[0083] The database module 23 is configured to provide the rules and / or variables for the rule or variable replacement module 22, and store a database. The database at least includes: a corresponding relationship between each GRPC request and each rule, and / or a corresponding relationship between each GRPC request and each variable, and / or each rule and / or each variable. The database module 23 is further configured to store the return result.
[0084] Here, the return result at least includes: rules and / or variables.
[0085] The return information management module 24 is configured to perform at least one of adding, deleting, modifying and querying on the information in the return result. The return information management module 24 is further configured to send the return result to the MOCK-server module 21 and / or the result display module 25.
[0086] The display module 25 is configured to display the return result.
[0087] The step S11 of obtaining the GRPC request can be obtaining a GRPC request of various remote procedure call (RPC) services or GRPC services. The GRPC request is configured to request to configure variables and / or rules.
[0088] The rules and / or variables can be various rules and / or variables for the GRPC request.
[0089] Here, the type of the service to which the GRPC request is directed, and the type of the rules and / or variables are not limited.
[0090] If the remote procedure call method is applied to the first server, in some embodiments of the present disclosure, the remote procedure call method is executed by the first server as an example.
[0091] The step S11 of obtaining the GRPC request can be: the first server obtains the GRPC request by using the service MOCK-server module 21. In this way, in the present embodiment, the GRPC request generated by the front end (or the client) can be called by the service end of the first server.
[0092] The step S11 of obtaining the GRPC request can be that the first server receives the GRPC request sent by the second server by using the service MOCK-server module 21. Thus, in the embodiment, the GRPC request sent by the other server can be obtained by the front end (or client) of the first server, and the GRPC request forwarded by the front end can be obtained by the server end of the first server.
[0093] The step S12 can be that the first server queries the database of the first server based on the GRPC request to determine the rules and / or variables required by the GRPC request. For example, the first server queries the database in the database module 23 by using the rule or variable replacement module 22 to determine the rules and / or variables required by the GRPC request.
[0094] The step S13 of returning the result can include one rule or multiple rules, and / or one variable or multiple variables.
[0095] The step S13 of returning the result including the rules and / or the variables can be that the first server returns the result to the client by using the server end of the first server.
[0096] Here, after the step S13, the method further includes displaying the result on the client. Thus, the user can directly view the returned result without the aid of other tools. The returned result of each GRPC request can be obtained, and some information functions in the GRPC can be dynamically obtained.
[0097] For example, the first server sends the result including the rules and / or the variables required by the GRPC request to the return information management module 24 by using the rule and / or variable module 22; the first server sends the result to the display module 24 by using the return information management module 24; and the first server displays the result by using the display module 24.
[0098] The step S13 of returning the result including the rules and / or the variables can be that the first server sends the result including the rules and / or the variables to the second server by using the MOCK-server module of the first server.
[0099] Exemplarily, the first server sends the return result including the rules and / or the variables required by the GRPC request to the return information management module 24 by using the rule and / or variable module 22; the first server sends the return result to the MOCK-server module 21 by using the return information management module 24; and the first server sends the return result to the second server by using the MOCK-server module 21. In this way, in this embodiment, the return result can also be returned to the second server through the front end of the first server, so as to display the return result in the second server. In this way, the user using the second server can view the return result based on the GRPC request.
[0100] In some embodiments, the method further includes but is not limited to one of the following: storing variables and / or rules in the database of the first server; updating variables and / or rules in the database of the first server. Here, updating variables and / or rules can be but is not limited to at least one of the following: adding new variables and / or rules, deleting existing variables and / or rules, and modifying fields in existing variables and / or rules.
[0101] In the embodiments of the present disclosure, the GRPC request can be obtained by the server; and based on the GRPC request, the rules and / or variables required by the GRPC request are determined; and a return result including the rules and / or the variables is returned. In this way, the corresponding required rules and / or variables can be determined for different GRPC requests, so as to realize flexible configuration of the return result, and thus to apply to more application scenarios of rule and / or variable request. Moreover, the result of each GRPC request can be obtained, and some functional information in some GRPC requests can be dynamically obtained.
[0102] As shown in Figure 3 In some embodiments, the S12 includes:
[0103] Step S121: determining whether the GRPC request requests to configure rules based on the GRPC request.
[0104] Step S122: if yes, querying a database based on the GRPC request to determine the rules required by the GRPC request.
[0105] In some embodiments, the step S122 of querying the database based on the GRPC request to determine the rules required by the GRPC request includes:
[0106] If the database includes the rules requested by the GRPC request, the rules configured by the GRPC request are obtained.
[0107] In some embodiments, the method further comprises at least one of:
[0108] If the rule requested by the GRPC request does not exist in the database, determining that the rule is not included in the return result returned.
[0109] If the rule requested by the GRPC request does not exist in the database, determining whether the GRPC request requests a configuration variable.
[0110] For example, the first server determines, based on the GRPC request, whether the GRPC request queries a request configuration rule. If the GRPC request is a request configuration rule, the mysql database is queried to determine whether the rule requested by the GRPC request exists in the mysql database. If the rule requested by the GRPC request exists in the mysql database, the rule is carried in the return result returned or displayed. If the rule requested by the GRPC request does not exist in the mysql database, the first server determines, based on the GRPC request, whether a variable is configured and / or determines that the rule is not included in the return result.
[0111] In the embodiments of the present disclosure, it can be determined based on the GRPC request whether a rule is requested, and if so, the rule is configured based on the GRPC request. In this way, different response rules can be configured based on different GRPC requests, so that flexible configuration of rules is realized.
[0112] Please refer again to Figure 3 In some embodiments, the step S12 comprises:
[0113] Step S123: If it is determined that the GRPC request does not request a configuration rule, it is determined whether the GRPC request requests a configuration variable.
[0114] Step S124: If so, based on the GRPC request, the variable required by the GRPC request is determined.
[0115] In some embodiments, the step S124 of determining, based on the GRPC request, the variable required by the GRPC request comprises:
[0116] If the variable requested by the GRPC request exists in the database, the variable requested by the GRPC request is obtained.
[0117] In some embodiments, the method comprises: if the variable requested by the GRPC request does not exist in the database, it is determined that the variable is not included in the return result.
[0118] In some embodiments, the method further comprises: if it is determined that the GRPC request does not request a configuration rule, determining that the obtained return information does not contain the variable.
[0119] In the embodiments of the present disclosure, after it is determined that the GRPC request does not request a configuration rule, it can be determined whether the GRPC request requests a configuration variable; if yes, the variable can be configured based on the GRPC request. In this way, on the one hand, a flexible configuration mode of only configuring a variable but not a rule can be implemented; on the other hand, different variables can be configured based on different GRPC requests, so that flexible configuration of the variable is implemented.
[0120] Of course, in other embodiments, the first server can continue to determine, based on the GRPC request, whether the GRPC request configures a variable after it is determined that the GRPC request requests a configuration rule.
[0121] Of course, in other embodiments, the first server can directly determine whether the GRPC request requests a configuration variable without first determining whether the GRPC request requests a configuration rule and then further determining whether the GRPC request configures a variable. For example, the step S12 comprises one of the following:
[0122] in response to the GRPC request being used to request a configuration rule, determining the rule required by the GRPC request;
[0123] in response to the GRPC request being used to request a configuration variable, determining the variable required by the GRPC request;
[0124] in response to the GRPC request being used to request a configuration rule and a variable, determining the rule and the variable required by the GRPC request.
[0125] In some embodiments, the determination of the variable required by the GRPC request based on the GRPC request in the S124 comprises:
[0126] if the variable requested by the GRPC request for configuration does not need to be applied to the GRPC request, determining the variable required by the GRPC request based on the GRPC request.
[0127] In one embodiment, the database comprises at least one of the following key fields: a request interface (interface_name), a request field for a variable (req_arg_to_resp), and a response json string associated storage (response_json).
[0128] Exemplarily, the first server calls the GRPC-MOCK architecture; after the request json is requested to the mock-server module, the mock-server module queries the database by calling the query function of the rule or variable replacement module. If the rule or variable replacement module queries that the "req_arg_to_resp" requested by the request interface in the database is empty, it indicates that this request does not need to use a certain key (key) in the request as a variable to show in the return result; then the rule or variable replacement module directly calls the return information management module. The return information management module obtains the "$mock.number" contained in the "response_json" field value corresponding to the request interface; and calls the rule query interface provided by the rule or variable replacement module to replace the "$mock.number" with the matched "number" queried based on the rule or variable replacement module; and returns the return result including the replaced "$mock.number" to the mock-server module. The mock-server module returns the return result to the requestor. Here, the request of the request interface is a GRPC request; here, the requestor can be a server, a client or a platform that sends a request, etc.; for example, the requestor can be a client of the first server or other servers, etc.
[0129] Thus, in the embodiments of the present disclosure, if the first server determines that the variable requested by the GRPC request does not need to be applied to the GRPC request, the request to the variable can be directly returned.
[0130] In some embodiments, the method further comprises:
[0131] If the variable configured by the GRPC request needs to be applied to the GRPC request, determining the required variable based on the GRPC request, and updating the variable to the GRPC request;
[0132] The return result including the rule and / or the variable includes:
[0133] The updated GRPC request is returned as the return result.
[0134] In one embodiment, the database includes at least one of the following key fields: request interface (interface_name), use request field as variable (req_arg_to_resp), and response json string association storage (response_json).
[0135] For example, the first server calls the GRPC-MOCK architecture; after the request json is requested to the mock-server module, the mock-server module queries the database by calling the query function of the rule or variable replacement module. If the rule or variable replacement module queries that the "req_arg_to_resp" requested by the request interface in the database is not empty, it indicates that this request needs to use a certain key (key) in the request as a variable to display in the return result. The mock-server module obtains the field value stored in the "req_arg_to_resp" in the database, for example, the "req.uid" field value, and sends the "req.uid" field value to the return information management module. The return information management module obtains the "response_json" field value corresponding to the request interface, which contains "$req.uid", and calls the rule query interface provided by the rule or variable replacement module to replace the "req.uid" field in the request with "$req.uid". The return information management module returns the request with the replaced "$req.uid" field to the mock-server module. The mock-server module returns the request including the replaced field to the requestor. Here, the request of the request interface is a GRPC request; here, the requestor can be a server, a client, or a platform that sends a request; for example, the requestor can be a client of the first server or other servers.
[0136] Therefore, in the embodiments of the present disclosure, if the first server determines that the variable requested by the GRPC request does not need to be applied to the GRPC request, the variable configured by the GRPC request can be obtained based on the GRPC request; and the variable is replaced in the GRPC request and returned. Therefore, in the embodiments of the present disclosure, the variable can be directly replaced and returned to the GRPC request, and the power consumption of some information in the GRPC request can be obtained.
[0137] To further explain any embodiment of the present disclosure, a specific example is provided as follows:
[0138] As shown in Figure 4 The embodiments of the present disclosure provide a remote procedure calling method, which is executed by a server and includes the following steps:
[0139] Step S41: obtaining a GRPC request;
[0140] In an optional embodiment, the server obtains the GRPC request by applying an application programming interface (API).
[0141] Step S42: determining whether the GRPC request needs to request a configuration rule; if yes, performing step S43; if no, performing step S44;
[0142] Step S43: determining the rule needed by the GRPC request based on the GRPC request;
[0143] In an optional embodiment, the server queries a database by using the rule or variable replacement module, and if the database matches the rule needed by the GRPC request, the server acquires the rule.
[0144] Step S44: determining whether the GRPC request needs to request a configuration variable; if yes, performing step S45; if no, performing step S48;
[0145] Step S45: determining whether the configuration variable requested by the GRPC request needs to be applied to the GRPC request; if yes, performing step S46; if no, performing step S47;
[0146] Step S46: acquiring GRPC request information;
[0147] In an optional embodiment, the server updates the variable into the GRPC request to obtain the GRPC request information.
[0148] Step S47: acquiring a return result including a variable;
[0149] In an optional embodiment, the return result is obtained based on the variable, or the return result is obtained based on the GRPC request information in which the variable is updated.
[0150] Here, the step S47 can be considered as a step of variable replacement.
[0151] Step S48: returning the return result.
[0152] In an optional embodiment, if the variable is obtained, the server returns the return result including the variable; if the variable is not obtained, the server returns the return result including the rule.
[0153] In another optional embodiment, the server also displays the return result on a client or a web page.
[0154] As shown in Figure 5 A remote procedure calling apparatus is provided, and the apparatus comprises:
[0155] An acquiring module 51 is configured to acquire a Google remote procedure calling (GRPC) request;
[0156] The processing module 52 is configured to determine the rule and / or the variable required by the GRPC request based on the GRPC request.
[0157] The returning module 53 is configured to return a return result including the rule and / or the variable.
[0158] In some embodiments, the processing module 52 is configured to perform one of the following:
[0159] In response to the GRPC request for requesting configuration of the rule, the processing module 52 is configured to determine the rule required by the GRPC request.
[0160] In response to the GRPC request for requesting configuration of the variable, the processing module 52 is configured to determine the variable required by the GRPC request.
[0161] In response to the GRPC request for requesting configuration of the rule and the variable, the processing module 52 is configured to determine the rule and the variable required by the GRPC request.
[0162] In some embodiments, the processing module 52 is configured to determine, based on the GRPC request, whether the GRPC request requests configuration of the rule; if yes, query a database based on the GRPC request to determine the rule required by the GRPC request.
[0163] In some embodiments, the processing module 52 is configured to, if it is determined that the GRPC request does not request configuration of the rule, determine whether the GRPC request requests configuration of the variable; if yes, determine, based on the GRPC request, the variable required by the GRPC request.
[0164] In some embodiments, the processing module 52 is configured to, if the variable for requesting configuration required by the GRPC request does not need to be applied to the GRPC request, determine, based on the GRPC request, the variable required by the GRPC request.
[0165] In some embodiments, the processing module 52 is configured to, if the variable for requesting configuration required by the GRPC request needs to be applied to the GRPC request, determine, based on the GRPC request, the variable required by the GRPC request, and update the variable into the GRPC request.
[0166] The returning module 53 is configured to return the updated GRPC request as the return result.
[0167] In some embodiments, the apparatus further comprises a display module configured to display the return result on a client.
[0168] In some embodiments, the processing module 52 is configured to store the variable and / or the rule in the database; and / or,
[0169] The processing module 52 is configured to update the variable and / or the rule in the database.
[0170] Please refer to Figure 2 The embodiments of the present disclosure provide a GRPC device applied to a first server, the device comprising:
[0171] A MOCK-server module 21 is configured to receive a GRPC request sent by a second server;
[0172] A rule or variable replacement module 22 is configured to search a database based on the GRPC request to determine a rule and / or a variable required by the GRPC request;
[0173] The MOCK-server module 21 is configured to send a return result comprising the rule and / or the variable to the second server by using the MOCK-server module.
[0174] As to the device in the above embodiments, the specific manners in which the modules perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0175] The embodiments of the present disclosure provide a server, comprising:
[0176] A processor;
[0177] A memory for storing processor-executable instructions;
[0178] The processor is configured to implement the remote procedure call method of any of the embodiments of the present disclosure when running the executable instructions.
[0179] The memory can comprise various types of storage media, which is non-transitory computer storage media and can continue to store information thereon after the communication device is powered off.
[0180] The processor can be connected with the memory through a bus or the like to read the executable program stored on the memory, for example, to implement at least one of the methods as shown in Figure 1 , Figures 3-4 .
[0181] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores an executable program, wherein the executable program is executed by a processor to implement the remote procedure call method of any of the embodiments of the present disclosure. For example, to implement at least one of the methods as shown in Figure 1 , Figures 3-4 .
[0182] With regard to the apparatuses in the above-described embodiments, a specific manner in which each module performs an operation has been described in detail in the embodiments related to the method, and thus detailed explanation will not be made here.
[0183] Figure 6 is a block diagram of a terminal 600 according to an exemplary embodiment. The terminal 600 can be, for example, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc. In one embodiment, the terminal 600 can also be a server in any of the above-described embodiments.
[0184] Referring to Figure 6 , the terminal 600 can include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0185] The processing component 602 usually controls overall operations of the terminal 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 can include one or more processors 620 to execute instructions to complete all or part of steps of the above-described methods. In addition, the processing component 602 can include one or more modules to facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0186] The memory 604 is configured to store various types of data to support operations of the device 800. Examples of these data include instructions for any application or method operating on the terminal 600, contact data, phonebook data, messages, pictures, videos, etc. The memory 604 can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic or optical disk.
[0187] The power supply component 606 supplies electric power for various components of the terminal 600. The power supply component 606 can include a power supply management system, one or more power supplies, and other components associated with generating, managing, and distributing electric power for the terminal 600.
[0188] The multimedia component 608 includes a screen providing an output interface between the terminal 600 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors for sensing a touch, a slide and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.
[0189] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) configured to receive external audio signals when the terminal 600 is in an operation mode, such as a call mode, a recording mode and a voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0190] The I / O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which can be a keypad, a click wheel, buttons and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button and a lock button.
[0191] The sensor component 614 includes one or more sensors for providing various state assessments for the terminal 600. For example, the sensor component 614 can detect an open / closed state of the device 800, relative positioning of components, such as a display and a keypad of the terminal 600, a change in position of the terminal 600 or a component of the terminal 600, presence or absence of user contact with the terminal 600, an orientation or acceleration / deceleration of the terminal 600, and a temperature change of the terminal 600. The sensor component 614 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 614 can further include a light sensor, such as a CMOS or CCD image sensor, for use in an imaging application. In some embodiments, the sensor component 614 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0192] The communication component 616 is configured to facilitate wired or wireless communication between the terminal 600 and other devices. The terminal 600 can access a wireless network based on a communication standard, such as WiFi, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast-related information from external broadcast management systems via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0193] In an exemplary embodiment, the terminal 600 can be implemented with one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements to perform the above-described methods.
[0194] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 604 including instructions, is also provided, which can be executed by the processor 620 of the terminal 600 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0195] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present application cover any and all variations of the application that come within the scope of the claims and their equivalents. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the application being indicated by the following claims.
[0196] It is to be understood that the application is not limited to the precise construction described and as shown in the attached figures, and that various modifications and changes can be effected therein by those skilled in the art without departing from the scope of the application. The scope of the application is to be limited only by the appended claims.
Claims
1. A remote procedure call method, characterized by, The method comprises: acquiring a Google Remote Procedure Call (GRPC) request; determining rules and / or variables required by the GRPC request based on the GRPC request; returning a return result comprising the rules and / or the variables; the determining of the rules and / or the variables required by the GRPC request based on the GRPC request comprises: determining whether the GRPC request requests configuration rules based on the GRPC request; if yes, querying a database based on the GRPC request to determine the rules required by the GRPC request; if it is determined that the GRPC request does not request configuration rules, determining whether the GRPC request requests configuration variables; if yes, determining the variables required by the GRPC request based on the GRPC request; the determining of the variables required by the GRPC request based on the GRPC request comprises: if the variable requested by the GRPC request for configuration does not need to be applied to the GRPC request, determining the required variables based on the GRPC request; if the variable requested by the GRPC request for configuration needs to be applied to the GRPC request, determining the required variables based on the GRPC request and updating the variables into the GRPC request; the returning of the return result comprising the rules and / or the variables comprises: returning the updated GRPC request as the return result.
2. The method of claim 1, wherein, The determining of the rules and / or the variables required by the GRPC request based on the GRPC request comprises one of: determining the rules required by the GRPC request in response to the GRPC request for requesting configuration rules; determining the variables required by the GRPC request in response to the GRPC request for requesting configuration variables; determining the rules and the variables required by the GRPC request in response to the GRPC request for requesting configuration rules and variables.
3. The method according to claim 1 or 2, characterized in that, The method further comprises at least one of: displaying the return result on a client; storing the variables and / or the rules in a database; updating the variables and / or the rules in a database.
4. The method of claim 1, wherein, applying to a first server; the acquiring of the GRPC request comprises: receiving the GRPC request sent by a second server by using a Mock-Server module; the determining of the rules and / or the variables required by the GRPC request based on the GRPC request comprises: determining the rules and / or the variables required by the GRPC request based on the GRPC request by using a rule or variable replacement module; the returning of the return result comprising the rules and / or the variables comprises: sending the return result comprising the rules and / or the variables to the second server by using the Mock-Server module.
5. A remote procedure call apparatus characterized by comprising: The apparatus comprises: an acquiring module configured to acquire a Google Remote Procedure Call (GRPC) request; a processing module configured to determine rules and / or variables required by the GRPC request based on the GRPC request; The processing module is configured to determine, based on the GRPC request, whether the GRPC request requests a configuration rule. If it is determined that the GRPC request is used to request a configuration rule, the processing module is configured to query a database based on the GRPC request to determine the rule required by the GRPC request. The returning module is configured to return a return result including the rule and / or the variable. The processing module is configured to determine, based on the GRPC request, whether the GRPC request requests a configuration variable if it is determined that the GRPC request does not request a configuration rule; and if so, determine the variable required by the GRPC request based on the GRPC request. The processing module is configured to determine the variable required by the GRPC request based on the GRPC request if the configuration variable requested by the GRPC request does not need to be applied to the GRPC request. The processing module is configured to determine the variable required by the GRPC request based on the GRPC request and update the variable into the GRPC request if the configuration variable requested by the GRPC request needs to be applied to the GRPC request. The returning module is configured to return the updated GRPC request as the return result.
6. The apparatus of claim 5, wherein, The processing module is configured to perform one of the following: In response to the GRPC request being used to request a configuration rule, determine the rule required by the GRPC request. In response to the GRPC request being used to request a configuration variable, determine the variable required by the GRPC request. In response to the GRPC request being used to request a configuration rule and a variable, determine the rule and the variable required by the GRPC request.
7. The apparatus of claim 5 or 6, wherein: The apparatus further comprises a display module configured to display the return result on a client side. And / or, The processing module is configured to store the variable and / or the rule in a database. And / or, The processing module is configured to update the variable and / or the rule in a database.
8. A GRPC device, characterized by The apparatus is applied to a first server, and the apparatus comprises: A mock service (MOCK-server) module configured to receive a GRPC request sent by a second server. A rule or variable replacement module configured to query a database based on the GRPC request to determine a rule and / or a variable required by the GRPC request. The MOCK-server module is configured to send a return result including the rule and / or the variable to the second server by using the MOCK-server module. The rule or variable replacement module is configured to: if it is determined that the GRPC request does not request configuration of a rule, determine whether the GRPC request requests configuration of a variable; if yes, determine the variable required by the GRPC request based on the GRPC request; if the variable requested by the GRPC request for configuration does not need to be applied to the GRPC request, determine the variable required by the GRPC request based on the GRPC request; if the variable requested by the GRPC request for configuration needs to be applied to the GRPC request, determine the variable required by the GRPC request based on the GRPC request, and update the variable to the GRPC request; The MOCK-server module is configured to return the updated GRPC request as the return result.
9. A server, characterized by The method comprises: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the remote procedure call method of any one of claims 1 to 4 when the processor-executable instructions are executed.
10. A computer-readable storage medium, characterized in that, The readable storage medium stores an executable program, wherein the executable program implements the remote procedure call method of any one of claims 1 to 4 when executed by the processor.
Citation Information
Patent Citations
Remote procedure call method and system, client and server
CN103095785A
Parameter setting method and device for a gRPC request
CN109739655A
Remote service calling method and device, electronic equipment and storage medium
CN111858083A
Agent system and method supporting real-time analysis of GRPC request
CN113746851A