CN115576720A - RPC timeout duration configuration method and device, electronic equipment and storage medium - Google Patents

RPC timeout duration configuration method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115576720A
CN115576720A CN202211577154.8A CN202211577154A CN115576720A CN 115576720 A CN115576720 A CN 115576720A CN 202211577154 A CN202211577154 A CN 202211577154A CN 115576720 A CN115576720 A CN 115576720A
Authority
CN
China
Prior art keywords
rpc
interface function
overtime
configuration
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211577154.8A
Other languages
Chinese (zh)
Inventor
肖政东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Automobile Technology Co Ltd
Original Assignee
Xiaomi Automobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaomi Automobile Technology Co Ltd filed Critical Xiaomi Automobile Technology Co Ltd
Priority to CN202211577154.8A priority Critical patent/CN115576720A/en
Publication of CN115576720A publication Critical patent/CN115576720A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a method and a device for configuring RPC timeout duration, electronic equipment and a storage medium, and relates to the technical field of computers. The RPC timeout duration configuration method comprises the following steps: acquiring a Remote Procedure Call (RPC) timeout duration configuration file; the RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the plurality of interface functions respectively; and configuring the RPC timeout duration corresponding to each interface function based on the RPC timeout duration configuration file. By adopting the RPC overtime length configuration method provided by the embodiment of the disclosure, the independent configuration of the RPC overtime length of each interface function can be realized, so that the flexibility of the RPC overtime length configuration method can be improved, and the configuration requirement can be better met.

Description

