Method and apparatus for configuring rpc timeout duration, electronic device, and storage medium

By obtaining and configuring the preset RPC timeout duration for each interface function, the problem that the existing technology cannot meet personalized needs due to the shared RPC timeout duration for interface functions is solved. This enables independent RPC timeout duration configuration for interface functions, improving the flexibility of configuration.

CN115576720BActive Publication Date: 2026-11-20XIAOMI EV TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211577154.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-11-20
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

In existing technologies, sharing a single RPC timeout duration across all interface functions cannot meet the personalized requirements of different interface functions for RPC timeout durations.

Method used

A method for configuring RPC timeout duration is provided. By obtaining a configuration file containing preset RPC timeout durations for multiple interface functions, the RPC timeout duration of each interface function is parsed and configured, supporting independent configuration of interface functions.

Benefits of technology

It enables flexible configuration of RPC timeout duration for different interface functions, improving the flexibility of RPC timeout duration configuration and meeting personalized configuration needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576720B_ABST
    Figure CN115576720B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a RPC timeout duration configuration method and device, electronic equipment and storage medium, and relates to the technical field of computers. The RPC timeout duration configuration method comprises: obtaining a remote procedure call (RPC) timeout duration configuration file; wherein the RPC timeout duration configuration file comprises a plurality of interface functions each corresponding to a preset RPC timeout duration; and configuring the RPC timeout duration corresponding to each interface function based on the RPC timeout duration configuration file. The RPC timeout duration configuration method provided by the embodiments of the present disclosure can realize independent configuration of the RPC timeout duration of each interface function, thereby improving the flexibility of the RPC timeout duration configuration method and better meeting the configuration requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to an RPC timeout duration configuration method, apparatus, electronic device, and storage medium. Background Technology

[0002] In related technologies, the timeout of all interface functions is typically controlled by configuring a single RPC (Remote Procedure Call) timeout duration, meaning all interface functions share the same RPC timeout duration. However, in practical applications, different interface functions may have different requirements for RPC timeout durations. Therefore, the current approach of sharing a single RPC timeout duration for all interface functions can no longer meet actual needs. Summary of the Invention

[0003] This disclosure provides a method, apparatus, electronic device, and storage medium for configuring RPC timeout duration, to at least solve the problem that the method of sharing a single RPC timeout duration for all interface functions in related technologies cannot meet practical needs. The technical solution of this disclosure is as follows: According to a first aspect of the present disclosure, an RPC timeout duration configuration method is provided, including: Obtain the Remote Procedure Call (RPC) timeout configuration file; the RPC timeout configuration file includes the preset RPC timeout duration for each of the multiple interface functions; Configure the RPC timeout duration for each interface function based on the RPC timeout duration configuration file.

[0004] In one possible implementation, the RPC timeout configuration file is an Interactive Data Language (IDL) file; the IDL file includes interface function identifiers corresponding to each of the multiple interface functions and preset RPC timeout durations corresponding to each of the multiple interface functions.

[0005] In one possible implementation, configuring the RPC timeout duration for each interface function based on the RPC timeout duration configuration file includes: Determine if the IDL file contains the first... i The preset RPC timeout duration for each interface function; among them... i ∈ (1, n), where n is the number of interface functions contained in the IDL file; The first one exists in the IDL file. i In the case of the preset RPC timeout duration corresponding to the interface function, the first one described in the IDL file will be used. i The preset RPC timeout duration corresponding to each interface function is configured as the first... iThe RPC timeout duration for each interface function.

[0006] In one possible implementation, the method further includes: The first one does not exist in the IDL file. i Given the preset RPC timeout duration for each interface function, obtain the default RPC timeout duration; Configure the default RPC timeout duration to the specified value. i The RPC timeout duration for each interface function.

[0007] In one possible implementation, the first [item] in the IDL file... i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function includes: Determine the first i Does each interface function have a corresponding RPC timeout duration in the target process? In the first i If the target process has a corresponding RPC timeout duration, the interface function will... i The RPC timeout duration for each interface function in the target process is configured as described above. i RPC timeout duration for each interface function; In the first i If the target process does not have a corresponding RPC timeout duration, the interface function will use the first one described in the IDL file. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

