Method, device, equipment and medium for distributing local service to opposite side equipment

Through soft bus technology, networking and service distribution are realized between the local equipment and the other equipment, the problem of inefficient service distribution between equipment is solved, efficient and stable data transmission and resource utilization are achieved, and the development of the Internet of Things is supported.

CN119030822APending Publication Date: 2024-11-26深圳开鸿数字产业发展有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411191458.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the prior art, the service distribution method between devices has problems with large bandwidth consumption and resource utilization, resulting in low efficiency.

Method used

Using soft bus technology to realize networking between the local equipment and the other party’s equipment, distribute local services to the other party’s equipment through the soft bus, and pull up and run after the other party’s equipment receives the service, avoiding the information uploaded to the server. The process of distribution.

Benefits of technology

Optimize bandwidth consumption, reduce development costs and complexity, improve resource utilization efficiency, and achieve efficient and stable data transmission and service sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030822A_ABST
    Figure CN119030822A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device, equipment and a medium for distributing a local service to opposite equipment, and the method comprises the steps: detecting the states of the local equipment and the opposite equipment, packaging the local service through a soft bus when the local equipment and the opposite equipment are detected to be in an online state, and broadcasting the packaged local service to a network layer; generating a service request according to the demand of the opposite side equipment after determining that the opposite side equipment monitors the local service; after the local device receives a service request of the opposite device, the local service is distributed to the opposite device through the soft bus; and after the local device receives the feedback that the opposite side device has received the local service, the local device pulls up and operates the local service. According to the invention, the local service of the local equipment is distributed to the opposite equipment based on the soft bus, and the local service is pulled up and operated, so that the bandwidth consumption is optimized, the development cost and complexity are reduced, and the resource occupation problem of the client is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, apparatus, device and medium for distributing a local service to a counterpart device. Background Art

[0002] With the rapid development of Internet of Things (IoT) technology, interconnection between various devices has become an urgent need.

[0003] Currently, the function of implementing service distribution mainly relies on different technologies and architectures, but the common methods include the following two: 1. Centralized server architecture: In this method, all information needs to be uploaded to the central server first, and then distributed to the user end by the server. The advantage of this method is centralized control and management, but the disadvantages are also obvious. For example, server overload is easy to occur, and bandwidth dependence is too high, which is easy to form a bottleneck; 2. Point-to-point method: This method allows clients to exchange information directly without going through a central server. Its advantage is decentralization and reduced dependence on network bandwidth, but its disadvantage is that a large amount of computing and storage resources need to be distributed to each client, and there is still a problem of insufficient bandwidth utilization efficiency.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a method, apparatus, device and medium for distributing local services to a remote device, so as to solve the problems of large bandwidth consumption and resource occupation in the existing service distribution method.

[0006] The technical solution of the present invention is as follows:

[0007] A method for distributing a local service to a counterpart device, comprising:

[0008] Detect the status of the local device and the other device. When it is detected that the local device and the other device are online, encapsulate the local service through the soft bus and broadcast it to the network layer;

[0009] After confirming that the other party's device has monitored the local service, a service request is generated according to the needs of the other party's device;

[0010] After receiving the service request from the other device, the local device distributes the local service to the other device through the soft bus;

[0011] After the local device receives feedback that the other device has received the local service, the local device starts and runs the local service.

[0012] According to a further configuration of the present invention, when it is detected that the local device and the other device are in an online state, the step of encapsulating the local service through the soft bus and broadcasting it to the network layer includes:

[0013] Establish a discovery mechanism between the local device and the other device to realize local services;

[0014] Register the HAP package information of the local service.

[0015] In a further configuration of the present invention, the step of registering the HAP package information of the local service with the network layer includes:

[0016] Copy the HAP package of the specified local service from the installed source directory to the specified shared directory;

[0017] Synchronize files in the shared directory to other devices in the network.

[0018] According to a further configuration of the present invention, after the local device receives the service request from the other device, the step of distributing the local service to the other device via the soft bus includes:

[0019] The local device actively pushes the HAP package of the local service to the other device.