RPC timeout duration configuration method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for configuring an RPC timeout period, an electronic device, and a storage medium.
Background
In the related art, the timeout of all interface functions is usually configured and controlled through an RPC (Remote Procedure Call) timeout duration, that is, all interface functions share one RPC timeout duration. However, in practical application, different interface functions may have different requirements on the RPC timeout duration, and thus, the current manner in which all interface functions share one RPC timeout duration cannot meet the actual requirements.
Disclosure of Invention
The disclosure provides an RPC timeout duration configuration method, an RPC timeout duration configuration device, an electronic device and a storage medium, which are used for solving the problem that the actual requirement cannot be met in a mode that all interface functions share one RPC timeout duration in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for configuring an RPC timeout period is provided, including:
acquiring a Remote Procedure Call (RPC) timeout duration configuration file; the RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the interface functions;
and configuring the RPC timeout duration corresponding to each interface function based on the RPC timeout duration configuration file.
In a possible implementation manner, the RPC timeout duration configuration file is an interactive data language IDL file; the IDL file comprises a plurality of interface function identifications corresponding to the interface functions and a plurality of preset RPC timeout duration corresponding to the interface functions.
In a possible implementation manner, the configuring, based on the RPC timeout duration configuration file, the RPC timeout duration corresponding to each interface function includes:
determining whether there is an IDL fileiPresetting RPC overtime duration corresponding to each interface function; wherein, the first and the second end of the pipe are connected with each other,ie (1, n), n being the number of the interface functions contained in the IDL file;
the first in the IDL fileiUnder the condition of presetting RPC overtime length corresponding to each interface function, the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime duration corresponding to each interface function.
In one possible embodiment, the method further comprises:
the second file does not exist in the IDL fileiAcquiring default RPC overtime length under the condition of preset RPC overtime length corresponding to each interface function;
configure the default RPC timeout duration to the secondiAnd RPC overtime duration corresponding to each interface function.
In one possible embodiment, the first in the IDL file is selected from the group consisting of a plurality of IDL files, and a plurality of IDL filesiPresetting RPC overtime length corresponding to each interface function as the secondiThe RPC overtime length corresponding to each interface function comprises:
determine the secondiWhether the interface function has corresponding RPC overtime length in the target process or not;
at the first stageiUnder the condition that the target process has corresponding RPC overtime length, the interface function is toiThe RPC overtime length of each interface function corresponding to the target process is configured as the secondiRPC overtime duration corresponding to each interface function;
at the first stageiUnder the condition that the target process does not have corresponding RPC overtime length, the interface function sends the second interface function in the IDL fileiPresetting RPC overtime length corresponding to each interface function as the secondiAnd RPC overtime duration corresponding to each interface function.
According to a second aspect of the embodiments of the present disclosure, there is provided an RPC timeout duration configuration apparatus, including:
the remote procedure call RPC timeout duration configuration file comprises a first acquisition module, a second acquisition module and a remote procedure call RPC timeout duration configuration file, wherein the first acquisition module is used for acquiring the remote procedure call RPC timeout duration configuration file; the RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the plurality of interface functions respectively;
and the first configuration module is used for configuring the RPC overtime length corresponding to each interface function based on the RPC overtime length configuration file.
In a possible implementation manner, the RPC timeout duration configuration file is an interactive data language IDL file; the IDL file comprises a plurality of interface function identifications corresponding to the interface functions and a plurality of preset RPC overtime lengths corresponding to the interface functions.
In one possible embodiment, the configuration module includes:
a determination unit for determining whether or not the IDL file existsiPresetting RPC overtime duration corresponding to each interface function(ii) a Wherein, the first and the second end of the pipe are connected with each other,ie (1, n), n being the number of said interface functions contained in said IDL file;
a configuration unit for existing the first IDL file in the IDL fileiUnder the condition of presetting RPC overtime length corresponding to each interface function, the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime duration corresponding to each interface function.
In a possible embodiment, the apparatus further comprises:
a second obtaining module for not having the first obtaining module in the IDL fileiAcquiring default RPC overtime length under the condition of preset RPC overtime length corresponding to each interface function;
a second configuration module for configuring the default RPC timeout period as the second configuration moduleiAnd RPC overtime duration corresponding to each interface function.
In a possible implementation, the configuration unit includes:
a determination subunit for determining the secondiWhether the interface function has corresponding RPC overtime length in the target process or not;
a first configuration subunit for configuring the firstiUnder the condition that the target process has corresponding RPC overtime length, the interface function is toiThe RPC overtime length of each interface function corresponding to the target process is configured as the secondiRPC overtime duration corresponding to each interface function;
a second configuration subunit for configuring the secondiUnder the condition that the target process does not have corresponding RPC overtime length, the interface function sends the second interface function in the IDL fileiPresetting RPC overtime length corresponding to each interface function as the secondiRPC overtime duration corresponding to each interface function.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the RPC timeout period configuration method of any one of the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein when executed by a processor of an electronic device, instructions of the storage medium enable the electronic device to execute the RPC timeout period configuration method according to any one of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the RPC timeout period configuration method of any one of the first aspects.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the embodiment of the disclosure, an RPC overtime length configuration file comprising preset RPC overtime lengths corresponding to a plurality of interface functions is obtained; and configuring the RPC timeout duration corresponding to each interface function based on the RPC timeout duration configuration file. Therefore, the configuration of the RPC overtime length of different interface functions can be realized, and the independent configuration of the RPC overtime length of each interface function can be realized, so that the flexibility of the RPC overtime length configuration method can be improved, and the configuration requirement can be better met.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flowchart illustrating a RPC timeout period configuration method according to an exemplary embodiment.
Fig. 2 is a schematic diagram illustrating a method for configuring RPC timeout period according to an exemplary embodiment.
Fig. 3 is a block diagram illustrating an apparatus for configuring RPC timeout period according to an example embodiment.
FIG. 4 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in other sequences than those illustrated or described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
As known in the related art, all interface functions share one RPC timeout period. Illustratively, the RPC timeout duration may be passed through Param (parameter) into the whole process, with all interface functions configured with only one RPC timeout (RPC timeout duration). However, because some interface functions want to timeout for a long time and some interface functions want to return quickly, it is difficult for all interface functions to share one RPC timeout duration to meet the configuration requirement. Based on this, embodiments of the present disclosure provide an RPC timeout duration configuration method and apparatus, an electronic device, and a storage medium, which can configure different timeout durations for different interface functions, so as to better meet configuration requirements.
The following describes in detail a method, an apparatus, an electronic device, and a storage medium for configuring an RPC timeout period according to an embodiment of the present disclosure with reference to the drawings.
Fig. 1 is a flowchart illustrating an RPC timeout duration configuration method according to an exemplary embodiment, which may be applied to an electronic device, for example, a mobile phone, a tablet computer, a computer, and the like. As shown in fig. 1, the RPC timeout period configuration method may include the following steps.
In step S101, an RPC timeout duration configuration file is obtained.
The RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the plurality of interface functions.
In the embodiment of the present disclosure, when the RPC timeout duration configuration is performed, an RPC timeout duration configuration file may be obtained, where the RPC timeout duration configuration file may include RPC timeout durations corresponding to a plurality of interface functions, that is, preset RPC timeout durations. Taking the example that the RPC timeout duration configuration file includes RPC timeout durations corresponding to 100 interface functions, the RPC timeout duration configuration file may include RPC timeout duration 1 corresponding to interface function 1, RPC timeout duration 2 corresponding to interface function 2, RPC timeout duration 3, 8230corresponding to interface function 3, 8230, and RPC timeout duration 100 corresponding to interface function 100. It can be understood that RPC timeout durations corresponding to different interface functions may be the same or different; the RPC timeout duration configuration method of the interface function can be executed when the compiler compiles, and the preset RPC timeout duration corresponding to the configured interface function can be called by a corresponding process when the application program is started.
In step S102, the RPC timeout duration corresponding to each interface function is configured based on the RPC timeout duration configuration file.
In the embodiment of the present disclosure, after the RPC timeout duration configuration file is obtained, the RPC timeout duration corresponding to each interface function may be configured based on the RPC timeout duration configuration file. Illustratively, each interface function identifier and the corresponding preset RPC timeout duration in the RPC timeout duration configuration file can be analyzed by analyzing the RPC timeout duration configuration file, and the preset RPC timeout duration is configured for the corresponding interface function through the interface function identifier. Therefore, the configuration of the preset RPC timeout duration of different interface functions can be realized.
In the embodiment of the disclosure, an RPC overtime length configuration file comprising preset RPC overtime lengths corresponding to a plurality of interface functions is obtained; and configuring the RPC overtime length corresponding to each interface function based on the RPC overtime length configuration file. Therefore, the configuration of the RPC overtime length of different interface functions can be realized, and the independent configuration of the RPC overtime length of each interface function can be realized, so that the flexibility of the RPC overtime length configuration method can be improved, and the configuration requirement can be better met.
In one possible embodiment, the RPC timeout duration configuration file may be an IDL (Interactive Data Language) file; the IDL file may include interface function identifiers corresponding to the plurality of interface functions and preset RPC timeout durations corresponding to the plurality of interface functions. It is understood that the IDL file may be in the form of a table, and the table may include interface function representations and corresponding RPC timeout durations corresponding to a plurality of interface functions, and the table may be referred to in table 1, taking the example that the RPC timeout duration configuration file includes RPC timeout durations corresponding to 100 interface functions. Therefore, the RPC overtime configuration file is in the form of an IDL file or a form, so that the configuration of the RPC overtime is more convenient, and the configuration efficiency of the RPC overtime is improved.
TABLE 1
Interface function identification Presetting RPC overtime length
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 embodiment, a specific implementation method for configuring the RPC timeout period corresponding to each interface function based on the RPC timeout period configuration file in the above steps may be as follows:
analyzing the IDL file to obtain preset RPC timeout duration corresponding to each interface function in the IDL file;
and configuring the RPC overtime duration corresponding to each interface function based on the preset RPC overtime duration corresponding to each interface function in the IDL file.
In the embodiment of the disclosure, when the RPC timeout duration configuration file is an IDL file, and the RPC timeout duration corresponding to each interface function is configured based on the RPC timeout duration configuration file, the IDL file may be analyzed first to obtain a configuration form, where the configuration form may include a preset RPC timeout duration corresponding to each interface function. Then, the RPC timeout duration corresponding to each interface function may be configured based on the preset RPC timeout duration corresponding to each interface function in the IDL file, that is, based on the preset RPC timeout duration corresponding to each interface function in the configuration form.
In a further possible embodiment, the configuring, in the above step, the RPC timeout duration corresponding to each interface function based on the preset RPC timeout duration corresponding to each interface function in the IDL file includes:
determining whether the IDL file has the second orderiPresetting RPC overtime duration corresponding to each interface function; wherein, the first and the second end of the pipe are connected with each other,ie (1, n), wherein n is the number of interface functions contained in the IDL file;
in IExistence of the second in DL fileiUnder the condition of presetting RPC overtime length corresponding to each interface function, the first interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime duration corresponding to each interface function.
In the embodiment of the present disclosure, it is considered that the preset RPC timeout duration corresponding to one or several interface functions may not be included in the IDL form. Therefore, when the RPC timeout duration corresponding to each interface function is configured based on the preset RPC timeout duration corresponding to each interface function in the IDL file, for the second interface functioniAn interface function for determining whether IDL file exists or notiAnd presetting RPC overtime duration corresponding to each interface function. If the IDL file exists in the secondiThe preset RPC overtime length corresponding to each interface function can be readiPresetting RPC overtime length corresponding to each interface function, and setting the second interface functioniThe preset RPC overtime duration corresponding to each interface function is configured as the secondiAnd RPC overtime duration corresponding to each interface function. As can be appreciated, it is possible to,ithe value n can be taken from 1, and during the value taking, the value can be taken sequentially or randomly, as long as the configuration of the RPC overtime length corresponding to all the interface functions can be realized. Therefore, the RPC overtime length configuration of the interface function can be carried out only under the condition that the RPC overtime length corresponding to the interface function exists in the IDL file, and therefore the success rate of the RPC overtime length configuration method can be improved.
In a further possible embodiment, the configuration of the RPC timeout duration is also required to take into account interface functions that are not included in the IDL form. Thus, for the secondiAn interface function if the IDL file does not existiThe preset RPC overtime length corresponding to each interface function can be obtained, and the default RPC overtime length can be set according to needs, for example, the default RPC overtime length can be set to be 1 second, 2 seconds and the like. Then, the default RPC timeout duration may be configured to be secondiAnd RPC overtime duration corresponding to each interface function. Thus, even for interface functions not in the IDL file, the RPC timeout duration can be configured.
In some possible embodiments, theIn the above-mentioned step, the first one in IDL file is addediThe preset RPC overtime duration corresponding to each interface function is configured as the secondiThe specific implementation manner of the RPC timeout duration corresponding to each interface function may be as follows:
is determined to beiWhether the interface function has corresponding RPC overtime length in the target process or not;
in the first placeiUnder the condition that the target process has corresponding RPC overtime length, the interface function sends the first interface function to the second interface functioniThe RPC overtime length of each interface function corresponding to the target process is configured as the secondiRPC overtime duration corresponding to each interface function;
in the first placeiUnder the condition that the target process does not have corresponding RPC overtime length, the interface function transmits the first interface function in the IDL fileiThe preset RPC overtime duration corresponding to each interface function is configured as the secondiAnd RPC overtime duration corresponding to each interface function.
The target process may be a process corresponding to any application program.
In embodiments of the present disclosure, it is contemplated that some processes may have different requirements on the RPC timeout duration of the interface function. Thus, for the firstiAn interface function when the target process calls the firstiWhen an interface function is used, the first interface function can be determinediWhether the interface function has corresponding RPC overtime length in the target process or not is judgediThe RPC timeout duration corresponding to the target process of each interface function may be preset, and may be the same as or different from the preset RPC timeout duration in the IDL form. If it is the firstiIf the interface function has corresponding RPC overtime length in the target process, the first interface function can be obtainediThe RPC overtime length of each interface function corresponding to the target process is addediConfiguring the corresponding RPC overtime length of the interface function in the target process as the secondiAnd RPC overtime duration corresponding to each interface function. On the contrary, if it is firstiThe interface function has no corresponding RPC overtime length in the target process, and can obtain the first time in the IDL formiPresetting RPC overtime length corresponding to each interface function, and comparing the first time in the IDL formiThe preset RPC overtime duration corresponding to each interface function is configured as the secondiRPC super corresponding to each interface functionThe time duration. It can be understood that the RPC timeout duration corresponding to the interface function may also be configured by using the thread as the granularity, and the implementation manner of the configuration is similar to that of the RPC timeout duration corresponding to the interface function performed by using the process as the granularity. Therefore, the RPC overtime length corresponding to the interface function can better meet the requirement.
In order to make the configuration method of the RPC timeout period provided by the embodiment of the present disclosure clearer, the following description is made with reference to fig. 2, as shown in fig. 2.
When the RPC timeout duration corresponding to the interface function is configured, the IDL file (i.e. the interactive data language file in the drawing) may be analyzed first to obtain a plurality of interface functions, i.e. interface function 1, interface function 2, \8230;, interface function n, and a global configuration form, where the global configuration form includes preset RPC timeout durations corresponding to the plurality of interface functions, and the format of the global configuration form may be: [ interface function identification, RPC timeout duration ], the global configuration form may be an array formed by the aforementioned fields. Then, the preset RPC overtime duration corresponding to each interface function in the global configuration form can be read by the configuration reading module agent, and the configuration module configures the preset RPC overtime duration corresponding to each interface function. For example, if there is no preset RPC timeout duration corresponding to a certain interface function, that is, the timeout configuration is 0, a default RPC timeout duration, that is, the timeout of the system default parameter (Param) (that is, the timeout duration in the system default parameter in fig. 2) may be used; otherwise, the overtime duration specified by the array can be used, that is, the preset RPC overtime duration corresponding to the interface function in the global configuration form is used. Therefore, the independent configuration task of the RPC overtime length of the interface function can be completed.
Based on the same inventive concept, an embodiment of the present disclosure further provides an RPC timeout duration configuration device, as shown in fig. 3, where fig. 3 is a block diagram of an RPC timeout duration configuration device shown according to an exemplary embodiment. Referring to fig. 3, the RPC timeout period configuration means 300 may include:
a first obtaining module 310, configured to obtain a Remote Procedure Call (RPC) timeout duration configuration file; the RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the plurality of interface functions respectively;
and a first configuration module 320, configured to configure the RPC timeout duration corresponding to each interface function based on the RPC timeout duration configuration file.
In a possible implementation manner, the RPC timeout duration configuration file is an interactive data language IDL file; the IDL file comprises a plurality of interface function identifications corresponding to the interface functions and a plurality of preset RPC timeout duration corresponding to the interface functions.
In a possible implementation, the first configuration module 320 includes:
a determination unit for determining whether or not the IDL file existsiPresetting RPC overtime duration corresponding to each interface function; wherein the content of the first and second substances,ie (1, n), n being the number of said interface functions contained in said IDL file;
a configuration unit for existing the first ID file in the IDL fileiUnder the condition of presetting RPC overtime length corresponding to each interface function, the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiAnd RPC overtime duration corresponding to each interface function.
In a possible implementation, the apparatus 300 further comprises:
a second obtaining module for not having the first obtaining module in the IDL fileiAcquiring default RPC overtime length under the condition of preset RPC overtime length corresponding to each interface function;
a second configuration module for configuring the default RPC timeout period as the second configuration moduleiRPC overtime duration corresponding to each interface function.
In a possible implementation, the configuration unit includes:
a determination subunit for determining the secondiWhether the interface function has corresponding RPC overtime length in the target process or not;
a first configuration subunit for configuring the firstiCorresponding RPC overtime exists in the target process by each interface functionIn the case of a long time, the first stepiThe RPC overtime length of each interface function corresponding to the target process is configured as the secondiRPC overtime duration corresponding to each interface function;
a second configuration subunit for configuring the secondiUnder the condition that the target process does not have corresponding RPC overtime length, the interface function sends the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime duration corresponding to each interface function.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present disclosure also provides an electronic device, a storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 4 shows a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic device 400 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that 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. In the RAM403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, ROM402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in the electronic device 400 are connected to the I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408, such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 401 may be a variety of general 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 dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 401 performs the various methods and processes described above, such as the RPC timeout duration configuration method. For example, in some embodiments, the touch RPC timeout duration configuration method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM402 and/or the communication unit 409. When the computer program is loaded into RAM403 and executed by computing unit 401, one or more steps of the RPC timeout period configuration method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the RPC timeout period configuration method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
The program code of a computer program product for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a storage medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The storage medium may be a machine-readable signal medium or a machine-readable storage medium. A storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a 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 acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (13)