[0008] According to a second aspect of the present disclosure, an RPC timeout duration configuration device is provided, comprising: The first acquisition module is used to acquire the Remote Procedure Call (RPC) timeout configuration file; wherein, the RPC timeout configuration file includes the preset RPC timeout duration for each of the multiple interface functions; The first configuration module is used to configure the RPC timeout duration for each interface function based on the RPC timeout duration configuration file.

[0009] In one possible implementation, the RPC timeout configuration file is an Interactive Data Language (IDL) file; the IDL file includes interface function identifiers corresponding to each of the multiple interface functions and preset RPC timeout durations corresponding to each of the multiple interface functions.

[0010] In one possible implementation, the configuration module includes: The determining unit is used to determine whether the first [unclear] exists in the IDL file. i The preset RPC timeout duration for each interface function; among them... i ∈ (1, n), where n is the number of interface functions contained in the IDL file; Configuration unit, used to store the first in the IDL file i In the case of the preset RPC timeout duration corresponding to the interface function, the first one described in the IDL file will be used. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

[0011] In one possible implementation, the device further includes: The second acquisition module is used to obtain information that does not exist in the IDL file. i Given the preset RPC timeout duration for each interface function, obtain the default RPC timeout duration; The second configuration module is used to configure the default RPC timeout duration as specified in the first configuration module. i The RPC timeout duration for each interface function.

[0012] In one possible implementation, the configuration unit includes: Determine subunit, used to determine the first i Does each interface function have a corresponding RPC timeout duration in the target process? The first configuration subunit is used in the... i If the target process has a corresponding RPC timeout duration, the interface function will... i The RPC timeout duration for each interface function in the target process is configured as described above. i RPC timeout duration for each interface function; The second configuration subunit is used in the first... i If the target process does not have a corresponding RPC timeout duration, the interface function will use the first one described in the IDL file. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

[0013] According to a third aspect of the present disclosure, an electronic device is provided, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the RPC timeout duration configuration method as described in any one of the first aspects.

[0014] According to a fourth aspect of the present disclosure, a storage medium is provided that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the RPC timeout duration configuration method as described in any one of the first aspects.

[0015] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the RPC timeout duration configuration method as described in any one aspect of the first aspect.

[0016] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects: In the embodiments of this disclosure, an RPC timeout configuration file is obtained, which includes preset RPC timeout durations for each of multiple interface functions. The RPC timeout duration for each interface function is then configured based on this configuration file. This allows for the configuration of RPC timeout durations for different interface functions, enabling independent configuration of the RPC timeout duration for each function. This improves the flexibility of the RPC timeout configuration method and better meets configuration requirements.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0019] Figure 1 This is a flowchart illustrating an RPC timeout duration configuration method according to an exemplary embodiment.

[0020] Figure 2 This is a schematic diagram illustrating an RPC timeout duration configuration method according to an exemplary embodiment.

[0021] Figure 3 This is a block diagram illustrating an RPC timeout duration configuration device according to an exemplary embodiment.

[0022] Figure 4 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0023] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0024] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0025] As is known from the background art, in related technologies, all interface functions share a single RPC timeout duration. For example, the RPC timeout duration can be passed to the entire process via Param (parameters), and all interface functions have only one RPC timeout configuration. However, because some interface functions require long timeouts while others require quick returns, sharing a single RPC timeout duration across all interface functions is difficult to meet configuration requirements. Therefore, this disclosure provides an RPC timeout configuration method, apparatus, electronic device, and storage medium, which can configure different timeout durations for different interface functions, thereby better meeting configuration requirements.

[0026] The RPC timeout duration configuration method, apparatus, electronic device, and storage medium provided in the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.

[0027] Figure 1 This is a flowchart illustrating an RPC timeout configuration method according to an exemplary embodiment. This RPC timeout configuration method can be applied to electronic devices, such as mobile phones, tablets, and computers. Figure 1 As shown, the RPC timeout duration configuration method may include the following steps.

