A service recommendation method, device, system and electronic equipment

CN122802570APending Publication Date: 2026-09-22HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510332213.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

然而,目前仍存在设备控制能力分散、功能复杂,功能入口深,跨设备操作繁琐、门槛高等诸多问题,因此,如何在设备间实现无感流转已成为全场景设备感知技术发展的瓶颈

Benefits of technology

[0025]第六方面,本申请提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如第一方面中所描述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802570A_ABST
    Figure CN122802570A_ABST
Patent Text Reader

Abstract

A service recommendation method applied to a first electronic device, comprising: detecting that a state of the first electronic device is switched to a target state, wherein the target state is used to represent that the first electronic device is in a state of adapting to a new environment or a new demand; broadcasting a first packet; receiving a response packet returned from a second electronic device, wherein the second electronic device and the first electronic device are in a trusted networking state; determining, based on the response packet, a device type of the second electronic device and a first distance between the first electronic device and the second electronic device; determining, based on the device type of the second electronic device, a service that can be provided to the second electronic device; and recommending, based on a screen state of the first electronic device and the first distance, the service that can be provided to the second electronic device to a user. The method realizes distance measurement and service recommendation between devices without sensing, and solves the problems of strong user perception, complicated operation and security and privacy risks in existing cross-device solutions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a service recommendation method, apparatus, system and electronic device. Background Technology

[0002] With the rapid development of technology and the widespread adoption of smart living, terminal devices are increasing at an astonishing rate, from smart wearables to various smart home products, from mobile office terminals to industrial control equipment, and are permeating every corner of people's lives and work. For example, mobile phones, with their lightweight and portable characteristics, meet people's diverse and complex needs for communication, entertainment, and work anytime, anywhere; televisions, with their large, high-definition screens, create an immersive visual feast, becoming the core carrier of home entertainment; in-vehicle systems are closely linked to vehicle operation, accurately acquiring and clearly displaying key vehicle information; and smartwatches, with their compact and wearable design, can not only monitor health indicators such as heart rate and sleep in real time, but also promptly push notifications, enabling convenient interaction. These various terminal devices, with their unique functional advantages, collectively construct a smart and convenient modern living and production system.

[0003] Full-scenario device collaboration is an inevitable trend in the era of the Internet of Things, with its core objective being to achieve seamless cross-terminal collaboration. Building comprehensive inter-device distance sensing capabilities to enable seamless application flow is key to improving the user experience across all scenarios. Seamlessly triggering corresponding services and creating new, superficial interactive experiences across all scenarios, such as sensing-based broadcast control, proximity sharing, sensing-based vehicle control, and sensing-based remote control, all require seamless application flow to empower full-scenario service applications. However, currently, there are still many problems such as fragmented device control capabilities, complex functions, deep function entry points, cumbersome cross-device operations, and high barriers to entry. Therefore, how to achieve seamless flow between devices has become a bottleneck in the development of full-scenario device sensing technology. Summary of the Invention

[0004] This application provides a service recommendation method, apparatus, system, and electronic device that can proactively recommend services between devices without the user's awareness, thereby enabling seamless flow between devices.

[0005] Firstly, this application provides a service recommendation method applied to a first electronic device, comprising: detecting that the state of the first electronic device has switched to a target state, wherein the target state is used to characterize the first electronic device as being in a state adapted to a new environment or new needs; broadcasting a first message; receiving a response message returned from a second electronic device, wherein the second electronic device and the first electronic device are in a trusted network state; determining the device type of the second electronic device and a first distance between the first electronic device and the second electronic device based on the response message; determining services that can be provided to the second electronic device based on the device type of the second electronic device; and recommending services that can be provided to the second electronic device to a user based on the screen state of the first electronic device and the first distance. For example, the first message may be a message requiring a response from other devices. For example, the new needs may, but are not limited to, new needs generated by the user for the first electronic device; for example, when the screen of the first electronic device is woken up by the user, it indicates that the user has a need to use the first electronic device; when a video application on the first electronic device is opened, it indicates that the user has a need to use the first electronic device to watch videos.

[0006] In this way, when the first electronic device and the second electronic device are in a trusted network state, and the state of the first electronic device is adapted to the new environment or new requirements, the distance between the two is actively measured by actively triggering broadcast and actively making service recommendations based on the distance measurement results. This achieves seamless triggering of distance measurement and service recommendations between devices, solving the problems of strong user perception, cumbersome operation and security and privacy risks in existing cross-device solutions.

[0007] In one possible implementation, detecting a change in the state of the first electronic device to the target state includes: detecting a change in the location of the first electronic device; or detecting a change in the wireless network associated with the first electronic device; or detecting that the screen of the first electronic device is woken up; or detecting that a network has been successfully established between the first electronic device and the second electronic device; or detecting that a target service on the first electronic device is activated. Thus, when changes occur in the location, wireless network, network formation, or service of the first electronic device, it can be determined that the first electronic device is in the target state.

[0008] In one possible implementation, determining a first distance between the first electronic device and the second electronic device based on a response message includes: calculating the first distance based on a received signal strength indication carried in the response message. In this way, the distance between the two devices can be calculated from their communication messages.

[0009] In one possible implementation, the first message is broadcast, including via Bluetooth. This enables low-power communication and ranging.

[0010] In one possible implementation, based on the screen state of the first electronic device and a first distance, services available to the second electronic device are recommended to the user. This includes: if the first distance is less than or equal to a first threshold, recommending services available to the second electronic device based on the screen state of the first electronic device; if the first distance is greater than the first threshold, calculating a second distance between the first and second electronic devices based on a first ranging method, and if the second distance is less than or equal to the second threshold, recommending services available to the second electronic device based on the screen state of the first electronic device. The ranging accuracy of the first ranging method is higher than that of Bluetooth. Thus, by combining low-precision and high-precision ranging methods, a ranging scheme that combines low power consumption with wide coverage can be constructed, solving the problem of balancing power consumption and coverage in existing wireless signal ranging schemes. For example, the first ranging method can be a star-flash or ultrasonic ranging method.

[0011] In one possible implementation, before calculating the second distance between the first electronic device and the second electronic device based on the first ranging method, the method further includes: determining whether to use the first ranging method for ranging based on the device type of the first electronic device and the device type of the second electronic device. This way, high-precision ranging can be initiated only when it is required, thereby saving power consumption.

