Service calling method, electronic equipment and readable storage medium

By obtaining the device manufacturer information and service priority query order, determining the target server, the problem that multiple service users cannot share the same server is solved, and the sharing of services or data is realized and the efficiency of service calls is improved.

CN119739471AActive Publication Date: 2025-04-01HONOR DEVICE CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202311246384.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-04-01
Estimated Expiration
2043-09-25

AI Technical Summary

Technical Problem

Multiple service users cannot realize service or data sharing, because in the prior art service users usually use their own integrated server by default, resulting in the inability to share the same server.

Method used

By obtaining the equipment manufacturer information, determine whether the electronic device belongs to the target manufacturer, and determine the target server from multiple candidate servers according to the service priority query order that matches the equipment manufacturer information, so that each service user can call the same server.

Benefits of technology

It realizes the sharing of services or data, improves the efficiency and accuracy of service calls, and ensures the independence of each service user.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739471A_ABST
    Figure CN119739471A_ABST
Patent Text Reader

Abstract

The invention discloses a service calling method, electronic equipment and a readable storage medium, and belongs to the technical field of terminals. The method comprises the steps that in response to starting of a service user, device manufacturer information of the electronic device is obtained, the device manufacturer information is used for indicating whether the electronic device belongs to a target manufacturer or not, and the target manufacturer is a manufacturer providing services needing to be used by the service user. According to the service priority query sequence matched with the equipment manufacturer information, a target server side is determined from at least one candidate server side, the at least one candidate server side provides the service needing to be used by the service user, and the existence forms of the at least one candidate server side in the electronic equipment are different. And processing the service request through the target server in response to the service request of the service user. According to the service sharing method and device, all service users can call the same server side under the condition that the service sharing conditions are met, and then service or data sharing is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method for calling a service, an electronic device, and a readable storage medium. Background Art

[0002] At present, business development generally includes two components: client and server. The server is used to provide the required services to service users (such as smart space, sports health and other applications), and the client is used for service users to call, that is, the service user calls the server through the client.

[0003] Generally, there may be multiple servers in an electronic device that can provide the same service. For example, some servers may be integrated into the service user, while some servers may run independently in a process. In the related art, when the service user accesses the client by itself, it usually defaults to using its own integrated server.

[0004] However, in some scenarios, multiple service users may need to use the same service. If the service end is called according to the above method, the multiple service users cannot realize service or data sharing. Summary of the invention

[0005] The present application provides a method for calling a service, an electronic device and a readable storage medium, which can solve the problem that multiple service users cannot realize service or data sharing. The technical solution is as follows:

[0006] In a first aspect, a method for calling a service is provided, which is applied to an electronic device, and the method includes:

[0007] In response to the service user starting up, the device manufacturer information of the electronic device is obtained, and the device manufacturer information is used to indicate whether the electronic device belongs to the target manufacturer, and the target manufacturer is the manufacturer that provides the service required by the service user. Afterwards, according to the service priority query order matching the device manufacturer information, the target server is determined from at least one candidate server, and at least one candidate server provides the service required by the service user, and at least one candidate server exists in a different form in the electronic device. When the service user makes a service request, the service request is processed by the determined target server. In this way, for any service user in the electronic device, the server is called according to the process, so that when there is a server with a higher version or a stronger service compatibility, each service user calls the server, that is, when the service sharing condition is met, each service user can call the same server, thereby realizing service or data sharing. In addition, determining the target server after the service user starts up, that is, determining the target server before requesting the service, can enable direct calling when requesting the service, without having to determine it once every time it is called, thereby improving the efficiency of service calling.

[0008] As an example of the present application, when the device manufacturer information indicates that the electronic device belongs to the target manufacturer, the service priority query order that matches the device manufacturer information is: first candidate server, second candidate server; wherein the first candidate server is a native server in the form of APK provided by the target manufacturer, and the second candidate server is a server integrated in the form of a plug-in to the service user. When the device manufacturer information indicates that the electronic device does not belong to the target manufacturer, the service priority query order that matches the device manufacturer information is: third candidate server, fourth candidate server, second candidate server; wherein the third candidate server is a server in the form of APK, and the APK where the third candidate server is located is different from the APK where the first candidate server is located, and the fourth candidate server is a server integrated in the form of a plug-in to the third-party service user.

[0009] In this way, by determining the service priority query sequence that matches the device manufacturer information and determining the target server according to the service priority query sequence that matches the device manufacturer information, the accuracy and effectiveness of the service call can be improved.

[0010] As an example of the present application, a target server is determined from at least one candidate server according to a service priority query order that matches the device manufacturer information, including: determining an application identifier to be used each time the target server is queried according to the service priority query order that matches the device manufacturer information. Each time an application identifier is determined, the application information corresponding to the currently determined application identifier is queried from an application information list, and the application information list includes application information corresponding to each application identifier in a plurality of application identifiers. In the case where the currently determined application identifier is not the application identifier of the service user, a verification is performed based on the currently queried application information. In the case where the verification passes, the server providing the service in the service provider corresponding to the currently determined application identifier is determined as the target server. In the case where the verification fails, the operation of returning to the service priority query order that matches the device manufacturer information to determine the application identifier to be used each time the target server is queried.

[0011] In this way, since at least one candidate server in the electronic device is different when the electronic device belongs to the target manufacturer and when it does not belong to the target manufacturer, the service priority query order is different. In this way, the target server is determined according to the service priority query order that matches the device manufacturer information, which can improve the accuracy and effectiveness of service calls.

[0012] As an example of the present application, the application information in the application information list includes application version information. In this case, the implementation of verification based on the currently queried application information may include: comparing the application version information in the currently queried application information with the application version information provided in the client used by the service user. If the application version information in the currently queried application information is higher than the application version information provided in the client used by the service user, it is determined that the verification has passed. If the application version information in the currently queried application information is lower than the application version information provided in the client used by the service user, it is determined that the verification has not passed.

[0013] In this way, by comparing the application version information, it is verified whether the version of the service provider is higher than the version required by the service user, thereby determining whether the service provided by the server in the service provider can meet the needs of the service user, and the effectiveness of calling the service can be guaranteed.

[0014] As an example of the present application, the application information in the application information list includes a server identifier. In this case, the implementation of verification based on the currently queried application information may include: when the currently queried application information includes the first server identifier of the server providing the service, the client of the service user is bound to the server corresponding to the first server identifier. The server interface version information of the server corresponding to the first server identifier is obtained through the client of the service user. In the case where the obtained server interface version information is higher than the server interface version information provided in the client used by the service user, it is determined that the verification has passed. In the case where the obtained server interface version information is lower than the server interface version information provided in the client used by the service user, it is determined that the verification has not passed.

[0015] In this way, by binding the service user's client to the server, the server interface version information of the server is obtained, and whether the verification passes is determined based on the server interface version information to ensure that the server version is higher than the version supported by the service user's client, thereby ensuring the validity of the service call.

[0016] As an example of the present application, the device manufacturer information indicates that the electronic device belongs to the target manufacturer. In this case, according to the service priority query order that matches the device manufacturer information, the implementation of determining the application identifier to be used for each query to the target server may include: according to the service priority query order that matches the device manufacturer information, determining the application identifiers to be used for each query to the target server are: the first application identifier, the second application identifier, wherein the first application identifier is the identifier of the APK where the first candidate server is located, and the second application identifier is the identifier of the APK where the second candidate server is located.

[0017] In this way, in the target manufacturer's own electronic device, the target server is determined according to the service priority query order, so that different service users can call the same server as much as possible, thereby realizing the sharing of services or data. And when the service sharing conditions are not met, the service user can also use its own server, ensuring the independence of the service user itself.

[0018] As an example of the present application, the device manufacturer information indicates that the electronic device does not belong to the target manufacturer. In this case, according to the service priority query order that matches the device manufacturer information, the implementation of determining the application identifier to be used for each query of the target server may include: according to the service priority query order that matches the device manufacturer information, determining that the application identifiers to be used for each query of the target server are the third application identifier, the fourth application identifier, and the second application identifier, respectively, the third application identifier is the identifier of the APK where the third candidate server is located, and the fourth application identifier is the identifier of the APK where the fourth candidate server is located.

[0019] In this way, in electronic devices of other manufacturers, the target server is determined according to the service priority query order, so that different service users can call the same server as much as possible, thereby realizing the sharing of services or data. And when the service sharing conditions are not met, the service user can also use its own server, ensuring the independence of the service user itself.

[0020] As an example of the present application, the fourth application identifier is determined from a system configuration file, or the fourth application identifier is determined from system attribute information. By setting the fourth application identifier information in the preset setting item, the fourth application identifier can be queried regardless of which manufacturer's electronic device the server is integrated into, thereby querying the server integrated in the third-party service user based on the fourth application identifier, thereby ensuring the applicability of the service call method.

[0021] In a second aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for calling a service as described in the first aspect when executing the computer program.

[0022] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes the method for calling a service described in the first aspect.

[0023] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method for calling a service as described in the first aspect.

[0024] The technical effects obtained by the above-mentioned second aspect, third aspect and fourth aspect are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a schematic diagram of components involved in a functional characteristic according to an exemplary embodiment;

[0026] Figure 2 is a schematic diagram showing the existence form of a server in an electronic device of a target manufacturer according to an exemplary embodiment;