1. A RPC timeout duration configuration method is characterized by comprising the following steps:
acquiring a Remote Procedure Call (RPC) timeout duration configuration file; the RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the interface functions;
and configuring the RPC overtime length corresponding to each interface function based on the RPC overtime length configuration file.
2. The RPC timeout period configuration method of claim 1, wherein the RPC timeout period configuration file is an IDL (interactive data language) file; the IDL file comprises a plurality of interface function identifications corresponding to the interface functions and a plurality of preset RPC timeout duration corresponding to the interface functions.
3. The RPC timeout period configuration method of claim 2, wherein configuring the RPC timeout period corresponding to each interface function based on the RPC timeout period configuration file comprises:
determining whether there is an IDL fileiAre connected toPresetting RPC overtime duration corresponding to the mouth function; wherein the content of the first and second substances,ie (1, n), n being the number of said interface functions contained in said IDL file;
the second file exists in the IDL fileiUnder the condition of presetting RPC overtime length corresponding to each interface function, the second interface function in the IDL fileiPresetting RPC overtime length corresponding to each interface function as the secondiAnd RPC overtime duration corresponding to each interface function.
4. The RPC timeout period configuration method of claim 3, wherein the method further comprises:
the second file does not exist in the IDL fileiAcquiring default RPC overtime length under the condition of preset RPC overtime length corresponding to each interface function;
configuring the default RPC timeout duration as the secondiAnd RPC overtime duration corresponding to each interface function.
5. The RPC timeout period configuration method of claim 3, wherein the IDL file is stored in a storage deviceiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime length corresponding to each interface function comprises:
determine the secondiWhether the interface function has corresponding RPC overtime length in the target process or not;
at the first placeiUnder the condition that the target process has corresponding RPC overtime length, the interface function sends the second interface function to the target processiThe RPC overtime length of each interface function corresponding to the target process is configured as the secondiRPC overtime duration corresponding to each interface function;
at the first stageiUnder the condition that the target process does not have corresponding RPC overtime length, the interface function sends the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime duration corresponding to each interface function.
6. An RPC timeout duration configuration device, comprising:
the remote procedure call RPC overtime configuration module is used for setting a remote procedure call RPC overtime configuration file; the RPC timeout duration configuration file comprises preset RPC timeout durations corresponding to the interface functions;
and the first configuration module is used for configuring the RPC overtime length corresponding to each interface function based on the RPC overtime length configuration file.
7. The RPC timeout period configuration device of claim 6, wherein the RPC timeout period configuration file is an interactive data language IDL file; the IDL file comprises a plurality of interface function identifications corresponding to the interface functions and a plurality of preset RPC overtime lengths corresponding to the interface functions.
8. The RPC timeout period configuration device of claim 7, wherein said first configuration module comprises:
a determination unit for determining whether or not the IDL file existsiPresetting RPC overtime duration corresponding to each interface function; wherein, the first and the second end of the pipe are connected with each other,ie (1, n), n being the number of said interface functions contained in said IDL file;
a configuration unit for existing the first ID file in the IDL fileiUnder the condition of presetting RPC overtime length corresponding to each interface function, the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiRPC overtime duration corresponding to each interface function.
9. The RPC timeout period configuration device of claim 8, wherein the device further comprises:
a second obtaining module for not having the first obtaining module in the IDL fileiAcquiring default RPC overtime length under the condition of preset RPC overtime length corresponding to each interface function;
a second configuration module for configuring the default RPC timeout period toDescription of the inventioniRPC overtime duration corresponding to each interface function.
10. The RPC timeout period configuration device of claim 8, wherein said configuration unit comprises:
a determination subunit for determining the secondiWhether the interface function has corresponding RPC overtime length in the target process or not;
a first configuration subunit for configuring the firstiUnder the condition that the target process has corresponding RPC overtime length, the interface function sends the second interface function to the target processiConfiguring the RPC overtime length corresponding to the target process of each interface function as the secondiRPC overtime duration corresponding to each interface function;
a second configuration subunit for configuring the secondiUnder the condition that the target process does not have corresponding RPC overtime length, the interface function sends the second interface function in the IDL fileiThe preset RPC overtime length corresponding to each interface function is configured as the secondiAnd RPC overtime duration corresponding to each interface function.
11. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the RPC timeout period configuration method of any of claims 1 to 5.
12. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the RPC timeout period configuration method of any one of claims 1 to 5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the RPC timeout duration configuration method of any of claims 1 to 5.
CN202211577154.8A 2022-12-09 2022-12-09 RPC timeout duration configuration method and device, electronic equipment and storage medium Pending CN115576720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211577154.8A CN115576720A (en) 2022-12-09 2022-12-09 RPC timeout duration configuration method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211577154.8A CN115576720A (en) 2022-12-09 2022-12-09 RPC timeout duration configuration method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115576720A true CN115576720A (en) 2023-01-06