[0012] In one possible implementation, services available to a second electronic device are recommended to the user based on the screen state of the first electronic device. This includes: when the screen is locked, displaying recommended information related to the available services via a lock screen notification; and when the screen is unlocked, displaying recommended information related to the available services in real time, or displaying such information on the desktop, control center, or notification center. This allows for different proactive service prompts depending on the screen state of the first electronic device, improving the user experience.

[0013] In one possible implementation, the response message carries information such as the device type of the second electronic device, the device identifier of the second electronic device, an indication of the received signal strength of the second electronic device, and a flag indicating whether the second electronic device supports high-precision ranging. In this way, information such as the device type of the second electronic device can be identified through the response message.

[0014] Secondly, this application provides a service recommendation device deployed on a first electronic device, comprising: a processing module and a communication module. The processing module is configured to detect when the state of the first electronic device switches to a target state, wherein the target state characterizes the first electronic device as being adapted to a new environment or new requirements. The communication module is configured to broadcast a first message and receive a response message returned from a second electronic device, wherein the second electronic device and the first electronic device are in a trusted network state. The processing module is further configured to determine the device type of the second electronic device and a first distance between the first and second electronic devices based on the response message. The processing module is also configured to determine services available to the second electronic device based on the device type of the second electronic device, and recommend services available to the user by the second electronic device based on the screen state of the first electronic device and the first distance.

[0015] In one possible implementation, when the processing module detects that the state of the first electronic device has switched to the target state, it is specifically used to: detect a change in the location of the first electronic device; or, detect a change in the wireless network associated with the first electronic device; or, detect that the screen of the first electronic device is woken up; or, detect that a network has been successfully established between the first electronic device and the second electronic device; or, detect that the target service on the first electronic device has been activated.

[0016] In one possible implementation, when the processing module determines the first distance between the first electronic device and the second electronic device based on the response message, it is specifically used to: calculate the first distance based on the received signal strength indication carried in the response message.

[0017] In one possible implementation, when broadcasting the first message, the communication module is specifically used to: broadcast the first message via Bluetooth.

[0018] In one possible implementation, when the processing module recommends services available to the second electronic device based on the screen state of the first electronic device and a first distance, it is specifically configured to: recommend services available to the second electronic device based on the screen state of the first electronic device when the first distance is less than or equal to a first threshold; and calculate a second distance between the first and second electronic devices based on a first ranging method when the first distance is greater than the first threshold, and recommend services available to the second electronic device based on the screen state of the first electronic device when the second distance is less than or equal to the second threshold, wherein the ranging accuracy of the first ranging method is higher than that of Bluetooth.

[0019] In one possible implementation, before the processing module calculates the second distance between the first electronic device and the second electronic device based on the first ranging method, it is further configured to: determine whether to use the first ranging method for ranging based on the device type of the first electronic device and the device type of the second electronic device.

[0020] In one possible implementation, when the processing module recommends services available to the second electronic device based on the screen state of the first electronic device, it is specifically configured to: pop up recommendation information related to the services available to the second electronic device in the form of a lock screen notification when the screen state is locked; and pop up recommendation information related to the services available to the second electronic device in real time when the screen state is unlocked, or display recommendation information related to the services available to the second electronic device on the desktop, control center, or notification center.

[0021] In one possible implementation, the response message carries the device type of the second electronic device, the device identifier of the second electronic device, the received signal strength indication of the second electronic device, and a flag indicating whether the second electronic device supports high-precision ranging.

[0022] Thirdly, this application provides a service recommendation system, including: a first electronic device and a second electronic device, wherein the second electronic device and the first electronic device are in a trusted network state. The first electronic device is used to detect when its state switches to a target state, wherein the target state represents a state where the first electronic device is adapted to a new environment or new requirements. The first electronic device is also used to broadcast a first message. The second electronic device is used to receive the first message and send a response message to the first electronic device. The first electronic device is also used to receive the response message. The first electronic device is also used to determine, based on the response message, the device type of the second electronic device and a first distance between the first and second electronic devices. The first electronic device is also used to determine, based on the device type of the second electronic device, services that can be provided to the second electronic device, and, based on the screen state of the first electronic device and the first distance, recommend services that can be provided to the second electronic device to a user.

[0023] Fourthly, this application provides an electronic device, comprising: one or more processors; a memory; wherein the memory stores one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method described in the first aspect.

[0024] Fifthly, this application provides a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the method described in the first aspect.

[0025] In a sixth aspect, this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in the first aspect.

[0026] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0027] Figure 1 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0028] Figure 2 This is a flowchart illustrating a service recommendation method provided in an embodiment of this application;

[0029] Figure 3 This is a schematic diagram of the interface display of an electronic device provided in an embodiment of this application;

[0030] Figure 4 This is a schematic diagram of the core part of a service recommendation method provided in an embodiment of this application;

[0031] Figure 5 This is a schematic diagram of a perception-based broadcast triggering strategy provided in an embodiment of this application;

[0032] Figure 6 This is a schematic diagram of a wireless Xinhua fusion ranging process provided in an embodiment of this application;

[0033] Figure 7 This is a schematic diagram illustrating the process of an active recommendation service for all-scenario devices provided in an embodiment of this application;

[0034] Figure 8 This is a schematic diagram of the structure of a service recommendation device provided in an embodiment of this application;

[0035] Figure 9 This is a schematic diagram of the interface display of an electronic device provided in an embodiment of this application;

[0036] Figure 10 This is a schematic diagram illustrating another proactive recommendation service for all-scenario devices provided in this application embodiment. Detailed Implementation

[0037] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.

[0038] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.

[0039] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0040] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.

[0041] First, some of the technical terms involved in the embodiments of this application will be introduced.

[0042] (1) Circulation

[0043] Flow refers to distributed operations across multiple devices. Flow capabilities break down device boundaries, enabling multi-device collaboration and allowing user applications to be separated, combined, and flow seamlessly, achieving distributed business applications such as cross-device email editing, multi-device collaborative fitness, and multi-screen gaming. Flow provides developers with broader use cases and a fresher product perspective, strengthening product advantages and achieving enhanced user experience. Flow can be categorized by use case into cross-platform migration and multi-platform collaboration.