[0027] Figure 3 is a schematic diagram showing the existence form of a server in an electronic device of another manufacturer according to an exemplary embodiment;

[0028] Figure 4is a schematic diagram showing the existence form of a server in an electronic device of another manufacturer according to another exemplary embodiment;

[0029] Figure 5 is a schematic diagram showing the existence form of a server in an electronic device of another manufacturer according to another exemplary embodiment;

[0030] Figure 6 is a schematic diagram showing several existence forms of a server and a client in an electronic device according to an exemplary embodiment;

[0031] Figure 7 is a schematic diagram showing an application scenario according to an exemplary embodiment;

[0032] Figure 8 is a schematic diagram of an application scenario according to another exemplary embodiment;

[0033] Fig. 9 is a schematic diagram of a software system of an electronic device according to an exemplary embodiment;

[0034] Fig.10 is a flowchart of a method for calling a service according to an exemplary embodiment;

[0035] Fig.11 is a schematic diagram showing an application scenario according to an exemplary embodiment;

[0036] Fig.12 is a flowchart of a method for calling a service according to another exemplary embodiment;

[0037] Fig.13 is a flowchart of a method for calling a service according to another exemplary embodiment;

[0038] Fig.14 is a flowchart of a method for calling a service according to another exemplary embodiment;

[0039] Fig.15 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0041] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.

[0042] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0043] To facilitate understanding, the terms and vocabulary involved in the embodiments of the present application are first briefly explained.

[0044] Service user: It is the party requesting the service, or the party requesting the provision of functional features, such as requesting the provision of proximity discovery functional features. Service users are usually, but not limited to, applications that interact with users in electronic devices. For example, service users can include sports health, smart space, car connection, video, game, navigation and other applications. The service user corresponds to an Android installation package (Android Package, APK), which becomes a service user after being installed in an electronic device. In some examples, the service user may also be called a feature user, service user, or feature user, etc.

[0045] Service provider: is the party that provides services, or the party that provides features, such as providing proximity discovery features. A service provider also corresponds to an APK. In some examples, a service provider may also be called a feature provider, service provider, or feature provider.

[0046] Output: refers to installing or pre-installing the APK provided by the manufacturer into electronic devices of other manufacturers for use.

[0047] See also Figure 1 , the implementation of functional characteristics generally includes a server and a client. The server is the specific implementation of the functional characteristics provided by the service provider. For example, the server is a Service. The client is the interface provided by the server (i.e., Service) for the service user to call. For example, the client is a software development kit (SDK) interface as an example below.

[0048] See also Figure 2 In some target manufacturers' (such as Honor, which can be called: R manufacturer) electronic devices, the server (i.e. Service) provided by the target manufacturer itself is usually integrated into the service provider's APK (i.e. the native APK provided by the target manufacturer), and the client is integrated into the service user's APK. The two APKs can communicate through the Android Binder mechanism. That is, when implementing the business, one APK can call another APK through the Android Binder mechanism, where the calling APK is the service user and the called APK is the service provider.

[0049] In some scenarios, the target manufacturer's service users need to support normal use in electronic devices of other manufacturers through installation or pre-installation, for example, an APP of Honor manufacturer needs to be installed in electronic devices of other manufacturers for use. As mentioned above, this situation can be called the outbound end. In order to ensure that the service user can use it normally after the outbound end, the server used by the service user needs to be supported on the electronic devices of other manufacturers. Since the service user is only partially dependent on the service provider (that is, it only relies on the server in the service provider), the service provider's APK (that is, the native APK) is usually not also exported with the service user. In one possible implementation, please refer to Figure 3 , the server that the service consumer depends on can also be integrated into the service consumer and follow the service consumer's exit.

[0050] Of course, in some examples, the functional characteristics of the service provider may also be exported to electronic devices of other manufacturers as basic characteristics to provide external capabilities, that is, for use by multiple service users in electronic devices of other manufacturers. In other words, the functional characteristics can be exported to electronic devices of other manufacturers for use. As an example of this application, the export forms of functional characteristics generally include the following two:

[0051] Mode 1: Export in APK mode.

[0052] See also Figure 4As an example, the service end in the service provider can be exported in the form of APK, that is, it can be pre-installed in the electronic devices of other manufacturers in the form of APK. The exported APK and the non-exported APK (i.e., native APK) are basically the same in logical framework and form. Usually, the exported APK may add or delete some functions based on the non-exported APK. It can be understood that the non-exported APK is the native APK provided by the target manufacturer, and the exported APK is obtained by modifying the native APK. The differences with the non-exported APK generally include: different functional support ranges, or differences in performance experience, or differences in special adaptation, or differences in operating environment, etc. Due to these differences, the exported APK is usually different from the non-exported APK in its binary information, mainly manifested in different application identifiers and signature methods between the exported APK and the non-exported APK, where the application identifier can be used to identify an APK (or service user), for example, the application identifier can be an application name or application ID, etc. The signature can be used to distinguish different applications with the same application package name to prevent the application from being forged and replaced.

[0053] Mode 2: Output as a plug-in.

[0054] Exemplarily, the plug-in may be an AAR (android archive) or a JAR (Java Archive).

[0055] See also Figure 5 As an example, the server in the service provider can be integrated into the APK of the third-party service user in the form of AAR or JAR, and exported to electronic devices of other manufacturers (such as manufacturer X). The third-party service user is not the service user provided by the target manufacturer, for example, the third-party service user is the service user provided by manufacturer X. In this case, the server depends on the operating environment of the third-party service user. For example, when searching for the server, it is necessary to search according to the application identifier of the third-party service user.

[0056] In a possible implementation, the electronic device of manufacturer X can encapsulate the functional characteristics of the plug-in terminal, that is, the third-party service user can Figure 5 The service provider (plug-in form) shown in is encapsulated so that each service user of manufacturer X can use the functional characteristics of the output end through the encapsulated SDK interface, thus ensuring the uniformity of service calls. In another possible implementation, the electronic device of manufacturer X may not encapsulate the functional characteristics of the output end in the form of a plug-in, that is, directly Figure 5The service provider shown in is integrated into the third-party service consumer. In this case, the service consumer of manufacturer X accesses the server through the SDK interface of the outbound end.

[0057] It should be noted that Figure 5 The upper-layer service APK in the above refers to the APK installed or pre-installed in the electronic device of other manufacturers and does not belong to the target manufacturer, for example, the upper-layer service APK is an application provided by manufacturer X itself. In one possible implementation, when the electronic device of manufacturer X encapsulates the functional characteristics of the outbound end, the upper-layer service APK may integrate the encapsulated SDK interface, that is, the integrated SDK interface is provided by manufacturer X. In another possible implementation, when the electronic device of manufacturer X does not encapsulate the functional characteristics of the outbound end, the upper-layer service APK may integrate the SDK interface corresponding to the server of the outbound end, that is, the SDK interface corresponding to the server of the outbound end is provided by the target manufacturer, or the upper-layer service APK may not integrate the SDK interface, for example, the SDK interface of the functional characteristics of the outbound end may be directly used when requesting a service.

[0058] As described above, whether it is the target manufacturer's electronic equipment or other manufacturers' electronic equipment, the following may occur: Figure 6 The scenario of Figure (a) or Figure (b) in FIG. 1, that is, a certain functional feature may exist in multiple servers on an electronic device, and the existence forms of the multiple servers are different. For example:

[0059] See also Figure 6 As shown in Figure (a), on the electronic device provided by the target manufacturer, a certain functional feature may have the following types of servers: (1) a server in the form of a native APK; (2) a server integrated in the form of a plug-in in the service user of the exportable end, and the service user of the exportable end also integrates a client for calling the server, and the service user of the exportable end is the service user provided by the target manufacturer. In addition, Figure 6 As shown in Figure (a), in the electronic device provided by the target manufacturer, some service users may also be integrated with a client for calling the server and the service user does not include the server.

[0060] See also Figure 6 As shown in Figure (b) in the figure, on electronic devices provided by other manufacturers, a certain functional feature may have the following types of servers: (1) a server in the form of an APK; (2) a server integrated into a third-party service user in the form of a plug-in, and the corresponding client of the server is also integrated into the third-party service user; (3) a server integrated into the service user at the output end in the form of a plug-in, and the corresponding client of the server is also integrated into the service user at the output end. In addition, Figure 6As shown in Figure (b), electronic devices provided by other manufacturers may also include an outbound service user and an upper-layer business APK, and the outbound service user is integrated with a client corresponding to the server.

[0061] For ease of description and understanding, see Figure 6 , Next, we distinguish each server in the above scenario.

[0062] (1) The server providing functional features in the service provider pre-installed or installed on the electronic device of the target manufacturer can be recorded as SVC1. The application identifier used when accessing the server SVC1 through a mechanism such as Binder can be recorded as PKG1. PKG1 is used to identify the APK where the server SVC1 is located.

[0063] (2) For a server that provides functional features in the form of an APK to electronic devices of other manufacturers, it can be recorded as SVC2. The application identifier used when accessing the server SVC2 through a mechanism such as Binder can be recorded as PKG2. PKG2 is used to identify the APK where the server SVC2 is located.

[0064] (3) The server that is integrated into the third-party service user in the form of a plug-in to provide functional features can be recorded as SVC3. The application identifier used when accessing the server SVC3 through a mechanism such as Binder can be recorded as PKG3. PKG3 is used to identify the APK where the server SVC3 is located.