[0020] According to a further configuration of the present invention, the local device uses HTTP, HTTPS or FTP transmission protocol to push the HAP package of the local service to the other device.

[0021] According to a further configuration of the present invention, the step of the local device actively pushing the HAP package of the local service to the other device includes:

[0022] Compress and sub-packetize the HAP package of the local service.

[0023] In a further configuration of the present invention, when it is detected that the local device and the other device are in an online state, the step of encapsulating the local service through the soft bus and broadcasting it to the network layer also includes:

[0024] When a new counterpart device is networked, the new counterpart device is connected to the soft bus through an interface with the existing counterpart device.

[0025] In a second aspect, the present invention further provides an apparatus for distributing a local service to a counterpart device, comprising:

[0026] The detection and encapsulation module is used to detect the status of the local device and the other device. When it is detected that the local device and the other device are online, the local service is encapsulated through the soft bus and broadcast to the network layer;

[0027] A service request module, used to generate a service request according to the needs of the other party device after determining that the other party device monitors the local service;

[0028] The service distribution and startup module is used to distribute the local service to the other device through the soft bus after the local device receives the service request from the other device, and to start and run the local service after the local device receives the feedback from the other device that the local service has been received.

[0029] In a third aspect, the present invention further provides a device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, it is used to implement the method of distributing local services to a counterpart device as described above.

[0030] In a fourth aspect, the present invention further provides a medium on which a computer program is stored, and when the computer program is executed by a processor, it is used to implement the method of distributing a local service to a counterpart device as described above.

[0031] The present invention provides a method, device, computer equipment and medium for distributing a local service to a counterparty device. The method includes: detecting the status of the local device and the counterparty device, and when detecting that the local device and the counterparty device are in an online state, encapsulating the local service through a soft bus and broadcasting it to the network layer; after determining that the counterparty device monitors the local service, generating a service request according to the needs of the counterparty device; after the local device receives the service request of the counterparty device, distributing the local service to the counterparty device through the soft bus; after the local device receives the feedback that the counterparty device has received the local service, the local device starts and runs the local service. The present invention realizes the networking between the local device and the counterparty device based on the soft bus, and the local device can distribute the local service to the counterparty device through the soft bus based on the service request of the counterparty device, and when the counterparty device receives the local service, the local service is started and run. In this way, the present invention does not need to upload the information to the server first, and then distribute it to the user end by the server, which optimizes the bandwidth consumption, reduces the development cost and complexity, and starts and runs the local service on the local device, which optimizes the resource occupation problem of the client (the counterparty device). BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary personnel in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0033] Figure 1It is a flowchart of the method of distributing local services to the other party's equipment in the present invention.

[0034] Figure 2 The present invention is a flowchart of a method for distributing a local service to a counterpart device in one embodiment of the present invention.

[0035] Figure 3 It is a principle block diagram of the distribution of local services to the other party's equipment in the present invention. DETAILED DESCRIPTION

[0036] The present invention provides a method, apparatus, computer equipment and medium for distributing a local service to a remote device. To make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0037] In the embodiments and the scope of the patent application, unless the text specifically defines the article, "a", "an", "the" and "the" may also include plural forms. If there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.

[0038] It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when an element is said to be "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can also be intermediate elements. In addition, the "connection" or "coupling" used herein can include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0039] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0040] In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0041] The inventors have discovered that traditional device connection methods are often limited by specific communication protocols and network architectures, which results in large bandwidth consumption and resource occupation in existing service distribution methods, making service distribution between devices complicated and inefficient.

[0042] In response to the above technical problems, the present invention provides a method, device, computer equipment and medium for distributing local services to other devices, and realizes networking between the local device and the other device based on a soft bus. The local device can distribute the local service to the other device through the soft bus based on the service request of the other device, and when the other device receives the local service, the local service is started and run. In this way, the present invention does not need to upload the information to the server first, and then distribute it to the user end by the server, which optimizes bandwidth consumption, reduces development costs and complexity, and starts and runs the local service on the local device, optimizes the resource occupation and calculation problems of the client (other device), and avoids the problem of insufficient bandwidth utilization efficiency.