[0028] In step S101, the RPC timeout duration configuration file is obtained.

[0029] The RPC timeout configuration file includes preset RPC timeout durations for each of the multiple interface functions.

[0030] In this embodiment of the disclosure, when configuring RPC timeout duration, an RPC timeout duration configuration file can be obtained. This configuration file can include multiple RPC timeout durations corresponding to each interface function, i.e., preset RPC timeout durations. Taking an RPC timeout duration configuration file including RPC timeout durations corresponding to 100 interface functions as an example, the configuration file can include RPC timeout duration 1 for interface function 1, RPC timeout duration 2 for interface function 2, RPC timeout duration 3 for interface function 3, ..., and RPC timeout duration 100 for interface function 100. It is understood that the RPC timeout durations corresponding to different interface functions can be the same or different; the RPC timeout duration configuration method for interface functions can be executed during compilation, and the preset RPC timeout durations corresponding to the configured interface functions can be called by the corresponding process when the application starts.

[0031] In step S102, the RPC timeout duration for each interface function is configured based on the RPC timeout duration configuration file.

[0032] In this embodiment of the disclosure, after obtaining the RPC timeout configuration file, the RPC timeout duration for each interface function can be configured based on the configuration file. For example, the RPC timeout configuration file can be parsed to extract each interface function identifier and its corresponding preset RPC timeout duration. The preset RPC timeout duration can then be configured for the corresponding interface function based on the interface function identifier. In this way, the preset RPC timeout durations for different interface functions can be configured.

[0033] In the embodiments of this disclosure, an RPC timeout configuration file is obtained, which includes preset RPC timeout durations for each of multiple interface functions. The RPC timeout duration for each interface function is then configured based on this configuration file. This allows for the configuration of RPC timeout durations for different interface functions, enabling independent configuration of the RPC timeout duration for each function. This improves the flexibility of the RPC timeout configuration method and better meets configuration requirements.

[0034] In one possible implementation, the RPC timeout configuration file can be an IDL (Interactive Data Language) file. The IDL file can include interface function identifiers and preset RPC timeout durations for each of the multiple interface functions. Understandably, the IDL file can be in form, which can include interface function representations and corresponding RPC timeout durations for each of the multiple interface functions. Taking an RPC timeout configuration file containing the RPC timeout durations for 100 interface functions as an example, the form can be found in Table 1. Thus, using an IDL file or form format for the RPC timeout configuration file facilitates RPC timeout configuration and improves configuration efficiency.

[0035] Table 1 Interface function identifier Preset RPC timeout duration Interface function 1 RPC timeout duration 1 Interface function 2 RPC timeout duration 2 Interface function 3 RPC timeout duration 3 …… …… Interface Function 99 RPC timeout duration 99 Interface function 100 RPC timeout duration 100 In a further possible implementation, the specific method for configuring the RPC timeout duration for each interface function based on the RPC timeout duration configuration file in the above steps can be as follows: Parse the IDL file to obtain the preset RPC timeout duration for each interface function in the IDL file; Configure the RPC timeout duration for each interface function based on the preset RPC timeout duration for each interface function in the IDL file.

[0036] In the embodiments of this disclosure, when the RPC timeout configuration file is an IDL file, when configuring the RPC timeout duration for each interface function based on the RPC timeout configuration file, the IDL file can be parsed first to obtain a configuration form. This configuration form may include a preset RPC timeout duration for each interface function. Then, the RPC timeout duration for each interface function can be configured based on the preset RPC timeout duration for each interface function in the IDL file, that is, based on the preset RPC timeout duration for each interface function in the configuration form.

[0037] In a further possible embodiment, the above steps, based on the preset RPC timeout duration for each interface function in the IDL file, configure the RPC timeout duration for each interface function, including: Determine if the IDL file contains the first... i The preset RPC timeout duration for each interface function; among them... i ∈ (1, n), where n is the number of interface functions contained in the IDL file; The IDL file contains the first... i In the case of the preset RPC timeout duration for each interface function, the first one in the IDL file will be... iThe preset RPC timeout duration for each interface function is configured as follows: i The RPC timeout duration for each interface function.