[0065] (4) The server that is integrated into the service user provided by the target manufacturer in the form of a plug-in to provide functional features can be recorded as SVC4. The application identifier used when accessing the server SVC4 through mechanisms such as Binder can be recorded as PKG4. PKG4 is used to identify the APK where the server SVC4 is located.

[0066] It can be seen that SVC1 and SVC2 can be used to provide capabilities to the outside, that is, they can be used by multiple service users in the electronic device. SVC1 and SVC2 are usually located in the bottom layer of the electronic device (such as the application framework layer). In addition, SVC3 can also be used as a basic feature to provide capabilities to the outside, that is, it can also be used by multiple service users in the electronic device, but because SVC3 is integrated in the third-party service user, SVC3 is usually located in the upper layer of the electronic device (such as the application layer). SVC4 is a service end for the service user itself. Therefore, from the perspective of the upper and lower hierarchical relationship of the electronic device system, the importance of the above-mentioned service ends or the possibility of being the core is: SVC1 = SVC2>SVC3>SVC4. That is, SVC1 and SVC2 are equally important and the importance is the highest, and SVC4 is the least important.

[0067] According to the above records, SVC1 and SVC2 usually do not coexist in the same electronic device. For example, SVC1 exists in the electronic device of the target manufacturer, and SVC2 exists in the electronic device of other manufacturers. In addition, in some embodiments, SVC3 generally does not coexist with SVC1 or SVC2 in the same electronic device. Of course, in other embodiments, SVC3 may also exist in the same electronic device as SVC1, or SVC3 may also coexist with SVC2 in the same electronic device. The embodiments of the present application do not limit this.

[0068] In some scenarios, there may be a need to share capabilities or data between multiple service users, such as sharing configuration information, databases, memory data, etc. To this end, an embodiment of the present application provides a service calling method, which can adaptively access services when there are multiple service terminals in an electronic device, so that multiple service users can use the same service terminal as much as possible to achieve service or data sharing through this one service terminal. In addition, even if the service or data sharing conditions are not met, the access mechanism of each service user to itself will not be affected, thereby ensuring the independence of each service user.

[0069] To facilitate understanding, several exemplary application scenarios involved in the embodiments of the present application are introduced below.

[0070] In an example, see Figure 7 , the electronic device includes two applications, smart space and sports health. Sports health is integrated with a server, which can be used to realize the proximity discovery function; sports health is integrated with a server, which can also be used to realize the proximity discovery function, and the bottom layer of the electronic device also provides a server to realize the proximity discovery function. During the operation of the smart space, when the user triggers the electronic device to scan other devices attached in the smart space, the smart space calls the underlying server, and the underlying server performs the proximity discovery function, that is, scans. When the sphygmomanometer is close to the electronic device, the smart space can discover the sphygmomanometer through the underlying server, and trigger the electronic device to establish a communication connection with the sphygmomanometer, so that the smart space can exchange data with the sphygmomanometer through the established communication connection. Afterwards, during the operation of sports health, when the user triggers the electronic device to discover other devices in sports health, sports health also calls the underlying server. At this time, since the underlying server has discovered the sphygmomanometer, the server no longer scans, but directly notifies sports health that the sphygmomanometer has been discovered, and data can be directly transmitted, so that sports health can interact with the sphygmomanometer through the established communication.

[0071] In another example, see Figure 8There are two applications in the electronic device, namely navigation and file sharing. The navigation application is integrated with a server, which can realize the proximity discovery function. The bottom layer of the electronic device also provides a server, which can also realize the proximity discovery function. In a possible application scenario, the electronic device needs to send navigation information to the vehicle device for display. To this end, the user can trigger the navigation application to use the proximity discovery function to discover the vehicle device. At this time, the navigation application will call the bottom layer server of the electronic device. The server performs the proximity discovery function and triggers the electronic device to connect with the vehicle device after discovering the vehicle device. In this way, the navigation application can send the navigation information to the vehicle device for display through the established connection. Afterwards, when the file sharing application in the electronic device wants to share files with the vehicle device, it also needs to call the bottom layer server. In this case, since the vehicle device has been discovered by the bottom layer proximity discovery function, it is no longer necessary to perform the scanning and connection operations of the vehicle device, but can directly instruct the file sharing application to send files. In this way, the file sharing application can send the files to be shared to the vehicle device through the established connection.

[0072] It can be seen that in the embodiment of the present application, when multiple applications in the electronic device need to use the proximity discovery feature, they do not call their own servers, but all call the underlying server of the electronic device, so that service sharing can be achieved. In this way, when a connection has been established through the proximity discovery feature, when other applications also use the proximity discovery feature, the electronic device no longer scans, which can reduce the operating power consumption of the electronic device to a certain extent.

[0073] Of course, it should be noted that the above application scenarios are only exemplary and do not limit the application of the method for calling services provided in the embodiments of the present application. For example, the method for calling services provided in the embodiments of the present application can also be applied to adaptive access scenarios of multiple similar functional modules.

[0074] It should also be noted that the electronic devices involved in the embodiments of the present application may be but are not limited to mobile phones, sports cameras (GoPro), digital cameras, tablet computers, desktops, laptops, handheld computers, notebook computers, vehicle-mounted equipment, ultra-mobile personal computers (ultra-mobile personal computers, UMPC), netbooks, cellular phones, personal digital assistants (personal digital assistants, PDA), augmented reality (augmented reality, AR) \ virtual reality (virtual reality, VR) devices, and the embodiments of the present application are not limited to this.

[0075] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device. Fig. 9 is a block diagram of a software system of an electronic device provided in an embodiment of the present application. Fig. 9 The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system layer, and the kernel layer.

[0076] The application layer can include a series of application packages. Fig. 9 As shown, the application package may include applications such as smart space, sports health, car connection, navigation, file sharing, etc., which are also referred to as service users in the embodiments of this application. In some examples, the service user is integrated with an SDK interface, that is, an integrated client for the service provider to call. In addition, the service user may also be integrated with a business module, which is used to monitor the triggering of the business. In one possible implementation, the service user may also be integrated with a server ( Fig. 9 not shown).

[0077] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Fig. 9 As shown, the application framework layer may include a service provider (i.e., APK), in which a server may run. In addition, the application framework layer may also include an activity manager service (AMS), which is a system service in the Android system. It runs in the system process and is mainly responsible for managing the life cycle of the application, the management of the task stack, and the interaction between applications.

[0078] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0079] Next, the service calling method provided in the embodiment of the present application is introduced.

[0080] As an example of the present application, in order to allow multiple service users who need to use the same service to call the same server as much as possible, the electronic device can specify the service priority query order of the above-mentioned service users, so that the service user can determine the target service to be used from multiple service users according to the service priority query order. Exemplarily, the service priority query order can be:

[0081] (1) On the electronic device of the target manufacturer, the query can be made in the order of PKG1>PKG3=PKG4, and the service user corresponding to PKG4 does not access the server in the service user corresponding to PKG3.

[0082] (2) On electronic devices from other manufacturers, you can search in the order of PKG2>PKG3>PKG4.

[0083] On this basis, we will then combine Fig.10 The method for calling a service provided in the embodiment of the present application is described in detail. As an example but not a limitation, the method is applied to the above Fig. 9 In the electronic equipment shown, see Fig.10 , the method may include some or all of the following:

[0084] S1001: In response to a service user initiating, obtaining device manufacturer information of an electronic device, and determining whether the electronic device belongs to a target manufacturer according to the device manufacturer information.

[0085] The device manufacturer information is used to indicate whether the electronic device belongs to the target manufacturer. According to the previous record, the target manufacturer is the manufacturer that provides the service that the service user needs to use. For example, the target manufacturer is manufacturer R, which is the manufacturer that provides the original service provider.

[0086] The service user may be any application installed or pre-installed in the electronic device. In one possible case, the service user is triggered and started by the user. For example, if the service user is sports health, when the user needs to use sports health, the user can click the sports health application icon in the electronic device. In response to the user's triggering operation on the sports health application icon, the electronic device starts sports health. In another possible case, the service user is a resident process, and the service user is started after the electronic device is turned on and the system is started.

[0087] After the service user is started, he usually needs to use the service during operation, that is, he needs to call the server. Since there may be multiple servers in the electronic device, in order to facilitate the service user to directly call the server when he needs to use the service, the electronic device can determine a server from multiple servers as the target server after the service user is started. The target server is used for the service user to call when he needs to use the service to execute functional characteristics.

[0088] Since the service priority query order required to determine the target server is different when the electronic device belongs to the target manufacturer or does not belong to the target manufacturer, the electronic device queries the device manufacturer information after the service user starts to determine whether the electronic device belongs to the target manufacturer. As an example of the present application, the electronic device can obtain the device manufacturer information from the system.

[0089] If it is determined according to the device manufacturer information that the electronic device belongs to the target manufacturer, the process proceeds to step S1002 . Otherwise, if it is determined according to the manufacturer device information that the electronic device does not belong to the target manufacturer, the process proceeds to step S1008 .

[0090] S1002: Query from the application information list whether there is application information corresponding to PKG1, where the application information list includes a plurality of application information.

[0091] According to the above records, PKG1 is an application identifier used when accessing the server SVC1. The server SVC1 is a service provider that provides functional features and is pre-installed or installed on the electronic device of the target manufacturer.