[0044] (2) Star-flash ranging

[0045] Star-flash ranging is a wireless signal-based positioning technology primarily used for short-range, high-precision positioning. Its process mainly includes the following steps: a) Initiating a ranging request: Device 1 sends a ranging request message to Device 2. b) Measurement and data acquisition: After receiving the request, Device 2 measures the signal characteristics emitted by Device 1, such as signal strength and the time difference between signal transmission and reception. c) Data processing and calculation: Based on the measurement results and a positioning algorithm, Device 2 calculates the relative position or distance information between Device 1 and Device 2. d) Feedback of ranging results: Device 2 sends the calculated distance information back to Device 1 via a response message, completing the ranging process.

[0046] (3) Ultrasonic ranging

[0047] Ultrasonic ranging primarily utilizes the propagation speed and time difference of ultrasonic waves in a medium to calculate distance. A common method is pulse-echo ranging, the process of which is as follows: a) Initiating ranging: Device 1 emits an ultrasonic pulse of a certain frequency towards Device 2. b) Receiving the reflected wave: The ultrasonic wave reflects after encountering Device 2 during propagation. Device 1 receives the reflected echo and records the time difference between transmission and reception. c) Calculating the distance: Device 1 calculates the distance between the two devices based on the formula relating distance, sound speed, and time difference.

[0048] Next, the technical solutions provided in the embodiments of this application will be introduced.

[0049] For example, in the full-scenario device sensing technology, application flow is mainly based on sensor-triggered operation, that is, it is achieved through user-initiated operation. For instance, users can control application flow through voice commands, quickly migrate applications using the device's "tap-to-swap" function, operate step-by-step using the flow function built into the business application, or achieve cross-device interaction through third-party software. While these methods can meet basic needs, they have some problems: First, they are highly user-aware and rely too much on user operation. Cross-device operation involves complex connection steps, deep function entry points, and long operation paths, which is unfriendly to users unfamiliar with the operation and reduces the user experience. For example, screen casting requires multiple setups and pairings. Second, there are security and privacy issues. Flow software obtained through unofficial channels may contain security vulnerabilities or malicious code. Installing and using it may lead to the device being infected with viruses or attacked, affecting device and data security.

[0050] In view of this, the embodiments of this application provide a service recommendation scheme that can automatically identify the status of electronic devices to trigger wireless signal ranging, thereby realizing the proactive recommendation of services (such as large screen projection) between devices without the user's awareness. This effectively solves the problem of long user operation paths and ensures the security of proactive service recommendation (projection and other services) between devices based on trusted networking and other prerequisites.

[0051] It is understood that the electronic devices in the embodiments of this application may be mobile phones, tablets, desktop computers, laptops, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, vehicle infotainment systems, smart TVs, Huawei smart screens, smart speakers, smart home devices, and / or smart city devices, etc. Exemplary embodiments of the electronic devices include, but are not limited to, electronic devices running iOS, Android, Windows, Harmony OS, or other operating systems. The embodiments of this application do not specifically limit the type of electronic device.

[0052] For example, Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Figure 1 As shown, the electronic device 100 may include: a processor 110, a memory 120, a communication module 130, a display screen 140, a sensor module 150, and a battery 160.

[0053] Processor 110 is the computing and control core of electronic device 100. Processor 110 may include one or more processing units. For example, processor 110 may include one or more of the following: application processor (AP), modem, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. In this embodiment, the NPU may be a neural network (NN) computing processor, which, by referencing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, can quickly process input information and continuously learn itself. The NPU can enable intelligent cognitive applications of electronic device 100, such as image recognition, face recognition, speech recognition, text understanding, and text recognition. In some embodiments, the processor 110 can collect data from various sensors (such as accelerometers, gyroscopes, magnetometers, barometers, etc.), and after preprocessing steps such as filtering and calibration, calculate the position of the electronic device 100 using data fusion techniques (such as Kalman filtering or particle filtering) combined with inertial navigation algorithms, attitude estimation, and other methods. Additionally, the processor 110 can also calculate the distance between the electronic device 100 and other devices based on information from messages returned by other devices. Furthermore, the processor 100 can also detect whether the electronic device 100 is in a state adapted to new environments or new requirements, and so on.

[0054] The memory 120 may store a program, which can be executed by the processor 110, causing the processor 110 to perform the methods executed by the electronic device 100 provided in this embodiment. The memory 120 may also store data. The processor 110 may read the data stored in the memory 120. The memory 120 and the processor 110 may be configured separately. Optionally, the memory 120 may also be integrated into the processor 110.

[0055] The communication module 130 may include, but is not limited to, functional components such as filters, switches, power amplifiers, and low-noise amplifiers (LNAs). The communication module 130 can receive electromagnetic waves via an antenna, filter and amplify the received electromagnetic waves, and transmit them to a modem for demodulation. The communication module 130 can also amplify the signal modulated by the modem and radiate it as electromagnetic waves via the antenna. In some examples, some functional modules of the communication module 130 may be integrated into the processor 110, or integrated together with some modules of the processor 110 in the same device. In other examples, the communication module 130 may include at least one of a mobile communication module and a wireless communication module. When the communication module 130 includes a mobile communication module, the communication module 130 can provide wireless communication solutions, including 2G / 3G / 4G / 5G / 6G, for use on the electronic device 100. Examples include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), and New Radio (NR). When the communication module 130 includes a wireless communication module, it can provide solutions for wireless communication applications on the electronic device 100, including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR) technologies.

[0056] The display screen 140 can be used to display images, videos, service recommendation cards, etc. The display screen 140 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 (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc.

[0057] The electronic device 100 may also include a sensor module 150. The sensor module 150 may include a pressure sensor 150A, a gyroscope sensor 150B, a barometric pressure sensor 150C, an accelerometer sensor 150D, a proximity sensor 150E, an ambient light sensor 150F, or a touch sensor 150G, etc. The pressure sensor 150A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 150A may be disposed on the display screen 140. There are many types of pressure sensors 150A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 150A, the capacitance between the electrodes changes. The electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to the display screen 140, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 150A. The electronic device 100 may also calculate the touch position based on the detection signal from the pressure sensor 150A. In some embodiments, touch operations applied to the same touch location but with different touch intensity can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS message is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS message is executed.

[0058] The gyroscope sensor 150B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 150B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 150B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 150B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 150B can also be used in navigation and motion-sensing game scenarios.

[0059] The barometric pressure sensor 150C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 150C to assist in positioning and navigation.

[0060] The accelerometer 150D can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic device and applied to applications such as screen orientation switching and pedometers.

[0061] The proximity sensor 150E may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that no object is near the electronic device 100. The electronic device 100 may use the proximity sensor 150E to detect when a user holds the electronic device 100 close to their ear for a phone call, so as to automatically turn off the screen to save power. The proximity sensor 150E can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0062] The ambient light sensor 150F is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 140 according to the sensed ambient light brightness. The ambient light sensor 150F can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 150F can also work with the proximity sensor 150E to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0063] Touch sensor 150G, also known as a "touch device," can be disposed on display screen 140. The touch sensor 150G and display screen 140 together form a touchscreen, also known as a "touchscreen." Touch sensor 150G is used to detect touch operations applied to or near it. The touch sensor can transmit 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 display screen 140. Exemplarily, the touch sensor can be implemented using various methods such as resistive, capacitive, infrared, and surface acoustic wave. In other embodiments, touch sensor 150G may also be disposed on the surface of electronic device 100, in a different location than display screen 140.

[0064] A battery 160 may also be provided on the electronic device 100. The battery 160 can provide power to the electronic device 100.

[0065] It is understood that this embodiment Figure 1 The illustrated structure does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0066] The above is a description of the hardware and software of the electronic device 100 provided in the embodiments of this application. The following is a detailed description in conjunction with... Figure 2 The service recommendation scheme provided in the embodiments of this application will be described in detail.

[0067] For example, Figure 2 A flowchart illustrating a service recommendation method provided in an embodiment of this application is shown. Figure 2 In this context, electronic devices 100 and 200 are in a trusted network state. For example, when both are logging in using the same account, or when both have previously logged in using the same account, they can be considered to be in a trusted network state. Figure 2 The hardware structure of the Zhong Electronic Device 200 can be referenced. Figure 1 The hardware structure of the electronic device 100 described herein will not be elaborated upon here. Additionally, in Figure 2 In this context, electronic device 100 can also be referred to as the "first electronic device," and electronic device 200 can also be referred to as the "second electronic device." For example... Figure 2 As shown, the service recommendation method may include the following steps:

[0068] S201, Electronic device 100 detects that its own state has switched to the target state, wherein the target state is used to characterize the electronic device 100 in a state that is adapted to a new environment or new requirements.

[0069] In this embodiment, the electronic device 100 can detect its own state in real time or periodically. When the electronic device 100 detects that it is in a state adapted to a new environment or new requirements, the electronic device 100 detects that its own state has switched to the target state. For example, when the location of the electronic device 100 changes (e.g., the electronic device 100 is moved by the user from the living room to the bedroom), or when the wireless network associated with the electronic device 100 changes (e.g., the list of wireless networks scanned by the electronic device 100 changes, or the address of the wireless network connected to the electronic device 100 changes), the electronic device 100 can consider itself to be in a state adapted to the new environment. In addition, when the screen of the electronic device 100 is woken up (e.g., the screen switches from off to on), the network between the electronic device 100 and the electronic device 200 is successfully established, or the target service on the electronic device 100 is activated (e.g., an application is launched), the electronic device 100 can consider itself to be in a state adapted to the new requirements. It should be understood that when the user has a new requirement for the electronic device 100 and operates the electronic device 100, the electronic device 100 can consider itself to be in a state adapted to the new requirements. For example, new demands may refer to, but are not limited to, new demands generated by the user for the first electronic device. For instance, when the screen of the first electronic device is woken up by the user, it indicates that the user has a demand to use the first electronic device; when a music-related application on the first electronic device is opened, it indicates that the user has a demand to use the first electronic device to play music.

[0070] S202, Electronic device 100 broadcasts the first message.

[0071] In this embodiment, the electronic device 100 can actively broadcast a first message. For example, to save power, the electronic device 100 can broadcast the first message via Bluetooth. For example, the first message may, but is not limited to, carry the device type, device identifier, etc., of the electronic device 100. For example, the first message may be a message requiring a response from other devices.

[0072] S203, electronic device 200 receives the first message and sends a response message to electronic device 100.

[0073] In this embodiment, when the electronic device 200 is within a certain range of the electronic device 100, the electronic device 200 can receive the first message. Then, the electronic device 200 can send a response message to the electronic device 100. For example, the electronic device 200 can also send a response message to the electronic device 100 via Bluetooth. For example, the response message may, but is not limited to, carry the device type of the electronic device 200, the device identifier of the electronic device 200, the received signal strength indication (RSSI) of the electronic device 200, and a flag indicating whether the electronic device 200 supports high-precision ranging, etc.

[0074] S204. Electronic device 100 receives a response message and, based on the response message, determines the device type of electronic device 200, and, based on the response message, determines the distance L00 between electronic device 100 and electronic device 200.

[0075] In this embodiment, electronic device 100 can receive a response message from electronic device 200. Then, electronic device 100 can determine the device type of electronic device 200 based on the device type of electronic device 200 carried in the response message. For example, the device type can refer to the type or category of the device, used to classify and distinguish devices with different functions, uses, and forms. For instance, the device type of electronic device 200 can be in-vehicle equipment, in-vehicle infotainment system, smart TV, Huawei smart screen, smart speaker, smart home device, smart city device, computer, PDA, AR, VR, AI device, or wearable device, etc. Additionally, electronic device 100 can also calculate the distance between electronic device 100 and electronic device 200 based on the RSSI carried in the response message to calculate the distance L00 between them. For example, the distance L00 can be calculated using the following "Formula 1":

[0076]

[0077] Wherein, RSSI is the RSSI carried in the response message; A is the RSSI carried in the response message sent by electronic device 200 when electronic device 100 and electronic device 200 are 1 meter apart, and A can be pre-calibrated; n is the environmental attenuation factor, which can be an empirical value. For example, distance L00 can also be referred to as "first distance". In some embodiments, in addition to using the RSSI in the response message to calculate distance L00, other ranging methods (such as star flash / ultrasonic ranging, etc.) can also be used to calculate it. Distance L00 calculated using other ranging methods is still within the protection scope of this application.