[0043] Please also see Figure 1 and Figure 2 The present invention provides a preferred embodiment of a method for distributing local services to a counterpart device.

[0044] In some embodiments, Figure 1 As shown, the present invention provides a method for distributing a local service to a counterpart device, which comprises the steps of:

[0045] S100, detecting the status of the local device and the other device, and when detecting that the local device and the other device are online, encapsulating the local service through the soft bus and broadcasting it to the network layer;

[0046] Specifically, the network layer refers to the third layer in the OSI (Open System Interconnection) reference model, between the transport layer and the data link layer. Based on the data frame transmission function between two adjacent endpoints provided by the data link layer, the network layer further manages data communications in the network and tries to transmit data from the source to the destination through several intermediate nodes, thereby providing the most basic end-to-end data transmission service to the transport layer. The purpose of the network layer is to achieve transparent data transmission between two end systems. Specific functions include addressing and routing selection, connection establishment, maintenance and termination, etc. The services it provides make it unnecessary for the transport layer to understand the data transmission and switching technology in the network.

[0047] The soft bus refers to the distributed soft bus of the Hongmeng system, which shields the protocol differences of various devices through the protocol shelf and the same layer of software and hardware. The soft bus central module is responsible for parsing commands to complete the discovery and connection between devices, and realizes file transfer and message transfer between devices through the two buses of task and data. For example, when there are photos on the mobile phone that need to be transferred to the personal computer, Bluetooth transmission can be used. First, you need to turn on the Bluetooth discovery function of the mobile phone and computer. The mobile phone or computer motor searches for the device, and then pair and authorize each other to connect. After the connection is successful, you can send photos. In this photo sharing scenario, it is necessary to turn on Bluetooth discovery, search for devices, pairing authorization and other operations, which is more troublesome. The soft bus can automatically discover nearby devices with the same account without waiting.

[0048] In short, the main goal of the soft bus is to simplify and unify the communication process between devices. In the soft bus, device authentication, networking, communication and other steps are uniformly managed and processed. Developers no longer need to deal with device trust issues, create sockets, consider event loops and other underlying logic of network programming, which greatly simplifies the communication process. The soft bus uses an optimized UDP customized transmission protocol to reduce transmission delay and improve transmission efficiency. Combined with the TCP reliable transmission mechanism, it ensures data integrity while minimizing bandwidth consumption. The soft bus uses a minimalist protocol to reduce the complexity of the transmission process and improve transmission efficiency. This protocol is enhanced on the basis of traditional network protocols, and implements data order preservation and reliable transmission based on UDP, further improving the compatibility between devices. In this way, it can not only improve the user experience, but also meet the user's demand for high-quality and efficient services. It can simplify the communication process, enhance system flexibility, optimize resource utilization and improve user experience.

[0049] Then, the present invention can achieve faster, more stable and reliable data transmission and service sharing by distributing local services to other devices through soft bus networking. For example, when device A needs to distribute local services to device B, after detecting that both device A and device B are online, device A and device B will register with the network layer, and the network layer will establish a channel connection with the device to detect the change of the device in real time.

[0050] S200, after determining that the other party device monitors the local service, generate a service request according to the needs of the other party device;

[0051] Specifically, local service refers to atomic service, which is a user application form with an independent entrance (users can directly trigger it by clicking, etc.), free installation (no need to display installation, it can be used after being installed in the background of the system program framework), and can provide users with one or more convenient services. Atomic service consists of one or more Hap packages, one Hap package corresponds to one FA or one PA, each FA or PA can run independently to complete a specific function, and one or more functions (corresponding to PA or PA) complete a specific convenient service. Atomic service supports running on 1+8+N (1 represents mobile phone, 8 represents car machine, audio, headphones, watch / bracelet, tablet, large screen, PC, AR / VR, N represents other IOT devices) devices, and can be used by users in appropriate scenarios and on appropriate devices.