[0092] As an example of the present application, PKG1 may be pre-set in the SDK interface used by the service user, that is, the electronic device uses PKG1 provided in the SDK interface of the service user to query whether there is application information corresponding to PKG1 in the application information list.

[0093] The application information list can be managed by the AMS in the electronic device. As an example but not a limitation, the application information list includes application information of all applications in the electronic device, that is, the application information list includes multiple application information. The application information may include application version information, application identification and server identification. Further, the application information may also include, signature, user identification (UID), etc.

[0094] The server identifier is used to uniquely identify a server. An application information may include a server identifier, which means that the service provider corresponding to the application information only provides one server. Alternatively, an application information may include multiple server identifiers, each of which is used to identify a server. This means that the service provider corresponding to the application information provides multiple servers, each of which is used to implement different services. For example, some servers are used to implement proximity discovery functions, while others are used to implement positioning functions.

[0095] The UID can be used to distinguish different applications and prevent applications from being forged and replaced.

[0096] According to the service priority query order specified by the electronic device (i.e., the order of PKG1>PKG3=PKG4), in the electronic device of the target manufacturer, when it is necessary to query the target service end, PKG1 is first used for query, that is, to query whether there is a callable service provider corresponding to PKG1. To this end, the electronic device queries whether there is application information corresponding to PKG1 from the application information list. In one example, the electronic device can traverse multiple application information in the application information list to query whether there is application information corresponding to PKG1 in the application information list.

[0097] If the application information corresponding to PKG1 exists in the application information list, it means that the server SVC1 exists in the electronic device, and in this case the electronic device enters the operation of step S1003. Otherwise, if the application information corresponding to PKG1 does not exist in the application information list, it means that the server SVC1 does not exist in the electronic device, and in this case the electronic device enters the operation of step S1006.

[0098] S1003: Perform verification based on the application information corresponding to PKG1 to determine whether the verification passes.

[0099] In one example, verification can be performed based on the application version information carried in the application information. Exemplarily, the specific verification method may include: comparing the application version information in the application information corresponding to PKG1 with the application version information in the SDK interface used by the service user. If the application version information in the application information corresponding to PKG1 is higher than the application version information in the SDK interface used by the service user, it is determined that the verification has passed. Otherwise, if the application version information in the application information corresponding to PKG1 is lower than the application version information in the SDK interface used by the service user, it is determined that the verification has not passed.

[0100] The application version information in the SDK interface of the service user may be preset, indicating which version of the service provider the service user supports to provide services. If the application version information in the application information corresponding to PKG1 is higher than the application version information in the SDK interface of the service user, it means that the application version of the service provider is higher. In this case, it can be determined that the service provided by the server side of the service provider can meet the needs of the service user, so the verification result is determined to be passed. Otherwise, if the application version information in the application information corresponding to PKG1 is lower than the application version information in the SDK interface of the service user, it means that the application version of the service provider is lower. In this case, it can be determined that the service provided by the server side of the service provider cannot meet the needs of the service user, so the verification result is determined to be failed.

[0101] In another example, verification can also be performed based on the server-side interface version information of the server. Exemplarily, the application information in the application information list includes a server identifier. In this case, the verification process can include: determining whether SVC1 exists in the application information corresponding to PKG1. If SVC1 exists in the application information corresponding to PKG1, the SDK interface of the service user is bound to the server corresponding to SVC1. For example, a binding request can be sent to the service provider corresponding to PKG1 through the SDK interface of the service user. The binding request carries SVC1, so that the service provider corresponding to PKG1 binds the server SVC1 to the SDK interface of the service user. Afterwards, the server interface version information of SVC1 is obtained from the bound server through the SDK interface of the service user. If the obtained server interface version information is higher than the server interface version information preset in the SDK interface of the service user, it is determined that the verification is passed; if the obtained server interface version information is lower than the server interface version information preset in the SDK interface of the service user, it is determined that the verification is not passed.

[0102] In one example, the SDK interface of the service user can obtain its server interface version information from SVC1 through the interface version information acquisition function. If the server interface version information provided by the server SVC1 is higher than the server interface version information preset in the SDK interface of the service user, it means that the version of the server SVC1 is higher. In this case, it can be determined that the service provided by the server SVC1 can meet the needs of the service user, so the verification result is determined to be passed. Otherwise, if the server interface version information provided by the server SVC1 is lower than the server interface version information preset in the SDK interface of the service user, it means that the version of the server SVC1 is lower. In this case, it can be determined that the service provided by the server SVC1 cannot meet the needs of the service user, so the verification result is determined to be failed.

[0103] Of course, if the server identifier in the application information corresponding to PKG1 does not include SVC1, it is determined that the server SVC1 does not exist in the service provider corresponding to PKG1. In this case, it is determined that the verification fails.

[0104] It should be noted that the embodiment of the present application is explained by taking the example that the server identification is included in the application information. In another example, the application information may also not include the server identification. In this case, the SDK interface of the service user cannot determine whether the service provider corresponding to PKG1 provides the server SVC1. In this case, when it is determined that there is application information corresponding to PKG1, the SDK interface of the service user can also send a binding request to the service user corresponding to PKG1. The binding request can carry SVC1 to try to bind with the server SVC1. If the server SVC1 exists in the service user corresponding to PKG1, it is bound to the SDK interface of the service user. After that, the SDK interface of the service user can obtain the server interface version information from the server SVC1 and perform verification. If the server SVC1 does not exist in the service user corresponding to PKG1, the service user corresponding to PKG1 returns a message of binding failure. In this case, it is determined that the verification has not passed.

[0105] As an optional implementation method, after the verification is completed, the electronic device can unbind the SDK interface of the service user from the bound server to avoid binding the server for a long time when the server is not in use, thereby avoiding occupying service resources.

[0106] It should also be noted that the above is explained by first binding the server to obtain the server interface version information from the server. In another example, the application version information in the application information corresponding to PKG1 may also include the server interface version information, that is, a certain field of the application version information may carry the server interface version information, such as including the server interface version information corresponding to SVC1. In this case, it is not necessary to bind the server during the verification process, and the electronic device can directly perform verification based on the server interface version information included in the application version information and the server interface version information provided in the SDK interface of the service user.

[0107] As an example of the present application, when the application information also includes a signature, before performing the above-mentioned verification operation, the signature can also be verified to determine whether the service provider corresponding to PKG1 is reliable. If the signature verification passes, the above-mentioned verification operation is performed again to improve the security of the service call.

[0108] Similarly, when the application information also includes UID, before performing the above-mentioned verification operation, the UID can also be verified to determine whether the service provider corresponding to PKG1 is reliable. If the UID verification passes, the above-mentioned verification operation is performed again to improve the security of the service call.

[0109] In one possible implementation, the application information also includes a signature and a UID. Before performing the above verification operation, the electronic device verifies the signature and the UID respectively. When both the signature and the UID are verified, the above verification operation is performed again to improve the security of the service call.

[0110] As an optional implementation method, during the verification process, verification can be first performed based on the application version information (see the previous text for specific implementation). If the verification based on the application version information passes, verification can be performed based on the server interface version information (see the previous text for specific implementation). If the verification based on the server interface version information passes, the verification result is determined to be passed. Otherwise, if the verification based on the server interface version information fails, the verification result is determined to be failed. Of course, if the verification based on the application version information fails, the verification result is determined to be failed. In this way, through multiple verifications, the effectiveness of the verification can be improved.

[0111] If the verification is passed, it means that the server SVC1 in the electronic device can provide services that meet the service user's needs. At this time, the server SVC1 is determined as the target server, and the electronic device enters the operation of step S1004. If the verification is not passed, it means that the server SVC1 in the electronic device cannot provide services that meet the service user's needs. At this time, the electronic device enters the operation of step S1006.

[0112] S1004: Store the service query result, which is used to indicate the target server that the service user can call.

[0113] In one example, the service query result includes the application identifier of the APK where the determined target server is located. Exemplarily, when the application information corresponding to PKG1 is verified, the service query result includes PKG1. Further, it may also include the server identifier of the target server, for example, when the target server is the server SVC1, the service query result also includes SVC1.

[0114] It should be noted that the example here is based on the verification of the application information corresponding to PKG1. In another example, if the verification of the application information corresponding to other PKGs is passed, the service query result includes other application identifiers. For example, if the verification of the application information corresponding to PKG1 fails, and the service user has integrated the server SVC4, the service query result includes PKG4, and further may include SVC4. That is, the stored service query result includes information related to the target server that is finally determined.

[0115] S1005: In response to the service request of the service user, the target server is called according to the service query result.

[0116] After the service query results are stored, when the user triggers the service consumer to call the target server, the service consumer can determine the relevant information of the target server based on the service query results, and thus determine which server to call to perform the requested service. For example, if the service query results include PKG1, it can be determined that the target server to be called is server SVC1. After that, the service consumer can call the target server through the SDK interface, such as calling server SVC1.

[0117] In an example, the service user is sports health, and the service provided by the target server is proximity discovery. Fig.11 In FIG. 1 , in the case of displaying the application interface U1 for sports and health, the application interface U1 includes an interface switching option 1101. The user clicks the interface switching option 1101. In response to the user's triggering operation on the interface switching option 1101, the electronic device displays the application interface U2 for sports and health, such as Fig.11 As shown in FIG. (b), the application interface U2 includes an "add device" item 1102, and the user triggers the "add device" item 1102. In response to the user's triggering operation on the "add device" item 1102, the service user sends a service request to the target server through the SDK interface according to the service query result to call the target server to scan. For example, the electronic device displays the following during the scanning process: Fig.11 The interface shown in Figure (c) is used to scan other devices in the vicinity to discover other devices, so that after discovering other devices, communication connections can be established with other devices, and data interaction can be performed through the established communication connections.

[0118] Of course, it should be noted that the above is based on the example that the electronic device has not performed the proximity discovery function before. In another example, if the electronic device has performed the proximity discovery function, that is, if other service users in the electronic device have called the target server to perform the proximity discovery function, then when the service user calls the target server, the electronic device no longer performs the scanning function, but directly indicates to the service user that a communication connection has been established and data can be directly transmitted, thereby realizing service sharing.

[0119] S1006: Check whether the service user has integrated the server.

[0120] According to the above records, the service user may have a server integrated in it. If the verification based on the application information corresponding to PKG1 fails, or the application information corresponding to PKG1 does not exist in the electronic device, the electronic device can query whether the service user itself has an integrated server. In one example, the electronic device can query whether there is indication information in the SDK interface used by the service user to indicate that it has an integrated server. If the indication information exists, it is determined that the service user has an integrated server. If the indication information does not exist, it is determined that the service user has not an integrated server.

[0121] If the service user does not have a server, the process proceeds to step S1007. Otherwise, if the service user has a server, that is, the server SVC4, the process proceeds to step S1004. At this time, the stored service query result includes the application identifier of the service user, such as PKG4, and may further include SVC4.

[0122] S1007: Determine that the server is inaccessible.

[0123] Since the service user corresponding to PKG4 does not access the server in the service user corresponding to PKG3, if the application information corresponding to PKG1 does not exist or the verification based on the application information corresponding to PKG1 fails, and there is no server in the service user, it means that there is no server accessible to the service user. In this case, the electronic device can feedback the service query result to the service user that the service is inaccessible, so that the service user is informed of the inaccessible service.

[0124] As an example, when a service is inaccessible, when a service user calls the server, a pop-up window may be displayed in the application interface of the service user, displaying a prompt message that the service is inaccessible to prompt the user.

[0125] S1008: Check from the application information list whether there is application information corresponding to PKG2.

[0126] According to the above records, PKG2 is the application identifier used when accessing the server SVC2. The server SVC2 is exported to the server in the electronic device of other manufacturers in the form of APK, that is, PKG2 is the application identifier of the exported APK and the exported APK includes the server SVC2.

[0127] PKG2 can also be pre-set in the SDK interface used by the service user. That is, when it is determined that the electronic device does not belong to the target manufacturer based on the device manufacturer information, the electronic device uses the PKG2 provided in the SDK interface of the service user to query whether there is application information corresponding to PKG2 in the application information list, so as to query whether there is an APK of the output end and including the service end in the electronic device. In one example, the electronic device can traverse multiple application information in the application information list to query whether there is application information corresponding to PKG2 in the application information list.

[0128] If the application information list contains the application information corresponding to PKG2, it means that the electronic device has an outgoing APK, that is, the server SVC2, and in this case the electronic device enters the operation of step S1009. Otherwise, if the application information list does not contain the application information corresponding to PKG2, it means that the electronic device does not have an outgoing APK, that is, the server SVC2, and in this case the electronic device enters the operation of step S1010.

[0129] S1009: Perform verification based on the application information corresponding to PKG2, and determine whether the verification passes.

[0130] The implementation method of verifying based on the application information corresponding to PKG2 can refer to the specific implementation of verifying based on the application information corresponding to PKG1 in S1003, which will not be described in detail here.

[0131] If the application information verification based on PKG2 is passed, it means that the electronic device has a server SVC2, and the server SVC2 can provide services that meet the service user's needs. At this time, the target server is the server SVC2, and the electronic device performs the operation of step S1004. At this time, the service query result can include PKG2, and further can include SVC2. Otherwise, if the application information verification based on PKG2 is not passed, it means that the electronic device has a server SVC2, but the server SVC2 cannot provide services that meet the service user's needs. At this time, the electronic device enters the operation of step S1010.

[0132] S1010: Get PKG3, which is used to access the server SVC3.

[0133] Since the server SVC3 is integrated in the third-party service user, the operating environment of the server SVC3 depends on the third-party service user. For example, in electronic devices of different manufacturers (excluding the target manufacturer), the server SVC3 depends on different third-party service users. For example, in the electronic device of manufacturer B, the third-party service user that the server SVC3 depends on is APK1, and in the electronic device of manufacturer C, the third-party service user that the server SVC3 depends on is APK2. That is, the third-party service users may be inconsistent on electronic devices of different manufacturers (excluding the target manufacturer) or even on different electronic devices of the same manufacturer. Therefore, in order to make the overall solution unified, PKG3 can be set in a preset configuration item of the system of the electronic device. In this way, when PKG3 needs to be used, the electronic device can query PKG3 from the preset configuration item, thereby facilitating the use of PKG3 to query the corresponding application information from the application information list.

[0134] As an example but not limitation, the preset configuration item may be a system configuration file, such as a json file. Alternatively, the preset configuration item may also be system property information (such as Android's Property mechanism). For example, if the preset configuration item is ro.vendor.magicringpkgname and PKG3 is com.xiaomi.pkgname, the electronic device may set PKG3 to ro.vendor.magicringpkgname=com.xiaomi.pkgname.

[0135] Optionally, when setting the preset configuration item, the electronic device may also encrypt the preset configuration item and then store the encryption key used for encryption. In this way, when PKG3 needs to be obtained, the preset configuration item can be decrypted using the stored encryption key to obtain PKG3. In this way, the security of data storage can be guaranteed.

[0136] S1011: Check from the application information list whether there is application information corresponding to PKG3.

[0137] In one example, the electronic device traverses multiple application information in the application information list to query whether there is application information corresponding to PKG3 in the application information list.

[0138] In one possible case, the application information list contains application information corresponding to PKG3, which means that the electronic device contains a server SVC3 corresponding to PKG3, and the electronic device enters the operation of step S1012. In another possible case, the application information list contains application information corresponding to PKG3, which means that the electronic device contains a server SVC3 corresponding to PKG3, and the electronic device executes the operation of step S1006.

[0139] S1012: Perform verification based on the application information corresponding to PKG3, and determine whether the verification passes.

[0140] The implementation method of verifying based on the application information corresponding to PKG3 can refer to the specific implementation of verifying based on the application information corresponding to PKG1 in S1003, which will not be described in detail here.

[0141] If the application information verification based on PKG3 is passed, it means that the electronic device has a server SVC3 and the service provided by the server SVC3 can meet the needs of the service user, so the electronic device performs the operation of step S1004, and the service query result can include PKG3 and further include SVC3. Otherwise, if the application information verification based on PKG3 is not passed, it means that although the electronic device has a server SVC3, the service provided by the server SVC3 cannot meet the needs of the service user, so the electronic device performs the operation of step S1006, that is, to query whether the service user has integrated the server SVC4.

[0142] As an example of the present application, after the service user is closed, the relevant data of the target server used this time can be deleted, such as deleting the service query results, execution results, etc., so that when the target server sends changes (such as version updates, etc.), the latest version of the server can be used next time.

[0143] In an embodiment of the present application, in response to a service user starting up, the device manufacturer information of the electronic device is obtained, and the device manufacturer information is used to indicate whether the electronic device belongs to a target manufacturer, and the target manufacturer is a manufacturer that provides services that the service user needs to use. Afterwards, the target server is determined from multiple servers based on the service priority query order that matches the device manufacturer information. When the service user requests to call a service, the service request is processed by the target server. In this way, for any service user of the electronic device, the server is called according to the process, so that when there is a server with a higher version or stronger service compatibility, each service user calls the server, that is, when the service sharing conditions are met, each service user can call the same server, thereby realizing service or data sharing.

[0144] according to Fig.10 As can be seen from the illustrated embodiment, the specific implementation method of determining the target server depends on whether the electronic device belongs to the target manufacturer. For ease of understanding, the following two embodiments are used to introduce the implementation process of calling the service in two scenarios: the electronic device belongs to the target manufacturer and does not belong to the target manufacturer.

[0145] See also Fig.12 , Fig.12 is a flow chart of a method for calling a service according to another exemplary embodiment. Here, the electronic device belongs to the target manufacturer. The method is as follows Fig. 9 Taking the electronic device shown as being executed, and the electronic device being implemented through the interaction of multiple modules as an example, the method may mainly include the following implementation steps.

[0146] S1201: In response to the service user starting up, the AMS notifies the service user's business module.

[0147] As an example of the present application, taking the service user as sports health, when the user clicks on the application icon of sports health in the electronic device, the AMS detects the user's click operation, and then the AMS notifies the business module.

[0148] It should be noted that the embodiment of the present application is described by taking the example that the AMS can sense the start of the service user. In another example, the electronic device can also sense the start of the service user through other modules, and then the other modules notify the business module, which is not limited in the embodiment of the present application.

[0149] S1202: The business module of the service user sends an initialization request to the client of the service user.

[0150] That is, after receiving the startup notification from the service user, the business module sends an initialization request to the SDK interface of the service user to request the SDK interface to initialize the operating environment.

[0151] S1203: In response to the initialization request, the client sends a device information acquisition request to the AMS.

[0152] S1204: The AMS sends the device manufacturer information to the client.

[0153] After receiving the initialization request, the client obtains the device manufacturer information of the electronic device from the system of the electronic device. As an example but not a limitation, the client obtains the device manufacturer information from the AMS. For example, the AMS can provide an interface for obtaining the device manufacturer information. In this way, the client can send a device information acquisition request to the AMS by calling the interface to obtain the device manufacturer information.

[0154] S1205: The client determines that the electronic device belongs to the target manufacturer according to the device manufacturer information.

[0155] After obtaining the device manufacturer information, the client can determine whether the electronic device belongs to the target manufacturer based on the device manufacturer information. Fig.13 The embodiment shown.

[0156] S1206: The client sends a first query request to the AMS, where the first query request carries PKG1.

[0157] The first query request is used to request to query the application information corresponding to PKG1.

[0158] PKG1 is pre-installed in the client.

[0159] As an example of the present application, the AMS provides an interface for requesting to query application information. When the client needs to query application information, the client can call the interface to query the required application information from the AMS.

[0160] S1207: In response to the first query request, the AMS sends application information corresponding to PKG1 to the client.

[0161] As an example, the AMS manages an application information list, which includes application information of all application programs in the electronic device. After receiving the first query request, the AMS can traverse the application information list to query whether there is application information corresponding to PKG1. This application is described by taking the existence of application information corresponding to PKG1 as an example.

[0162] It should be noted that the embodiment of the present application is explained by taking the example of sending a first query request to AMS when it is necessary to query the application information corresponding to PKG1. In an optional implementation method, the client can also obtain an application information list from AMS after receiving the notification initiated by the service user sent by AMS, so that when querying the application information corresponding to PKG1, the client can query from the obtained application information list, for example, by traversal and the like. It should be noted that in this implementation method, there is no strict order of execution between the client's operation of obtaining the application information list and the operation of obtaining the device manufacturer information. In one example, these two operations can be performed in parallel, that is, the device manufacturer information is obtained while obtaining the application information list.

[0163] S1208: The client performs verification based on the application information corresponding to PKG1.

[0164] The specific implementation of the check can be found in Fig.10 Step S1003 in the illustrated embodiment.

[0165] If the application information corresponding to PKG1 is verified, the client performs the operation of S1209. Otherwise, if the application information corresponding to PKG1 is verified, the client performs the operation of S1210.

[0166] S1209: The client stores the first service query result, where the first service query result includes PKG1.

[0167] That is, when the application information verification corresponding to PKG1 is passed, it means that the server SVC1 corresponding to PKG1 exists in the electronic device, and the service provided by the server SVC1 can meet the needs of the service user. Therefore, the client can record PKG1 locally, so that when the service is needed in the future, the server SVC1 can be determined according to the first service query result, and the server SVC1 can be called to implement the required service.

[0168] S1210: The client stores the second service query result, where the second service query result includes PKG4.

[0169] That is, when the application information verification corresponding to PKG1 fails, it means that the server SVC1 corresponding to PKG1 exists in the electronic device, but the service provided by the server SVC1 cannot meet the needs of the service user. Therefore, the client can record PKG4 locally so that when the service is needed in the future, it can determine the server SVC4 based on the second service query result and call the server SVC4 to implement the required service.

[0170] Of course, it should be noted that the above description is based on the example that the application information corresponding to PKG1 exists in the application information list. In another possible case, if the application information corresponding to PKG1 does not exist in the application information list, the query result fed back by the AMS to the client is that the application information corresponding to PKG1 does not exist. In this case, the client also stores the second service query result.

[0171] It should be noted that the embodiment of the present application is described by taking the service user integrated with the server SVC4 as an example. In another example, if the service user does not integrate the server SVC4, the client determines that the service cannot be accessed.

[0172] The above process is the process of initializing the operating environment after the service user starts. Afterwards, if the service user calls the server, the electronic device can access it according to the initialization result (that is, the stored service query result), see below for details:

[0173] S1211: In response to the user's service triggering operation on the service user, the AMS notifies the service user's service module.

[0174] For example, see Fig.11 In (b) of FIG. 1 , the user clicks the "Add Device" item in the application interface U2 of the service user to trigger the service trigger operation. In this way, the AMS can detect the service trigger operation and notify the service module of the service user.

[0175] It should be noted that the embodiment of the present application is described by taking the AMS module detecting the user's business triggering operation on the service user as an example. In another example, it can also be detected by other modules in the electronic device, and the embodiment of the present application is not limited to this.

[0176] S1212: The business module calls the client of the service user.

[0177] S1213: The client queries a service query result, where the service query result includes a first service query result or a second service query result.

[0178] According to the above records, if the verification based on the application information corresponding to PKG1 is passed, the first service query result is stored in the client. Otherwise, if the verification based on the application information corresponding to PKG1 is not passed or the application information corresponding to PKG1 does not exist, if the service user is integrated with the server SVC4, the second service query result is stored in the client. Therefore, the service query result queried by the client may be the first service query result, or it may be the second service query result.

[0179] If the service query result is the first service query result, the process proceeds to step S1214. Otherwise, if the service query result is the second service query result, the process proceeds to step S1219.

[0180] S1214: The client sends a binding request to the service provider corresponding to PKG1, and the binding request carries SVC1.

[0181] The binding request is used to request binding with the server SVC1.

[0182] S1215: The service provider corresponding to PKG1 binds the client to the server SVC1.

[0183] It should be noted that the embodiment of the present application is described by taking the case where the client and the server SVC1 in the service user corresponding to PKG1 have not been bound before as an example. In a possible implementation, the client and the server SVC1 in the service provider corresponding to PKG1 have been bound before, for example, bound during verification based on the server interface version information and have not been unbound. In this case, the client directly enters the following S1216 operation, that is, there is no need to perform the binding operation again.

[0184] S1216: The client sends a service request to the service provider corresponding to PKG1.

[0185] S1217: The service provider corresponding to PKG1 processes the service request if it has not processed the service request before.

[0186] In one example, during the operation of the service provider, if the service request has not been processed, the service request is processed, such as performing a device scan, etc. If the service request has been processed, such as the execution result of the service request exists on the server, the execution result of the service request can be obtained and sent to the client.

[0187] In another example, during the operation of the service provider, if the service request has not been processed within a preset time period, the service request is processed. If the service request has been processed within the preset time period, the execution result of the service request is obtained and sent to the client.

[0188] The preset duration can be set according to the needs. By setting the preset duration, the shared service or data can be the result of the most recent execution, thereby improving the effectiveness of providing the service.

[0189] S1218: The service provider corresponding to PKG1 returns the execution result to the client.

[0190] After the service provider corresponding to PKG1 returns the execution result to the client, the operation proceeds to the following step S1223.

[0191] S1219: The client binds to the server SVC4.

[0192] S1220: The client sends a service request to the server SVC4.

[0193] S1221: The server SVC4 processes the service request.

[0194] S1222: The server SVC4 sends the execution result to the client.

[0195] S1223: The client sends the execution result to the business module.

[0196] In this way, the service call is realized. Moreover, as long as there is a server with strong compatibility or a higher version, the service calls of multiple service users using this feature can be aggregated to the server, that is, multiple service users call the same server, realizing service sharing and data sharing. Of course, in the case of not meeting the service sharing requirements, the access mechanism of each service user itself will not be affected, that is, it can also use its own server, thus ensuring the independence of each service user.

[0197] In an embodiment of the present application, in response to a service user starting up, the device manufacturer information of the electronic device is obtained, and the device manufacturer information can be used to indicate whether the electronic device belongs to a target manufacturer, and the target manufacturer is a manufacturer that provides services that the service user needs to use. Afterwards, the target server is determined from multiple servers based on the service priority query order that matches the device manufacturer information. When the service user requests to call a service, the service request is processed by the target server. In this way, for any service user of the electronic device, the server is called according to the process, so that when there is a server with a higher version or stronger service compatibility, each service user calls the server, that is, when the service sharing conditions are met, each service user can call the same server, thereby realizing service or data sharing.

[0198] See also Fig.13 , Fig.13 is a flow chart of a method for calling a service according to another exemplary embodiment. Here, the electronic device does not belong to the target manufacturer. The method is as follows Fig. 9 Taking the electronic device shown as being executed, and the electronic device being implemented through the interaction of multiple modules as an example, the method may mainly include the following implementation steps.

[0199] S1301: In response to the service user starting, the AMS notifies the business module.

[0200] S1302: The business module sends an initialization request to the client of the service user.

[0201] S1303: In response to the initialization request, the client sends a device information acquisition request to the AMS.

[0202] S1304: The AMS sends the device manufacturer information to the client.

[0203] The specific implementation of steps S1301 to S1304 can be found in Fig.12 Steps S1201 to S1204 in .

[0204] S1305: The client determines, based on the device manufacturer information, that the electronic device does not belong to the target manufacturer.

[0205] S1306: The client sends a second query request to the AMS, where the second query request carries PKG2.

[0206] The second query request is used to request to query the application information corresponding to PKG2.

[0207] PKG2 is pre-installed in the client.

[0208] S1307: In response to the second query request, the AMS sends application information corresponding to PKG2 to the client.

[0209] As an example, after receiving the first query request, the AMS may traverse the application information list to query whether there is application information corresponding to PKG2.

[0210] The embodiment of the present application is explained by taking the existence of application information corresponding to PKG2 as an example. If the application information corresponding to PKG2 does not exist, the query result fed back by AMS to the client is that the application information corresponding to PKG2 does not exist. In this case, the following S1310 operation is performed.

[0211] S1308: The client performs verification based on the application information corresponding to PKG2.

[0212] The specific implementation of the check can be found in Fig.10 Step S1003 in the illustrated embodiment.

[0213] If the application information corresponding to PKG2 is verified, the client performs the operation of S1309. Otherwise, if the application information corresponding to PKG2 is verified, the client performs the operation of S1310.

[0214] S1309: The client stores the third service query result, where the third service query result includes PKG2.

[0215] That is, when the application information verification corresponding to PKG2 is passed, it means that the server SVC2 corresponding to PKG2 exists in the electronic device, and the service provided by the server SVC2 can meet the needs of the service user. Therefore, the client can record PKG2 locally, so that when the service is needed in the future, the server SVC2 can be determined according to the third service query result, and the server SVC2 can be called to implement the required service.

[0216] S1310: The client sends an application information acquisition request to the AMS to request to obtain PKG3.

[0217] S1311: AMS sends PKG3 to the client.

[0218] That is, if the application information corresponding to PKG2 fails to be verified, or there is no application information corresponding to PKG2, the client obtains PKG3. For the specific implementation of obtaining PKG3, see Fig.10 Step S1010 in the illustrated embodiment.

[0219] S1312: The client sends a third query request to the AMS, where the third query request carries PKG3.

[0220] The third query request is used to request the application information corresponding to PKG3.

[0221] S1313: In response to the third query request, the AMS sends application information corresponding to PKG3 to the client.

[0222] It should be noted that the embodiment of the present application is described by taking the existence of application information corresponding to PKG3 as an example. In another possible case, the application information corresponding to PKG3 does not exist in the electronic device. In this case, the AMS feedbacks to the client that the application information corresponding to PKG3 does not exist, and the client enters the operation of the following step S1316.

[0223] Similarly, the embodiment of the present application is explained by taking the example of sending a corresponding query request to AMS when it is necessary to query the application information corresponding to a certain PKG (such as PKG2 or PKG3). In an optional implementation, the client can also obtain the application information list from AMS after receiving the notification initiated by the service user sent by AMS, so that when it is necessary to query the application information corresponding to a certain PKG, the client can query from the obtained application information list.

[0224] S1314: The client performs verification based on the application information corresponding to PKG3.

[0225] The specific implementation of the client's verification based on the application information corresponding to PKG3 can be found in Fig.10 Step S1003 in the illustrated embodiment.

[0226] If the application information verification based on PKG3 is passed, the client performs the operation of S1315. Otherwise, if the application information verification based on PKG1 is not passed, the client performs the operation of S1316.

[0227] S1315: The client stores the fourth service query result, where the fourth service query result includes PKG3.

[0228] If the application information verification based on PKG3 is passed, it means that the server SVC3 corresponding to PKG3 exists in the electronic device, and the service provided by the server SVC3 can meet the needs of the service user. Therefore, the client can record PKG3 locally, so that when the service is needed in the future, the server SVC3 can be determined according to the fourth service query result, and the server SVC3 can be called to implement the required service.

[0229] It should be noted that the embodiment of the present application is described by taking the case where the application information list contains the application information corresponding to PKG3 as an example. If the application information list does not contain the application information corresponding to PKG3, the following operation S1316 is entered.

[0230] S1316: The client stores the second service query result, where the second service query result includes PKG4.

[0231] If the verification based on the application information corresponding to PKG3 fails, it means that the server SVC3 corresponding to PKG3 exists in the electronic device, but the service provided by the server SVC3 cannot meet the needs of the service user; or if the application information corresponding to PKG3 does not exist, it means that the server SVC3 corresponding to PKG3 does not exist. Therefore, the client can record PKG4 locally, so that when the service needs to be used later, the server SVC4 can be determined according to the second service query result, and the server SVC4 can be called to implement the required service.

[0232] It should be noted that the embodiment of the present application is described by taking the service user integrated with the server SVC4 as an example. In another example, if the service user does not integrate the server SVC4, the client determines that the service cannot be accessed.

[0233] At this point, the initialization operation has been completed. After that, if the service user calls the server, the electronic device can access it according to the initialization result. For details, see below:

[0234] S1317: When the service is triggered, the service module calls the client.

[0235] For its specific implementation, please refer to Fig.12 Steps S1211 to S1212 in the illustrated embodiment.

[0236] S1318: The client queries the service query result, where the service query result includes the third service query result, the fourth service query result or the second service query result.

[0237] If the service query result is the third service query result, the operation proceeds to step S1319. Otherwise, if the service query result is the fourth service query result, the operation proceeds to step S1324. Otherwise, if the service query result is the second service query result, the operation proceeds to step S1329.

[0238] S1319: The client sends a binding request to the service provider corresponding to PKG2, and the binding request carries SVC2.

[0239] The binding request is used to request binding with the server SVC2.

[0240] S1320: The service provider corresponding to PKG2 binds the client to the server SVC2.

[0241] Similarly, if the client and the server SVC2 are bound, for example, bound based on the server interface version information verification and have not been unbound, the client directly enters the following 1321 operation, that is, there is no need to perform the binding operation again.

[0242] S1321: The client sends a service request to the server SVC2.

[0243] S1322: When determining that the service request has not been processed, the server SVC2 processes the service request.

[0244] For specific implementation, see Fig.12 S1217 in the illustrated embodiment.

[0245] S1323: The server SVC2 returns the execution result to the client.

[0246] After the execution result is returned, enter the operation of the following step S1333.

[0247] S1324: The client sends a binding request to the service user corresponding to PKG3, and the binding request carries SVC3.

[0248] S1325: The service user corresponding to PKG3 binds the server SVC3 to the client.

[0249] S1326: The client sends a service request to the server SVC3.

[0250] S1327: When determining that the service request has not been processed, the server SVC3 processes the service request.

[0251] S1328: The server SVC3 returns the execution result to the client.

[0252] After the execution result is returned, enter the operation of the following step S1333.

[0253] S1329: The client binds to the server SVC4.

[0254] S1330: The client sends a service request to the server SVC4.

[0255] S1331: The server SVC4 processes the service request.

[0256] S1332: The server SVC4 sends the execution result to the client.

[0257] S1333: The client sends the execution result to the business module.

[0258] In an embodiment of the present application, in response to a service user starting up, the device manufacturer information of the electronic device is obtained, and the device manufacturer information can be used to indicate whether the electronic device belongs to a target manufacturer, and the target manufacturer is a manufacturer that provides services that the service user needs to use. Afterwards, the target server is determined from multiple servers based on the service priority query order that matches the device manufacturer information. When the service user requests to call a service, the service request is processed by the target server. In this way, for any service user of the electronic device, the server is called according to the process, so that when there is a server with a higher version or stronger service compatibility, each service user calls the server, that is, when the service sharing conditions are met, each service user can call the same server, thereby realizing service or data sharing.

[0259] See also Fig.14 , Fig.14 is a flowchart of a method for calling a service according to another exemplary embodiment. As an example but not a limitation, the method is applied to the above Fig. 9 The electronic device shown may mainly include some or all of the following contents:

[0260] S1401: In response to the service user initiating, obtaining device manufacturer information of the electronic device, where the device manufacturer information is used to indicate whether the electronic device belongs to a target manufacturer, which is a manufacturer that provides services required by the service user.

[0261] The specific implementation can be found in the above Fig.10 Step S1001 in the illustrated embodiment.

[0262] S1402: Determine a target server from at least one candidate server according to a service priority query order that matches the device manufacturer information, wherein the at least one candidate server provides a service required by a service user, and the at least one candidate server exists in a different form in the electronic device.

[0263] As an example of the present application, when the device manufacturer information indicates that the electronic device belongs to the target manufacturer, the service priority query order matching the device manufacturer information is: first candidate server, second candidate server; wherein the first candidate server is a native server provided by the target manufacturer in the form of APK (native APK), and the second candidate server is a server integrated in the service user in the form of a plug-in, and the service user at this time is usually provided by the target manufacturer. Exemplarily, the first candidate server is server SVC1, and the second candidate server is server SVC4.

[0264] As an example of the present application, when the device manufacturer information indicates that the electronic device does not belong to the target manufacturer, the service priority query order matching the device manufacturer information is: the third candidate server, the fourth candidate server, and the second candidate server; wherein the third candidate server is a server in the form of APK, and the APK (modified APK) where the third candidate server is located is different from the APK where the first candidate server is located, and the fourth candidate server is a server integrated in the form of a plug-in to a third-party service user. Exemplarily, the third candidate server is server SVC2, and the fourth candidate server is server SVC3.

[0265] Since at least one candidate server in the electronic device is different when the electronic device belongs to the target manufacturer and when it does not belong to the target manufacturer, the service priority query order is different. In this way, the target server is determined according to the service priority query order that matches the device manufacturer information, which can improve the accuracy and effectiveness of service calls.

[0266] In one example, the specific implementation of S1402 includes: determining the application identifier (i.e., PKG) to be used each time the target server is queried based on the service priority query order that matches the device manufacturer information. Each time an application identifier is determined, the application information corresponding to the currently determined application identifier is queried from the application information list, and the application information list includes application information corresponding to each application identifier in multiple application identifiers. In the case where the currently determined application identifier is not the application identifier of the service user, a verification is performed based on the currently queried application information. In the case where the verification passes, the server providing the service in the service provider corresponding to the currently determined application identifier is determined as the target server. In the case where the verification fails, the operation of returning to the service priority query order that matches the device manufacturer information to determine the application identifier to be used each time the target server is queried.

[0267] It should be noted that, in the case where the currently determined application identifier is the application identifier of a third-party service user, the service provider corresponding to the application identifier is integrated into the third-party application user in the form of a plug-in.

[0268] For the specific implementation of verification based on the current query application information, please refer to Fig.10 S1003 in the illustrated embodiment.

[0269] When the currently determined application identifier is the application identifier of the service user, it is possible to query whether the service user itself has integrated the server. If the server is integrated, the server is determined as the target server, which means that no further verification is required at this time.

[0270] In this way, according to the service priority query order that matches the device manufacturer information, the candidate servers in the electronic device are queried one by one to determine the server with stronger compatibility or higher priority, and then the server is called, so that each service user in the electronic device can use the same server instead of using their own integrated server. In this way, the sharing of services or data is achieved.

[0271] As an example of the present application, when the device manufacturer information indicates that the electronic device belongs to the target manufacturer, the application identifier to be used for each query to the target server is determined according to the service priority query order that matches the device manufacturer information, including: according to the service priority query order that matches the device manufacturer information, the application identifiers to be used for each query to the target server are determined to be: the first application identifier, the second application identifier, wherein the first application identifier is the identifier of the APK where the first candidate server is located, and the second application identifier is the identifier of the APK where the second candidate server is located. Exemplarily, the first application identifier is PKG1, and the second application identifier is PKG4.

[0272] In this way, in the target manufacturer's own electronic device, the target server is determined according to the service priority query order, so that different service users can call the same server as much as possible, thereby realizing the sharing of services or data. And when the service sharing conditions are not met, the service user can also use its own server, ensuring the independence of the service user itself.

[0273] As an example of the present application, when the device manufacturer information indicates that the electronic device does not belong to the target manufacturer, the application identifier to be used for each query to the target server is determined according to the service priority query order that matches the device manufacturer information, including: according to the service priority query order that matches the device manufacturer information, the application identifiers to be used for each query to the target server are determined to be the third application identifier, the fourth application identifier, and the second application identifier, respectively, the third application identifier is the identifier of the APK where the third candidate server is located, and the fourth application identifier is the identifier of the APK where the fourth candidate server is located. Exemplarily, the third application identifier is PKG2, and the fourth application identifier is PKG3.

[0274] In this way, in electronic devices of other manufacturers, the target server is determined according to the service priority query order, so that different service users can call the same server as much as possible, thereby realizing the sharing of services or data. And when the service sharing conditions are not met, the service user can also use its own server, ensuring the independence of the service user itself.

[0275] As an example of the present application, the fourth application identifier is determined from a system configuration file, or it can also be determined from system attribute information. In this way, by setting the fourth application identifier information in the preset setting item, the fourth application identifier can be queried regardless of which manufacturer's electronic device the server is integrated into, so that the server integrated in the third-party service user can be queried based on the fourth application identifier, thereby ensuring the applicability of the service call method.

[0276] S1403: In response to the service request from the service user, the service request is processed by the target server.

[0277] For its specific implementation, please refer to Fig.10 S1005 in the illustrated embodiment.

[0278] In an embodiment of the present application, in response to a service user starting up, the device manufacturer information of the electronic device is obtained, and the device manufacturer information can be used to indicate whether the electronic device belongs to a target manufacturer, and the target manufacturer is a manufacturer that provides services that the service user needs to use. Afterwards, the target server is determined from multiple servers based on the service priority query order that matches the device manufacturer information. When the service user requests to call a service, the service request is processed by the target server. In this way, for any service user of the electronic device, the server is called according to the process, so that when there is a server with a higher version or stronger service compatibility, each service user calls the server, that is, when the service sharing conditions are met, each service user can call the same server, thereby realizing service or data sharing.

[0279] It is also worth noting that the concept of calling services provided in the embodiments of the present application can also be applied to software engineering or system engineering with similar characteristics (such as server access priority control, etc.).

[0280] Fig.15 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. Fig.15The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0281] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0282] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0283] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0284] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0285] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0286] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0287] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193 and the wireless communication module 160.

[0288] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0289] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0290] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is an integer greater than 1.

[0291] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0292] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0293] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121, such as executing the method of calling the service described in the above-mentioned embodiments. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0294] The electronic device 100 can implement audio functions, such as music playback, recording, etc., through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D and the application processor.

[0295] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0296] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).

[0297] The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present application.

Claims

1. A method for calling a service, characterized in that: Applied to electronic equipment, the method comprises: In response to the service user starting, obtaining device manufacturer information of the electronic device, the device manufacturer information is used to indicate whether the electronic device belongs to a target manufacturer, the target manufacturer is a manufacturer that provides the service required by the service user; Determine a target server from at least one candidate server according to a service priority query order matching the device manufacturer information, wherein the at least one candidate server provides the service required by the service user, and the at least one candidate server exists in different forms in the electronic device; In response to the service request of the service user, the service request is processed by the target service end.

2. The method according to claim 1, characterized in that In the case where the device manufacturer information indicates that the electronic device belongs to the target manufacturer, the priority query order of services matching the device manufacturer information is: first candidate server, second candidate server; wherein the first candidate server is a native server in the form of APK provided by the target manufacturer, and the second candidate server is a server integrated in the form of a plug-in in the service user; When the device manufacturer information indicates that the electronic device does not belong to the target manufacturer, the service priority query order that matches the device manufacturer information is: the third candidate server, the fourth candidate server, and the second candidate server; wherein, the third candidate server is a server in the form of APK, and the APK where the third candidate server is located is different from the APK where the first candidate server is located, and the fourth candidate server is a server integrated in the form of a plug-in in a third-party service user.

3. The method according to claim 2, characterized in that The determining of the target server from at least one candidate server according to the service priority query order matching the device manufacturer information comprises: Determine the application identifier to be used for each query of the target server according to the service priority query order matching the device manufacturer information; Each time an application identifier is determined, searching an application information list for application information corresponding to the currently determined application identifier, wherein the application information list includes application information corresponding to each of the multiple application identifiers; If the currently determined application identifier is not the application identifier of the service user, verifying based on the currently queried application information; If the verification is passed, a server providing the service among the service providers corresponding to the currently determined application identifier is determined as the target server; In the case where the verification fails, the process continues to return to the operation of determining the application identifier to be used for each query to the target server according to the service priority query sequence matching the device manufacturer information.

4. The method according to claim 3, characterized in that The application information in the application information list includes application version information; The verifying based on the currently queried application information when the currently determined application identifier is not the application identifier of the service user includes: When the currently determined application identifier is not the application identifier of the service user, comparing the application version information in the currently queried application information with the application version information provided in the client used by the service user; If the application version information in the currently queried application information is higher than the application version information provided in the client used by the service user, it is determined that the verification is passed; If the application version information in the currently queried application information is lower than the application version information provided in the client used by the service user, it is determined that the verification has failed.

5. The method according to claim 3, characterized in that The application information in the application information list includes a server identifier; The verifying based on the currently queried application information when the currently determined application identifier is not the application identifier of the service user includes: In the case where the currently determined application identifier is not the application identifier of the service user, if the currently queried application information includes a first server identifier of the server providing the service, then binding the client of the service user with the server corresponding to the first server identifier; Obtaining, through the client of the service user, the server interface version information of the server corresponding to the first server identifier; In the case where the obtained server interface version information is higher than the server interface version information provided in the client used by the service user, determining that the verification is passed; In a case where the acquired server interface version information is lower than the server interface version information provided in the client used by the service user, it is determined that the verification has failed.

6. The method according to any one of claims 3 to 5, characterized in that The device manufacturer information indicates that the electronic device belongs to the target manufacturer; The determining, according to the service priority query order matching the device manufacturer information, the application identifier to be used for each query of the target server includes: According to the service priority query order that matches the device manufacturer information, it is determined that the application identifiers to be used for each query to the target server are: the first application identifier and the second application identifier, wherein the first application identifier is the identifier of the APK where the first candidate server is located, and the second application identifier is the identifier of the APK where the second candidate server is located.

7. The method according to any one of claims 3 to 5, characterized in that The device manufacturer information indicates that the electronic device does not belong to the target manufacturer; The determining, according to the service priority query order matching the device manufacturer information, the application identifier to be used for each query of the target server includes: According to the service priority query order that matches the device manufacturer information, it is determined that the application identifiers to be used for each query of the target server are the third application identifier, the fourth application identifier, and the second application identifier, respectively. The third application identifier is the identifier of the APK where the third candidate server is located, and the fourth application identifier is the identifier of the APK where the fourth candidate server is located.

8. The method according to claim 7, characterized in that The fourth application identifier is determined from a system configuration file, or the fourth application identifier is determined from system attribute information.

9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Service calling control method and device, service calling method and device and terminal

    CN109933960A

  • AI service open center station and method

    CN110245031A

  • Service calling method and device, electronic equipment and storage medium

    CN112965765A

  • SDK plug-in loading method and apparatus, and mobile terminal and storage medium

    CN113412468A

  • Service calling method and system based on micro-service architecture, equipment and medium

    CN113742100A