A remote calling method, device, equipment and computer readable storage medium
Patent Information
- Application Number
- CN202611160330.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-09-29
AI Technical Summary
[0004]有鉴于此,本发明的目的在于提供一种远程调用方法、装置、设备及计算机可读存储介质,解决现有技术中调用方在没有显式指定边缘地址的情况下,难以实现远程调用;以及无法准确进行远程调用的技术问题
[0016]可见,本发明通过获取远程服务接口的服务调用名称、边缘节点发现键名称和边缘连接注册关系;其中,边缘连接注册关系包括边缘节点标识与远程调用通道列表之间的对应关系;通过远程服务接口对应的代理对象接收业务接口调用,并根据边缘节点发现键名称从业务接口调用的业务方法入参中提取发现键值;其中,发现键值为定位边缘连接注册关系中的目标边缘节点的业务语义键;确定与发现键值对应的目标边缘节点标识,并根据目标边缘节点标识利用边缘连接注册关系确定可用远程调用通道列表,并根据可用远程调用通道列表确定目标远程调用通道;根据服务调用名称和业务接口调用生成远程调用请求,通过目标远程调用通道将远程调用请求发送至与目标边缘节点标识对应的目标边缘节点;接收目标边缘节点执行远程调用请求得到的执行结果,并通过代理对象将执行结果作为业务接口调用的调用结果返回。
Smart Images