Family

ID=84590520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211577154.8A Pending CN115576720A (en) 2022-12-09 2022-12-09 RPC timeout duration configuration method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115576720A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489323A (en) * 2019-07-09 2019-11-22 北京字节跳动网络技术有限公司 Visual RPC API adjustment method, device, medium and equipment
US20200183657A1 (en) * 2018-12-05 2020-06-11 Electronics And Telecommunications Research Institute Apparatus and method for executing function
US20200341827A1 (en) * 2019-04-23 2020-10-29 Apple Inc. System call interception for file providers

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200183657A1 (en) * 2018-12-05 2020-06-11 Electronics And Telecommunications Research Institute Apparatus and method for executing function
US20200341827A1 (en) * 2019-04-23 2020-10-29 Apple Inc. System call interception for file providers
CN110489323A (en) * 2019-07-09 2019-11-22 北京字节跳动网络技术有限公司 Visual RPC API adjustment method, device, medium and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WB57E7BE70E3B57: ""微服务项目技术难点:RPC的超时设置(附代码详解)"", 《HTTPS://BLOG.51CTO.COM/U_12109989/3360616》 *

Similar Documents

Publication Publication Date Title
CN113704063B (en) Performance monitoring method, device, equipment and storage medium of cloud mobile phone
CN112506581A (en) Method and device for rendering small program, electronic equipment and readable storage medium
CN114157701A (en) Task testing method, device, equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN114327918B (en) Method and device for adjusting resource amount, electronic equipment and storage medium
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN115576720A (en) RPC timeout duration configuration method and device, electronic equipment and storage medium
CN115391204A (en) Test method and device for automatic driving service, electronic equipment and storage medium
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN114237755A (en) Application running method and device, electronic equipment and storage medium
CN114138358A (en) Application program starting optimization method, device, equipment and storage medium
CN107728769B (en) Background application management method and device and computer readable storage medium
CN113422734B (en) Resource distribution method, device, electronic equipment and storage medium
CN113032040B (en) Method, apparatus, device, medium, and article for processing tasks
CN114301975A (en) Processing method, device and equipment for pushing information in application and storage medium
CN113760315A (en) Method and device for testing system
CN115206549A (en) Online inquiry method and device, electronic equipment and storage medium
CN114996605A (en) Page loading method and device, electronic equipment and storage medium
CN114117317A (en) Model processing method, device, equipment and storage medium
CN115080205A (en) Task execution method and device, electronic equipment and readable storage medium
CN114968286A (en) Micro-service issuing method, device, storage medium and electronic equipment
CN115686304A (en) Information acquisition method and device, electronic equipment and storage medium
CN118075290A (en) Data synchronization method, device, equipment, medium and product
CN114840276A (en) Object calling method, device, equipment, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination