WO2009129745A1 - A method and apparatus for interface invoking of distributed system - Google Patents

A method and apparatus for interface invoking of distributed system Download PDF

Info

Publication number
WO2009129745A1
WO2009129745A1 PCT/CN2009/071422 CN2009071422W WO2009129745A1 WO 2009129745 A1 WO2009129745 A1 WO 2009129745A1 CN 2009071422 W CN2009071422 W CN 2009071422W WO 2009129745 A1 WO2009129745 A1 WO 2009129745A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
idl
value
default
client
Prior art date
Application number
PCT/CN2009/071422
Other languages
French (fr)
Chinese (zh)
Inventor
李立达
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2009129745A1 publication Critical patent/WO2009129745A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to an interface calling method and apparatus for a distributed system.
  • a distributed system enables clients in the system to use remote services like local servers, with the advantages of incremental scalability, resource sharing, and so on.
  • most of the distributed systems describe the interfaces between the components in the distributed system through the Interface Description Language (IDL), and call the corresponding functions (Functions) of the components through the interfaces to implement the corresponding functions.
  • IDL Interface Description Language
  • new interfaces are typically generated in the system for newly upgraded components.
  • a new interface corresponding to the new component is generated, and the new interface needs to be described using IDL. Since the upgraded component usually inherits the old features while having new functions, the new interface corresponding to the component inherits the original functions of the old interface and also gives new functions. Therefore, the existing interface calling method of a distributed system is that a new client calls a new interface, and an old client calls an old interface.
  • the newly added interface is an enhancement of the function of the original old interface
  • the processing is inconvenient due to the redundancy of the code defining the new interface, which makes the maintenance inconvenient. And it will make the system upgrade a lot of work.
  • An interface calling method for a distributed system comprising:
  • Determining whether the interface call request message includes the number of interface description language IDL default parameters The value, if not included, obtains a default value of the IDL default parameter from the pre-stored information; invokes the interface requested by the client using the default value of the obtained IDL default parameter.
  • An apparatus for an interface call of a distributed system comprising:
  • a receiving unit configured to receive an interface call request message sent by the client
  • a default value obtaining unit configured to not include in an interface call request message in the receiving unit
  • the default value of the IDL default parameter is obtained from the pre-stored information
  • the first calling interface unit is configured to invoke the interface requested by the client by using a default value of an IDL default parameter obtained by the default value obtaining unit.
  • a distributed system includes: a server that communicates with a client, the server, configured to receive an interface call request message from the client, when the interface call request message does not include an IDL default parameter
  • the server configured to receive an interface call request message from the client, when the interface call request message does not include an IDL default parameter
  • the default value of the IDL default parameter is obtained from the pre-stored information, and the interface requested by the client is invoked by using the default value of the obtained IDL default parameter.
  • the embodiment of the invention has the following advantages:
  • the embodiment of the present invention can perform the corresponding interface calling operation according to whether the request message includes the value of the IDL default parameter according to the received interface of the client, so that when the server is upgraded, it is not necessary to upgrade all the clients, but for the old client. Because there is no upgrade, the interface call request message sent will not contain the value of the IDL default parameter. In this case, the IDL default value can be obtained from the pre-stored information to perform the interface call. It can be seen that, by using the interface calling method disclosed in the present invention, linkage upgrade of all components in the entire distributed system caused by server-side upgrade can be avoided.
  • FIG. 1 is a schematic block diagram of a method for calling an interface of a distributed system according to an embodiment of the present invention
  • FIG. 2(a), (b), and (c) are schematic diagrams showing the application of the method shown in FIG. 1 for a distributed system according to an embodiment of the present invention
  • FIG. 3 is a schematic block diagram of an interface call device of a distributed system according to an embodiment of the present invention
  • FIG. 4 is a schematic block diagram of another interface call device of a distributed system according to an embodiment of the present invention
  • FIG. 5 is another embodiment of the present invention.
  • the code defined for the new interface needs to have a large number of defined codes identical to the old interface.
  • the code redundancy that defines the new interface can be cumbersome to handle and inconvenient to maintain.
  • the software on the server side is upgraded, the software of the client side should also be upgraded together, so that the client can invoke the interface according to the agreed method of the server side. Therefore, the prior art will increase the workload of the system upgrade.
  • An embodiment of the present invention discloses an interface calling method of a distributed system.
  • an IDL is used to define an interface, and an identifier of a method parameter is added in the upgraded interface definition IDL, so that the client is received.
  • the sent interface invokes the request message, it can determine whether the client is an upgraded new client according to whether the received interface in the request message contains the value of the IDL default parameter.
  • FIG. 1 is a schematic block diagram of a method for calling an interface of a distributed system according to an embodiment of the present invention.
  • Oneway void doError in short errorCode
  • address is a default parameter set in the embodiment of the present invention
  • value of the default parameter may be a specified default value, or may be a value arbitrarily set by the client.
  • the value of the default parameter may not be added, and it is expressed as a silent value.
  • the default value of the default parameters can be saved in the server-side skeleton (the server skeleton generated by the IDL compiler).
  • the server After receiving the interface call request message sent by the client, the server reads the value of the default parameter in each IDL language from the interface call request message. If the default parameter does not have a specified value, execute S103; otherwise, Execution S106.
  • S103 The server determines whether the default value of the IDL default parameter is saved in the skeleton on itself, if not, executes S104; otherwise, executes S105.
  • S104 The call fails, and an abnormal response is returned to the client.
  • the client is an old client that has not been upgraded.
  • the default value of the IDL default parameter saved by itself is used to invoke the interface requested by the client to implement the corresponding application through the function defined by the interface.
  • the client is an upgraded new client.
  • the interface used by the client request is invoked by using the value of the IDL default parameter in the interface call request message.
  • the server uses the value specified in the interface call request message to call the corresponding interface to implement the subsequent operation; if the default parameter of the interface call request message does not have the specified IDL default value, then the default value of the IDL default parameter is in the server. If there is a save, then the client is an old client that has not been upgraded. At this time, the server uses the default value to call the required interface.
  • the present invention realizes the distinguishing operation between the new client and the old client by identifying the value of the IDL default parameter, and avoids the problem of the client linkage upgrade caused by the server-side system upgrade in the prior art, and the system upgrades in the system.
  • the linkage upgrade of the system components is overcome, the system upgrade operation is simple, the maintenance is convenient, and the lightweight component upgrade is realized.
  • the embodiment of the present invention uses the way of adding default parameters to the old interface to implement the calling of the upgraded component, and does not need to add a new interface, thereby avoiding the cumbersome processing caused by the code redundancy of the new interface during the call. Easy to maintain.
  • FIG. 2 it is a schematic diagram of the application of the method in FIG. 1 according to an embodiment of the present invention.
  • the request sent by client A includes Fun ( 1 , 2 ).
  • client B sends The request includes Fun ( 3 , 4 ).
  • Server C calls the interface of the method with the parameter values 1 and 2 according to the request of client A.
  • the interface of the method is called with the parameter values 3 and 4.
  • the request sent by client A includes Fun (1, 2)
  • the request sent by client B includes Fun (3, 4)
  • server C receives The values of the default parameters are respectively queried in these requests. Since the values of the default parameter c are not specified in the requests of client A and client B, it means that both clients are old clients without upgrade, and the server is now End C retrieves the default value of the default parameter c from the information saved by itself.
  • the default value of 10 and other parameter values 1 and 2 in the request are used according to the request of client A.
  • the method interface is invoked using the default value 10 and other parameter values 3 and 4 in the request.
  • client B can set the specified value for the default parameter c in the request sent.
  • the value specified by the client B is the value specified by the default parameter c. It is 20, that is, Fun (3, 4, 20). Since client A does not upgrade, there is no default parameter c in the request sent by client A, which is still Fun(l, 2).
  • server C queries the value of the default parameter c in these requests. Since the value of the default parameter c is not specified in the request of client A, server C retrieves the information saved by itself.
  • an embodiment of the present invention further discloses an apparatus for an interface call of a distributed system, where the apparatus can be integrated on a server, and an interface is defined by an IDL language, and the apparatus defines an IDL language in the upgraded interface.
  • the identification of the default value of the method parameter is added, so that when the interface call request message sent by the client is received, the client can be determined as the upgraded new client according to whether the value of the default parameter is included in the interface call request message. Still an old customer who has not upgraded.
  • FIG. 3 is a schematic block diagram showing the structure of an interface calling device for a distributed system according to an embodiment of the present invention.
  • the device includes: a receiving unit 301, a default value obtaining unit 302, and a first calling interface unit 303, where
  • the receiving unit 301 is configured to receive an interface call request message sent by the client.
  • the default value obtaining unit 302 is configured to read a default parameter value of each IDL language in the interface call request message in the receiving unit 301, and when the interface call request message does not include the value of the IDL default parameter, the pre-stored information is used. Get the default value of the IDL default parameter; where the default value of the IDL default parameter can be pre-stored in the skeleton of the server where the device is located.
  • the first call interface unit 303 is configured to invoke the interface used by the client request by using the default value of the IDL default parameter obtained by the default value obtaining unit 302, to implement the corresponding application by using the function defined by the interface.
  • the embodiment of the present invention implements the distinguishing operation between the new client and the old client by identifying the value of the IDL default parameter in the request message, and avoids the client linkage upgrade caused by the server system upgrade in the prior art. problem.
  • the interface calling method of the embodiment of the present invention it is not necessary to upgrade the old client program when the system is upgraded. Therefore, the linkage upgrade of the system components is overcome, the system upgrade operation is simple, the maintenance is convenient, and the lightweight component upgrade is realized.
  • the embodiment of the present invention uses the way of adding default parameters to the old interface to implement the calling of the upgraded component, and does not need to add a new interface, thereby avoiding the cumbersome processing caused by the code redundancy of the new interface during the call. Easy to maintain.
  • the default parameter value of each IDL language in the interface call request message may be read by the receiving unit 301, and it is determined whether the interface call request message includes the value of the IDL default parameter, when the IDL default parameter is included.
  • the subsequent operations are performed by the default value obtaining unit 302 and the first calling interface unit 303.
  • FIG. 4 is a schematic block diagram showing another structure of an interface calling device for a distributed system according to an embodiment of the present invention.
  • the device is based on the device embodiment shown in FIG. 3, and includes: a receiving unit 301, a default value obtaining unit 302, a first calling interface unit 303, a value obtaining unit 401, and a second calling interface unit 402, where
  • the receiving unit 301 is configured to receive an interface call request message sent by the client.
  • the default value obtaining unit 302 is configured to read a default parameter value of each IDL language in the interface call request message in the receiving unit 301, and when the interface call request message does not include the value of the IDL default parameter, the pre-stored information is used. Get the default value of the IDL default parameter; where the default value of the IDL default parameter can be pre-stored in the skeleton of the server where the device is located.
  • the first call interface unit 303 is configured to invoke the interface used by the client request by using the default value of the IDL default parameter obtained by the default value obtaining unit 302, to implement the corresponding application by using the function defined by the interface.
  • the value obtaining unit 401 is configured to: when the value of the IDL default parameter is included in the interface call request message in the receiving unit 301, obtain the value of the IDL default parameter from the interface call request message; the second call interface unit 402 is configured to use The value of the IDL default parameter acquired by the value obtaining unit 401 invokes the interface requested by the client to implement the corresponding application through the function defined by the interface.
  • FIG. 5 is a schematic block diagram showing another structure of an interface calling device for a distributed system according to an embodiment of the present invention.
  • the device is based on the device embodiment shown in FIG. 3, and includes: a receiving unit 301, a default value obtaining unit 302, a first calling interface unit 303, and a default value determining executing unit 501, where
  • the receiving unit 301 is configured to receive an interface call request message sent by the client.
  • the default value determining execution unit 501 determines whether the default value of the IDL default parameter is stored in the pre-stored information, and if so, the command default value.
  • the obtaining unit 302 performs an acquisition function; otherwise, returns an abnormal response to the client.
  • the default value obtaining unit 302 is configured to obtain a default value of the IDL default parameter from the pre-stored information when the value of the IDL default parameter is not included in the interface call request message.
  • the default value of the IDL default parameter may be pre-stored in the skeleton of the server side where the device is located.
  • the first call interface unit 303 is configured to use the default value of the IDL obtained by the default value obtaining unit 302.
  • the default value of the number calls the interface used by the client request to implement the corresponding application through the functions defined by the interface.
  • the default value judgment execution unit 501 in the above apparatus embodiment can be applied to the apparatus embodiment shown in FIG. 4, and its function is the same as that shown in FIG. 5, in addition to the apparatus embodiment shown in FIG. I will not repeat them here.
  • the embodiment of the present invention further discloses a distributed system, where the system includes a client and a server, where the server includes the embodiment as shown in FIG. 3 or FIG.
  • the interface of the distributed system is called the device, and the structure and function of the device are the same as those of the device embodiment shown in FIG. 3 or FIG. 4, and details are not described herein again.
  • the embodiment of the invention also discloses a distributed system, comprising:
  • the server that communicates with the client,
  • the server is configured to receive an interface call request message from the client.
  • the interface call request message does not include the value of the IDL default parameter
  • the default value of the IDL default parameter is obtained from the pre-stored information, and the default value of the obtained IDL default parameter is used.
  • the value calls the interface requested by the client.
  • the server is further configured to: when the received interface call request message includes the value of the IDL default parameter, obtain the value of the IDL default parameter from the interface call request message, and invoke the interface requested by the client by using the value of the IDL default parameter.
  • the server is further configured to determine whether the default value of the IDL default parameter is stored in the pre-stored information, and if not, return an abnormal response to the client.
  • the default parameter and the default value of the default parameter are set in the IDL of the interface calling method, so that when the value of the default parameter is specified in the interface call request message sent by the client, the client For the upgraded new client, at this time, the server uses the value specified in the interface call request message to call the corresponding interface to implement the subsequent operation; if the default parameter in the interface call request message does not specify the default value, then the client is If the default value of the default parameter is saved on the server side, the server side uses the default value to call the required interface.
  • the embodiment of the present invention realizes the distinguishing operation between the new client and the old client by identifying the value of the default parameter in the request message, and avoids the problem of client linkage upgrade caused by the server system upgrade in the prior art. It makes the system upgrade easy to operate, easy to maintain, and realizes lightweight component upgrade.
  • the embodiment of the present invention uses the way of adding default parameters to the old interface to implement the calling of the upgraded component, and does not need to add a new interface, thereby avoiding the cumbersome processing caused by the code redundancy of the new interface during the call. Easy to maintain.
  • the device embodiments described above are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located in one place. , or it can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
  • the present invention can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is a better implementation. the way.
  • the technical solution of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. , an optical disk, etc., includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