Figure CN122845595A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data synchronization technology, and in particular to a remote invocation method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] Existing remote procedure call (RPC) technologies typically use service names, domain names, a list of registry instances, gateway addresses, or request parameter rules for routing. For example, ordinary RPC routing often uses service names, environment tags, domain names, service instances, or gateway addresses as the routing basis. The caller still needs to explicitly know the target service instance, and remote calls cannot be achieved if the caller does not explicitly pass in the edge connection or network address.
[0003] It is evident that improving the accuracy and comprehensiveness of remote invocation is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a remote invocation method, apparatus, device and computer-readable storage medium to solve the technical problems in the prior art where it is difficult for the caller to realize remote invocation without explicitly specifying the edge address, and the inability to accurately perform remote invocation.
[0005] To address the aforementioned technical problems, this invention provides a remote invocation method applied to a central node, comprising: Obtain the service call name, edge node discovery key name, and edge connection registration relationship of the remote service interface; wherein, the edge connection registration relationship includes the correspondence between edge node identifiers and the list of remote call channels; The proxy object corresponding to the remote service interface receives the business interface call and extracts the discovery key value from the business method input parameter of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship; Determine the target edge node identifier corresponding to the discovery key value, and determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels; A remote call request is generated based on the service call name and the business interface call, and the remote call request is sent to the target edge node corresponding to the target edge node identifier through the target remote call channel; Receive the execution result obtained by the target edge node from the remote call request, and return the execution result as the call result of the business interface call through the proxy object.
[0006] Optionally, obtain the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship, including: The system receives the edge node identifier, edge node address, and remote call channel corresponding to the edge service instance; wherein, multiple edge service instances located under the same edge node have the same edge node identifier but different edge node addresses; the edge node address is the address that identifies the edge service instance under the edge node with which a connection has been established; Generate a connection registration key based on the edge node identifier and the edge node address; When the connection registration key does not exist in the first registry, the correspondence between the connection registration key and the remote call channel is written into the first registry, the correspondence between the edge node identifier and the remote call channel is written into the second registry, and the correspondence between the remote call channel and the connection registration key is written into the third registry. The edge connection registration relationship includes the first registry, the second registry, and the third registry.
[0007] Optionally, after writing the remote call channel and the connection registration key to the third registry, the method further includes: When the target remote call channel is detected to be invalid, the target connection registration key corresponding to the target remote call channel is queried according to the third registry; The target edge node identifier and target edge node address are determined based on the target connection registration key; The edge node corresponding to the target edge node identifier is determined, and the edge service instance under the edge node that has a connection error is determined according to the target edge node address. A connection error prompt message containing the target edge node identifier and the target edge node address is generated.
[0008] Optionally, the discovery key value is extracted from the input parameters of the business method called by the business interface based on the edge node discovery key name, including: Iterate through the input parameters of the business methods called by the business interface and determine the parameter types of the parameters in the current business method input parameters; When the parameter is a basic type parameter, obtain the parameter name of the current business method input parameter; wherein, the basic type parameter includes string, number, boolean value and date; When the parameter name matches the edge node discovery key name, the parameter value under the parameter name is determined as the discovery key value.
[0009] Optionally, after iterating through the input parameters of the business methods called by the business interface and determining the parameter types of the parameters in the current business method input parameters, the method further includes: When the parameter is an object type parameter, the target field whose field name matches the edge node discovery key name is searched in the object field of the current business method input parameter through reflection. When the value of the target field is not empty, the value of the target field is determined as the discovery key value.
[0010] Optionally, determining the target remote call channel based on the list of available remote call channels includes: When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a synchronous call, a remote call channel is selected from the multiple remote call channels as the target remote call channel according to a preset channel selection strategy; wherein, during the synchronous call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is received; When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a one-way call, a remote call channel is selected from the multiple remote call channels as the target remote call channel according to the preset channel selection strategy; wherein, during the one-way call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is obtained asynchronously; When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a broadcast call, the multiple remote call channels are simultaneously used as the target remote call channels; wherein, during the broadcast call process, remote call requests are sent simultaneously through multiple target remote call channels, and execution results corresponding to multiple target edge nodes are received; When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a broadcast synchronous call, the multiple remote call channels are sequentially selected as the target remote call channels according to the preset channel order; wherein, during the broadcast synchronous call process, the first received result that meets the preset success condition is taken as the execution result.
[0011] Optionally, after receiving the business interface call through the proxy object corresponding to the remote service interface, the method further includes: When the discovery key value is not extracted from the input parameters of the business method called by the business interface, a failure result indicating the failure of discovery key resolution is generated and the failure result is returned through the proxy object; When the list of available remote call channels cannot be determined using the edge connection registration relationship based on the target edge node identifier, a failure result is generated to indicate that the target edge node is unavailable, and the failure result is returned through the proxy object.
[0012] The present invention also provides a remote invocation device, applied to a central node, comprising: The acquisition module is used to acquire the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship; wherein, the edge connection registration relationship includes the correspondence between the edge node identifier and the list of remote call channels; The discovery key value determination module is used to receive business interface calls through the proxy object corresponding to the remote service interface, and extract the discovery key value from the business method input parameters of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship; The target remote call channel determination module is used to determine the target edge node identifier corresponding to the discovery key value, determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels; The remote call module is used to generate a remote call request based on the service call name and the business interface call, and send the remote call request to the target edge node corresponding to the target edge node identifier through the target remote call channel; The call result return module is used to receive the execution result obtained by the target edge node from executing the remote call request, and return the execution result as the call result of the business interface call through the proxy object.
[0013] The present invention also provides a remote invocation device, comprising: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the remote invocation method described above.
[0014] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described remote invocation method.
[0015] The present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.
[0016] As can be seen, this invention obtains the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship; wherein, the edge connection registration relationship includes the correspondence between edge node identifiers and remote call channel lists; receives business interface calls through the proxy object corresponding to the remote service interface, and extracts the discovery key value from the business method input parameters of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship; determines the target edge node identifier corresponding to the discovery key value, and determines the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determines the target remote call channel based on the list of available remote call channels; generates a remote call request based on the service call name and business interface call, and sends the remote call request to the target edge node corresponding to the target edge node identifier through the target remote call channel; receives the execution result obtained by the target edge node executing the remote call request, and returns the execution result as the call result of the business interface call through the proxy object.
[0017] The beneficial effects of this invention are that, by using the set of business semantic keys and edge connection registration relationships, ordinary business interface calls can be automatically converted into remote calls targeting edge nodes, thereby reducing the communication overhead caused by sending requests to irrelevant edge nodes and improving the accuracy of remote call targets. Since it can be applied to application scenarios where the caller does not explicitly pass in the edge connection or network address, it can improve the comprehensiveness of the call.
[0018] In addition, the present invention also provides a remote invocation device, equipment, and computer-readable storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0020] Figure 1 A flowchart of a remote invocation method provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a remote invocation method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a remote invocation device provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a remote calling device provided in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Please refer to Figure 1 , Figure 1 A flowchart illustrating a remote invocation method provided in an embodiment of the present invention. This method is applied to a central node. The method may include: S101, obtain the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship; wherein, the edge connection registration relationship includes the correspondence between the edge node identifier and the list of remote call channels.
[0023] This embodiment is applied in a cloud-edge collaborative system where a central node calls business services on edge nodes. The remote service interface in this embodiment is the business interface used by the central node to call edge services. The service call name is used to determine the service to be called on the target edge node, such as data synchronization scheduling service, computing resource scheduling service, or power service. The edge node discovery key name in this embodiment is used to indicate which parameter or field the proxy object should extract from the business method input parameters of the business interface call as the basis for edge node discovery, in order to obtain the discovery key value. The edge connection registration relationship in this embodiment at least includes the correspondence between edge node identifiers and remote call channel lists. This embodiment does not limit the declaration method of the service call name and the edge node discovery key name. Declarations can be implemented through annotations, configuration files, or interface metadata. Preferably, the interface-level remote reference annotation includes three types of parameters: serviceName (service name), version (version number), and discoveryKey (discovery key). It should be noted that the remote service interface can also declare a service version number, which is used to identify the version of the remote service interface or edge service implementation in scenarios where services are upgraded in batches on different edge nodes.
[0024] It should be further noted that, based on any of the above embodiments, the acquisition of the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship may include: Step 1: Receive the edge node identifier, edge node address, and remote call channel corresponding to the edge service instance; where multiple edge service instances under the same edge node have the same edge node identifier but different edge node addresses; the edge node address is the address that identifies the edge service instance under the edge node with which the connection has been established. Step 2: Generate a connection registration key based on the edge node identifier and edge node address; Step 3: When the connection registration key does not exist in the first registry, write the correspondence between the connection registration key and the remote call channel into the first registry, write the correspondence between the edge node identifier and the remote call channel into the second registry, and write the correspondence between the remote call channel and the connection registration key into the third registry; wherein, the edge connection registration relationship includes the first registry, the second registry and the third registry.
[0025] In this embodiment, the connection registration key is determined by both the edge node identifier and the edge node address. The edge node identifier identifies an edge node or data center, and multiple edge service instances under the same edge node have the same edge node identifier. The edge node address distinguishes different edge service instances that establish a connection under the same edge node; therefore, different edge service instances can have different edge node addresses.
[0026] The first registry is used to record the correspondence between connection registration keys and remote call channels, and to determine whether the connection registration key already exists when an edge service instance establishes a connection. When the connection registration key does not exist in the first registry, the central node establishes the relationship between the connection registration key and the remote call channel. This embodiment does not limit the storage method of the first registry; it can use a memory key-value table or other data structures that can query remote call channels based on connection registration keys. In this embodiment, when the connection registration key already exists in the first registry, it indicates that the corresponding edge service instance has completed connection registration, and the central node retains the established registration relationship and does not write the same relationship to the first registry again. By verifying the connection registration key before writing, it is possible to distinguish between multiple edge service instances with different addresses under the same edge node and duplicate connections with the same edge node identifier and edge node address, thereby preventing duplicate registration of the same edge service instance. In this embodiment, the second registry is used to record the correspondence between edge node identifiers and remote call channels. The same edge node identifier can correspond to multiple remote call channels, and multiple remote call channels can correspond to multiple edge service instances under the same edge node. The second registry can map an edge node identifier to a list of remote call channels; or it can store multiple remote call channel records with the edge node identifier as an index. The second registry allows the central node to query the list of available remote call channels for a target edge node even with only the target edge node's identifier. In this embodiment, the third registry records the correspondence between remote call channels and connection registration keys. The mapping direction of the third registry is opposite to that of the first registry, allowing for the reverse determination of the corresponding connection registration key based on the failed remote call channel when it fails, and further identification of the edge node identifier and address where the connection anomaly occurred. By having three registry entries respectively handle connection registration verification, remote call channel querying, and reverse location of failed channels, the edge connection registration relationship can simultaneously support multi-instance channel management and connection anomaly location.
[0027] It should be further explained that, based on any of the above embodiments, after writing the remote call channel and connection registration key into the third registry, the method may further include: when a target remote call channel failure is detected, querying the target connection registration key corresponding to the target remote call channel according to the third registry; determining the target edge node identifier and target edge node address according to the target connection registration key; determining the edge node corresponding to the target edge node identifier, and determining the edge service instance under the edge node where the connection abnormality occurred according to the target edge node address, and generating connection abnormality prompt information containing the target edge node identifier and target edge node address. In this embodiment, the failure of the target remote call channel can be determined by heartbeat detection; or it can be determined when a connection abnormality occurs when sending a request or receiving a response through the target remote call channel. In this embodiment, since the third registry stores the correspondence between the remote call channel and the connection registration key, the target connection registration key can be queried in reverse according to the failed target remote call channel. The target connection registration key is generated from the target edge node identifier and target edge node address, and the target edge node identifier and target edge node address can be determined according to the target connection registration key, and the edge service instance where the connection abnormality occurred can be located accordingly. The connection abnormality prompt information generated in this embodiment can be used for alarm display; or it can be used to trigger subsequent connection maintenance processing. By using a third-party registry for reverse location, it is not necessary to traverse all edge nodes and remote call channels to determine the specific edge service instance where the anomaly occurred, thus improving the accuracy of anomaly location.
[0028] S102, receive the business interface call through the proxy object corresponding to the remote service interface, and extract the discovery key value from the business method input parameter of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship.
[0029] In this embodiment, remote service interfaces are scanned upon application startup, and proxy objects are generated for these interfaces. These proxy objects intercept business interface calls initiated using the normal local interface method. It does not need to directly obtain the edge node address or remote call channel; it only needs to pass in the business method parameters according to the remote service interface definition. This embodiment can extract discovery key values based on the edge node discovery key name. In this embodiment, the discovery key value is a business semantic key used to locate the target edge node in the edge connection registration relationship. This embodiment does not limit the specific discovery key value; the discovery key value can be an edge node identifier or a data center identifier; or it can be a device identifier, resource identifier, authorization identifier, or other business object identifier that can establish a corresponding relationship with the target edge node identifier. In this embodiment, the discovery key value is not a network connection object explicitly passed in by the caller, but rather business attribution information automatically extracted from the business method parameters.
[0030] It should be further noted that, based on any of the above embodiments, extracting the discovery key value from the input parameters of the business method called by the business interface according to the edge node discovery key name may include: S1021, iterate through the input parameters of the business methods called by the business interface, and determine the parameter type of the parameters in the current business method input parameters; S1022, when the parameter is a basic type parameter, obtain the parameter name of the current business method input parameter; where basic type parameters include string, number, boolean value and date; S1023, when the parameter name is consistent with the edge node discovery key name, the parameter value under the parameter name is determined as the discovery key value.
[0031] In this embodiment, the basic type parameters include strings, numbers, booleans, and dates. The proxy object first determines the parameter type of the parameters in the current business method's input parameters. When the parameter is a basic type parameter, it compares the parameter name with the edge node discovery key name. Only when the parameter name matches the edge node discovery key name is the parameter value under the parameter name read as the discovery key value. This embodiment does not limit the method of obtaining the parameter name; it can be obtained from the reflection metadata of the business method; or it can be obtained from the method call context formed when the proxy object intercepts the business interface call. As long as the name and corresponding parameter value of each parameter in the business method's input parameters can be determined, it is acceptable. This embodiment can directly use the parameter value as the discovery key value, and the caller does not need to manually select the connection object, improving the efficiency of determining the call connection object. For example, when the business method is queryStatus(String clientId), clientId can be used as the edge node discovery key name, and the parameter value of that parameter can be used as the discovery key value.
[0032] It should be further noted that, based on any of the above embodiments, after traversing the input parameters of the business method called by the business interface and determining the parameter type of the parameter in the current business method input parameter, it may also include: S1024, When the parameter is an object type parameter, use reflection to search for the target field whose field name matches the discovery key name of the edge node in the object field of the current business method input parameter; S1025, when the field value of the target field is not empty, determine the field value of the target field as the discovery key value.
[0033] In this embodiment, for object type parameters, the proxy object reads the field information of the object corresponding to the current business method input parameter through reflection and searches for the target field according to the edge node discovery key name. This embodiment does not limit the access method for object fields; fields can be read directly through reflection, or the field value corresponding to the target field can be read through object property access methods. For example, when the business method is operate(DeviceCommand command), the DeviceCommand object may include clientId (edge node identifier), deviceId, and command fields. The proxy object can search for the clientId field in this object and read its field value. In this embodiment, the remote call framework is compatible with two types of interface forms, improving the comprehensiveness of discovery key-value extraction.
[0034] S103, determine the target edge node identifier corresponding to the discovery key value, determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels.
[0035] In this embodiment, the discovery key is used to determine the target edge node identifier, which identifies the target edge node targeted by this service interface call. In one implementation, the discovery key can be directly the target edge node identifier; in another implementation, there is a predetermined one-to-one correspondence between the discovery key and the target edge node identifier, and the central node determines the target edge node identifier based on this correspondence. In this embodiment, the central node queries the correspondence between the edge node identifier and the remote call channel list based on the target edge node identifier to obtain the list of available remote call channels. If there is only one online edge service instance under the same target edge node, the list of available remote call channels includes one remote call channel; if multiple online edge service instances are deployed under the same target edge node, the list of available remote call channels may include multiple remote call channels.
[0036] It should be further noted that, based on any of the above embodiments, determining the target remote call channel according to the list of available remote call channels may include: S1031, when the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a synchronous call, a remote call channel is selected from the multiple remote call channels as the target remote call channel according to the preset channel selection strategy; wherein, during the synchronous call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is received; S1032, when the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a one-way call, a remote call channel is selected from the multiple remote call channels as the target remote call channel according to the preset channel selection strategy; wherein, during the one-way call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is obtained asynchronously; S1033, when the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a broadcast call, multiple remote call channels are used as target remote call channels simultaneously; wherein, during the broadcast call process, remote call requests are sent simultaneously through multiple target remote call channels, and execution results corresponding to multiple target edge nodes are received; S1034, when the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a broadcast synchronous call, the multiple remote call channels are selected as target remote call channels in sequence according to the preset channel order; wherein, in the broadcast synchronous call process, the first received result that meets the preset success condition is taken as the execution result.
[0037] In this embodiment, synchronous calls require obtaining the execution result of the edge service. Therefore, when the list of available remote call channels includes multiple remote call channels, a channel can be selected based on a random selection strategy, a round-robin selection strategy, a weighted selection strategy, or other preset channel selection strategies. Broadcast calls require sending requests to multiple edge service instances under the same target edge node. Therefore, multiple remote call channels can be used simultaneously as target remote call channels. This embodiment does not limit the preset channel selection strategy. The preset channel selection strategy can be a random selection strategy, giving multiple edge service instances a chance to be selected; or it can be a round-robin selection strategy, selecting remote call channels sequentially according to a preset order; or it can be a weighted selection strategy, selecting remote call channels according to the weights corresponding to each edge service instance; or it can be a load balancing strategy. It should be noted that, in addition to synchronous calls and broadcast calls, remote calls can also include one-way calls and broadcast synchronous calls. A one-way call can select a remote call channel from the list of available remote call channels to send a request, and does not wait for the business execution result after completing the request. A broadcast synchronous call can try multiple remote call channels sequentially according to the channel order in the list of available remote call channels, and stops trying when an edge service instance returns a successful result. This embodiment does not limit the method for determining the success of broadcast synchronous calls. It can be based on whether the remote call response indicates successful execution, or on whether the business return result meets preset success conditions. This embodiment can improve the accuracy of identifying the target remote call channel.
[0038] It should be further explained that, based on any of the above embodiments, after receiving the business interface call through the proxy object corresponding to the remote service interface, the process may further include: when the discovery key value is not extracted from the business method input parameters of the business interface call, generating a failure result indicating that the discovery key resolution failed, and returning the failure result through the proxy object; when the list of available remote call channels cannot be determined based on the target edge node identifier using the edge connection registration relationship, generating a failure result indicating that the target edge node is unavailable, and returning the failure result through the proxy object. In this embodiment, when the discovery key value is not extracted, the central node cannot determine the target edge node based on the business method input parameters and needs to return a failure result indicating that the discovery key resolution failed. In this embodiment, when the list of available remote call channels cannot be determined based on the target edge node identifier, it indicates that the target edge node has not currently established a remote call channel or the established channel is unavailable, and a failure result indicating that the target edge node is unavailable needs to be returned. By completing the discovery key value and channel availability verification before sending the remote call request, business interface calls without a target or with an unavailable target will not blindly enter the network sending process. This embodiment does not limit the form of the failure result. A response object including the reason for failure can be returned by the proxy object; or the proxy object can throw out abnormal information that can characterize the failure of discovery key resolution or the unavailability of the target edge node.
[0039] S104: Generate a remote call request based on the service call name and business interface call, and send the remote call request to the target edge node corresponding to the target edge node identifier through the target remote call channel.
[0040] In this embodiment, the method name, parameter type, parameter name, and parameter value can be obtained based on the business interface call, and the service call name, method name, parameter type, parameter name, and parameter value are encapsulated into a remote call request. The service call name is used by the target edge node to determine the target service, the method name and parameter type are used by the target edge node to determine the target method in the target service module, and the parameter value is used to execute the target method. In this embodiment, after receiving the remote call request, the target edge node searches for the local service implementation based on the service call name, determines the corresponding method based on the method name and parameter type, and then passes the parameter value to the method and executes it. The service implementation in the target edge node can be data synchronization scheduling, computing resource scheduling, power service, or other edge services. This embodiment does not limit the way the target edge node searches for the local service implementation; it can search for the corresponding service implementation from the local service registry based on the service call name; or it can determine the corresponding service implementation based on the pre-established mapping relationship between service call names and service implementations. The key is to be able to locate the edge service that executes the remote call request based on the service call name.
[0041] It should be noted that the remote call channel supports bidirectional communication. The above embodiment mainly illustrates the example of a central node calling a service in a target edge node. In other embodiments, the edge node can also send a remote call request to the central node through an established remote call channel. The central node determines and executes the corresponding central-side service method based on the service call name and business interface call information in the request, and then returns the execution result to the edge node through the remote call channel.
[0042] S105 receives the execution result obtained from the remote call request of the target edge node, and returns the execution result as the call result of the business interface through the proxy object.
[0043] This embodiment returns an execution result, which can be a single result or multiple results. For example, in a synchronous call scenario, the central node waits for the target edge node to return the execution result through the target remote call channel. After receiving the execution result, the proxy object converts the remote call response into the result of the business interface call, so that the business caller perceives it as still a normal interface call. In broadcast or one-way call scenarios, it is not necessary to wait for each edge service instance to return the business execution result.
[0044] In this embodiment, the execution result can be encapsulated as a remote call response and returned to the central node. After receiving the response, the proxy layer returns the result to the original business caller, so that the caller perceives it as a normal interface call.
[0045] This invention provides a remote invocation method, which may include: S101, obtaining the service invocation name of a remote service interface, the edge node discovery key name, and the edge connection registration relationship; wherein, the edge connection registration relationship includes the correspondence between edge node identifiers and a list of remote invocation channels; S102, receiving a business interface call through a proxy object corresponding to the remote service interface, and extracting a discovery key value from the business method input parameters of the business interface call according to the edge node discovery key name; wherein, the discovery key value is a business semantic key for locating the target edge node in the edge connection registration relationship; S103, determining the target edge node identifier corresponding to the discovery key value, and determining a list of available remote invocation channels based on the target edge node identifier using the edge connection registration relationship, and determining the target remote invocation channel based on the list of available remote invocation channels; S104, generating a remote invocation request based on the service invocation name and the business interface call, and sending the remote invocation request to the target edge node corresponding to the target edge node identifier through the target remote invocation channel; S105: Receive the execution result obtained from the remote call request from the target edge node, and return the execution result as the call result of the business interface through the proxy object. This embodiment of the invention automatically converts the input parameters of the business method into discovery keys for remote calls, and locates the edge connection channel through the discovery keys. This avoids the caller manually specifying the edge address or broadcasting calls to all edge nodes, thereby supporting low-intrusion access of existing business interfaces to the cloud-edge RPC framework and adapting to changes in the online status of edge nodes, multiple connections to the same node, and different call types, thus improving the accuracy and comprehensiveness of remote calls.
[0046] For a clearer understanding of this invention, please refer to the following details. Figure 2 , Figure 2 A flowchart illustrating a remote invocation method provided in this embodiment of the invention may specifically include: Step 1: Declare the service call name, version number, and edge node discovery key name on the remote service interface.
[0047] In this embodiment, the version number is the service version number. The edge node discovery key name in this embodiment is used to declare which parameter or field to extract from the business method input parameters as the routing basis. For example, clientId (edge node identifier), license (authorization information), roomCode (room code), deviceId (device identifier), or resourceId (resource identifier). The service call name and version number in this embodiment are used to locate the specific service implementation on the edge node side, avoiding confusion between service calls of different versions.
[0048] Step 2: When the business system starts up, it scans remote service interfaces and generates corresponding proxy objects.
[0049] Step 3: The caller invokes the proxy object in the manner of a normal business interface and passes in the business method parameters.
[0050] In this embodiment, the caller does not need to be aware of the underlying connection and node address when calling the proxy object. The proxy layer automatically completes parameter reading, request encapsulation, discovery key extraction, and remote call sending.
[0051] Step 4: The proxy layer reads the input parameters of the business method; if the discovery key name of the edge node is not empty, the discovery key extraction will begin.
[0052] Step 5: For basic type parameters, the proxy layer checks whether the parameter name is equal to the discovery key name. If they are equal, the parameter value is taken as the discovery key value.
[0053] Step six: For object type parameters, the proxy layer searches for a field in the object fields that matches the discovery key name. If found, the field value is read as the discovery key value.
[0054] In this embodiment, for basic type parameters, the edge node discovery key name is matched by the parameter name; for object type parameters, the edge node discovery key name is matched by the field name, and the field value is read. For example, when the method parameter is a string, number, boolean, date, or other basic type, if the parameter name matches the discovery key name, the parameter value is the discovery key. When the method parameter is an object type, the system uses reflection to find the field that matches the discovery key name. If the field exists and its value is not empty, the field value is used as the discovery key value.
[0055] Step 7: The proxy layer constructs a remote call request based on the service call name, version, method name, parameter name, parameter type, and parameter value.
[0056] Step 8: The proxy layer passes the discovery key to the edge connection registration relationship and queries the list of available remote call channels corresponding to the discovery key.
[0057] In this embodiment, the edge connection registration relationship is used to maintain connection channels according to the edge node's identity after the edge node connects to the center. One edge node identity can correspond to one or more connection channels to adapt to edge service clusters or multi-connection scenarios. This embodiment can query the edge connection registration relationship based on the discovery key value and return a list of available connection channels. If no connection is found, an explicit error is returned to avoid remote calls entering a targetless state. The edge connection registration relationship in this embodiment includes a connection registration key, which includes at least the edge client identifier and may also include the edge client address. The same client identifier can correspond to multiple connection channels.
[0058] Step 9: If the list of available remote call channels is empty, return an error result indicating that the target client was not found or the target is unavailable.
[0059] Step 10: If the list of available remote call channels is not empty, select the target connection based on the call type and load balancing strategy, or send a broadcast request to multiple connections.
[0060] The load balancing selection strategy in this embodiment is used to select a target channel among multiple available remote call channels, or to send requests to multiple channels in a broadcast call.
[0061] Step 11: The central node sends a remote call request through the target connection. After receiving the request, the edge node finds the service implementation and executes the target method.
[0062] This embodiment converts business calls into remote call requests and sends them to the edge node via the target connection channel. On the edge node side, it locates the service implementation based on the service name, version, and method information, executes the corresponding method, and returns the result. The remote call types in this embodiment include synchronous calls, one-way calls, broadcast calls, and broadcast-synchronous calls. Different call types reuse the same discovery key extraction and connection discovery mechanism. In this embodiment, when the discovery key value cannot be resolved or no corresponding connection is found, a clear error result is returned, facilitating the caller's identification that the target edge node is unavailable.
[0063] Step 12: The edge node returns the execution result to the central node, and the proxy layer then returns the result to the business caller.
[0064] Specifically, suppose in a cloud-edge collaboration platform, the central node needs to call the device control service on the edge node. A remote call connection has been established between the edge node and the central node. When the edge node logs in, it registers its client identifier and connection address with the central node's connection registry. The central side (central node) defines a remote service interface and declares the service name, version number, and discovery key name on the interface. For example, the service name is Device Control Service, the version number is 1.0, and the discovery key name is clientId. The system scans this interface at startup and generates a proxy object for it. When the business code calls control(String clientId, String deviceId, String command), the proxy layer recognizes the discovery key name as clientId and checks the method parameters. Since the first parameter name matches the discovery key name, the proxy layer directly uses this parameter value as the discovery key. Subsequently, the proxy layer constructs a remote call request and uses the discovery key to query the connection registry for available edge connections. If a connection channel corresponding to clientId is found, a channel is selected to send the request through a load balancing strategy. In another calling method, the business code calls control(DeviceCommand command). The DeviceCommand object contains fields such as clientId, deviceId, and command. After the proxy layer discovers that the method parameter is an object type, it uses reflection to find the clientId field in the object and reads its value as the discovery key. Subsequent connection discovery, load balancing, and request sending processes are consistent with the scenario for basic type parameters. If the central node cannot find an available connection based on the discovery key, it indicates that the target edge node is currently not connected or the connection has expired. At this point, the system no longer blindly broadcasts requests but returns an error result indicating that the client was not found or the target is unavailable. The business caller can use this to indicate that the edge node is offline or trigger a subsequent retry process. If the same clientId corresponds to multiple connection channels, such as multiple edge service instances deployed in the same data center, the connection registry returns multiple available connections. For synchronous calls, the system selects one connection to execute the call based on the load balancing strategy; for broadcast calls, the system can send a one-way request to all connections; for broadcast synchronous calls, the system can try multiple connections sequentially until one connection returns a valid result. After receiving a remote call request, the edge node finds the local service implementation based on the service name and version number, and then executes the target method based on the method name, parameter type, and parameter value. The execution result is encapsulated as a remote call response and returned to the central node. After receiving the response, the proxy layer returns the result to the original business caller, so that the caller perceives it as a normal interface call.
[0065] Through the above implementation, this invention automatically converts the edge affiliation information in the business parameters into a remote call discovery key, and locates the edge connection channel through the discovery key, avoiding the caller manually specifying the edge address or broadcasting calls to all edge nodes. This solution can support low-intrusion access of existing business interfaces to the cloud-edge RPC framework and adapt to changes in the online status of edge nodes, multiple connections to the same node, and different call types.
[0066] The beneficial effects of this invention are as follows: (1) When the caller does not explicitly pass in the edge connection or network address, the discovery key value used to locate the edge node can be automatically obtained from the input parameters of the business method. (2) It can be compatible with two common business interface forms: simple parameters and object parameters, so that the discovery key can come from either basic type parameters or object fields. (3) The discovery key value can be associated with the edge connection registration relationship to automatically obtain the callable edge connection channel. (4) It can return a clear failure result when the target edge node is unavailable, avoiding blindly sending call requests. (5) The same proxy and discovery mechanism can be reused among synchronous calls, one-way calls, broadcast calls, and broadcast-synchronous calls.
[0067] The following describes a remote invocation device provided by an embodiment of the present invention. The remote invocation device described below can be referred to in correspondence with the remote invocation method described above.
[0068] Please refer to the details. Figure 3 , Figure 3 This is a schematic diagram of a remote invocation device provided in an embodiment of the present invention. The remote invocation device is applied to a central node and may include: The acquisition module 100 is used to acquire the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship; wherein, the edge connection registration relationship includes the correspondence between the edge node identifier and the remote call channel list; The discovery key value determination module 200 is used to receive business interface calls through the proxy object corresponding to the remote service interface, and extract the discovery key value from the business method input parameters of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship; The target remote call channel determination module 300 is used to determine the target edge node identifier corresponding to the discovery key value, and determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels; The remote call module 400 is used to generate a remote call request based on the service call name and the business interface call, and send the remote call request to the target edge node corresponding to the target edge node identifier through the target remote call channel; The call result return module 500 is used to receive the execution result obtained by the target edge node in executing the remote call request, and return the execution result as the call result of the business interface call through the proxy object.
[0069] Furthermore, based on any of the above embodiments, the acquisition module 100 may include: The registration information receiving unit is used to receive the edge node identifier, edge node address, and remote call channel corresponding to the edge service instance; wherein, multiple edge service instances located under the same edge node have the same edge node identifier, but different edge node addresses; the edge node address is the address that identifies the edge service instance that has established a connection under the edge node; A connection registration key generation unit is used to generate a connection registration key based on the edge node identifier and the edge node address; The registry writing unit is used to write the correspondence between the connection registration key and the remote call channel into the first registry when the connection registration key does not exist in the first registry, write the correspondence between the edge node identifier and the remote call channel into the second registry, and write the correspondence between the remote call channel and the connection registration key into the third registry; wherein the edge connection registration relationship includes the first registry, the second registry and the third registry.
[0070] Furthermore, based on any of the above embodiments, the remote invocation device may further include: The target connection registration key determination unit is used to query the target connection registration key corresponding to the target remote call channel according to the third registry when the target remote call channel is detected to be invalid. The target edge node address determination unit is used to determine the target edge node identifier and the target edge node address based on the target connection registration key; The connection error message determination unit is used to determine the edge node corresponding to the target edge node identifier, and determine the edge service instance under the edge node where the connection error occurred based on the target edge node address, and generate connection error message containing the target edge node identifier and the target edge node address.
[0071] Furthermore, based on any of the above embodiments, the key value determination module 200 may include: The parameter traversal unit is used to traverse the input parameters of the business method called by the business interface and determine the parameter type of the current input parameter of the business method. The basic type parameter processing unit is used to obtain the parameter name of the current business method input parameter when the parameter is a basic type parameter; wherein, the basic type parameter includes string, number, boolean value and date; when the parameter name is consistent with the edge node discovery key name, the parameter value under the parameter name is determined as the discovery key value; The object type parameter processing unit is used to search for a target field whose field name matches the edge node discovery key name in the object field of the current business method input parameter when the parameter is an object type parameter; and to determine the field value of the target field as the discovery key value when the field value of the target field is not empty.
[0072] Furthermore, based on any of the above embodiments, the target remote call channel determination module 300 may include: The synchronous call channel determination unit is used to select a remote call channel from the multiple remote call channels as the target remote call channel according to a preset channel selection strategy when the list of available remote call channels includes multiple remote call channels and the call type corresponding to the business interface call is a synchronous call; wherein, during the synchronous call process, a remote call request is sent through the target remote call channel and the execution result returned by the target edge node is received; A one-way call channel determination unit is used to select a remote call channel from the multiple remote call channels as the target remote call channel according to the preset channel selection strategy when the list of available remote call channels includes multiple remote call channels and the call type corresponding to the business interface call is a one-way call; wherein, during the one-way call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is obtained asynchronously; The broadcast call channel determination unit is used to simultaneously use multiple remote call channels as the target remote call channels when the list of available remote call channels includes multiple remote call channels and the call type corresponding to the business interface call is a broadcast call; wherein, during the broadcast call process, remote call requests are sent simultaneously through multiple target remote call channels, and execution results corresponding to multiple target edge nodes are received; The broadcast synchronization channel determination unit is used to determine the target remote call channel in sequence according to a preset channel order when the list of available remote call channels includes multiple remote call channels and the call type corresponding to the business interface call is a broadcast synchronization call; wherein, during the broadcast synchronization call process, the first received result that meets the preset success condition is taken as the execution result.
[0073] Furthermore, based on any of the above embodiments, the remote invocation device may further include: The first failure result return module is used to generate a failure result indicating the failure of discovery key resolution when the discovery key value is not extracted from the input parameters of the business method called by the business interface, and return the failure result through the proxy object; The second failure result return module is used to generate a failure result indicating that the target edge node is unavailable when the list of available remote call channels cannot be determined by using the edge connection registration relationship based on the target edge node identifier, and to return the failure result through the proxy object.
[0074] It should be noted that the order of the modules and units in the aforementioned remote invocation device can be changed without affecting the logic.
[0075] This invention provides a remote invocation device, which may include: an acquisition module 100, configured to acquire the service invocation name of a remote service interface, an edge node discovery key name, and an edge connection registration relationship; wherein the edge connection registration relationship includes a correspondence between edge node identifiers and a list of remote invocation channels; a discovery key value determination module 200, configured to receive a business interface call through a proxy object corresponding to the remote service interface, and extract a discovery key value from the business method input parameters of the business interface call according to the edge node discovery key name; wherein the discovery key value is a business semantic key for locating a target edge node in the edge connection registration relationship; and a target remote invocation channel determination module 300, configured to determine the target remote invocation channel. The invention automatically converts the business method input parameters into a remote call discovery key value and locates the edge connection channel using the discovery key value. This avoids the caller manually specifying the edge address or broadcasting calls to all edge nodes. This enables low-intrusion access to the cloud-edge RPC framework for existing business interfaces and adapts to changes in edge node online status, multiple connections to the same node, and different call types, thereby improving the accuracy and comprehensiveness of remote calls. A remote call module 400 generates a remote call request based on the service call name and the business interface call, and sends the remote call request to the target edge node corresponding to the target edge node identifier through the target remote call channel. A call result return module 500 receives the execution result obtained by the target edge node executing the remote call request and returns the execution result as the call result of the business interface call through the proxy object.
[0076] The following describes a remote invocation device provided by an embodiment of the present invention. The remote invocation device described below can be referred to in correspondence with the remote invocation method described above.
[0077] Please refer to Figure 4 , Figure 4 A schematic diagram of a remote calling device provided in an embodiment of the present invention may include: Memory 10 is used to store computer programs; Processor 20 is used to execute computer programs to implement the remote invocation method described above.
[0078] The memory 10, processor 20, and communication interface 30 all communicate with each other through the communication bus 40.
[0079] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment of the invention, the memory 10 may store programs for implementing the following functions: Obtain the service call name, edge node discovery key name, and edge connection registration relationship of the remote service interface; wherein, the edge connection registration relationship includes the correspondence between edge node identifiers and the list of remote call channels; The business interface call is received through the proxy object corresponding to the remote service interface, and the discovery key value is extracted from the input parameter of the business method of the business interface call according to the edge node discovery key name; where the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship. Determine the target edge node identifier corresponding to the discovery key value, and determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels; A remote call request is generated based on the service call name and business interface call, and the remote call request is sent to the target edge node corresponding to the target edge node identifier through the target remote call channel; Receive the execution result obtained from the remote call request from the target edge node, and return the execution result as the call result of the business interface through the proxy object.
[0080] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.
[0081] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.
[0082] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.
[0083] The communication interface 30 can be an interface for the communication module, used to connect with other devices or systems.
[0084] Of course, it should be noted that, Figure 4 The structure shown does not constitute a limitation on the remote invocation device in the embodiments of the present invention. In practical applications, the remote invocation device may include more than Figure 4 Show more or fewer parts, or combine certain parts.
[0085] The following describes the computer-readable storage medium provided in the embodiments of the present invention. The computer-readable storage medium described below can be referred to in correspondence with the remote invocation method described above.
[0086] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described remote invocation method.
[0087] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0088] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0089] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0090] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0091] The foregoing has provided a detailed description of a remote invocation method, apparatus, device, and computer-readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A remote invocation method, characterized in that, Applied to the central node, including: Obtain the service call name, edge node discovery key name, and edge connection registration relationship of the remote service interface; wherein, the edge connection registration relationship includes the correspondence between edge node identifiers and the list of remote call channels; The proxy object corresponding to the remote service interface receives the business interface call and extracts the discovery key value from the business method input parameter of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship; Determine the target edge node identifier corresponding to the discovery key value, and determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels; A remote call request is generated based on the service call name and the business interface call, and the remote call request is sent to the target edge node corresponding to the target edge node identifier through the target remote call channel; Receive the execution result obtained by the target edge node from the remote call request, and return the execution result as the call result of the business interface call through the proxy object.
2. The remote invocation method according to claim 1, characterized in that, Obtain the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship, including: The system receives the edge node identifier, edge node address, and remote call channel corresponding to the edge service instance; wherein, multiple edge service instances located under the same edge node have the same edge node identifier but different edge node addresses; the edge node address is the address that identifies the edge service instance under the edge node with which a connection has been established; Generate a connection registration key based on the edge node identifier and the edge node address; When the connection registration key does not exist in the first registry, the correspondence between the connection registration key and the remote call channel is written into the first registry, the correspondence between the edge node identifier and the remote call channel is written into the second registry, and the correspondence between the remote call channel and the connection registration key is written into the third registry. The edge connection registration relationship includes the first registry, the second registry, and the third registry.
3. The remote invocation method according to claim 2, characterized in that, After writing the remote call channel and the connection registration key into the third registry, the process also includes: When the target remote call channel is detected to be invalid, the target connection registration key corresponding to the target remote call channel is queried according to the third registry; The target edge node identifier and target edge node address are determined based on the target connection registration key; The edge node corresponding to the target edge node identifier is determined, and the edge service instance under the edge node that has a connection error is determined according to the target edge node address. A connection error prompt message containing the target edge node identifier and the target edge node address is generated.
4. The remote invocation method according to any one of claims 1 to 3, characterized in that, Extract the discovery key value from the input parameters of the business method called by the business interface based on the edge node discovery key name, including: Iterate through the input parameters of the business methods called by the business interface and determine the parameter types of the parameters in the current business method input parameters; When the parameter is a basic type parameter, obtain the parameter name of the current business method input parameter; wherein, the basic type parameter includes string, number, boolean value and date; When the parameter name matches the edge node discovery key name, the parameter value under the parameter name is determined as the discovery key value.
5. The remote invocation method according to claim 4, characterized in that, After iterating through the input parameters of the business methods called by the business interface and determining the parameter types of the parameters in the current business method input parameters, the process also includes: When the parameter is an object type parameter, the target field whose field name matches the edge node discovery key name is searched in the object field of the current business method input parameter through reflection. When the value of the target field is not empty, the value of the target field is determined as the discovery key value.
6. The remote invocation method according to claim 1, characterized in that, Determining the target remote call channel based on the list of available remote call channels includes: When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a synchronous call, a remote call channel is selected from the multiple remote call channels as the target remote call channel according to a preset channel selection strategy; wherein, during the synchronous call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is received; When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a one-way call, a remote call channel is selected from the multiple remote call channels as the target remote call channel according to the preset channel selection strategy; wherein, during the one-way call process, a remote call request is sent through the target remote call channel, and the execution result returned by the target edge node is obtained asynchronously; When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a broadcast call, the multiple remote call channels are simultaneously used as the target remote call channels; wherein, during the broadcast call process, remote call requests are sent simultaneously through multiple target remote call channels, and execution results corresponding to multiple target edge nodes are received; When the list of available remote call channels includes multiple remote call channels, and the call type corresponding to the business interface call is a broadcast synchronous call, the multiple remote call channels are sequentially selected as the target remote call channels according to the preset channel order; wherein, during the broadcast synchronous call process, the first received result that meets the preset success condition is taken as the execution result.
7. The remote invocation method according to claim 1, characterized in that, After receiving the business interface call through the proxy object corresponding to the remote service interface, the process also includes: When the discovery key value is not extracted from the input parameters of the business method called by the business interface, a failure result indicating the failure of discovery key resolution is generated and the failure result is returned through the proxy object; When the list of available remote call channels cannot be determined using the edge connection registration relationship based on the target edge node identifier, a failure result is generated to indicate that the target edge node is unavailable, and the failure result is returned through the proxy object.
8. A remote dispatching device, characterized in that, Applied to the central node, including: The acquisition module is used to acquire the service call name of the remote service interface, the edge node discovery key name, and the edge connection registration relationship; wherein, the edge connection registration relationship includes the correspondence between the edge node identifier and the list of remote call channels; The discovery key value determination module is used to receive business interface calls through the proxy object corresponding to the remote service interface, and extract the discovery key value from the business method input parameters of the business interface call according to the edge node discovery key name; wherein, the discovery key value is the business semantic key for locating the target edge node in the edge connection registration relationship; The target remote call channel determination module is used to determine the target edge node identifier corresponding to the discovery key value, determine the list of available remote call channels based on the target edge node identifier using the edge connection registration relationship, and determine the target remote call channel based on the list of available remote call channels; The remote call module is used to generate a remote call request based on the service call name and the business interface call, and send the remote call request to the target edge node corresponding to the target edge node identifier through the target remote call channel; The call result return module is used to receive the execution result obtained by the target edge node from executing the remote call request, and return the execution result as the call result of the business interface call through the proxy object.
9. A remote invocation device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the remote invocation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the remote invocation method as described in any one of claims 1 to 7.