Service calling method and device, computer equipment and storage medium
By sending version information and determining the set of interfaces during the service handshake phase, compatibility issues in cross-platform intelligent connection scenarios are resolved, enabling efficient business calls and code reuse, and improving software performance and development efficiency.
Patent Information
- Application Number
- CN202410612970.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2025-11-18
AI Technical Summary
In cross-platform intelligent interconnection scenarios, the compatibility issues between services are serious, resulting in a significant impact on software performance and a large workload for developers. Code is difficult to reuse, and each business call requires version information lookup, generating traffic and time overhead.
By sending version information during the handshake phase, a connection channel is established, and the set of interfaces is determined based on the version, achieving forward and backward compatibility and avoiding duplicate version queries.
It reduces traffic and time overhead during software operation, improves performance and code reusability, reduces developer workload, and increases development flexibility and interaction efficiency.
Smart Images

Figure CN120973403A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of cross-service interaction, and particularly relates to a business calling method and device, a computer device and a storage medium. BACKGROUND
[0002] With the continuous progress of technology and the popularity of intelligent devices, people hope to achieve seamless connection and interaction between multiple devices, which leads to the demand for business calling between services. For example, in the cross-end intelligent connection scenario, a service or device can act as a client and a server, and the managers of these services or devices are users. Developers cannot synchronously manage or upgrade these services or devices, which leads to serious compatibility problems.
[0003] In the related art, the software needs to call the version information query once every time the business is called, which will cause huge traffic and time overhead, affecting the software performance. At the same time, services are often running on different platforms, so developers need to adapt the version information query on different platforms. Each platform needs to be independently programmed, tested and debugged, which is a large workload and the code is difficult to reuse. SUMMARY
[0004] To overcome the problems in the related art, the present disclosure provides a business calling method, device, computer device and storage medium.
[0005] The first aspect of the present disclosure provides a business calling method, which comprises:
[0006] In the handshake phase, a connection establishment request is sent to a first service, and a first version returned by the first service to a second service is received;
[0007] Based on the first version, a first interface set is determined;
[0008] The connection establishment request is used to establish a connection channel between the first service and the second service, the first version represents the current version information of the first service, and the first interface set is used to call the business provided by the first service.
[0009] Optionally, the connection establishment request sent to the first service comprises:
[0010] In the handshake phase, a connection establishment request is sent to a first service and a second version is sent to the first service, so that the first service interacts with the second service based on the interaction mode corresponding to the second version in the case that the business is called by the second service, wherein the second version represents the current version information of the second service.
[0011] Optionally, the method further includes:
[0012] The second version is determined based on predefined metadata.
[0013] Optionally, the second service stores a set of first interfaces corresponding to at least one version of the first service, wherein at least one version of the first service includes versions of the first service that were released earlier than the second version.
[0014] Based on the first version, a first set of interfaces is determined, including:
[0015] Based on the first version, determine the first interface set corresponding to the first version in the first interface set corresponding to at least one version of the first service.
[0016] Optionally, the method further includes:
[0017] Receive connection confirmation information sent by the first service to the second service to establish a connection channel between the first service and the second service.
[0018] A second aspect of this disclosure provides a business invocation method, the method comprising:
[0019] Receive a connection establishment request from the second service to begin the handshake phase;
[0020] During the handshake phase, a first version is sent to the second service so that the second service can determine a first interface set based on the first version;
[0021] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0022] Optionally, receiving the connection establishment request sent by the second service includes:
[0023] The system receives a connection establishment request and a second version sent by the second service, and interacts with the second service based on the interaction method corresponding to the second version when the service is invoked by the second service. The second version represents the current version information of the second service.
[0024] Optionally, when the service is invoked by the second service, interacting with the second service based on the interaction method corresponding to the second version includes:
[0025] When a service is invoked by the second service, the service is provided to the second service based on the information format corresponding to the second version.
[0026] Optionally, when the service is invoked by the second service, interacting with the second service based on the interaction method corresponding to the second version includes:
[0027] When the service is invoked by the second service, the service corresponding to the second version is provided to the second service.
[0028] Optionally, the method further includes:
[0029] Based on the second version, a second set of interfaces is determined, and the second set of interfaces is used to call the services provided by the second service.
[0030] A third aspect of this disclosure provides a service invocation apparatus, the apparatus comprising:
[0031] The connection request module is used to send a connection establishment request to the first service during the handshake phase and receive the first version returned by the first service to the second service.
[0032] The interface set determination module is used to determine the first interface set based on the first version;
[0033] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0034] Optionally, when sending a connection establishment request to the first service, the connection request module is used to:
[0035] During the handshake phase, a connection establishment request is sent to the first service and a second version is sent to the first service, so that when the business is called by the second service, the first service can interact with the second service based on the interaction method corresponding to the second version, wherein the second version represents the current version information of the second service.
[0036] Optionally, the device further includes:
[0037] The metadata parsing module is used to determine the second version based on predefined metadata.
[0038] Optionally, the second service stores a set of first interfaces corresponding to at least one version of the first service, wherein at least one version of the first service includes versions of the first service that were released earlier than the second version.
[0039] The interface set determination module, when determining the first interface set based on the first version, is used for:
[0040] Based on the first version, determine the first interface set corresponding to the first version in the first interface set corresponding to at least one version of the first service.
[0041] Optionally, the device further includes:
[0042] The connection confirmation receiving module is used to receive connection confirmation information sent by the first service to the second service, so as to establish a connection channel between the first service and the second service.
[0043] A fourth aspect of this disclosure provides a service invocation apparatus, the apparatus comprising:
[0044] The connection request receiving module is used to receive connection establishment requests sent by the second service to begin the handshake phase;
[0045] A first version sending module is used to send a first version to the second service during the handshake phase, so that the second service determines a first interface set based on the first version;
[0046] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0047] Optionally, when the connection request receiving module receives the connection establishment request sent by the second service, it is used to:
[0048] The system receives a connection establishment request and a second version sent by the second service, and interacts with the second service based on the interaction method corresponding to the second version when the service is invoked by the second service. The second version represents the current version information of the second service.
[0049] Optionally, the connection request receiving module is used to, when interacting with the second service based on the interaction method corresponding to the second version, in the case where the service is invoked by the second service, perform the following:
[0050] When a service is invoked by the second service, the service is provided to the second service based on the information format corresponding to the second version.
[0051] Optionally, the connection request receiving module is used to, when interacting with the second service based on the interaction method corresponding to the second version, in the case where the service is invoked by the second service, perform the following:
[0052] When the service is invoked by the second service, the service corresponding to the second version is provided to the second service.
[0053] Optionally, the device further includes:
[0054] The preparation module is invoked to determine the second set of interfaces based on the second version. The second set of interfaces is used to invoke the services provided by the second service.
[0055] The fifth aspect of this disclosure provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the method described in the first or second aspect.
[0056] A sixth aspect of this disclosure provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in the first or second aspect.
[0057] The seventh aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in the first or second aspect.
[0058] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0059] In this embodiment, the second service sends a connection establishment request to the first service and receives a first version sent by the first service in response to the connection establishment request. Next, based on the first version, a first interface set is determined. The connection establishment request is used to establish a connection channel between the first service and the second service; the first version represents the current version information of the first service; and the first interface set is used to call the services provided by the first service. In this embodiment, different services can complete the transmission of version information during the connection establishment process, enabling the second service to directly call the services provided by the first service. This ensures forward and backward compatibility while eliminating the need to deploy a unified version query interface for different platforms and versions. Therefore, the implementation method provided by this disclosure significantly reduces the huge overhead in terms of traffic and time during software operation, improving software performance; at the same time, it significantly reduces the workload of developers and improves code reusability.
[0060] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0061] The accompanying drawings, which are incorporated in and form part of this disclosure, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0062] Figure 1 These are application scenario diagrams illustrating a business invocation method using some exemplary embodiments.
[0063] Figure 2 This is a flowchart illustrating a business invocation method using some exemplary embodiments.
[0064] Figure 3 These are schematic diagrams illustrating the steps of a business invocation method using some exemplary embodiments.
[0065] Figure 4 This is a multi-party interaction diagram illustrating a business invocation method using some exemplary embodiments.
[0066] Figure 5 This is a block diagram illustrating a service invocation device using some exemplary embodiments.
[0067] Figure 6 This is a block diagram illustrating another service invocation device, as shown in some exemplary embodiments.
[0068] Figure 7 These are hardware structure diagrams of a computer device illustrating some exemplary embodiments. Detailed Implementation
[0069] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0070] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0071] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0072] With the continuous advancement of technology and the widespread adoption of smart devices, people desire seamless connectivity and interactive operation across multiple devices, leading to the need for business calls between services. For example, in cross-device intelligent interconnection scenarios, a service or device often acts as both a client and a server, and the administrators of these services or devices are all users. Developers cannot synchronously manage or upgrade these services or devices, resulting in significant compatibility issues.
[0073] In related technologies, software needs to query version information every time a business call is made, which will generate huge overhead in terms of traffic and time, affecting software performance. At the same time, services often run on different platforms, so developers need to adapt the version information query for different platforms. Developers of different platforms need to negotiate a unified version query interface, and the code is difficult to reuse. Each platform requires independent testing and debugging.
[0074] In view of this, this disclosure provides a service invocation method, apparatus, computer device, and storage medium. The following will first combine... Figure 1 The schematic diagram shown illustrates the application background of this disclosure.
[0075] In this disclosure, "service" is a logical concept, specifically referring to a collection of one or more user-facing software services. For example, a service can be a software service provided by a process, a thread, or a terminal, which has the function of calling services provided by other software services or providing services to other software services. In scenarios involving service calls (services can refer to a collection of underlying information interactions oriented towards services), users typically interact directly with client-side services. The software service responsible for direct interaction with the user can be called the second service (i.e., the client), and the software service responsible for providing services can be called the first service (i.e., the server). The second service provides services to the user by calling services provided by the first service (e.g., triggering a function of the first service, calling an algorithm of the first service, or collecting data collected by the first service). To implement a complete set of functions of the second service, there may be multiple or multi-level first services, and multiple second services and multiple first services may exist in various ways. Figure 1 The cross-interaction phenomenon shown makes the compatibility issues between multiple services even more important.
[0076] Compatibility between software versions of services can be backward compatible or forward compatible. Backward compatibility means that older versions of software can interact with or share data with newer versions, while forward compatibility means that newer versions of software can interact with or share data with older versions. This disclosure can guarantee forward and backward compatibility between services in scenarios including cross-platform service calls. It is worth noting that in this disclosure, "server" and "client" do not specifically refer to two different terminals, but rather to the identity of a software service in the business call process. That is, the software service that calls the business provided by other software services is called the "client," while the software service that provides the business to other software services is called the "server." A service can act as both a client and a server in different business call processes.
[0077] The embodiments and apparatus provided in this disclosure will now be described in detail from the perspectives of the second service side and the first service side, respectively.
[0078] The first aspect of this disclosure provides a business invocation method that can be applied to a second service side. Please refer to [link / reference needed]. Figure 2 It includes the following steps:
[0079] Step S201: During the handshake phase, a connection establishment request is sent to the first service, and the first version returned by the first service to the second service is received.
[0080] Step S202: Based on the first version, determine the first interface set;
[0081] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0082] In other words, before the second service and the first service can interact, the second service and the first service need to complete a handshake and establish a connection channel so that instructions and data can flow between them. During this process, the second service, acting as the client, sends a connection establishment request to the first service. Upon receiving the request, the first service can send a connection confirmation message to the second service to establish a reliable bidirectional connection channel (in some cases, the first service may not send a confirmation message but instead assume that the handshake has been completed), and then send a first version to the second service.
[0083] Next, the second service receives the connection confirmation information sent by the first service to the second service to establish a connection channel between the first service and the second service (of course, in some cases, it may not need to receive it). It also receives the first version sent by the first service. Then, based on the first version, it can determine the set of interfaces for calling the services provided by the first service (e.g., obtaining at least one interface).
[0084] Furthermore, to achieve better backward compatibility, the second service may store a set of first interfaces corresponding to at least one version of the first service, wherein at least one version of the first service includes versions of the first service that were released earlier than the second version; determining the set of first interfaces based on the first version may include: determining the set of first interfaces corresponding to the first version in the set of first interfaces corresponding to at least one version of the first service.
[0085] In other words, when developers or users choose to update the second service, they can retain the set of interfaces saved before each update. These sets of interfaces correspond to other services and can be used to call the business provided by the corresponding services.
[0086] As can be seen from the above embodiments, since version information can be sent between different services during the connection establishment process, the second service can directly call the services provided by the first service. This ensures forward and backward compatibility while eliminating the need to deploy a unified version query interface for different platforms and versions. Therefore, the implementation method provided in this disclosure significantly reduces the huge overhead in terms of traffic and time during software operation, improving software performance; at the same time, it significantly reduces the workload of developers and improves code reusability.
[0087] In some embodiments of this disclosure, the method may further include: during the handshake phase, sending a second version to the first service, so that the first service can interact with the second service based on the interaction method corresponding to the second version when the service is invoked by the second service, wherein the second version represents the current version information of the second service.
[0088] In other words, when the second service wants to establish a connection with the first service, it can send a second version to the first service, for example, by sending the second version separately or by including the second version in the connection establishment request, so that the first service can record the current version information of the second service and interact with the second service based on the interaction method corresponding to the second version.
[0089] For example, the second version can be used to help the first service determine the format of the information returned to the second service (e.g., determining the transmission method or data structure carrier on which the returned information is based). This ensures software compatibility while enabling the first service to provide services to the second service in an information format more suitable for the second service, thereby improving user experience and development flexibility. Specifically, sending a connection establishment request to the first service and sending the second version to the first service, so that the first service can interact with the second service based on the interaction method corresponding to the second version when its services are invoked by the second service, includes: sending a connection establishment request to the first service and sending the second version to the first service, so that the first service can provide services to the second service based on the information format corresponding to the second version when its services are invoked by the second service.
[0090] For another example, the second version can be used to help the first service determine the specific services to be provided to the second service. For instance, in some versions, the second service requires the first service to provide humidity sensor data and temperature sensor data collected by the first service. However, with subsequent device updates, the second service running on the subsequent device can directly read temperature sensor data from the subsequent device, no longer requiring the second service to provide temperature sensor data. Therefore, when the second service calls the service, the first service can determine, based on the second version, that "the second service no longer needs temperature sensor data," and based on this fact, only transmit the humidity sensor data to the first service, thereby improving interaction efficiency and development flexibility, and reducing the interaction pressure between services. That is, sending a connection establishment request to the first service and sending the second version to the first service so that the first service can interact with the second service based on the interaction method corresponding to the second version when the service is called by the second service includes: sending a connection establishment request to the first service and sending the second version to the first service so that the first service can provide the service corresponding to the second version to the second service when the service is called by the second service.
[0091] For example, the second version can be used to enable the first service to determine a second set of interfaces, which are used to call the services provided by the second service. As mentioned above, the identities of the server and the client can coexist on the same service or adapt to changes in user needs. Therefore, during the handshake process between the first and second services, the specific method of calling the services provided by the second service can be determined based on the second version. This facilitates the first service to directly call the services provided by the second service, thereby improving interaction efficiency and development flexibility, and reducing the interaction pressure between services.
[0092] In the embodiments provided in this disclosure, optionally, the first service and the second service can determine the first version and the second version by parsing predefined metadata, and send the determined first version and the second version to each other, thereby providing developers with the best development convenience and providing optimal compatibility with the development framework and the components and libraries they depend on.
[0093] Secondly, this disclosure provides a business invocation method that can be applied to the first service side; please refer to [link to relevant documentation]. Figure 3 The method may include:
[0094] Step S301: Receive a connection establishment request sent by the second service to begin the handshake phase;
[0095] Step S302: During the handshake phase, a first version is sent to the second service so that the second service determines a first interface set based on the first version;
[0096] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0097] In other words, before the second service and the first service can interact, the second service and the first service need to complete a handshake and establish a connection channel so that instructions and data can flow between them. During this process, the second service, acting as a client, sends a connection establishment request to the first service. Upon receiving the connection establishment request, the first service considers the handshake phase to have begun and sends a connection confirmation message to the second service to establish a reliable bidirectional connection channel (of course, in some cases, the first service may not send a connection confirmation message to the second service, but may directly assume that the handshake has been completed). During this phase, the first service also sends a first version to the second service (e.g., sending the second version separately or including the second version in the connection confirmation message).
[0098] Next, the second service receives the connection confirmation information sent by the first service to the second service to establish a connection channel between the first service and the second service (of course, in some cases, it may not need to receive it). It also receives the first version sent by the first service. Then, based on the first version, it can determine the set of interfaces for calling the services provided by the first service (e.g., obtaining at least one interface).
[0099] As can be seen from the above embodiments, since version information can be sent between different services during the connection establishment process, the second service can directly call the services provided by the first service. This ensures forward and backward compatibility while eliminating the need to deploy a unified version query interface for different platforms and versions. Therefore, the implementation method provided in this disclosure significantly reduces the huge overhead in terms of traffic and time during software operation, improving software performance; at the same time, it significantly reduces the workload of developers and improves code reusability.
[0100] In some embodiments of this disclosure, the second service may send a connection establishment request to the first service and send a second version to the first service. Therefore, receiving the connection establishment request sent by the second service may include:
[0101] The system receives a connection establishment request and a second version sent by the second service, and interacts with the second service based on the interaction method corresponding to the second version when the service is invoked by the second service. The second version represents the current version information of the second service.
[0102] The second version obtained in the above steps can have multiple uses. For example, when a service is invoked by the second service, interacting with the second service based on the interaction method corresponding to the second version can include: providing the service to the second service based on the information format corresponding to the second version when the service is invoked by the second service. That is, the second version can be used to help the first service determine the format of the information returned to the second service (e.g., determining the transmission method or data structure carrier on which the returned information is based), thereby ensuring software compatibility while enabling the first service to provide services to the second service in an information format more suitable for the second service, thus improving user experience and development flexibility.
[0103] For another example, when a service is invoked by the second service, interacting with the second service based on the interaction method corresponding to the second version may include: providing the service corresponding to the second version to the second service when the service is invoked by the second service. That is, the second version can be used to help the first service determine the specific service to be provided to the second service. For example, in some versions, the second service requires the first service to provide humidity sensor data and temperature sensor data collected by the first service. However, with subsequent device updates, the second service running on the subsequent device can directly read temperature sensor data on the subsequent device and no longer needs the second service to provide temperature sensor data. Therefore, when the second service invokes the service, the second service does not need to issue a corresponding instruction. The first service can also determine the fact that "the second service no longer needs temperature sensor data" based on the second version, and based on this fact, only transmit the humidity sensor data to the first service, thereby improving interaction efficiency and development flexibility, and reducing the interaction pressure between services.
[0104] For example, the method may further include: determining a second set of interfaces based on the second version, wherein the second set of interfaces is used to call the services provided by the second service. As mentioned above, the identities of the server and the client can coexist on the same service, or adapt to changes in user needs. Therefore, during the handshake process between the first service and the second service, the specific method of calling the services provided by the second service can be determined based on the second version. This facilitates the first service to directly call the services provided by the second service, thereby improving interaction efficiency and development flexibility, and reducing the interaction pressure between services.
[0105] Based on the above steps, the implementation methods provided by this disclosure can significantly improve user experience and development flexibility, as well as enhance the efficiency of interaction between services. For specific details and beneficial effects regarding the steps provided in the second aspect, please refer to the relevant sections of the embodiments of the first aspect, which will not be repeated here.
[0106] Furthermore, to achieve better backward compatibility, the first service may store a set of second interfaces corresponding to at least one version of the second service, as well as interaction methods (e.g., information formats and specific business requirements) corresponding to at least one version of the second service. The at least one version of the second service includes versions of the second service that were released earlier than the first version. Determining the set of second interfaces based on the second version may include: determining the set of second interfaces corresponding to the second version from the set of second interfaces corresponding to at least one version of the second service.
[0107] The following is combined Figure 4The interactive diagrams shown on both sides provide a comprehensive explanation of at least one of the above embodiments.
[0108] First, when the second service has a business interaction requirement with the first service, in step S401, the second service can parse the metadata predefined by the developer or automatically generated during the compilation process to determine the second version. Next, in step S402, the second service sends a connection establishment request and the second version to the first service.
[0109] At this point, the first service learns of the second service's need to establish a connection. Similarly, in step S403, the first service can parse the predefined metadata (also known as annotations) to determine the first version, and in step S404, send the connection confirmation information and the first version to the second service.
[0110] After step S404 is completed, a connection channel has been established between the first service and the second service. At this time, the second service and the first service can determine the corresponding interface set and interaction method of each other based on steps S405 and S406, respectively, so as to facilitate subsequent business interactions.
[0111] Finally, in step S407, the second service calls the business provided by the first service based on the determined first interface, while the first service interacts with the second service in step S408 based on the interaction method corresponding to the second version. Thus, the second service successfully calls the business provided by the first service without needing to determine their versions through any identical version call interfaces, greatly improving interaction efficiency, development flexibility, and reducing development workload.
[0112] Corresponding to the embodiments of the foregoing methods, this disclosure also provides embodiments of the apparatus and the terminal to which it is applied.
[0113] This disclosure provides a service invocation device in a third aspect; please refer to [link / reference]. Figure 5 The device includes:
[0114] The connection request module 501 is used to send a connection establishment request to the first service during the handshake phase and receive the first version returned by the first service to the second service.
[0115] The interface set determination module 502 is used to determine a first interface set based on the first version;
[0116] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0117] Optionally, when sending a connection establishment request to the first service, the connection request module is used to:
[0118] During the handshake phase, a connection establishment request is sent to the first service and a second version is sent to the first service, so that when the business is called by the second service, the first service can interact with the second service based on the interaction method corresponding to the second version, wherein the second version represents the current version information of the second service.
[0119] Optionally, the device further includes:
[0120] The metadata parsing module is used to determine the second version based on predefined metadata.
[0121] Optionally, the second service stores a set of first interfaces corresponding to at least one version of the first service, wherein at least one version of the first service includes versions of the first service that were released earlier than the second version.
[0122] The interface set determination module, when determining the first interface set based on the first version, is used for:
[0123] Based on the first version, determine the first interface set corresponding to the first version in the first interface set corresponding to at least one version of the first service.
[0124] Optionally, the device further includes:
[0125] The connection confirmation receiving module is used to receive connection confirmation information sent by the first service to the second service, so as to establish a connection channel between the first service and the second service.
[0126] The fourth aspect of this disclosure provides a service invocation device; please refer to [link / reference]. Figure 6 The device includes:
[0127] The connection request receiving module 601 is used to receive a connection establishment request sent by the second service to start the handshake phase;
[0128] The first version sending module 602 is used to send a first version to the second service during the handshake phase, so that the second service determines a first interface set based on the first version;
[0129] The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
[0130] Optionally, when the connection request receiving module receives the connection establishment request sent by the second service, it is used to:
[0131] The system receives a connection establishment request and a second version sent by the second service, and interacts with the second service based on the interaction method corresponding to the second version when the service is invoked by the second service. The second version represents the current version information of the second service.
[0132] Optionally, the connection request receiving module is used to, when interacting with the second service based on the interaction method corresponding to the second version, in the case where the service is invoked by the second service, perform the following:
[0133] When a service is invoked by the second service, the service is provided to the second service based on the information format corresponding to the second version.
[0134] Optionally, the connection request receiving module is used to, when interacting with the second service based on the interaction method corresponding to the second version, in the case where the service is invoked by the second service, perform the following:
[0135] When the service is invoked by the second service, the service corresponding to the second version is provided to the second service.
[0136] Optionally, the device further includes:
[0137] The preparation module is invoked to determine the second set of interfaces based on the second version. The second set of interfaces is used to invoke the services provided by the second service.
[0138] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0139] The fifth aspect of this disclosure provides a computer program product including a computer program / instructions that, when executed by a processor, implement the method as described in the first or second aspect.
[0140] For the device embodiments and computer program product embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. Furthermore, the device embodiments described above are merely illustrative; the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without any inventive effort.
[0141] Sixthly, embodiments of the service invocation apparatus provided in this disclosure can be applied to computer devices. See also... Figure 7 The illustration exemplifies a hardware schematic of a computer device. For example, device 700 could be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0142] Device 700 may include one or more of the following components: processing component 701, memory 702, power supply component 703, multimedia component 704, audio component 705, input / output (I / O) interface 706, sensor component 707, and communication component 708.
[0143] Processing component 701 typically controls the overall operation of device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 701 may include one or more processors 709 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 701 may include one or more modules to facilitate interaction between processing component 701 and other components. For example, processing component 701 may include a multimedia module to facilitate interaction between multimedia component 704 and processing component 701.
[0144] Memory 702 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0145] The power supply component 703 provides power to the various components of the device 700. The power supply component 703 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 700.
[0146] Multimedia component 704 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 704 includes a front-facing camera and / or a rear-facing camera. When the device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0147] Audio component 705 is configured to output and / or input audio signals. For example, audio component 705 includes a microphone (MIC) configured to receive external audio signals when device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 702 or transmitted via communication component 708. In some embodiments, audio component 705 also includes a speaker for outputting audio signals.
[0148] I / O interface 706 provides an interface between processing component 701 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0149] Sensor assembly 707 includes one or more sensors for providing state assessments of various aspects of device 700. For example, sensor assembly 707 can detect the on / off state of device 700, the relative positioning of components such as the display and keypad of device 700, changes in the position of device 700 or a component of device 700, the presence or absence of user contact with device 700, the orientation or acceleration / deceleration of device 700, and temperature changes of device 700. Sensor assembly 707 may also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 707 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 707 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0150] Communication component 708 is configured to facilitate wired or wireless communication between device 700 and other devices. Device 700 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G or 5G, or combinations thereof. In one exemplary embodiment, communication component 708 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 708 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0151] In an exemplary embodiment, device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the business invocation method of the aforementioned computer device.
[0152] In a seventh aspect, this disclosure also provides a non-transitory computer-readable storage medium including instructions, such as a memory 702 including instructions, which can be executed by a processor 709 of device 700 to complete the aforementioned business invocation method of the computer device. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0153] The foregoing has described specific embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0154] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention applied herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0155] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
[0156] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A business invocation method, characterized in that, The method includes: During the handshake phase, a connection establishment request is sent to the first service, and the first version is received from the first service to the second service. Based on the first version, determine the first set of interfaces; The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
2. The service invocation method according to claim 1, characterized in that, The method further includes: During the handshake phase, a second version is sent to the first service so that when the service is invoked by the second service, the first service can interact with the second service based on the interaction method corresponding to the second version, wherein the second version represents the current version information of the second service.
3. The service invocation method according to claim 2, characterized in that, The method further includes: The second version is determined based on predefined metadata.
4. The service invocation method according to claim 1, characterized in that, The second service stores a set of first interfaces corresponding to at least one version of the first service, wherein at least one version of the first service includes versions of the first service that were released earlier than the second version. Based on the first version, a first set of interfaces is determined, including: Based on the first version, determine the first interface set corresponding to the first version in the first interface set corresponding to at least one version of the first service.
5. The business invocation method according to claim 1, characterized in that, The method further includes: Receive connection confirmation information sent by the first service to the second service to establish a connection channel between the first service and the second service.
6. A business invocation method, characterized in that, The method includes: Receive a connection establishment request from the second service to begin the handshake phase; During the handshake phase, a first version is sent to the second service so that the second service can determine a first interface set based on the first version; The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
7. The service invocation method according to claim 6, characterized in that, The receiving of the connection establishment request sent by the second service includes: The system receives a connection establishment request and a second version sent by the second service, and interacts with the second service based on the interaction method corresponding to the second version when the service is invoked by the second service. The second version represents the current version information of the second service.
8. The service invocation method according to claim 7, characterized in that, When the service is invoked by the second service, the interaction with the second service based on the interaction method corresponding to the second version includes: When a service is invoked by the second service, the service is provided to the second service based on the information format corresponding to the second version.
9. The service invocation method according to claim 7, characterized in that, When the service is invoked by the second service, the interaction with the second service based on the interaction method corresponding to the second version includes: When the service is invoked by the second service, the service corresponding to the second version is provided to the second service.
10. The service invocation method according to claim 7, characterized in that, The method further includes: Based on the second version, a second set of interfaces is determined, and the second set of interfaces is used to call the services provided by the second service.
11. A service invocation device, characterized in that, The device includes: The connection request module is used to send a connection establishment request to the first service and receive the first version returned by the first service to the second service. The interface set determination module is used to determine the first interface set based on the first version; The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
12. A service invocation device, characterized in that, The device includes: The connection request receiving module is used to receive connection establishment requests sent by the second service to begin the handshake phase; A first version sending module is used to send a first version to the second service during the handshake phase, so that the second service determines a first interface set based on the first version; The connection establishment request is used to establish a connection channel between the first service and the second service. The first version represents the current version information of the first service, and the first interface set is used to call the services provided by the first service.
13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1 to 10.
14. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1 to 10.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 10.