[0052] The online and offline changes of the local device and the other device can be realized through the network layer. The local device can monitor the other device. When the local device monitors that the other device is online, it can immediately establish a connection with the other device and further follow up on the needs of the other device to generate service requests.

[0053] S300, after receiving the service request from the other party, the local device distributes the local service to the other party through the soft bus;

[0054] Specifically, when the local device establishes a connection with the counterpart device and the local device receives a service request from the counterpart device, the local device may push a Hap package of the atomic service to the counterpart device.

[0055] S400: After the local device receives feedback that the other device has received the local service, the local device starts and runs the local service.

[0056] Specifically, the pull-up of the local service refers to the rapid pull-up of the atomic service received on the other device to achieve the connection and control of the local device to the other device. The pull-up methods of the atomic service include NFC touch, Bluetooth proximity discovery, Bluetooth touch, etc. Taking NFC touch as an example, the device has an NFC tag. The local device can run the corresponding atomic service by touching and identifying the NFC tag on the device. For example, when the local device is a mobile phone and the other device is a steam-bake cooking machine, when the mobile phone touches the steam-bake cooking machine, the mobile phone will automatically jump to the corresponding atomic service interface and display the network configuration interface or control interface of the steam-bake cooking machine. The user can operate the device on the mobile phone side, such as selecting recommended recipes in the control interface and experiencing functions such as automatic cooking. Taking Bluetooth proximity discovery as an example, the other device has Bluetooth proximity discovery function. The local device recognizes the Bluetooth broadcast sent by the device through proximity discovery and runs the corresponding atomic service. Taking the mobile phone and smart fan as an example, the user uses the mobile phone to approach a smart fan with Bluetooth function turned on, and the atomic service pops up automatically on the mobile phone, displaying the status information and control interface of the fan. The user can control the fan on the mobile phone.