[0078] To improve the accuracy of distance calculation, electronic device 100 can collect multiple response messages from electronic device 200 and calculate a distance based on each response message. Finally, electronic device 100 can choose the smallest distance as distance L00, or the average of these distances as distance L00, depending on the actual situation, which is not limited here.

[0079] S205. Based on the device type of electronic device 200, electronic device 100 determines the services that can be provided to electronic device 200.

[0080] In this embodiment, electronic device 100 can determine the services that can be provided to electronic device 200 based on its device type. The relationship between the device type of electronic device 200 and the services that can be provided to it can be, but is not limited to, pre-defined. For example, when the device type of electronic device 200 is a smart screen, the services that can be provided to it may include large-screen control or application streaming. When the device type of electronic device 200 is a vehicle infotainment system, the services that can be provided to it may include vehicle control. When the device type of electronic device 200 is a tablet computer, the services that can be provided to it may include content sharing or application streaming.

[0081] S206. Based on its own screen status and distance L00, electronic device 100 recommends services that can be provided to electronic device 200 to the user.

[0082] In this embodiment, electronic device 100 can recommend services available to electronic device 200 to the user based on its own screen state and distance L00. First, electronic device 100 can determine a distance threshold L1 by using its own device type and the device type of electronic device 200. The distance threshold L1 can also be different when the device types are different. The relationship between the device types and the distance threshold can also be preset. Then, electronic device 100 can determine the magnitude of the distance L00 and the distance threshold L1. When the distance L00 is less than or equal to the distance threshold L1, electronic device 100 can recommend services available to electronic device 200 to the user based on its own screen state. When the distance L00 is greater than the distance threshold L1, electronic device 100 may not recommend services available to electronic device 200 to the user, and in this case, electronic device 100 may not respond. For example, the distance threshold L1 can also be referred to as the "first threshold".

[0083] Furthermore, when the distance L00 is greater than the distance threshold L1, to facilitate a more accurate distance calculation, electronic device 100 can remeasure the distance between itself and electronic device 200 using a more precise ranging method than the one used to measure distance L00. For example, if distance L00 is obtained through Bluetooth ranging, electronic device 100 can use a more accurate ranging method such as star-flash / ultrasonic ranging to remeasure the distance between itself and electronic device 200 to obtain distance L01. When using other ranging methods, electronic device 100 can also determine the distance threshold L2 under the current ranging method based on its own device type and the device type of electronic device 200. Further, when distance L01 is less than or equal to the distance threshold L2, electronic device 100 can recommend services available to electronic device 200 to the user based on its own screen status. When distance L01 is greater than the distance threshold L2, electronic device 100 may not recommend services available to electronic device 200 to the user, and in this case, electronic device 100 may not respond. Thus, by combining low-precision and high-precision ranging methods, a ranging scheme that combines low power consumption with wide coverage can be constructed, solving the problem of balancing power consumption and coverage in existing wireless signal ranging schemes. For example, ranging methods such as star-flash / ultrasonic ranging, which have higher ranging accuracy than Bluetooth, can also be referred to as the "first ranging method." Distance L01 can also be referred to as the "second distance," and distance threshold L2 can also be referred to as the "second threshold." In some embodiments, considering that there may be situations between electronic devices 100 and 200 where high-precision ranging is not required, electronic device 100 can first determine whether high-precision ranging is needed based on the device types of both devices before performing high-precision ranging. For example, when electronic device 100 is a mobile phone and electronic device 200 is a computer, the distance between the two does not meet the requirements under low-precision ranging, but meets the requirements under high-precision ranging. However, since the distance threshold is often large under high-precision ranging, the two may be far apart. If service recommendations continue to be made, it may be difficult to use the relevant services on the computer. Therefore, in this case, high-precision ranging can be omitted, that is, electronic device 100 can not respond.

[0084] As one possible implementation, when electronic device 100 recommends services available to electronic device 200 based on its own screen state, electronic device 100 can, even when its screen is locked, display recommendation information related to the services available to electronic device 200 via a lock screen notification. This recommendation information can, but is not limited to, be carried by a service recommendation card. For example, such as... Figure 3As shown in (A), when the screen is locked, a lock screen notification card shown in area 31 can pop up to display relevant recommended information. When the screen is unlocked, recommended information related to services available to the electronic device 200 can pop up in real time, or recommended information related to services available to the electronic device 200 can be displayed on its own desktop, control center, or notification center. For example, as... Figure 3 As shown in (B), when the screen is on and unlocked, a lock screen notification card shown in area 32 can be displayed in real-time via a pop-up window to show relevant recommended information; such as Figure 3 As shown in (C), when the screen is on and unlocked, the lock screen notification card shown in area 33 can be displayed on the desktop to show the corresponding recommended information; such as Figure 3 As shown in (D), when the screen is on and unlocked, the lock screen notification card shown in area 34 can be displayed in the notification center to show the corresponding recommended information. For the case where recommended information is displayed in the control center, it can be done as follows: Figure 9 As shown in (A) and (B), in Figure 9 In (A), cards related to the smart screen can be displayed in the lower left corner of the control center. Figure 9 In (B), cards related to vehicle control can be displayed below the control center. It should be noted that the cards are only one way to display recommended information, and they can consist of text and / or images. The specific display forms of the cards include, but are not limited to, the methods listed in this embodiment.

[0085] As one possible implementation, recommendation information can also be displayed in a form other than cards, such as voice prompts.

[0086] In this way, when electronic devices 100 and 200 are in a trusted network state, and when electronic device 100 is in a state that adapts to a new environment or new requirements, it can actively trigger broadcasting and actively measure the distance between the two devices, and actively make service recommendations based on the distance measurement results. This achieves seamless triggering of distance measurement and service recommendations between devices, solving the problems of strong user perception, cumbersome operation, and security and privacy risks in existing cross-device solutions.

[0087] From the above Figure 2 As can be seen from the description, Figure 2 The described service recommendation method mainly comprises three core components: a perception-based broadcast triggering strategy, wireless-Xinhua fusion ranging, and proactive recommendation services for devices across all scenarios. For ease of understanding, these three core components are explained in more detail below.