[0038] In the embodiments of this disclosure, considering that the IDL form may not include the preset RPC timeout duration for one or more interface functions, when configuring the RPC timeout duration for each interface function based on the preset RPC timeout duration for each interface function in the IDL file, for the first... i The first interface function can first determine whether the first one exists in the IDL file. i The preset RPC timeout duration for each interface function. If the IDL file contains the first... i The preset RPC timeout duration corresponding to each interface function can then be read. i The preset RPC timeout duration corresponding to each interface function, and the first one i The preset RPC timeout duration for the first interface function is configured as follows: i The RPC timeout duration for each interface function. This is understandable. i The timeout values ​​can range from 1 to n. When selecting values, they can be selected sequentially or randomly, as long as the configuration of RPC timeout durations for all interface functions is possible. This way, the RPC timeout duration for a specific interface function can be configured only if that timeout duration exists in the IDL file, thus improving the success rate of the RPC timeout configuration method.

[0039] In a further possible embodiment, considering that RPC timeout configuration is also required for interface functions not included in the IDL form, therefore, for the first... i The first interface function, if the first one does not exist in the IDL file. i By determining the preset RPC timeout duration for each interface function, you can obtain the default RPC timeout duration. This default RPC timeout duration can be set as needed, for example, to 1 second, 2 seconds, etc. Then, you can configure the default RPC timeout duration as the first... i This allows you to configure the RPC timeout duration for each interface function. This way, even for interface functions not specified in the IDL file, you can still configure their RPC timeout duration.

[0040] In some possible implementations, the steps described above will involve the first [item] in the IDL file. i The preset RPC timeout duration for each interface function is configured as follows: i The specific implementation of the RPC timeout duration for each interface function can be as follows: Determine the first iDoes each interface function have a corresponding RPC timeout duration in the target process? In the i If the target process has a corresponding RPC timeout duration, the first interface function will... i The RPC timeout duration for each interface function in the target process is configured as follows: i RPC timeout duration for each interface function; In the i If the target process does not have a corresponding RPC timeout duration, the first interface function will be the first one in the IDL file. i The preset RPC timeout duration for each interface function is configured as follows: i The RPC timeout duration for each interface function.

[0041] The target process can be any process corresponding to any application.

[0042] In the embodiments of this disclosure, it is considered that some processes may have different requirements for the RPC timeout duration of interface functions. Therefore, for the first... i The first interface function, when the target process calls this first... i When defining the first interface function, you can first determine the first one. i Does the first interface function have a corresponding RPC timeout duration in the target process? i The RPC timeout duration for each interface function in the target process can be pre-set, and it may be the same as or different from the preset RPC timeout duration in the IDL form. If the first... i If the target process has a corresponding RPC timeout duration for each interface function, then the timeout duration can be obtained. i The timeout duration of the first interface function in the target process's corresponding RPC timeout, and then the first... i The corresponding RPC timeout duration for each interface function in the target process is configured as follows: i The RPC timeout duration corresponding to each interface function. Conversely, if the first... i The interface function does not have a corresponding RPC timeout duration in the target process, and the timeout can be obtained from the IDL form. i The preset RPC timeout duration corresponding to the first interface function, in this IDL form, is... i The preset RPC timeout duration for the first interface function is configured as follows: i The RPC timeout duration for each interface function. Understandably, the RPC timeout duration for interface functions can also be configured at the thread level, similar to configuring it at the process level. This allows the RPC timeout duration for interface functions to better meet requirements.

[0043] To make the configuration method for RPC timeout duration provided in this disclosure clearer, the following is in conjunction with the appendix. Figure 2 Please provide an explanation, such as Figure 2 As shown.