[0057] In this embodiment, please combine Figure 2 , the working principle of the present invention is explained: in the specific implementation, click on the atomic service (i.e., local service) in the application market, and click on the local download service. When it is necessary to distribute the local service to other devices (i.e., the other party's device), the local device and the other party's device are networked through the network layer. When it is detected that the local device and the other party's device are online, the local service is encapsulated through the soft bus and broadcast to the network layer. After the other party's device monitors the local service, the other party's device makes a service request according to the demand, and the local device responds to the service request of the other party's device and distributes the local service to the other party's device through the soft bus. After the other party's device receives the HAP package, the other party's device will parse the service information in the HAP package, and after the other party's device receives the local service, the local device will pull up and run the local service. In the specific implementation, it can be flexibly adjusted according to the description information in the HAP package and the actual situation of the local device. For example, the creation, initialization and operation of the service can be realized by calling the system API or service framework of the local device. When the local device pulls up the HAP package, the occupation of system resources can be reduced through reasonable resource scheduling and management mechanisms. For example, multi-threading, asynchronous processing and other technical means can be used to improve processing efficiency and reduce resource consumption.

[0058] In the above technical scheme, the present invention realizes the networking between the local device and the other device based on the soft bus. The local device can distribute the local service to the other device through the soft bus based on the service request of the other device, and when the other device receives the local service, the local service is pulled up and run. In this way, the present invention does not need to upload the information to the server first, and then distribute it to the user end by the server, which optimizes the bandwidth consumption, reduces the development cost and complexity, and pulls up and runs the local service on the local device, optimizes the resource occupation and calculation problems of the client (other device), and avoids the problem of insufficient bandwidth utilization efficiency. In addition, the present invention realizes the cross-device distribution and pulling up of the atomic service Hap, which can provide effective support for the interconnection and service sharing between smart devices, and can provide effective support for the development of the Internet of Things, and further realize the popularization and application of smart devices.

[0059] In some embodiments, when it is detected that the local device and the other device are online, the step of encapsulating the local service through the soft bus and broadcasting it to the network layer includes:

[0060] S110, establishing a discovery mechanism for the local device and the other device to realize local services;

[0061] S120: Register the HAP package information of the local service.

[0062] In this embodiment, when the local device distributes the local service to the other device, it is necessary to implement an atomic service discovery mechanism on the local device and the other device. Specifically, the local device discovers the service receiver on the other device by scanning the network or broadcasting, and registers the HAP package information of the local service. At the same time, the other device also needs a corresponding service receiver to receive and parse the service HAP package. In specific implementation, the HAP package of the specified local service is copied from the installed source directory to the specified shared directory, and the distributed file service HMDFS then synchronizes the files in the shared directory to the other device in the network. In this way, seamless connection and service distribution between the local device and the other device can be achieved, ensuring that the HAP package can be successfully pulled up on various devices and operating systems to improve the compatibility of the device.

[0063] Furthermore, when it is detected that the local device and the other device are in an online state, the step of encapsulating the local service through the soft bus and broadcasting it to the network layer also includes:

[0064] S130: When a new counterpart device is networked, the new counterpart device is connected to the soft bus through an interface with the existing counterpart device.

[0065] In this embodiment, a newly added counterpart device can be connected to the soft bus through the same interface without modifying the existing system or device, thereby achieving seamless expansion between devices.

[0066] In some embodiments, after the local device receives the service request from the other device, the steps of distributing the local service to the other device via the soft bus include:

[0067] S310: The local device actively pushes the HAP package of the local service to the other device.

[0068] In this embodiment, after the service discovery mechanism is completed and the HAP package information of the local service is registered, the local device actively pushes the HAP package of the atomic service to the other device.

[0069] When the local device pushes the HAP package of the atomic service to the other device, the local device can, but is not limited to, use HTTP, HTTPS or FTP transmission protocol to push the HAP package of the local service to the other device to ensure secure and reliable transmission of the HAP package.

[0070] In some embodiments, in order to improve transmission efficiency, the HAP packets of the local service may be compressed and sub-packetized.

[0071] In some embodiments, Figure 3 As shown, the present invention also provides a device for distributing local services to other devices, which includes: a detection and encapsulation module, a service request module and a service distribution and pull-up module. Among them, the detection and encapsulation module is used to detect the status of the local device and the other device. When it is detected that the local device and the other device are in an online state, the local service is encapsulated through a soft bus and broadcast to the network layer; the service request module is used to determine that the other device monitors the local service and generates a service request according to the needs of the other device; the service distribution and pull-up module is used to distribute the local service to the other device through the soft bus after the local device receives the service request of the other device, and is used to pull up and run the local service after the local device receives the feedback that the other device has received the local service. As described in an embodiment of a method for distributing local services to other devices, it will not be repeated here.

[0072] In some embodiments, the present invention further provides a computer device, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. A computer program is stored on the memory, and when the computer program is executed by the processor, it is used to implement the steps in the following method:

[0073] The status of the local device and the other device is detected. When it is detected that the local device and the other device are online, the local service is encapsulated through the soft bus and broadcast to the network layer; the specific details are as described in an embodiment of a method for distributing local services to the other device, which will not be repeated here.

[0074] After determining that the other party device monitors the local service, a service request is generated according to the needs of the other party device; the specific details are as described in an embodiment of a method for distributing the local service to the other party device, which will not be repeated here.

[0075] After the local device receives the service request from the other device, it distributes the local service to the other device via the soft bus; the details are as described in an embodiment of a method for distributing the local service to the other device, which will not be repeated here.

[0076] After the local device receives feedback that the other device has received the local service, the local device starts and runs the local service. The details are as described in an embodiment of a method for distributing a local service to a other device, which will not be repeated here.

[0077] In some embodiments, the present invention further provides a medium having a computer program stored thereon, wherein the computer program is used to implement the steps in the following method when executed by a processor:

[0078] The status of the local device and the other device is detected. When it is detected that the local device and the other device are online, the local service is encapsulated through the soft bus and broadcast to the network layer; the specific details are as described in an embodiment of a method for distributing local services to the other device, which will not be repeated here.

[0079] After determining that the other party device monitors the local service, a service request is generated according to the needs of the other party device; the specific details are as described in an embodiment of a method for distributing the local service to the other party device, which will not be repeated here.

[0080] After the local device receives the service request from the other device, it distributes the local service to the other device via the soft bus; the details are as described in an embodiment of a method for distributing the local service to the other device, which will not be repeated here.

[0081] After the local device receives feedback that the other device has received the local service, the local device starts and runs the local service. The details are as described in an embodiment of a method for distributing a local service to a other device, which will not be repeated here.

[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0083] In summary, the method, apparatus, computer device and medium for distributing local services to other devices provided by the present invention have the following beneficial effects:

[0084] Based on the soft bus, the networking between the local device and the other device is realized. The local device can distribute the local service to the other device through the soft bus based on the service request of the other device, and when the other device receives the local service, the local service is pulled up and operated. The present invention does not need to upload the information to the server first, and then distribute it to the user end by the server, which optimizes the bandwidth consumption, reduces the development cost and complexity, and pulls up and runs the local service on the local device, optimizes the resource occupation problem of the client (the other device), has the characteristics of high efficiency and stability, and also has good adaptability and reliability, can meet the needs of various application scenarios, can provide effective support for the interconnection and service sharing between smart devices, can provide effective support for the development of the Internet of Things, and further realize the popularization and application of smart devices.

[0085] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for distributing a local service to a counterpart device, characterized in that: include: Detect the status of the local device and the other device. When it is detected that the local device and the other device are online, encapsulate the local service through the soft bus and broadcast it to the network layer; After confirming that the other party's device has monitored the local service, a service request is generated according to the needs of the other party's device; After receiving the service request from the other device, the local device distributes the local service to the other device through the soft bus; After the local device receives feedback that the other device has received the local service, the local device starts and runs the local service.

2. The method for distributing a local service to a counterpart device according to claim 1, characterized in that: When it is detected that the local device and the other device are in an online state, the steps of encapsulating the local service through the soft bus and broadcasting it to the network layer include: Establish a discovery mechanism between the local device and the other device to realize local services; Register the HAP package information of the local service.

3. The method for distributing a local service to a counterpart device according to claim 2, characterized in that: The step of registering the HAP package information of the local service with the network layer includes: Copy the HAP package of the specified local service from the installed source directory to the specified shared directory; Synchronize files in the shared directory to other devices in the network.

4. The method for distributing a local service to a counterpart device according to claim 1, characterized in that: After the local device receives the service request from the other device, the steps of distributing the local service to the other device via the soft bus include: The local device actively pushes the HAP package of the local service to the other device.

5. The method for distributing local services to a counterpart device according to claim 3, characterized in that: The local device uses HTTP, HTTPS or FTP transmission protocol to push the HAP package of the local service to the other device.

6. The method for distributing a local service to a counterpart device according to claim 4, characterized in that: The step of the local device actively pushing the HAP package of the local service to the other device includes: Compress and sub-packetize the HAP package of the local service.

7. The method for distributing local services to a counterpart device according to claim 1, characterized in that: When it is detected that the local device and the other device are in an online state, the step of encapsulating the local service through the soft bus and broadcasting it to the network layer also includes: When a new counterpart device is networked, the new counterpart device is connected to the soft bus through an interface with the existing counterpart device.

8. A device for distributing a local service to a counterpart device, characterized in that: include: The detection and encapsulation module is used to detect the status of the local device and the other device. When it is detected that the local device and the other device are online, the local service is encapsulated through the soft bus and broadcast to the network layer; A service request module, used to generate a service request according to the needs of the other party device after determining that the other party device monitors the local service; The service distribution and startup module is used to distribute the local service to the other device through the soft bus after the local device receives the service request from the other device, and to start and run the local service after the local device receives the feedback from the other device that the local service has been received.

9. A device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, it is used to implement the method for distributing a local service to a counterpart device as described in any one of claims 1 to 7.

10. A medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the method for distributing a local service to a counterpart device as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Power grid supply and demand cooperative control method and system based on soft bus and atomization service

    CN121262030A