[0088] For example, Figure 4 This diagram illustrates the core components of a service recommendation method provided in an embodiment of this application. For example... Figure 4As shown, the core components of this service recommendation method may include:

[0089] S41. Perception-based broadcast triggering strategy. This strategy mainly relies on sensor data from electronic device 100, such as accelerometer and gyroscope sensors, or wireless network data scanned by electronic device 100, or information such as network status and events of electronic device 100, to automatically trigger electronic device 100 to broadcast a first message. This allows for distance measurement and seamless communication between electronic devices without the user's awareness, avoiding cumbersome operations and achieving seamless communication between electronic devices. For example... Figure 5 As shown, the effective scenarios for this strategy can be, but are not limited to, the following three scenarios:

[0090] a) New Environment Trigger Strategy: When the location of electronic device 100 changes, such as when electronic device 100 enters a new environment (e.g., a new room), the first broadcast message is automatically triggered. For example, in this scenario, sensor data on electronic device 100 can be used to detect whether the location of electronic device 100 has changed, or to determine whether electronic device 100 has switched from a moving state to a stationary state, and whether the moving distance in the moving state exceeds a certain distance, or the stationary duration in the stationary state exceeds a certain time. Furthermore, when electronic device 100 detects a change in its associated wireless network, such as a significant change in the list of wireless networks scanned by electronic device 100, or a change in the address of the wireless network connected to by electronic device 100, the first broadcast message (e.g., a heartbeat message) is triggered.

[0091] b) New state triggering strategy: When the state of electronic device 100 changes, such as the screen turning on or off (e.g., the screen is woken up), or the network connection with electronic device 200 is successfully established, the first broadcast message is automatically triggered.

[0092] c) New service triggering strategy: When electronic device 100 performs certain services, such as when an application is launched, the first broadcast message is automatically triggered.

[0093] S42. Wireless Signal Fusion Ranging. This ranging method mainly integrates two or more positioning methods with different levels of accuracy to achieve ranging capabilities between electronic devices 100 and 200, provided they are in a trusted network state. In this method, a low-precision ranging method such as Bluetooth is first used to initially determine the distance. If the distance obtained through this low-precision method is very close, the result is directly output. If the distance cannot be accurately determined through the low-precision method, a high-precision ranging method such as satellite flash / ultrasound is activated to achieve a low-power, wide-coverage fusion ranging solution.

[0094] This step assumes that electronic device 100 successfully receives a response message from electronic device 200 after broadcasting the first message. For example... Figure 6 As shown, this step can be mainly divided into the following sub-steps: a) Determine that electronic devices 100 and 200 are in a trusted network state. b) Based on the device types of electronic devices 100 and 200, determine the distance threshold L1 under the low-precision ranging method and whether high-precision ranging (such as star-flash ranging / ultrasonic ranging) can be initiated. This is to minimize the use of high-precision ranging and reduce unnecessary power consumption. The device types of electronic devices 100 and 200 can be in-vehicle devices, in-vehicle systems, smart TVs, Huawei smart screens, smart speakers, smart home devices, smart city devices, computers, PDAs, AR, VR, AI devices, or wearable devices, etc.

[0095] c) Electronic device 100 collects the RSSI carried in at least one response message from electronic device 200 for ranging. d) Based on the RSSI, the distance between the two is calculated. If the calculated distance is less than or equal to the distance threshold L1, the distance and the result of the service recommendation are returned. e) If the distance calculated in d) is greater than the distance threshold X1, and it is determined in b) that high-precision ranging cannot be initiated, the process ends; if the distance calculated in d) is greater than the distance threshold X1, and it is determined in b) that high-precision ranging can be initiated, high-precision ranging is initiated, and the distance threshold X2 under the high-precision ranging method is determined based on the device types of electronic devices 100 and 200. f) If the distance measured by the high-precision ranging method is less than the distance threshold X2, the distance and the result of the service recommendation are returned; otherwise, the process ends.

[0096] S43. Proactive Recommendation Service for All-Scenario Devices. This part mainly uses the ranging results from S42 and the device type of electronic device 200 to achieve perceptual recommendation of devices across all scenarios at the business layer. Based on the ranging results and the device type of electronic device 200, different business applications can be derived, including: proactive recommendations for mobile phones / tablets to connect to personal computers, proactive recommendations for large-screen control of TVs from mobile phones / tablets, and proactive recommendations for mobile phones to control in-vehicle systems, etc. Figure 7As shown, this step may include the following sub-steps: a) Electronic device 100 determines which service recommendation to initiate. b) Based on the device type of electronic device 200, the electronic device 200 is classified into device types. c) Based on the classification results of the device types of electronic device 200, the required proactively recommended services are determined, such as mobile content sharing, transfer between personal computer devices, large screen control, and vehicle control. d) The screen state of electronic device 100 is determined, and different prompts are generated according to different screen states. For example, different proactive service recommendation user experience (UX) prompts can be given in the screen-on / screen-off states.

[0097] As can be seen from the above description, the service recommendation scheme provided in this application embodiment is mainly based on trusted networking between devices, and based on sensor / status information of electronic devices, effectively controls the start of ranging broadcast, and provides proactive recommendation services in electronic devices across the entire scenario through multi-source fusion ranging, Bluetooth ranging or Bluetooth-assisted star flash ranging, etc.

[0098] The above is a description of the service recommendation method provided in the embodiments of this application. For ease of understanding, the following explanation uses a mobile phone as an example for electronic device 100 and a smart screen as an electronic device 200.

[0099] For example, when a user carries their phone from the bedroom to the living room and stops, the phone can calculate the number of steps taken based on sensor data and a pedometer module. If each step is considered 0.5m, then 8 steps would represent a total walking distance of 4m. When the user is stationary, the phone can calculate the duration of stillness. If the stillness lasts longer than 3 seconds, and there was a 4m walk within the previous 30 seconds, the phone can initiate a Bluetooth broadcast. The smart screen, upon receiving the broadcast, can respond with a Bluetooth broadcast.