[0044] When configuring the RPC timeout duration for each interface function, the IDL file (i.e., the interactive data language file in the diagram) can be parsed first to obtain multiple interface functions, namely interface function 1, interface function 2, ..., interface function n in the diagram, and a global configuration form. This global configuration form includes the preset RPC timeout duration for each of the multiple interface functions. The format of this global configuration form can be: [interface function identifier, RPC timeout duration]. The global configuration form can be an array formed by the aforementioned fields. Then, the preset RPC timeout duration for each interface function in the global configuration form can be read by the configuration reading module, and the configuration module can configure the preset RPC timeout duration for each interface function. For example, if there is no preset RPC timeout duration for a certain interface function, i.e., the timeout is configured to 0, the default RPC timeout duration can be used, i.e., the timeout of the system default parameter (Param). Figure 2 The system default timeout parameter can be used; otherwise, the timeout specified by the array can be used, that is, the preset RPC timeout corresponding to the interface function in the global configuration form. In this way, the independent configuration task of the RPC timeout of the interface function can be completed.

[0045] Based on the same inventive concept, embodiments of this disclosure also provide an RPC timeout duration configuration device, such as... Figure 3 As shown, Figure 3 This is a block diagram illustrating an RPC timeout duration configuration apparatus according to an exemplary embodiment. (Refer to...) Figure 3 The RPC timeout duration configuration device 300 may include: The first acquisition module 310 is used to acquire the Remote Procedure Call (RPC) timeout duration configuration file; wherein, the RPC timeout duration configuration file includes the preset RPC timeout duration corresponding to each of the multiple interface functions; The first configuration module 320 is used to configure the RPC timeout duration for each interface function based on the RPC timeout duration configuration file.

[0046] In one possible implementation, the RPC timeout configuration file is an Interactive Data Language (IDL) file; the IDL file includes interface function identifiers corresponding to each of the multiple interface functions and preset RPC timeout durations corresponding to each of the multiple interface functions.

[0047] In one possible implementation, the first configuration module 320 includes: The determining unit is used to determine whether the first [unclear] exists in the IDL file. i The preset RPC timeout duration for each interface function; among them... i ∈ (1, n), where n is the number of interface functions contained in the IDL file; Configuration unit, used to store the first in the IDL file i In the case of the preset RPC timeout duration corresponding to the interface function, the first one described in the IDL file will be used. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

[0048] In one possible implementation, the device 300 further includes: The second acquisition module is used to obtain information that does not exist in the IDL file. i Given the preset RPC timeout duration for each interface function, obtain the default RPC timeout duration; The second configuration module is used to configure the default RPC timeout duration as specified in the first configuration module. i The RPC timeout duration for each interface function.

[0049] In one possible implementation, the configuration unit includes: Determine subunit, used to determine the first i Does each interface function have a corresponding RPC timeout duration in the target process? The first configuration subunit is used in the... i If the target process has a corresponding RPC timeout duration, the interface function will... i The RPC timeout duration for each interface function in the target process is configured as described above. i RPC timeout duration for each interface function; The second configuration subunit is used in the first... i If the target process does not have a corresponding RPC timeout duration, the interface function will use the first one described in the IDL file. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

[0050] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0051] According to embodiments of this disclosure, this disclosure also provides an electronic device, a storage medium, and a computer program product.

[0052] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device 400 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0053] like Figure 4 As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of the electronic device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0054] Multiple components in electronic device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of displays, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0055] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as the RPC timeout duration configuration method. For example, in some embodiments, the RPC timeout duration configuration method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the RPC timeout duration configuration method described above can be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform an RPC timeout duration configuration method by any other suitable means (e.g., by means of firmware).

[0056] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0057] The program code of a computer program product used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0058] In the context of this disclosure, a storage medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A storage medium can be a machine-readable signal medium or a machine-readable storage medium. Storage media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0059] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0060] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.

[0061] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0062] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0063] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for configuring RPC timeout duration, characterized in that, include: Obtain the Remote Procedure Call (RPC) timeout configuration file; the RPC timeout configuration file includes the preset RPC timeout duration for each of the multiple interface functions; Configure the RPC timeout duration for each interface function based on the RPC timeout duration configuration file; The RPC timeout configuration file is an Interactive Data Language (IDL) file; the IDL file includes the interface function identifiers corresponding to each of the multiple interface functions and the preset RPC timeout durations corresponding to each of the multiple interface functions, wherein the IDL file is in the form of a form, and the form includes the interface function identifiers corresponding to each of the multiple interface functions and the corresponding RPC timeout durations; The configuration of the RPC timeout duration for each interface function based on the RPC timeout duration configuration file includes: Determine if the IDL file contains the first... i The preset RPC timeout duration for each interface function; among which... i ∈ (1, n), where n is the number of interface functions contained in the IDL file; The IDL file contains the first i In the case of the preset RPC timeout duration corresponding to the interface function, the first one described in the IDL file will be used. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i RPC timeout duration for each interface function; The first in the IDL file i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function includes: Determine the first i Does each interface function have a corresponding RPC timeout duration in the target process? In the first i If the target process has a corresponding RPC timeout duration, the interface function will... i The interface function is configured with the RPC timeout duration corresponding to the target process as described in the first... i RPC timeout duration for each interface function; In the first i If the target process does not have a corresponding RPC timeout duration, the interface function will, in the case that the first one described in the IDL file... i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

2. The RPC timeout duration configuration method according to claim 1, characterized in that, The method further includes: The first one does not exist in the IDL file. i Given the preset RPC timeout duration for each interface function, obtain the default RPC timeout duration; Configure the default RPC timeout duration to the specified value. i The RPC timeout duration for each interface function.

3. An RPC timeout duration configuration device, characterized in that, include: The first acquisition module is used to acquire the Remote Procedure Call (RPC) timeout configuration file; wherein, the RPC timeout configuration file includes the preset RPC timeout duration for each of the multiple interface functions; The first configuration module is used to configure the RPC timeout duration for each interface function based on the RPC timeout duration configuration file. The RPC timeout configuration file is an Interactive Data Language (IDL) file; the IDL file includes the interface function identifiers corresponding to each of the multiple interface functions and the preset RPC timeout durations corresponding to each of the multiple interface functions, wherein the IDL file is in the form of a form, and the form includes the interface function identifiers corresponding to each of the multiple interface functions and the corresponding RPC timeout durations; The first configuration module includes: The determining unit is used to determine whether the first [unclear] exists in the IDL file. i The preset RPC timeout duration for each interface function; among them... i ∈ (1, n), where n is the number of interface functions contained in the IDL file; Configuration unit, used to store the first in the IDL file i In the case of the preset RPC timeout duration corresponding to the interface function, the first one described in the IDL file will be used. i The preset RPC timeout duration corresponding to each interface function is configured as the first... i RPC timeout duration for each interface function; The configuration unit includes: Determine subunit, used to determine the first i Does each interface function have a corresponding RPC timeout duration in the target process? The first configuration subunit is used in the... i If the target process has a corresponding RPC timeout duration, the interface function will... i The interface function is configured with the RPC timeout duration corresponding to the target process as described in the first... i RPC timeout duration for each interface function; The second configuration subunit is used in the first... i If the target process does not have a corresponding RPC timeout duration, the interface function will, in the case that the first one described in the IDL file... i The preset RPC timeout duration corresponding to each interface function is configured as the first... i The RPC timeout duration for each interface function.

4. The RPC timeout duration configuration device according to claim 3, characterized in that, The device further includes: The second acquisition module is used to obtain information that does not exist in the IDL file. i Given the preset RPC timeout duration for each interface function, obtain the default RPC timeout duration; The second configuration module is used to configure the default RPC timeout duration as specified in the first configuration module. i The RPC timeout duration for each interface function.

5. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the RPC timeout duration configuration method as described in any one of claims 1 to 2.

6. A storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the RPC timeout duration configuration method as described in any one of claims 1 to 2.

7. A computer program product comprising a computer program that, when executed by a processor, implements the RPC timeout duration configuration method as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Apparatus and method for executing function

    US20200183657A1