A method and apparatus for interface invoking of distributed system. The method includes: receiving the interface invoking request message sent by the client; judging whether or not a value of the interface description language (IDL) default parameter is contained in the interface invoking request message, and if not contained, acquiring the default value of the IDL default parameter from the pre-stored information; and invoking the interface that the client requests by using the default value of the acquired IDL default parameter. Besides, an apparatus for interface invoking of distributed system is provided by the embodiments of the invention. In the embodiments of the invention, by using the pre-stored IDL default value to invoke interface for the old client that does not contain the value of the IDL default parameter, the old client that has not updated can also be compatible after the system updates, therefore the associated updating of all the components in the whole distributed system that is caused by the updating of the server end can be avoided, and the light-grade component updating can be realized.

Description

分布式系统的接口调用方法和装置  Interface calling method and device for distributed system
本申请要求于 2008 年 4 月 24 日提交中国专利局、 申请号为 200810094643.1、 发明名称为 "分布式系统的接口调用方法和装置"的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。  The present application claims priority to Chinese Patent Application No. 200810094643.1, entitled "Interface Calling Method and Apparatus for Distributed Systems", filed on April 24, 2008, the entire contents of which are incorporated herein by reference. In the application.
技术领域 Technical field
本发明涉及通信技术领域,尤其涉及一种分布式系统的接口调用方法和装 置。  The present invention relates to the field of communications technologies, and in particular, to an interface calling method and apparatus for a distributed system.
背景技术 Background technique
分布式系统能够使系统中的客户端像本地服务器一样使用远端服务,具有 增量扩展性、 资源共享等优点。 目前, 分布式系统中大都通过接口描述语言 ( IDL: Interface Description Language )描述分布式系统中各组件之间的接口, 通过接口, 调用与组件对应的方法( Function ) 以实现相应的功能。 为了支持 组件升级, 通常都在系统中为新升级的组件生成新的接口。 由于现有技术中在 组件升级时, 要生成与新组件对应的新接口, 同时还需要使用 IDL描述所述 新接口。 由于升级后的组件通常在具有新的功能的同时还继承了老的功能, 因 此,与组件对应的该新接口除了继承了老的接口中原有的功能外同时还赋予了 新的功能。 因此,现有的一种分布式系统的接口调用方法是新的客户端调用新 的接口, 老的客户端调用老的接口。  A distributed system enables clients in the system to use remote services like local servers, with the advantages of incremental scalability, resource sharing, and so on. At present, most of the distributed systems describe the interfaces between the components in the distributed system through the Interface Description Language (IDL), and call the corresponding functions (Functions) of the components through the interfaces to implement the corresponding functions. To support component upgrades, new interfaces are typically generated in the system for newly upgraded components. In the prior art, when a component is upgraded, a new interface corresponding to the new component is generated, and the new interface needs to be described using IDL. Since the upgraded component usually inherits the old features while having new functions, the new interface corresponding to the component inherits the original functions of the old interface and also gives new functions. Therefore, the existing interface calling method of a distributed system is that a new client calls a new interface, and an old client calls an old interface.
然而,在进行本发明创造过程中,发明人发现现有技术中至少存在如下问 题:  However, in carrying out the creation process of the present invention, the inventors found that at least the following problems exist in the prior art:
由于新增的接口是对原有老接口的功能的增强, 因此, 在使用 IDL描述 新接口时,会导致调用时由于定义新接口的代码冗余而处理繁瑣,使得维护不 便。 而且会使系统升级的工作量很大。  Since the newly added interface is an enhancement of the function of the original old interface, when the IDL is used to describe the new interface, the processing is inconvenient due to the redundancy of the code defining the new interface, which makes the maintenance inconvenient. And it will make the system upgrade a lot of work.
发明内容 Summary of the invention
本发明实施例的目的在于提供一种分布式系统的接口调用方法和装置,以 减少系统升级的工作量。  It is an object of embodiments of the present invention to provide an interface calling method and apparatus for a distributed system to reduce the workload of system upgrade.
一种分布式系统的接口调用方法, 所述方法包括:  An interface calling method for a distributed system, the method comprising:
接收客户端发送的接口调用请求消息;  Receiving an interface call request message sent by the client;
判断所述接口调用请求消息中是否包含接口描述语言 IDL 默认参数的数 值, 若不包含, 则从预先存储的信息中获取所述 IDL默认参数的默认值; 使用所获取的 IDL默认参数的默认值调用所述客户端请求的接口。 Determining whether the interface call request message includes the number of interface description language IDL default parameters The value, if not included, obtains a default value of the IDL default parameter from the pre-stored information; invokes the interface requested by the client using the default value of the obtained IDL default parameter.
一种用于分布式系统的接口调用的装置, 所述装置包括:  An apparatus for an interface call of a distributed system, the apparatus comprising:
接收单元, 用于接收客户端发送的接口调用请求消息;  a receiving unit, configured to receive an interface call request message sent by the client;
默认值获取单元, 用于当所述接收单元中的接口调用请求消息中不包含 a default value obtaining unit, configured to not include in an interface call request message in the receiving unit
IDL默认参数的数值时, 从预先存储的信息中获取所述 IDL默认参数的默认 值; When the value of the IDL default parameter is used, the default value of the IDL default parameter is obtained from the pre-stored information;
第一调用接口单元, 用于使用所述默认值获取单元获取的 IDL 默认参数 的默认值调用所述客户端请求的接口。  The first calling interface unit is configured to invoke the interface requested by the client by using a default value of an IDL default parameter obtained by the default value obtaining unit.
一种分布式系统, 所述系统包括: 与客户端进行通信的服务器, 所述服务器, 用于接收来自所述客户端的接口调用请求消息, 当所述接口 调用请求消息中不包含 IDL 默认参数的数值时, 从预先存储的信息中获取所 述 IDL默认参数的默认值, 使用获取的 IDL默认参数的默认值调用所述客户 端请求的接口。  A distributed system, the system includes: a server that communicates with a client, the server, configured to receive an interface call request message from the client, when the interface call request message does not include an IDL default parameter When the value is obtained, the default value of the IDL default parameter is obtained from the pre-stored information, and the interface requested by the client is invoked by using the default value of the obtained IDL default parameter.
与现有技术相比, 本发明实施例具有以下优点:  Compared with the prior art, the embodiment of the invention has the following advantages:
本发明实施例由于能够根据接收的客户端的接口调用请求消息中是否包 含 IDL默认参数的数值来执行相应的接口调用操作, 这样, 当服务器升级时, 无需升级所有的客户端, 而对于老客户端, 由于没有升级, 因此发送的接口调 用请求消息中不会包含 IDL 默认参数的数值, 此时, 可从预存的信息中获取 IDL默认值来执行接口调用。 可见, 使用本发明公开的接口调用方法, 能够避 免因服务器端升级而引起的整个分布式系统中所有组件的联动升级。  The embodiment of the present invention can perform the corresponding interface calling operation according to whether the request message includes the value of the IDL default parameter according to the received interface of the client, so that when the server is upgraded, it is not necessary to upgrade all the clients, but for the old client. Because there is no upgrade, the interface call request message sent will not contain the value of the IDL default parameter. In this case, the IDL default value can be obtained from the pre-stored information to perform the interface call. It can be seen that, by using the interface calling method disclosed in the present invention, linkage upgrade of all components in the entire distributed system caused by server-side upgrade can be avoided.
附图说明 DRAWINGS
图 1为本发明实施例分布式系统的接口调用方法流程示意框图;  1 is a schematic block diagram of a method for calling an interface of a distributed system according to an embodiment of the present invention;
图 2 ( a )、 (b )、 ( c )分别为本发明实施例分布式系统应用图 1 所示方法 的示意图;  2(a), (b), and (c) are schematic diagrams showing the application of the method shown in FIG. 1 for a distributed system according to an embodiment of the present invention;
图 3为一种本发明实施例分布式系统的接口调用装置结构示意框图; 图 4为另一种本发明实施例分布式系统的接口调用装置结构示意框图; 图 5为另一种本发明实施例分布式系统的接口调用装置结构示意框图。 具体实施方式 下面结合附图对本发明实施例的具体实施方式做进一步的详细阐述。 3 is a schematic block diagram of an interface call device of a distributed system according to an embodiment of the present invention; FIG. 4 is a schematic block diagram of another interface call device of a distributed system according to an embodiment of the present invention; FIG. 5 is another embodiment of the present invention. A schematic block diagram of an interface call device of a distributed system. detailed description The specific embodiments of the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
现有技术由于新增的接口是对原有老接口的功能的增强, 在使用 IDL描 述新接口时, 为新接口定义的代码中需要存在大量定义的与老接口相同的代 码, 在调用时, 由于定义新接口的代码冗余会造成处理繁瑣, 并且维护不便。 而且, 如果服务器端的软件升级后, 客户端的软件也要一起升级, 这样客户端 才能按照和服务器端配套的约定方法调用接口。 因此,现有技术会使系统升级 的工作量 4艮大。  In the prior art, since the newly added interface is an enhancement of the function of the original old interface, when the IDL is used to describe the new interface, the code defined for the new interface needs to have a large number of defined codes identical to the old interface. The code redundancy that defines the new interface can be cumbersome to handle and inconvenient to maintain. Moreover, if the software on the server side is upgraded, the software of the client side should also be upgraded together, so that the client can invoke the interface according to the agreed method of the server side. Therefore, the prior art will increase the workload of the system upgrade.
本发明实施例公开了一种分布式系统的接口调用方法,该实施例釆用 IDL 定义接口, 在升级后的接口定义 IDL 中增加对方法参数的默认值的识别, 这 样,在收到客户端发送的接口调用请求消息时, 能够根据接收的接口调用请求 消息中是否包含该 IDL默认参数的数值来确定客户端是否为升级后的新客户 端。如图 1所示, 为本发明实施例一种分布式系统的接口调用方法流程示意框 图。  An embodiment of the present invention discloses an interface calling method of a distributed system. In this embodiment, an IDL is used to define an interface, and an identifier of a method parameter is added in the upgraded interface definition IDL, so that the client is received. When the sent interface invokes the request message, it can determine whether the client is an upgraded new client according to whether the received interface in the request message contains the value of the IDL default parameter. FIG. 1 is a schematic block diagram of a method for calling an interface of a distributed system according to an embodiment of the present invention.
S101 : 在使用 IDL语言定义接口调用方法的程序时, 为该程序中的方法 参数设置默认参数、 以及该默认参数的默认值, 并且还设置"可以为该默认参 数指定除默认值外的其他数值,,的属性。 这样, 对于升级后的新客户端在调用 这个方法程序时, 可以为该 IDL默认参数设定一个默认值以外的其他数值。  S101: When the program of the interface calling method is defined by using the IDL language, a default parameter and a default value of the default parameter are set for the method parameter in the program, and "other values other than the default value can be specified for the default parameter" In this way, when the upgraded new client calls this method, you can set a value other than the default value for the IDL default parameter.
例如, 在 doRequest方法的定义中, 增加了一个参数默认值设置: interface IBaseSession {  For example, in the definition of the doRequest method, a parameter default setting has been added: interface IBaseSession {
void doRequest(in TXCAPMessage req, in string address ="");  Void doRequest(in TXCAPMessage req, in string address ="");
oneway void doResponse(in TXCAPMessage resp);  Oneway void doResponse(in TXCAPMessage resp);
oneway void close();  Oneway void close();
oneway void doError (in short errorCode); 其中, "address = "为本发明实施例设置的默认参数, 该默认参数的数值可 以为指定的默认值,或者还可以为客户端任意设置的一个数值。当为默认值时, 该默认参数的数值可以不添, 此时则表示为默任值。  Oneway void doError (in short errorCode); where "address=" is a default parameter set in the embodiment of the present invention, and the value of the default parameter may be a specified default value, or may be a value arbitrarily set by the client. When it is the default value, the value of the default parameter may not be added, and it is expressed as a silent value.
其中, IDL编译器编译带有默认参数的 IDL语言时, 默认参数的默认值可 保存在服务器端的 skeleton ( IDL编译器生成的服务端骨架) 中。 S102: 服务器端当收到客户端发送的接口调用请求消息后,从该接口调用 请求消息中读取每个 IDL语言中默认参数的值, 如果默认参数没有指定的数 值, 则执行 S103; 否则, 执行 S106。 When the IDL compiler compiles the IDL language with default parameters, the default value of the default parameters can be saved in the server-side skeleton (the server skeleton generated by the IDL compiler). S102: After receiving the interface call request message sent by the client, the server reads the value of the default parameter in each IDL language from the interface call request message. If the default parameter does not have a specified value, execute S103; otherwise, Execution S106.
S103:服务器端判断自身上的 skeleton中是否保存有 IDL默认参数的默认 值, 如果没有, 则执行 S104; 否则, 执行 S105。  S103: The server determines whether the default value of the IDL default parameter is saved in the skeleton on itself, if not, executes S104; otherwise, executes S105.
S104: 调用失败, 向客户端返回异常响应。  S104: The call fails, and an abnormal response is returned to the client.
S105: 则说明该客户端为没有升级的老客户端, 此时使用自身保存的 IDL 默认参数的默认值来调用客户端请求使用的接口,来通过该接口定义的功能实 现相应的应用。  S105: The client is an old client that has not been upgraded. In this case, the default value of the IDL default parameter saved by itself is used to invoke the interface requested by the client to implement the corresponding application through the function defined by the interface.
S106: 则说明该客户端为升级后的新的客户端, 此时, 使用接口调用请求 消息中该 IDL默认参数的数值来调用该客户端请求使用的接口。  S106: The client is an upgraded new client. In this case, the interface used by the client request is invoked by using the value of the IDL default parameter in the interface call request message.
上述实施例中, 由于在 IDL 中设置了默认参数和默认值, 这样, 当客户 端发送的接口调用请求消息中如果有 IDL 默认参数指定的数值时, 则该客户 端为升级后的新客户端, 此时,服务器端使用接口调用请求消息中指定的数值 调用相应的接口实现后续的操作;若接口调用请求消息中默认参数没有指定的 IDL默认值,那么该 IDL默认参数的默认数值如果在服务器端有保存,那么该 客户端为未升级的老的客户端, 此时,服务器端则使用默认数值来调用需要的 接口。 可见, 本发明通过识别 IDL 默认参数的数值来实现对新客户端和老客 户端的区分操作 ,避免了现有技术中因服务器端系统升级而引起的客户端联动 升级的问题, 本发明在系统升级时, 无需升级老客户端的程序。 因此, 克服了 系统组件的联动升级, 使系统升级操作简单, 方便维护, 实现了轻量级的组件 升级。  In the above embodiment, since the default parameter and the default value are set in the IDL, if the value of the IDL default parameter is specified in the interface call request message sent by the client, the client is the upgraded new client. At this time, the server uses the value specified in the interface call request message to call the corresponding interface to implement the subsequent operation; if the default parameter of the interface call request message does not have the specified IDL default value, then the default value of the IDL default parameter is in the server. If there is a save, then the client is an old client that has not been upgraded. At this time, the server uses the default value to call the required interface. It can be seen that the present invention realizes the distinguishing operation between the new client and the old client by identifying the value of the IDL default parameter, and avoids the problem of the client linkage upgrade caused by the server-side system upgrade in the prior art, and the system upgrades in the system. When you do not need to upgrade the old client program. Therefore, the linkage upgrade of the system components is overcome, the system upgrade operation is simple, the maintenance is convenient, and the lightweight component upgrade is realized.
另夕卜,本发明实施例釆用为老接口增加默认参数的方式来实现对升级后的 组件的调用, 不需要增加新的接口,避免了调用时由于新接口的代码冗余造成 的处理繁瑣, 便于维护。  In addition, the embodiment of the present invention uses the way of adding default parameters to the old interface to implement the calling of the upgraded component, and does not need to add a new interface, thereby avoiding the cumbersome processing caused by the code redundancy of the new interface during the call. Easy to maintain.
为方便理解,现举例说明分布式系统釆用本发明实施例上述接口调用方法 的具体应用, 如图 2所示, 为本发明实施例图 1方法的应用示意图。 如果升级 前客户端 A和客户端^ 以及服务器端 C都使用 Fun ( a, b )的方法调用接口, 例如图 2 ( a )所示, 客户端 A发送的请求中包括 Fun ( 1 , 2 ), 客户端 B发送 的请求中包括 Fun ( 3 , 4 )。 服务器端 C则根据客户端 A的请求, 使用参数值 为 1和 2来调用该方法的接口, 同时, 根据客户端 B的请求, 使用参数值为 3 和 4来调用该方法的接口。 For the sake of understanding, the specific application of the above-mentioned interface calling method in the embodiment of the present invention is illustrated by the distributed system. As shown in FIG. 2, it is a schematic diagram of the application of the method in FIG. 1 according to an embodiment of the present invention. If the client A and the client ^ and the server C both use the method of Fun ( a, b ) to call the interface before the upgrade, for example, as shown in Figure 2 ( a ), the request sent by client A includes Fun ( 1 , 2 ). , client B sends The request includes Fun ( 3 , 4 ). Server C calls the interface of the method with the parameter values 1 and 2 according to the request of client A. At the same time, according to the request of client B, the interface of the method is called with the parameter values 3 and 4.
当服务器端 C升级, 则在服务器端 C上为该方法定义了默认参数 c 以及 设置该默认参数 c的默认数值为 10, 即 Fun(a,b,c=10 )。 如图 2 ( b )所示, 如 果客户端 A发送的请求中包括 Fun ( 1 , 2 ), 客户端 B发送的请求中包括 Fun ( 3 , 4 ), 服务器端 C在收到这些请求后, 分别在这些请求中查询默认参数的 数值, 由于客户端 A和客户端 B的请求中都没有指定默认参数 c的数值, 那 么说明这两个客户端都为没有升级的老客户端, 此时服务器端 C从自身保存 的信息中检索默认参数 c的默认值, 当检索到 (即默认值为 10 )后, 则根据 客户端 A的请求, 使用默认值 10以及请求中的其他参数值 1和 2来调用该方 法接口; 同时, 根据客户端 B的请求, 使用该默认值 10以及请求中的其他参 数值 3和 4来调用该方法接口。  When the server C is upgraded, the default parameter c is defined for the method on the server C and the default value of the default parameter c is set to 10, that is, Fun(a, b, c=10). As shown in Figure 2 (b), if the request sent by client A includes Fun (1, 2), the request sent by client B includes Fun (3, 4), and after receiving the requests, server C receives The values of the default parameters are respectively queried in these requests. Since the values of the default parameter c are not specified in the requests of client A and client B, it means that both clients are old clients without upgrade, and the server is now End C retrieves the default value of the default parameter c from the information saved by itself. When retrieved (ie, the default value is 10), the default value of 10 and other parameter values 1 and 2 in the request are used according to the request of client A. To invoke the method interface; at the same time, according to the request of client B, the method interface is invoked using the default value 10 and other parameter values 3 and 4 in the request.
如果客户端 B也升级了, 则客户端 B在发送的请求中可以为默认参数 c 设置指定的数值, 例如图 2 ( c ) 中, 客户端 B发送的请求中的为默认参数 c 指定的数值为 20 , 即 Fun(3,4,20)。 而客户端 A由于没有升级, 因此, 在客户 端 A发送的请求中没有默认参数 c的数值, 即仍然为 Fun(l,2)。服务器端 C当 收到这些请求后, 分别在这些请求中查询默认参数 c 的数值, 由于客户端 A 的请求中没有指定默认参数 c的数值,此时服务器端 C则从自身保存的信息中 检索到默认参数 c的默认值 10, 然后根据客户端 A的请求, 使用该默认值 10 以及请求中的其他参数值 1和 2来调用该方法的接口; 同时, 根据客户端 B 的请求, 由于客户端 B的请求中包含了为默认参数 c指定的数值 20, 则服务 器端 C使用该指定数值 20以及该请求中的其他参数值 3和 4来调用该方法的 接口。  If client B is also upgraded, client B can set the specified value for the default parameter c in the request sent. For example, in Figure 2 (c), the value specified by the client B is the value specified by the default parameter c. It is 20, that is, Fun (3, 4, 20). Since client A does not upgrade, there is no default parameter c in the request sent by client A, which is still Fun(l, 2). After receiving these requests, server C queries the value of the default parameter c in these requests. Since the value of the default parameter c is not specified in the request of client A, server C retrieves the information saved by itself. To the default value of the default parameter c, 10, and then use the default value of 10 and the other parameter values 1 and 2 in the request to call the interface of the method according to the request of client A; meanwhile, according to the request of client B, due to the client The request of end B contains the value 20 specified for the default parameter c, and the server C uses the specified value 20 and the other parameter values 3 and 4 in the request to invoke the interface of the method.
基于上述技术方案,本发明实施例还公开了一种用于分布式系统的接口调 用的装置, 该装置可以集成在服务器端, 釆用 IDL语言定义接口, 装置在升 级后的接口定义 IDL语言中增加对方法参数的默认值的识别, 以便在收到客 户端发送的接口调用请求消息时,能够根据接口调用请求消息中是否包含该默 认参数的数值来判断客户端为升级后的新客户端, 还是未升级的老客户。 如图 3所示,为本发明实施例一种用于分布式系统的接口调用装置结构示 意框图。 装置包括: 接收单元 301、 默认值获取单元 302、 第一调用接口单元 303 , 其中, Based on the foregoing technical solution, an embodiment of the present invention further discloses an apparatus for an interface call of a distributed system, where the apparatus can be integrated on a server, and an interface is defined by an IDL language, and the apparatus defines an IDL language in the upgraded interface. The identification of the default value of the method parameter is added, so that when the interface call request message sent by the client is received, the client can be determined as the upgraded new client according to whether the value of the default parameter is included in the interface call request message. Still an old customer who has not upgraded. FIG. 3 is a schematic block diagram showing the structure of an interface calling device for a distributed system according to an embodiment of the present invention. The device includes: a receiving unit 301, a default value obtaining unit 302, and a first calling interface unit 303, where
接收单元 301 , 用于接收由客户端发送的接口调用请求消息;  The receiving unit 301 is configured to receive an interface call request message sent by the client.
默认值获取单元 302, 用于读取接收单元 301中的接口调用请求消息中每 个 IDL语言的默认参数数值, 当接口调用请求消息中不包含 IDL默认参数的 数值时, 从预先存储的信息中获取 IDL默认参数的默认值; 其中, IDL默认参 数的默认值可预先存储在该装置所在服务器端的 skeleton中。  The default value obtaining unit 302 is configured to read a default parameter value of each IDL language in the interface call request message in the receiving unit 301, and when the interface call request message does not include the value of the IDL default parameter, the pre-stored information is used. Get the default value of the IDL default parameter; where the default value of the IDL default parameter can be pre-stored in the skeleton of the server where the device is located.
第一调用接口单元 303 ,用于使用默认值获取单元 302获取的 IDL默认参 数的默认值调用客户端请求使用的接口,来通过该接口定义的功能实现相应的 应用。  The first call interface unit 303 is configured to invoke the interface used by the client request by using the default value of the IDL default parameter obtained by the default value obtaining unit 302, to implement the corresponding application by using the function defined by the interface.
上述实施例中, 由于在接口调用方法的 IDL 中设置了默认参数和该默认 参数的默认值, 这样, 当客户端发送的接口调用请求消息中如果 IDL默认参 数没有指定的默认值, 那么该客户端为未升级的老的客户端, 此时, 装置可使 用自身预存的默认值来调用接口。可见, 本发明实施例通过识别接口调用请求 消息中 IDL 默认参数的数值来实现对新客户端和老客户端的区分操作, 避免 了现有技术中因服务器端系统升级而引起的客户端联动升级的问题。釆用本发 明实施例的接口调用方法可在系统升级时, 无需升级老客户端的程序。 因此, 克服了系统组件的联动升级, 使系统升级操作简单, 方便维护, 实现了轻量级 的组件升级。  In the above embodiment, since the default parameter and the default value of the default parameter are set in the IDL of the interface calling method, when the IDL default parameter does not have a default value specified in the interface call request message sent by the client, the client The end is an old client that is not upgraded. At this point, the device can call the interface with its own pre-stored default value. It can be seen that the embodiment of the present invention implements the distinguishing operation between the new client and the old client by identifying the value of the IDL default parameter in the request message, and avoids the client linkage upgrade caused by the server system upgrade in the prior art. problem. By using the interface calling method of the embodiment of the present invention, it is not necessary to upgrade the old client program when the system is upgraded. Therefore, the linkage upgrade of the system components is overcome, the system upgrade operation is simple, the maintenance is convenient, and the lightweight component upgrade is realized.
另夕卜,本发明实施例釆用为老接口增加默认参数的方式来实现对升级后的 组件的调用, 不需要增加新的接口,避免了调用时由于新接口的代码冗余造成 的处理繁瑣, 便于维护。  In addition, the embodiment of the present invention uses the way of adding default parameters to the old interface to implement the calling of the upgraded component, and does not need to add a new interface, thereby avoiding the cumbersome processing caused by the code redundancy of the new interface during the call. Easy to maintain.
在本发明的一些实施例中,可以由接收单元 301读取接口调用请求消息中 每个 IDL语言的默认参数数值, 判断该接口调用请求消息中是否包含 IDL默 认参数的数值, 当包含 IDL默认参数的数值时, 由默认值获取单元 302 以及 第一调用接口单元 303执行后续操作。  In some embodiments of the present invention, the default parameter value of each IDL language in the interface call request message may be read by the receiving unit 301, and it is determined whether the interface call request message includes the value of the IDL default parameter, when the IDL default parameter is included. The subsequent operations are performed by the default value obtaining unit 302 and the first calling interface unit 303.
此外,在上述装置实施例的基础上, 当接收单元 301中的接口调用请求消 息中包含有客户端为 IDL 默认参数指定的数值时, 装置则可直接使用所指定 的数值调用接口。如图 4所示, 为本发明实施例另一种用于分布式系统的接口 调用装置结构示意框图。 装置在图 3所示装置实施例的基础上, 包括: 接收单 元 301、 默认值获取单元 302、 第一调用接口单元 303、 数值获取单元 401、 第 二调用接口单元 402, 其中, In addition, on the basis of the foregoing device embodiment, when the interface call request message in the receiving unit 301 includes the value specified by the client for the IDL default parameter, the device may directly use the specified The value of the call interface. FIG. 4 is a schematic block diagram showing another structure of an interface calling device for a distributed system according to an embodiment of the present invention. The device is based on the device embodiment shown in FIG. 3, and includes: a receiving unit 301, a default value obtaining unit 302, a first calling interface unit 303, a value obtaining unit 401, and a second calling interface unit 402, where
接收单元 301 , 用于接收由客户端发送的接口调用请求消息;  The receiving unit 301 is configured to receive an interface call request message sent by the client.
默认值获取单元 302, 用于读取接收单元 301中的接口调用请求消息中每 个 IDL语言的默认参数数值, 当接口调用请求消息中不包含 IDL默认参数的 数值时, 从预先存储的信息中获取 IDL默认参数的默认值; 其中, IDL默认参 数的默认值可预先存储在该装置所在服务器端的 skeleton中。  The default value obtaining unit 302 is configured to read a default parameter value of each IDL language in the interface call request message in the receiving unit 301, and when the interface call request message does not include the value of the IDL default parameter, the pre-stored information is used. Get the default value of the IDL default parameter; where the default value of the IDL default parameter can be pre-stored in the skeleton of the server where the device is located.
第一调用接口单元 303 ,用于使用默认值获取单元 302获取的 IDL默认参 数的默认值调用客户端请求使用的接口,来通过该接口定义的功能实现相应的 应用。  The first call interface unit 303 is configured to invoke the interface used by the client request by using the default value of the IDL default parameter obtained by the default value obtaining unit 302, to implement the corresponding application by using the function defined by the interface.
数值获取单元 401 , 用于当接收单元 301 中的接口调用请求消息中包含 IDL默认参数的数值时, 从接口调用请求消息中获取该 IDL默认参数的数值; 第二调用接口单元 402,用于使用数值获取单元 401获取的 IDL默认参数 的数值调用客户端请求的接口, 来通过该接口定义的功能实现相应的应用。  The value obtaining unit 401 is configured to: when the value of the IDL default parameter is included in the interface call request message in the receiving unit 301, obtain the value of the IDL default parameter from the interface call request message; the second call interface unit 402 is configured to use The value of the IDL default parameter acquired by the value obtaining unit 401 invokes the interface requested by the client to implement the corresponding application through the function defined by the interface.
此外,在上述图 3所示的装置实施例的基础上, 当预先存储的信息中没有 找到 IDL默认参数的默认值时, 装置可停止接口的调用。 如图 5所示, 为本 发明实施例另一种用于分布式系统的接口调用装置结构示意框图。 装置在图 3 所示装置实施例的基础上, 包括: 接收单元 301、 默认值获取单元 302、 第一 调用接口单元 303、 默认值判断执行单元 501 , 其中,  Further, on the basis of the apparatus embodiment shown in Fig. 3 above, when the default value of the IDL default parameter is not found in the pre-stored information, the device can stop the call of the interface. FIG. 5 is a schematic block diagram showing another structure of an interface calling device for a distributed system according to an embodiment of the present invention. The device is based on the device embodiment shown in FIG. 3, and includes: a receiving unit 301, a default value obtaining unit 302, a first calling interface unit 303, and a default value determining executing unit 501, where
接收单元 301 , 用于接收由客户端发送的接口调用请求消息。 当接收单元 301中的接口调用请求消息中不包含 IDL默认参数的数值时,由默认值判断执 行单元 501判断预先存储的信息中是否保存有 IDL默认参数的默认值, 如果 有,则指令默认值获取单元 302执行获取功能;否则,向客户端返回异常响应。  The receiving unit 301 is configured to receive an interface call request message sent by the client. When the value of the IDL default parameter is not included in the interface call request message in the receiving unit 301, the default value determining execution unit 501 determines whether the default value of the IDL default parameter is stored in the pre-stored information, and if so, the command default value. The obtaining unit 302 performs an acquisition function; otherwise, returns an abnormal response to the client.
默认值获取单元 302用于当接口调用请求消息中不包含 IDL默认参数的 数值时, 从预先存储的信息中获取 IDL默认参数的默认值。 其中, 述 IDL默 认参数的默认值可预先存储在该装置所在服务器端的 skeleton中。  The default value obtaining unit 302 is configured to obtain a default value of the IDL default parameter from the pre-stored information when the value of the IDL default parameter is not included in the interface call request message. The default value of the IDL default parameter may be pre-stored in the skeleton of the server side where the device is located.
第一调用接口单元 303 ,用于使用默认值获取单元 302获取的 IDL默认参 数的默认值调用客户端请求使用的接口,来通过该接口定义的功能实现相应的 应用。 The first call interface unit 303 is configured to use the default value of the IDL obtained by the default value obtaining unit 302. The default value of the number calls the interface used by the client request to implement the corresponding application through the functions defined by the interface.
此外,上述装置实施例中的默认值判断执行单元 501除了应用在图 3所示 装置实施例中外,还可以应用在图 4所示的装置实施例中, 其功能与图 5所示 的相同, 在此不再赘述。  In addition, the default value judgment execution unit 501 in the above apparatus embodiment can be applied to the apparatus embodiment shown in FIG. 4, and its function is the same as that shown in FIG. 5, in addition to the apparatus embodiment shown in FIG. I will not repeat them here.
此外,在上述装置实施例的基础上, 本发明实施例还公开了一种分布式系 统, 该系统包括客户端和服务器, 其中, 服务器包括如上述图 3或图 4所示实 施例的用于分布式系统的接口调用装置, 该装置的结构及功能都与上述图 3 或图 4所示装置实施例相同, 在此不再赘述。  In addition, based on the foregoing device embodiments, the embodiment of the present invention further discloses a distributed system, where the system includes a client and a server, where the server includes the embodiment as shown in FIG. 3 or FIG. The interface of the distributed system is called the device, and the structure and function of the device are the same as those of the device embodiment shown in FIG. 3 or FIG. 4, and details are not described herein again.
本发明实施例还公开了一种分布式系统, 包括:  The embodiment of the invention also discloses a distributed system, comprising:
与客户端进行通信的服务器,  The server that communicates with the client,
服务器, 用于接收来自客户端的接口调用请求消息, 当接口调用请求消息 中不包含 IDL默认参数的数值时, 从预先存储的信息中获取 IDL默认参数的 默认值, 使用获取的 IDL默认参数的默认值调用客户端请求的接口。  The server is configured to receive an interface call request message from the client. When the interface call request message does not include the value of the IDL default parameter, the default value of the IDL default parameter is obtained from the pre-stored information, and the default value of the obtained IDL default parameter is used. The value calls the interface requested by the client.
服务器还用于当接收到的接口调用请求消息中包含 IDL默认参数的数值 时, 从接口调用请求消息中获取 IDL默认参数的数值, 使用 IDL默认参数的 数值调用客户端请求的接口。  The server is further configured to: when the received interface call request message includes the value of the IDL default parameter, obtain the value of the IDL default parameter from the interface call request message, and invoke the interface requested by the client by using the value of the IDL default parameter.
服务器还用于判断预先存储的信息中是否保存有 IDL默认参数的默认值, 若没有, 向客户端返回异常响应。  The server is further configured to determine whether the default value of the IDL default parameter is stored in the pre-stored information, and if not, return an abnormal response to the client.
上述实施例中, 由于在接口调用方法的 IDL 中设置了默认参数和该默认 参数的默认值, 这样, 当客户端发送的接口调用请求消息中如果有默认参数指 定的数值时, 则该客户端为升级后的新客户端, 此时, 服务器端使用接口调用 请求消息中指定的数值调用相应的接口实现后续的操作;若接口调用请求消息 中默认参数没有指定的默认值, 那么该客户端为未升级的老的客户端, 如果该 默认参数的默认值在服务器端有保存,服务器端则使用默认值来调用需要的接 口。可见, 本发明实施例通过识别接口调用请求消息中默认参数的数值来实现 对新客户端和老客户端的区分操作,避免了现有技术中因服务器端系统升级而 引起的客户端联动升级的问题, 使系统升级操作简单, 方便维护, 实现了轻量 级的组件升级。 另夕卜,本发明实施例釆用为老接口增加默认参数的方式来实现对升级后的 组件的调用, 不需要增加新的接口,避免了调用时由于新接口的代码冗余造成 的处理繁瑣, 便于维护。 In the above embodiment, the default parameter and the default value of the default parameter are set in the IDL of the interface calling method, so that when the value of the default parameter is specified in the interface call request message sent by the client, the client For the upgraded new client, at this time, the server uses the value specified in the interface call request message to call the corresponding interface to implement the subsequent operation; if the default parameter in the interface call request message does not specify the default value, then the client is If the default value of the default parameter is saved on the server side, the server side uses the default value to call the required interface. It can be seen that the embodiment of the present invention realizes the distinguishing operation between the new client and the old client by identifying the value of the default parameter in the request message, and avoids the problem of client linkage upgrade caused by the server system upgrade in the prior art. It makes the system upgrade easy to operate, easy to maintain, and realizes lightweight component upgrade. In addition, the embodiment of the present invention uses the way of adding default parameters to the old interface to implement the calling of the upgraded component, and does not need to add a new interface, thereby avoiding the cumbersome processing caused by the code redundancy of the new interface during the call. Easy to maintain.
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元 可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以 不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可 以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。 本领域普通技术人员在不付出创造性的劳动的情况下, 即可以理解并实施。  The device embodiments described above are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located in one place. , or it can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明 可借助软件加必需的通用硬件平台的方式来实现, 当然也可以通过硬件,但很 多情况下前者是更佳的实施方式。基于这样的理解, 本发明的技术方案本质上 或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机 软件产品可以存储在存储介质中, 如 ROM/RAM、 磁碟、 光盘等, 包括若干指 令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 执行本发明各个实施例或者实施例的某些部分所述的方法。  Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is a better implementation. the way. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. , an optical disk, etc., includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
以上所述的本发明实施方式, 并不构成对本发明保护范围的限定。任何在 本发明的精神和原则之内所作的修改、等同替换和改进等, 均应包含在本发明 的保护范围之内。  The embodiments of the present invention described above are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种分布式系统的接口调用方法, 其特征是, 所述方法包括: 接收客户端发送的接口调用请求消息;  A method for invoking an interface of a distributed system, the method comprising: receiving an interface call request message sent by a client;
判断所述接口调用请求消息中是否包含接口描述语言 IDL 默认参数的数 值, 若不包含, 则从预先存储的信息中获取所述 IDL默认参数的默认值; 使用所获取的 IDL默认参数的默认值调用所述客户端请求的接口。  Determining whether the interface call request message includes a value of a default parameter of the interface description language IDL, if not, obtaining a default value of the IDL default parameter from the pre-stored information; using a default value of the obtained IDL default parameter The interface that invoked the client request.
2、 如权利要求 1所述的分布式系统的接口调用方法, 其特征是, 所述方 法还包括,  2. The interface calling method of a distributed system according to claim 1, wherein the method further comprises:
若所述接口调用请求消息中包含 IDL 默认参数的数值时, 则从所述接口 调用请求消息中获取所述 IDL默认参数的数值, 使用所述 IDL默认参数的数 值调用所述客户端请求的接口。  If the value of the IDL default parameter is included in the interface call request message, the value of the IDL default parameter is obtained from the interface call request message, and the interface requested by the client is invoked by using the value of the IDL default parameter. .
3、 如权利要求 1所述的分布式系统的接口调用方法, 其特征是, 在执行 所述获取所述 IDL默认参数的默认值之前, 还包括:  The interface calling method of the distributed system according to claim 1, wherein before performing the obtaining the default value of the IDL default parameter, the method further includes:
判断预先存储的信息中是否保存有所述 IDL默认参数的默认值, 如果有, 则执行所述获取所述 IDL默认参数的默认值动作。  Determining whether a default value of the IDL default parameter is saved in the pre-stored information, and if so, performing the default value action of obtaining the IDL default parameter.
4、 如权利要求 3所述的分布式系统的接口调用方法, 其特征是, 所述方 法还包括, 当预先存储的信息中没有保存所述 IDL 默认参数的默认值时, 向 所述客户端返回异常响应。  The interface calling method of the distributed system according to claim 3, wherein the method further comprises: when the default value of the IDL default parameter is not saved in the pre-stored information, to the client Returns an exception response.
5、 一种用于分布式系统的接口调用的装置, 其特征是, 所述装置包括: 接收单元, 用于接收客户端发送的接口调用请求消息;  A device for an interface call of a distributed system, the device comprising: a receiving unit, configured to receive an interface call request message sent by a client;
默认值获取单元, 用于当所述接收单元中的接口调用请求消息中不包含 IDL默认参数的数值时, 从预先存储的信息中获取所述 IDL默认参数的默认 值;  a default value obtaining unit, configured to: when a value of an IDL default parameter is not included in an interface call request message in the receiving unit, obtain a default value of the IDL default parameter from pre-stored information;
第一调用接口单元, 用于使用所述默认值获取单元获取的 IDL默认参数 的默认值调用所述客户端请求的接口。  The first calling interface unit is configured to invoke the interface requested by the client by using a default value of an IDL default parameter obtained by the default value obtaining unit.
6、 如权利要求 5所述的接口调用的装置, 其特征是, 所述装置还包括: 数值获取单元, 用于当所述接收单元中的接口调用请求消息中包含 IDL 默认参数的数值时, 从所述接口调用请求消息中获取所述 IDL默认参数的数 值; 第二调用接口单元, 用于使用所述数值获取单元获取的 IDL 默认参数的 数值调用所述客户端请求的接口。 The apparatus for invoking an interface according to claim 5, wherein the apparatus further comprises: a value obtaining unit, configured to: when an interface call request message in the receiving unit includes a value of an IDL default parameter, Obtaining a value of the IDL default parameter from the interface call request message; And a second calling interface unit, configured to invoke the interface requested by the client by using a value of an IDL default parameter acquired by the value obtaining unit.
7、 如权利要求 5所述的接口调用的装置, 其特征是, 所述装置还包括: 默认值判断执行单元, 用于判断预先存储的信息中是否保存有所述 IDL 默认参数的默认值, 如果有, 则指令所述默认值获取单元执行所述获取动作, 否则, 向所述客户端返回异常响应。  The device for invoking an interface according to claim 5, wherein the device further comprises: a default value determining execution unit, configured to determine whether a default value of the IDL default parameter is saved in the pre-stored information, If so, the default value obtaining unit is instructed to perform the obtaining action, otherwise, an abnormal response is returned to the client.
8、 一种分布式系统, 其特征是, 所述系统包括: 与客户端进行通信的服 务器,  8. A distributed system, the system comprising: a server for communicating with a client,
所述服务器, 用于接收来自所述客户端的接口调用请求消息, 当所述接口 调用请求消息中不包含 IDL 默认参数的数值时, 从预先存储的信息中获取所 述 IDL默认参数的默认值, 使用获取的 IDL默认参数的默认值调用所述客户 端请求的接口。  The server is configured to receive an interface call request message from the client, and when the interface call request message does not include a value of an IDL default parameter, obtain a default value of the IDL default parameter from the pre-stored information, The interface requested by the client is invoked using the default value of the obtained IDL default parameter.
9、 如权利要求 8所述的系统, 其特征是, 所述服务器还用于当接收到的 所述接口调用请求消息中包含 IDL 默认参数的数值时, 从所述接口调用请求 消息中获取所述 IDL默认参数的数值, 使用所述 IDL默认参数的数值调用所 述客户端请求的接口。  9. The system according to claim 8, wherein the server is further configured to: when the received interface call request message includes a value of an IDL default parameter, obtain the location from the interface call request message. The value of the IDL default parameter is used to invoke the interface requested by the client using the value of the IDL default parameter.
10、 如权利要求 8所述的系统, 其特征是, 所述服务器还用于判断预先存 储的信息中是否保存有所述 IDL 默认参数的默认值, 若没有, 向所述客户端 返回异常响应。  10. The system according to claim 8, wherein the server is further configured to determine whether a default value of the IDL default parameter is saved in the pre-stored information, and if not, return an abnormal response to the client. .
PCT/CN2009/071422 2008-04-24 2009-04-23 A method and apparatus for interface invoking of distributed system WO2009129745A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200810094643 CN101277301B (en) 2008-04-24 2008-04-24 Method, device and system for invocation of distributed system interface
CN200810094643.1 2008-04-24

Publications (1)

Publication Number Publication Date
WO2009129745A1 true WO2009129745A1 (en) 2009-10-29

Family

ID=39996313

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/071422 WO2009129745A1 (en) 2008-04-24 2009-04-23 A method and apparatus for interface invoking of distributed system

Country Status (2)

Country Link
CN (1) CN101277301B (en)
WO (1) WO2009129745A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101277301B (en) * 2008-04-24 2012-04-25 华为技术有限公司 Method, device and system for invocation of distributed system interface
CN102281152B (en) * 2011-06-08 2014-10-29 烽火通信科技股份有限公司 Distributed communication system, implementation method, marshalling and unmarshalling method of remote API (Application Program Interface)
CN102779071A (en) * 2012-06-14 2012-11-14 华为技术有限公司 Method, device and system for calling software interface
CN103577177B (en) * 2012-08-02 2018-07-13 腾讯科技(深圳)有限公司 A kind of shape library call method and equipment
CN105867928B (en) * 2016-03-30 2019-06-04 北京奇虎科技有限公司 A kind of method and apparatus accessing specified computation model in specified distributed system
CN106301920B (en) * 2016-08-17 2019-03-19 浪潮通用软件有限公司 Interface configuration method for DMD system and service system in intelligent client mode

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040221017A1 (en) * 2003-04-30 2004-11-04 International Business Machines Corporation Dynamic generator for fast-client static proxy from service interface definition document
CN1710865A (en) * 2005-06-30 2005-12-21 西安交通大学 Method for raising reliability of software system based on strucural member
CN101017447A (en) * 2007-02-13 2007-08-15 华为技术有限公司 IDE calling device and calling method therefor
CN101277301A (en) * 2008-04-24 2008-10-01 华为技术有限公司 Method and device for invocation of distributed system interface

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2406663B (en) * 2003-10-01 2006-03-22 Toshiba Res Europ Ltd Flexible protocol stack
US9503528B2 (en) * 2004-06-14 2016-11-22 Alcatel-Lucent Usa Inc. System for provisioning service data utilizing the IMS defined Sh interface's transparent data
CN100442712C (en) * 2005-12-13 2008-12-10 华为技术有限公司 Method and system for realizing network terminal equipment configuration automatic updating
CN1996878A (en) * 2006-06-28 2007-07-11 华为技术有限公司 A method for information conversion of the simple object access protocol service management interface
CN101001182B (en) * 2007-01-12 2010-09-29 中国电信股份有限公司 Adaptive test method and system of network management interface test

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040221017A1 (en) * 2003-04-30 2004-11-04 International Business Machines Corporation Dynamic generator for fast-client static proxy from service interface definition document
CN1710865A (en) * 2005-06-30 2005-12-21 西安交通大学 Method for raising reliability of software system based on strucural member
CN101017447A (en) * 2007-02-13 2007-08-15 华为技术有限公司 IDE calling device and calling method therefor
CN101277301A (en) * 2008-04-24 2008-10-01 华为技术有限公司 Method and device for invocation of distributed system interface

Also Published As

Publication number Publication date
CN101277301A (en) 2008-10-01
CN101277301B (en) 2012-04-25

Similar Documents

Publication Publication Date Title
US9626215B2 (en) Virtual machine provisioning engine
US7614059B2 (en) System and method for the discovery and usage of local resources by a mobile agent object
JP2020530722A (en) PDU type setting method, UE policy setting method, and related entities
US20210297504A1 (en) Software-specific auto scaling
US20120102506A1 (en) Web service patterns for globally distributed service fabric
JP2003058517A5 (en)
WO2009129745A1 (en) A method and apparatus for interface invoking of distributed system
CN111709046A (en) User permission data configuration method, device, equipment and storage medium
KR20060051932A (en) Updating software while it is running
US9026637B2 (en) Remotely managing enterprise resources
JP6539341B2 (en) Providing router information according to the programmatic interface
US8566847B2 (en) Out-of-band host management via a management controller
CN109522055B (en) Connection preheating method and system based on distributed service calling
US8510733B2 (en) Management of a grid computing network using independent software installation packages
US20110258620A1 (en) Method and Apparatus for Making a BPM Application Available to Multiple Tenants
WO2010081361A1 (en) Method, system of equipment management, and network management server
US7735095B2 (en) Network device drivers using a communication transport
US8898330B2 (en) Server node configuration using a configuration tool
US7593917B2 (en) Implementation of application management operations
US11411812B2 (en) Dynamic service creation for microservice-based integration service
JP6562744B2 (en) System and control method
JP2002324051A (en) Method and apparatus for user identification
CN114780228B (en) Hybrid cloud resource creation method and system
JP5298055B2 (en) Device control apparatus, program, and method for controlling control target device arranged in resource
JP2003318898A (en) Dynamic snmp network device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09734842

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09734842

Country of ref document: EP

Kind code of ref document: A1