[0100] Furthermore, after receiving the response message from the smart screen, the mobile phone can detect whether the two are in a trusted network state. For example, if both are using the same account to log in, or if their historical login accounts are the same, the mobile phone can determine that they are in a trusted network state. Then, the mobile phone can identify the smart screen's device type as a large screen from the response message, and calculate the distance between the two via Bluetooth ranging. Simultaneously, the mobile phone can learn from the response message that the smart screen can use the StarFlash high-precision ranging method. Based on the device types, the mobile phone can determine that the Bluetooth distance threshold is 70cm and the StarFlash threshold is 3m. Next, if any of the multiple response messages calculates a distance less than 70cm, or if Kalman filtering is applied to the RSSI in the response message before calculating the distance, and any calculated distance is less than 70cm, it is considered relatively close, and the distance result and the recommended service result are directly returned. Otherwise, the mobile phone initiates a StarFlash connection and obtains the StarFlash ranging result. If the distance measurement result is less than 3m, it is considered close, and the distance result is returned along with a service recommendation decision; otherwise, no response is made. For example, when determining the distance threshold between the two, the size information of electronic devices such as smart screens can also be considered to allow for different service recommendations based on different size information.

[0101] Furthermore, such as Figure 10 As shown, after determining to initiate a service recommendation, the phone can identify the desired service (e.g., large screen control) based on the smart screen's device type. Next, the phone checks its own screen status, such as whether it's on or unlocked. Finally, the phone can send different proactive service recommendation UX prompts to the user based on the screen's different states. For example, if the phone is locked, a lock screen notification card (large screen control card) will pop up. If the screen is on and unlocked, a real-time notification will appear.

[0102] In some embodiments, when determining whether electronic devices 100 and 200 are in a trusted network state, after receiving a response message from electronic device 200, electronic device 100 can obtain the device identifier of electronic device 200 through the response message. Then, electronic device 100 can determine whether the account currently logged in or previously logged in on electronic device 200 is the same as the account currently logged in on electronic device 100, based on the binding relationship between the account and the device identifier. When it is determined that the logged-in account is the same, electronic device 100 can determine that it and electronic device 200 are in a trusted network state. For example, the account currently logged in or previously logged in on electronic device 100 or electronic device 200 can be, but is not limited to, a cloud account. The binding relationship between the account and the device can be distributed to each device logged in with the cloud account through the cloud account.

[0103] It is understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In addition, the various embodiments and features described in the above embodiments can be combined according to actual conditions, and the combined solutions are still within the protection scope of this application.

[0104] Based on the methods in the above embodiments, this application provides a service recommendation device.

[0105] For example, Figure 8 A schematic diagram of a service recommendation device provided in an embodiment of this application is shown. This service recommendation device can, but is not limited to, be deployed in the aforementioned electronic device 100. For example... Figure 8 As shown, the service recommendation device 800 may include a processing module 801 and a communication module 802. The processing module is used to detect when the state of a first electronic device switches to a target state, where the target state characterizes the first electronic device as being adapted to a new environment or new requirements. The communication module is used to broadcast a first message and receive a response message from a second electronic device, where the second and first electronic devices are in a trusted network state. The processing module is also used to determine the device type of the second electronic device and a first distance between the first and second electronic devices based on the response message. Furthermore, the processing module is used to determine the services that the second electronic device can provide based on its device type, and to recommend services available to the second electronic device to the user based on the screen state of the first electronic device and the first distance.

[0106] In some embodiments, when the processing module detects that the state of the first electronic device has switched to the target state, it is specifically configured to: detect a change in the location of the first electronic device; or, detect a change in the wireless network associated with the first electronic device; or, detect that the screen of the first electronic device is woken up; or, detect that a network has been successfully established between the first electronic device and the second electronic device; or, detect that the target service on the first electronic device has been activated.

[0107] In some embodiments, when the processing module determines the first distance between the first electronic device and the second electronic device based on the response message, it is specifically used to: calculate the first distance based on the received signal strength indication carried in the response message.

[0108] In some embodiments, when broadcasting the first message, the communication module is specifically used to: broadcast the first message via Bluetooth.

[0109] In some embodiments, when the processing module recommends services available to a second electronic device to a user based on the screen state of the first electronic device and a first distance, it is specifically configured to: recommend services available to the second electronic device to the user based on the screen state of the first electronic device when the first distance is less than or equal to a first threshold; calculate a second distance between the first electronic device and the second electronic device based on a first ranging method when the first distance is greater than the first threshold, and recommend services available to the second electronic device to the user based on the screen state of the first electronic device when the second distance is less than or equal to the second threshold, wherein the ranging accuracy of the first ranging method is higher than the ranging accuracy of the Bluetooth ranging method.

[0110] In some embodiments, before the processing module calculates the second distance between the first electronic device and the second electronic device based on the first ranging method, it is further configured to: determine, based on the device type of the first electronic device and the device type of the second electronic device, to use the first ranging method for ranging.

[0111] In some embodiments, when the processing module recommends services available to the second electronic device to the user based on the screen state of the first electronic device, it is specifically configured to: pop up recommendation information related to the services available to the second electronic device in the form of a lock screen notification when the screen state is locked; pop up recommendation information related to the services available to the second electronic device in real time when the screen state is unlocked; or display recommendation information related to the services available to the second electronic device on the desktop, control center, or notification center of the first electronic device.

[0112] In some embodiments, the response message carries the device type of the second electronic device, the device identifier of the second electronic device, the received signal strength indicator of the second electronic device, and a flag indicating whether the second electronic device supports high-precision ranging.

[0113] It should be understood that the above-described device is used to execute the methods in the above embodiments. The implementation principle and technical effect of the corresponding program modules in the device are similar to those described in the above methods. The working process of the device can be referred to the corresponding process in the above methods, and will not be repeated here.

[0114] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program. When the computer program is run on an electronic device, it causes the electronic device to perform the methods described in the above embodiments. Exemplarily, the computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0115] Based on the methods in the above embodiments, this application provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to execute the methods in the above embodiments.

[0116] It is understood that the processor in the embodiments of this application can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor can be a microprocessor or any conventional processor.

[0117] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0118] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0119] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.

Claims

1. A service recommendation method applied to a first electronic device, characterized in that, include: The state of the first electronic device is detected to switch to the target state, wherein the target state is used to characterize the state of the first electronic device in adapting to a new environment or new requirements; First broadcast message; Receive a response message from the second electronic device, wherein the second electronic device and the first electronic device are in a trusted network state; Based on the response message, the device type of the second electronic device and the first distance between the first electronic device and the second electronic device are determined; Based on the device type of the second electronic device, determine the services that can be provided to the second electronic device; Based on the screen status of the first electronic device and the first distance, the services that can be provided to the second electronic device are recommended to the user.

2. The method according to claim 1, characterized in that, The detection that the state of the first electronic device has switched to the target state includes: A change in the position of the first electronic device was detected; Alternatively, a change in the wireless network associated with the first electronic device is detected; Alternatively, it is detected that the screen of the first electronic device has been woken up; Alternatively, a successful network connection between the first electronic device and the second electronic device is detected. Alternatively, the target service on the first electronic device is detected to be activated.

3. The method according to claim 1 or 2, characterized in that, Determining the first distance between the first electronic device and the second electronic device based on the response message includes: The first distance is calculated based on the received signal strength indication carried in the response message.

4. The method according to any one of claims 1-3, characterized in that, The first broadcast message includes: The first message is broadcast via Bluetooth.

5. The method according to claim 4, characterized in that, The step of recommending services available to the second electronic device to the user based on the screen status of the first electronic device and the first distance includes: If the first distance is less than or equal to the first threshold, the service that can be provided to the second electronic device is recommended to the user based on the screen status of the first electronic device. If the first distance is greater than the first threshold, a second distance between the first electronic device and the second electronic device is calculated based on the first ranging method. If the second distance is less than or equal to the second threshold, the services available to the second electronic device are recommended to the user based on the screen status of the first electronic device. The ranging accuracy of the first ranging method is higher than that of Bluetooth.

6. The method according to claim 5, characterized in that, Before calculating the second distance between the first electronic device and the second electronic device based on the first ranging method, the method further includes: Based on the device type of the first electronic device and the device type of the second electronic device, it is determined that the first ranging method will be used for ranging.

7. The method according to claim 5 or 6, characterized in that, The step of recommending services available to the second electronic device to the user based on the screen status of the first electronic device includes: When the screen is locked, a notification pops up with recommended information related to the services available to the second electronic device. When the screen is unlocked, recommending information related to the services available to the second electronic device will pop up in real time, or the recommending information related to the services available to the second electronic device will be displayed on the desktop, control center, or notification center.

8. The method according to any one of claims 1-7, characterized in that, The response message carries the device type of the second electronic device, the device identifier of the second electronic device, the received signal strength indication of the second electronic device, and a flag indicating whether the second electronic device supports high-precision ranging.

9. A service recommendation device, deployed in a first electronic device, characterized in that, include: The processing module is used to detect that the state of the first electronic device has switched to the target state, wherein the target state is used to characterize the first electronic device as being in a state adapted to a new environment or new requirements; The communication module is used to broadcast the first message; The communication module is also used to receive a response message returned from the second electronic device, wherein the second electronic device and the first electronic device are in a trusted network state; The processing module is further configured to determine the device type of the second electronic device and the first distance between the first electronic device and the second electronic device based on the response message; The processing module is further configured to determine the services available based on the device type of the second electronic device; The processing module is further configured to recommend the available services to the user based on the screen status of the first electronic device and the first distance.

10. The apparatus according to claim 8, characterized in that, When the processing module detects that the state of the first electronic device has switched to the target state, it is specifically used for: A change in the position of the first electronic device was detected; Alternatively, a change in the wireless network associated with the first electronic device is detected; Alternatively, it is detected that the screen of the first electronic device has been woken up; Alternatively, a successful network connection between the first electronic device and the second electronic device is detected. Alternatively, the target service on the first electronic device is detected to be activated.

11. The apparatus according to claim 9 or 10, characterized in that, When determining the first distance between the first electronic device and the second electronic device based on the response message, the processing module is specifically used for: The first distance is calculated based on the received signal strength indication carried in the response message.

12. The apparatus according to any one of claims 9-11, characterized in that, When broadcasting the first message, the communication module is specifically used for: The first message is broadcast via Bluetooth.

13. The apparatus according to claim 12, characterized in that, When the processing module recommends the available services to the user based on the screen status of the first electronic device and the first distance, it is specifically used for: If the first distance is less than or equal to the first threshold, the available services are recommended to the user based on the screen status of the first electronic device; If the first distance is greater than the first threshold, a second distance between the first electronic device and the second electronic device is calculated based on the first ranging method. If the second distance is less than or equal to the second threshold, the available services are recommended to the user based on the screen status of the first electronic device. The ranging accuracy of the first ranging method is higher than that of Bluetooth.

14. The apparatus according to claim 13, characterized in that, Before the processing module calculates the second distance between the first electronic device and the second electronic device based on the first ranging method, it is further configured to: Based on the device type of the first electronic device and the device type of the second electronic device, it is determined that the first ranging method will be used for ranging.

15. The apparatus according to claim 13 or 14, characterized in that, When the processing module recommends the available services to the user based on the screen status of the first electronic device, it is specifically used for: When the screen is locked, a notification will pop up with recommended information related to the available services. When the screen is unlocked, recommending information related to the available services will pop up in real time, or the recommending information related to the available services will be displayed on the desktop, control center, or notification center.

16. The apparatus according to any one of claims 9-15, characterized in that, The response message carries the device type of the second electronic device, the device identifier of the second electronic device, the received signal strength indication of the second electronic device, and a flag indicating whether the second electronic device supports high-precision ranging.

17. A service recommendation system, characterized in that, include: The first electronic device and the second electronic device are in a trusted network state; Wherein, the first electronic device is used for: The state of the first electronic device is detected to switch to the target state, wherein the target state is used to characterize the state of the first electronic device in adapting to a new environment or new requirements; First broadcast message; The second electronic device is used for: Receive the first message; And send a response message to the first electronic device; The first electronic device is also used for: Receive the response message; Based on the response message, the device type of the second electronic device and the first distance between the first electronic device and the second electronic device are determined; Based on the device type of the second electronic device, determine the services that can be provided to the second electronic device, and based on the screen status of the first electronic device and the first distance, recommend the services that can be provided to the second electronic device to the user.

18. An electronic device, characterized in that, include: Display screen; One or more processors; Memory; The memory stores one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-8.

19. A computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-8.

20. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-8.