CN114924807B - Method and device for improving running speed of applet - Google Patents

Method and device for improving running speed of applet Download PDF

Info

Publication number
CN114924807B
CN114924807B CN202210456815.5A CN202210456815A CN114924807B CN 114924807 B CN114924807 B CN 114924807B CN 202210456815 A CN202210456815 A CN 202210456815A CN 114924807 B CN114924807 B CN 114924807B
Authority
CN
China
Prior art keywords
applet
target
short
connection
wireless connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210456815.5A
Other languages
Chinese (zh)
Other versions
CN114924807A (en
Inventor
柳夫虎
邱智铠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202210456815.5A priority Critical patent/CN114924807B/en
Publication of CN114924807A publication Critical patent/CN114924807A/en
Application granted granted Critical
Publication of CN114924807B publication Critical patent/CN114924807B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the specification provides a method and a device for improving the running speed of an applet, which are applied to terminal equipment carrying the applet. The method comprises the following steps: when the host program is opened, calling a system interface of the terminal equipment to execute an equipment discovery process; judging whether a target controlled device capable of being controlled by the applet exists around the terminal device through a device discovery process; if so, determining a target applet for controlling the target controlled device; establishing a short-distance wireless connection with target controlled equipment; after the target applet is opened, the established short-range wireless connection is multiplexed. The embodiment of the specification can improve the running speed of the applet.

Description

Method and device for improving running speed of applet
Technical Field
One or more embodiments of the present disclosure relate to electronic information technology, and in particular, to a method and apparatus for improving the running speed of an applet.
Background
With the continuous development of software development technology, the small program gradually goes into the public view due to the characteristics of rapidness, portability and the like. The applet is an application which can be used without downloading and installing, and generally needs to be carried in a host program for running, and the host program provides a service interface for the applet, which can realize various service functions. For example, the present day shows a pay treasures applet, weChat applet, hundred degrees applet, 360 applet, and a head applet.
The user clicks on the applet icon and the applet opens. After the applet is opened, the applet starts to run, providing the corresponding service to the user. The speed of the running of the applet will affect the implementation of the service and the experience of the user. Therefore, how to increase the running speed of the applet is an important issue.
Disclosure of Invention
One or more embodiments of the present disclosure describe a method and an apparatus for improving the running speed of an applet, which can improve the running speed of the applet.
According to a first aspect, there is provided a method for improving the running speed of an applet, applied to a terminal device carrying at least one applet, where the method includes:
when the host program is opened, calling a system interface of the terminal equipment to execute an equipment discovery process;
judging whether a target controlled device capable of being controlled by the applet exists around the terminal device through a device discovery process; if there is a presence of a compound that,
determining a target applet for controlling the target controlled device;
establishing a short-distance wireless connection with target controlled equipment;
after the target applet is opened, the established short-range wireless connection is multiplexed.
Wherein the device discovery process comprises: short-range wireless scanning;
the determining, by the device discovery process, whether there is a target controlled device controllable by an applet around the terminal device includes:
judging whether a broadcast message sent by the wireless device is scanned or not;
if the information is scanned, judging whether the wireless device sending the broadcast message is a controlled device which can be controlled by a small program according to the parameter information carried in the broadcast message;
if so, it is determined that there is a target controlled device around the terminal device that can be controlled by the applet.
The step of judging whether the wireless device sending the broadcast message is a controlled device capable of being controlled by the small program according to the parameter information carried in the broadcast message comprises the following steps:
judging whether the parameter information carried in the broadcast message can be found in any corresponding relation in a pre-acquired configuration table; if yes, determining the wireless device sending the broadcast message as a target controlled device which can be controlled by the small program; each entry in the configuration table includes: app ID corresponding to one parameter information;
the determining a target applet for controlling the target controlled device comprises:
finding an App ID corresponding to the parameter information in the broadcast message from the configuration table;
and determining the target applet according to the found App ID.
Wherein, the code file of each applet is independently stored with a pre-connection configuration file for short-distance wireless connection;
each entry in the configuration table further includes: a path corresponding to the parameter information; the path is as follows: the pre-connection configuration file is relative to the path of the package file root directory;
the establishing short-distance wireless connection with the target controlled equipment comprises the following steps:
searching a path corresponding to the parameter information in the broadcast message from the configuration table;
reading a pre-connection configuration file stored in the target applet according to the searched path;
and establishing short-distance wireless connection with the target controlled equipment according to the execution logic in the read pre-connection configuration file.
The close range wireless scanning includes: bluetooth scanning;
the close range wireless connection includes: bluetooth connection;
the broadcast message includes: bluetooth broadcast messages;
the parameter information includes: UUID.
Wherein the method further comprises: executing a first process of the pre-connection configuration file and a second process of executing an applet to open a pre-connection service, wherein the first process and the second process are marked by using an APP ID of the applet so that the two processes access the same data storage area;
the second process stores the data of the applet required for pre-establishing the short-distance wireless connection into a data storage area corresponding to the applet;
the first process reads the data from the data storage area corresponding to the applet.
Wherein after the target applet is opened and before multiplexing the established short-range wireless connection, further comprising:
determining whether a third process for performing a short-range wireless connection with the target controlled device is running,
if not, the target applet starts to establish short-distance wireless connection with the target controlled equipment;
if so, judging whether a third process has established the short-distance wireless connection, if so, executing the multiplexing of the established short-distance wireless connection, if not, monitoring an event of establishing the short-distance wireless connection by the third process, and executing the multiplexing of the established short-distance wireless connection after receiving the event.
According to a second aspect, there is provided a device for increasing the running speed of an applet, for use in a terminal device carrying at least one applet, wherein the device comprises:
the detection module is configured to call a system interface of the terminal equipment to execute an equipment discovery process when the host program is opened;
a controlled device detection module configured to determine whether there is a target controlled device controllable by an applet around the terminal device through a device discovery process;
a target applet determining module configured to determine a target applet for controlling a target controlled device controllable by an applet when the target controlled device exists around the terminal device;
the pre-connection processing module is configured to establish short-distance wireless connection with the target controlled equipment;
and a connection multiplexing module configured to cause the target applet to multiplex the established short-range wireless connection after the target applet is opened.
According to a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method according to any of the embodiments of the present description.
According to a fourth aspect, there is provided a computing device comprising a memory having executable code stored therein and a processor which, when executing the executable code, implements a method as described in any of the embodiments of the present specification.
According to the method and the device for improving the running speed of the applet, the information dimension of physical distance is introduced, whether the object controlled device which can be controlled by the applet exists around the terminal device carrying the applet is judged through the device discovery process, if so, the fact that the user is likely to use the object applet to control the object controlled device can be judged in advance, therefore, the process of establishing the wireless close-range connection with the controlled device can be carried out in advance for the object applet, and after the object applet is opened by the user, the process of establishing the wireless close-range connection with the controlled device is not required to be executed in the running process, so that the process of the applet in the running process is reduced, and the running speed of the applet is improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present description, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a system architecture to which one embodiment of the present description applies.
FIG. 2 is a flow chart of a method of increasing the speed of a applet in one embodiment of the present disclosure.
Fig. 3 is a flow chart of a method for obtaining a distance wireless connection by a target applet after the target applet is opened in one embodiment of the present description.
Fig. 4 is a flowchart of a method for turning on and off bluetooth pre-connection functions of an applet in one embodiment of the present disclosure.
Fig. 5 is a flowchart of a method for improving the running speed of an applet based on the implementation of the applet supporting the bluetooth protocol in one embodiment of the present disclosure.
Fig. 6 is a schematic structural view of a lifting device for a small-program running speed in one embodiment of the present disclosure.
Detailed Description
As previously mentioned, the speed of the applet will affect the implementation of the service and affect the user experience. If the applet is running too slowly, it is likely that the user will not want to continue waiting, thereby shutting down the applet, resulting in the applet's functionality not being implemented. Therefore, there is a need to better promote the speed of operation of the applet.
Currently, applets have begun to be applied in the control of a certain device. For example, with the continuous development of internet of things (IoT) technology, more and more manufacturers select applets as carriers to control a certain device in the internet of things, such as controlling intelligent home appliances or intelligent electric vehicles through the applets, so as to provide relevant services for users.
When the applet is used to control a device, it is known that when the applet is started to operate after the applet is opened, a short-range wireless connection, such as a bluetooth connection, is first established with the controlled device, and then the applet can communicate with the controlled device through the established short-range wireless connection, such as the bluetooth connection, for example, to send a control command to the controlled device, so as to control the controlled device. In general, it takes a relatively long time to establish a short-distance wireless connection between an applet and a controlled device, for example, when a bluetooth connection is established, a process including scanning, connection, service authentication and the like needs to be performed, the process is time-consuming, and a user perceives that the running time of the applet is too long, the experience is poor, and even the user does not want to wait to close the applet.
Therefore, the embodiments of the present specification contemplate reducing the flow of the applet during operation, thereby improving the operation speed of the applet.
The following describes the scheme provided in the present specification with reference to the drawings.
For ease of understanding the methods provided in this specification, a description of the system architecture to which this specification relates and applies is first provided. As shown in fig. 1, the system architecture mainly includes: controlled equipment and terminal equipment. The terminal equipment downloads a host program, and the host program carries at least one applet. The applet is configured to control at least one controlled device, such as the on or off of a smart light, the opening and locking of a smart electric vehicle, etc. by the applet. The controlled device may be a device controlled by an applet in the terminal device, such as an intelligent device in the internet of things, for example, an intelligent refrigerator, an intelligent electric vehicle, an intelligent electric lamp, and the like.
It should be understood that the number of hosts, applets, controlled devices in fig. 1 is merely illustrative. Any number may be selected and deployed as desired for implementation.
FIG. 2 is a flow chart of a method of increasing the speed of a applet in one embodiment of the present disclosure. The execution subject of the method is a lifting device for the running speed of the small program. The device can be arranged in a host program and applied to a terminal device carrying at least one applet. The method shown in fig. 2 may be performed, for example, by a host program in the terminal device. It will be appreciated that the method may be performed by any apparatus, device, platform, cluster of devices, having computing, processing capabilities.
Referring to fig. 2, at least one applet referred to in an embodiment of the present description is configured to control at least one controlled device, the method comprising:
step 202: when the host program is opened, a system interface of the terminal device is called to execute a device discovery process.
Step 204: it is determined by the device discovery process whether there is a target controlled device around the terminal device that can be controlled by the applet, if so, step 206 is performed, otherwise step 204 is returned.
Step 206: a target applet for controlling the target controlled device is determined.
Step 208: and establishing a short-distance wireless connection with the target controlled equipment.
Step 210: after the applet is opened, the established short-range wireless connection is multiplexed by the applet.
As can be seen from the procedure shown in fig. 2, for such an applet for controlling the controlled device, the applet is mainly used for controlling the controlled device, for example, controlling the opening of an intelligent electric vehicle as the controlled device, or controlling the opening of an intelligent electric lamp as the controlled device, but it is usually only required that a user (the user carries the terminal device carrying the applet) approaches the controlled device, that is, when such control is required (i.e., when a wireless close-range connection such as bluetooth connection with the controlled device needs to be established in advance for such an applet), the controlled device will appear around the user, that is, the controlled device will appear around the terminal device carrying the applet, and thus, an information dimension of physical distance is introduced, and by the device discovery procedure, it is determined whether there is a target controlled device controllable by the applet around the terminal device carrying the applet, if there is any, it is determined in advance that the user is likely to need to use the target applet to control the target controlled device, that is required to perform the above-mentioned process of establishing the wireless close-range connection with the controlled device, so that the wireless close-range connection with the controlled device need not be established when the close-range connection is performed with the controlled device. It can be seen that the process of the method shown in fig. 2 reduces the processing of the applet during the operation because the process of establishing the wireless close-range connection with the controlled device is performed in advance, thereby improving the operation speed of the applet.
In the embodiment of the present disclosure, the method for improving the running speed of the applet may be applied to any scenario in which a controlled device is controlled by the applet. For example, with the development of internet of things (IoT) technology, more and more manufacturers select applets as carriers to provide relevant services for users. For example, the car is connected with the car and is locked or unlocked through the small program control, or the car is parked by clicking a horn button on the small program.
The method of the embodiment of the present specification shown in fig. 2 is described below in connection with specific embodiments.
First, for step 202 described above: when the host program is opened, a system interface of the terminal device is called to execute a device discovery process.
Once the host program is opened, a target applet that the user needs to open next can be started to judge as early as possible, and the process of establishing a wireless close-range connection in advance corresponding to the target applet can be performed as early as possible.
In contrast to the conventional applet in the prior art, the applet in the embodiments of the present disclosure may utilize a near field communication channel, such as a bluetooth or other short range wireless communication protocol channel, in addition to the network channel of the public network. The controlled device may send a broadcast message based on the near field communication channel, so that the host program may determine whether the user needs to open an applet for controlling the controlled device next based on the near field communication channel.
In this step 202, the device discovery process includes a short-range wireless scan, that is, the host program invokes the system interface of the terminal device to perform the short-range wireless scan using the near-field communication channel. For example, the host program calls the mobile phone system interface to perform bluetooth scanning.
Next for step 204: it is determined by the device discovery process whether there is a target controlled device controllable by the applet around the terminal device carrying the applet.
In one embodiment of the present disclosure, one implementation of step 204 includes:
step 2041: the host program judges whether a broadcast message sent by the wireless device is scanned or not; if scanned, step 2043 is performed, otherwise, step 2041 is returned.
Step 2043: the host program determines whether the wireless device sending the broadcast message is a controlled device that can be controlled by the applet according to the parameter information carried in the broadcast message, if so, step 2045 is executed, otherwise, step 2041 is returned.
Step 2045: the host program determines that there is a target controlled device around the terminal device that can be controlled by the applet.
The process of step 2043 may specifically include, in one embodiment of the present disclosure:
judging whether the parameter information carried in the broadcast message can be found in any corresponding relation in a pre-acquired configuration table; if yes, determining the wireless device sending the broadcast message as a controlled device which can be controlled by the applet; each entry in the configuration table includes: app ID corresponding to one parameter information;
accordingly, the specific implementation procedure of step 206 includes: finding an App ID corresponding to the parameter information in the broadcast message from the configuration table; and determining the target applet according to the found App ID.
In one embodiment of the present specification, the configuration table may be generated and obtained in a process of opening a pre-established short-range wireless connection function (hereinafter, simply referred to as a wireless pre-connection function) for one applet.
In one embodiment of the present description, the step 208 may be implemented using the configuration table and a pre-connection configuration file for a short-range wireless connection.
The pre-connection configuration file of the short-range wireless connection is used for establishing the short-range wireless connection with the target controlled device in advance before the target applet runs, and for example, the functions implemented by the pre-connection configuration file include: after a device is scanned, whether the device is a controlled device which can be controlled by an applet is judged according to the device information.
The pre-connection profile for the close range wireless connection may include two implementations:
mode 1: is shared by at least two applets in the host program.
Mode 2: different developers develop respective pre-connection profiles for different applets, which are more suitable for the applets.
In the mode 2, the pre-connection configuration file is stored independently from other code files in the applet, so that the pre-connection configuration file can not run together with the applet, thereby avoiding errors occurring in the process of establishing the short-range wireless connection in advance and the running process of the applet, and simultaneously, the pre-connection configuration file can be conveniently read according to the applet.
It can be seen that, in the above-mentioned mode 2, the pre-connection configuration file of the short-distance wireless connection is stored in the code file of the applet in advance;
accordingly, each entry in the configuration table further includes: a path (path) corresponding to the parameter information; the path is as follows: pre-connecting the path of the configuration file relative to the package file root directory; thus, each item in the configuration table comprises the corresponding relation among parameter information, app ID and paths of an applet;
accordingly, step 208 includes:
searching a path corresponding to the parameter information in the broadcast message from the configuration table;
reading a pre-connection configuration file of the target applet according to the searched path;
and establishing short-distance wireless connection with the target controlled equipment by using the read pre-connection configuration file.
In the embodiment of the present specification, before the flow shown in fig. 2 is executed, detection may also be made for the case of judging whether to execute the process of establishing a short-range wireless connection in advance shown in fig. 2. Comprising the following steps:
case 1: and determining according to the configuration table.
When the host program is opened, the host program may obtain the latest configuration table locally, if the configuration table is empty, it indicates that no applet has opened a wireless pre-connection function (such as a bluetooth pre-connection function), the flow shown in fig. 2 is not needed to be executed, and if the configuration table is not empty and includes the correspondence, it indicates that the applet has opened the wireless pre-connection function, the flow shown in fig. 2 is needed to be executed.
Case 2: depending on whether the applet has been run.
When a short-range wireless scan, such as a bluetooth scan, is started, if it is detected that an applet has been started to run, in order to avoid running the applet concurrently with running the wireless pre-connection function, the procedure shown in fig. 2 described above need not be performed, and a short-range wireless connection is established directly by the opened applet at run time, such as all bluetooth connection processing is completed by the applet.
Case 3: according to whether the Bluetooth of the system of the terminal equipment is started or not.
Taking the short-distance wireless connection as an example of bluetooth connection, if the system bluetooth of the terminal device is always turned off, the flow shown in fig. 2 cannot be executed either, and after the open applet is opened, the bluetooth connection is established in the operation process, for example, all bluetooth connection processing is completed by the applet. After entering the applet, the system bluetooth is turned on.
In one embodiment of the present description, the logic for pre-establishing a close range wireless connection is implemented by a developer according to a service. For example, for bluetooth connection, the logic and applet that pre-establishes the short-range wireless connection run in different JavaScript engine instances, and in order to realize data sharing and communication between the two engine instances, a host program is required to support. The processes corresponding to the two engines are identified by the same App ID, and the relevant logic can be implemented based on the identification. The specific implementation method comprises the following steps:
the method further comprises the steps of: the method comprises the steps that a first process for executing a pre-connection configuration file and a second process for executing an applet to open a wireless pre-connection function are identified by using an APP ID of the applet, so that the two processes access the same data storage area;
the second process stores the data of the applet required for pre-establishing the short-range wireless connection into a data storage area corresponding to the applet;
the first process reads data from the data storage area corresponding to the applet.
In one embodiment of the present disclosure, in order to further ensure that the short-range wireless connection is available after the target applet is opened, i.e. when the target applet is running, so that information can be transmitted with the target controlled device, in the above step 210, before the target applet multiplexes the established short-range wireless connection after the target applet is opened, see fig. 3, further including:
step 2101: it is determined whether a third process of performing short-range wireless connection with the target controlled device is running, and if not, step 2103 is performed, and if yes, step 2105 is performed.
Step 2103: and the short-distance wireless connection is established between the target applet and the target controlled equipment, and the current flow is ended.
Step 2105: it is determined whether the third process has established a completed short-range wireless connection, if so, step 2107 is performed, otherwise, step 2109 is performed.
Step 2107: multiplexing the established short-distance wireless connection, and ending the current flow.
Step 2109: and monitoring an event of establishing the short-distance wireless connection by the third process.
Step 2111: it is determined whether the event is received, if yes, step 2107 is performed, otherwise step 2109 is returned.
The process in the method of increasing the speed of the applet operation is described below in connection with further embodiments. In these embodiments, the close range wireless scanning includes: bluetooth scanning; the wireless device includes a bluetooth device; the short-distance wireless connection is as follows: bluetooth connection; the broadcast message is: bluetooth broadcast messages; and, the parameter information in the broadcast message is: UUID (Universally Unique Identifier) of bluetooth service.
Example 1:
this example 1 illustrates the pretreatment that needs to be performed in the method for increasing the operating speed of the applet. In this example, the short-range wireless connection is exemplified by bluetooth connection.
The pretreatment mainly comprises the following steps: aiming at the small program capable of controlling the controlled equipment, the Bluetooth pre-connection function is opened, and of course, the Bluetooth pre-connection function of the opened small program can be closed at any time according to the requirements of manufacturers. Referring to fig. 4, the process of turning on and off the bluetooth pre-connection function of the applet includes:
step 401: when a user binds at least one controlled device in an applet, the applet transmits parameters to the host program: UUID and path (i.e. memory address of pre-connection profile) of bluetooth service.
Step 403: the applet sends a request to the host program to open the bluetooth pre-connection function.
Step 405: and the host program acquires the App ID of the applet according to the running context of the applet currently bound.
Step 407: the host program obtains the UUID and path of the bluetooth service from the transfer.
Step 409: the host program uses UUID as an index (key), and generates a corresponding relation among the UUID, the App ID and the path in a configuration table.
Step 411: the host program sends a success notification of the opening to the applet.
Thus, the Bluetooth pre-connection function of opening the applet for the applet supporting Bluetooth is realized.
If the bluetooth pre-connection function of the applet is to be turned off as needed, the following steps 413 to 423 may be performed.
Step 413: the applet sends a request to the host to close the bluetooth pre-connection function.
Step 415: the host program reads the App ID of the applet from the context and obtains the bluetooth service UUID from the argument.
Step 417: the host program deletes the correspondence relationship taking the currently received UUID as a key in the configuration table.
Step 419: the host program sends a shutdown completion notification to the applet.
Example 2:
this embodiment 2 illustrates the processing of the method for increasing the running speed of the applet, which is executed in real time, taking the bluetooth communication supported by the applet and the controlled device as an example, on the basis of completing the preprocessing of the above embodiment 1. Referring to fig. 5, comprising:
step 501: the user opens the host program.
Step 503: the host program determines whether the current configuration table is empty, if so, ends the current flow, otherwise, executes step 505.
Step 505: the host program performs bluetooth scanning through the bluetooth system of the mobile phone.
Once the mobile phone discovers the Bluetooth device, the mobile phone transmits a broadcast message sent by the Bluetooth device to the host program.
Step 507: the host program determines whether the bluetooth broadcast message sent by the bluetooth device has been scanned, and if so, performs step 509, otherwise, returns to step 505.
Step 509: the host program judges whether UUIDs carried in the Bluetooth broadcast messages can be found in any corresponding relation in the configuration table; if yes, go to step 511, otherwise, return to step 505.
Step 511: the host program searches an App ID and a path corresponding to the UUID in the Bluetooth broadcast message from the configuration table, and determines a target applet according to the found App ID.
Step 513: and the host program acquires the pre-connection configuration file from the target applet according to the found App ID and path.
Step 515: the host program loads the pre-connection configuration file to establish a bluetooth connection with the scanned target bluetooth device.
Step 517: after the user opens the applet, the established bluetooth connection is multiplexed by the applet.
In step 515, specifically, a bluetooth connection may be first established between the terminal device and the target bluetooth device through system bluetooth, and then the terminal device may submit the established bluetooth connection to the host program for management. Accordingly, in step 517, the bluetooth connection managed by the host program is taken over by the target applet, thereby implementing the established bluetooth connection multiplexed by the target applet.
In one embodiment of the present description, an apparatus for improving the running speed of an applet is provided, which may be provided in a host program and applied to a terminal device. Referring to fig. 6, the apparatus includes:
a detection module 601 configured to invoke a system interface of the terminal device to perform a device discovery process when the host program is opened;
a controlled device detection module 602 configured to determine whether there is a target controlled device controllable by an applet around the terminal device through a device discovery process;
a target applet determining module 603 configured to determine a target applet for controlling a target controlled device controllable by an applet when the target controlled device exists around the terminal device;
a pre-connection processing module 604 configured to establish a short-range wireless connection with a target controlled device;
the connection multiplexing module 605 is configured to cause the target applet to multiplex the established short-range wireless connection after the target applet is opened.
In one embodiment of the apparatus of the present specification, the device discovery process includes: short-range wireless scanning;
the controlled device detection module 602 is configured to perform:
judging whether a broadcast message sent by the wireless device is scanned or not;
if the information is scanned, judging whether the wireless device sending the broadcast message is a controlled device which can be controlled by a small program according to the parameter information carried in the broadcast message;
if so, it is determined that there is a target controlled device around the terminal device that can be controlled by the applet.
In one embodiment of the present description apparatus, the controlled device detection module 602 is configured to perform: judging whether the parameter information carried in the broadcast message can be found in any corresponding relation in a pre-acquired configuration table; if yes, determining the wireless device sending the broadcast message as a controlled device which can be controlled by the applet; each entry in the configuration table includes: app ID corresponding to one parameter information;
the object applet determination module 603 is configured to perform:
searching an APP ID corresponding to the parameter information in the broadcast message from the configuration table;
and determining the target applet according to the found App ID.
In one embodiment of the apparatus of the present specification, the pre-connection configuration file of the short-range wireless connection is independently stored in the code file of the applet;
each entry in the configuration table further includes: a path corresponding to the parameter information; the path is as follows: the pre-connection configuration file is relative to the path of the package file root directory;
the pre-connection processing module 604 is configured to perform:
searching a path corresponding to the parameter information in the broadcast message from the configuration table;
reading a pre-connection configuration file of the target applet according to the searched path;
and establishing short-distance wireless connection with the target controlled equipment by using the logic code for establishing connection in the read pre-connection configuration file.
In one embodiment of the apparatus of the present specification,
the short-range wireless scanning includes: bluetooth scanning;
the short-distance wireless connection is as follows: bluetooth connection;
the broadcast message is: bluetooth broadcast messages;
the parameter information is as follows: UUID.
In one embodiment of the apparatus of the present specification, the pre-connection processing module 604 further includes a first process for executing a pre-connection configuration file;
the first process and the second process executing the applet to open the pre-connection service are identified by using the APP ID of the applet, so that the two processes access the same data sharing area;
the second process stores the data of the small program required by pre-establishing the short-distance wireless connection into a data sharing area corresponding to the small program;
the first process in the pre-connection processing module 604 reads data from the data-sharing area corresponding to the applet.
In one embodiment of the present description apparatus, the connection multiplexing module 605 is configured to perform:
determining whether a third process for performing a short-range wireless connection with the target controlled device is running,
if not, the target applet starts to establish short-distance wireless connection with the target controlled equipment;
if so, judging whether a third process has established the short-distance wireless connection, if so, executing the multiplexing of the established short-distance wireless connection, if not, monitoring an event of establishing the short-distance wireless connection by the third process, and executing the multiplexing of the established short-distance wireless connection after receiving the event.
An embodiment of the present specification provides a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of the embodiments of the specification.
An embodiment of the present specification provides a computing device including a memory having executable code stored therein and a processor that, when executing the executable code, performs a method of any of the embodiments of the present specification.
It should be understood that the structures illustrated in the embodiments of the present specification do not constitute a particular limitation on the apparatus of the embodiments of the present specification. In other embodiments of the specification, the apparatus may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The content of information interaction and execution process between the modules in the device and the system is based on the same concept as the method embodiment of the present specification, and specific content can be referred to the description in the method embodiment of the present specification, which is not repeated herein.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the present invention may be implemented in hardware, software, a pendant, or any combination thereof. When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention in further detail, and are not to be construed as limiting the scope of the invention, but are merely intended to cover any modifications, equivalents, improvements, etc. based on the teachings of the invention.

Claims (9)

1. The method for improving the running speed of the applet is applied to terminal equipment carrying at least one applet, and comprises the following steps:
when the host program is opened, calling a system interface of the terminal equipment to execute an equipment discovery process;
judging whether a target controlled device capable of being controlled by the applet exists around the terminal device through a device discovery process; if there is a presence of a compound that,
determining a target applet for controlling the target controlled device;
establishing a short-distance wireless connection with target controlled equipment;
multiplexing the established short-range wireless connection after the target applet is opened;
wherein the device discovery process comprises: short-range wireless scanning;
the determining, by the device discovery process, whether there is a target controlled device controllable by an applet around the terminal device includes:
judging whether a broadcast message sent by the wireless device is scanned or not;
if the information is scanned, judging whether the wireless device sending the broadcast message is a controlled device which can be controlled by a small program according to the parameter information carried in the broadcast message;
if so, it is determined that there is a target controlled device around the terminal device that can be controlled by the applet.
2. The method according to claim 1, wherein the determining whether the wireless device sending the broadcast message is a controlled device controllable by the applet according to the parameter information carried in the broadcast message comprises:
judging whether the parameter information carried in the broadcast message can be found in any corresponding relation in a pre-acquired configuration table; if yes, determining the wireless device sending the broadcast message as a target controlled device which can be controlled by the small program; each entry in the configuration table includes: app ID corresponding to one parameter information;
the determining a target applet for controlling the target controlled device comprises:
finding an App ID corresponding to the parameter information in the broadcast message from the configuration table;
and determining the target applet according to the found App ID.
3. The method of claim 2, wherein the code file of each applet has a pre-connection profile stored separately for a short-range wireless connection;
each entry in the configuration table further includes: a path corresponding to the parameter information; the path is as follows: the pre-connection configuration file is relative to the path of the package file root directory;
the establishing short-distance wireless connection with the target controlled equipment comprises the following steps:
searching a path corresponding to the parameter information in the broadcast message from the configuration table;
reading a pre-connection configuration file stored in the target applet according to the searched path;
and establishing short-distance wireless connection with the target controlled equipment according to the execution logic in the read pre-connection configuration file.
4. A method according to any one of claims 1 to 3, the close range wireless scanning comprising: bluetooth scanning;
the close range wireless connection includes: bluetooth connection;
the broadcast message includes: bluetooth broadcast messages;
the parameter information includes: UUID.
5. A method according to claim 3, wherein the method further comprises: executing a first process of the pre-connection configuration file and a second process of executing an applet to open a pre-connection service, wherein the first process and the second process are marked by using an APP ID of the applet so that the two processes access the same data storage area;
the second process stores the data of the applet required for pre-establishing the short-distance wireless connection into a data storage area corresponding to the applet;
the first process reads the data from the data storage area corresponding to the applet.
6. The method of claim 1, wherein after the applet is opened and before multiplexing the established short-range wireless connection, further comprising:
determining whether a third process for performing a short-range wireless connection with the target controlled device is running,
if not, the target applet starts to establish short-distance wireless connection with the target controlled equipment;
if so, judging whether a third process has established the short-distance wireless connection, if so, executing the multiplexing of the established short-distance wireless connection, if not, monitoring an event of establishing the short-distance wireless connection by the third process, and executing the multiplexing of the established short-distance wireless connection after receiving the event.
7. The device for improving the running speed of the applet is applied to terminal equipment carrying at least one applet, and comprises the following components:
the detection module is configured to call a system interface of the mobile phone to execute a device discovery process when the host program is opened;
a controlled device detection module configured to determine whether there is a target controlled device controllable by an applet around the terminal device through a device discovery process;
a target applet determining module configured to determine a target applet for controlling a target controlled device controllable by an applet when the target controlled device exists around the terminal device;
the pre-connection processing module is configured to establish short-distance wireless connection with the target controlled equipment;
a connection multiplexing module configured to cause the target applet to multiplex the established short-range wireless connection after the target applet is opened;
the device discovery process includes: short-range wireless scanning;
the controlled device detection module is configured to perform:
judging whether a broadcast message sent by the wireless device is scanned or not;
if the information is scanned, judging whether the wireless device sending the broadcast message is a controlled device which can be controlled by a small program according to the parameter information carried in the broadcast message;
if so, it is determined that there is a target controlled device around the terminal device that can be controlled by the applet.
8. A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1-6.
9. A computing device comprising a memory having executable code stored therein and a processor, which when executing the executable code, implements the method of any of claims 1-6.
CN202210456815.5A 2022-04-28 2022-04-28 Method and device for improving running speed of applet Active CN114924807B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210456815.5A CN114924807B (en) 2022-04-28 2022-04-28 Method and device for improving running speed of applet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210456815.5A CN114924807B (en) 2022-04-28 2022-04-28 Method and device for improving running speed of applet

Publications (2)

Publication Number Publication Date
CN114924807A CN114924807A (en) 2022-08-19
CN114924807B true CN114924807B (en) 2023-12-01

Family

ID=82805897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210456815.5A Active CN114924807B (en) 2022-04-28 2022-04-28 Method and device for improving running speed of applet

Country Status (1)

Country Link
CN (1) CN114924807B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101229513B1 (en) * 2012-04-12 2013-02-06 에이큐 주식회사 Informatiom display device with nfc using public-transportation
CN107135462A (en) * 2016-02-26 2017-09-05 美商安迈科技股份有限公司 The Bluetooth pairing methods and its computing system of UEFI firmwares
CN109144603A (en) * 2018-07-24 2019-01-04 阿里巴巴集团控股有限公司 Wake-up, information-pushing method and device calculate equipment and storage medium
CN109587650A (en) * 2018-12-24 2019-04-05 宁夏锐波网络有限公司 A kind of group of pump Internet of things system based on wechat small routine
CN109685955A (en) * 2019-01-09 2019-04-26 深圳市豪力士智能科技有限公司 A kind of wechat small routine method for unlocking and device
CN109803161A (en) * 2019-01-14 2019-05-24 深圳市金锐显数码科技有限公司 TV remote controlling method, device and terminal device
CN111586128A (en) * 2020-04-28 2020-08-25 百度在线网络技术(北京)有限公司 Method, device and equipment for acquiring applet data and storage medium
WO2020187121A1 (en) * 2019-03-15 2020-09-24 上海连尚网络科技有限公司 Applet start method, device, and computer storage medium
WO2020191570A1 (en) * 2019-03-25 2020-10-01 华为技术有限公司 Method for establishing wireless communication connection, and related devices
CN112181147A (en) * 2020-09-29 2021-01-05 北京歌尔泰克科技有限公司 Wearable device interaction method and device based on applet and electronic device
CN113656087A (en) * 2020-04-29 2021-11-16 腾讯科技(深圳)有限公司 Applet starting method, device, equipment and storage medium
CN114090104A (en) * 2021-01-20 2022-02-25 北京沃东天骏信息技术有限公司 Applet starting control method and device
CN114257579A (en) * 2021-12-20 2022-03-29 支付宝(杭州)信息技术有限公司 Information transmission method, device, equipment and medium
CN114299647A (en) * 2022-01-27 2022-04-08 支付宝(杭州)信息技术有限公司 Non-inductive vehicle entering method and system based on small program
CN114327685A (en) * 2022-01-04 2022-04-12 北京百度网讯科技有限公司 Method and device for optimizing running speed of small program
CN114398094A (en) * 2021-12-21 2022-04-26 中国银联股份有限公司 Applet starting method, device, equipment and computer readable storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101229513B1 (en) * 2012-04-12 2013-02-06 에이큐 주식회사 Informatiom display device with nfc using public-transportation
CN107135462A (en) * 2016-02-26 2017-09-05 美商安迈科技股份有限公司 The Bluetooth pairing methods and its computing system of UEFI firmwares
CN109144603A (en) * 2018-07-24 2019-01-04 阿里巴巴集团控股有限公司 Wake-up, information-pushing method and device calculate equipment and storage medium
CN109587650A (en) * 2018-12-24 2019-04-05 宁夏锐波网络有限公司 A kind of group of pump Internet of things system based on wechat small routine
CN109685955A (en) * 2019-01-09 2019-04-26 深圳市豪力士智能科技有限公司 A kind of wechat small routine method for unlocking and device
CN109803161A (en) * 2019-01-14 2019-05-24 深圳市金锐显数码科技有限公司 TV remote controlling method, device and terminal device
WO2020187121A1 (en) * 2019-03-15 2020-09-24 上海连尚网络科技有限公司 Applet start method, device, and computer storage medium
WO2020191570A1 (en) * 2019-03-25 2020-10-01 华为技术有限公司 Method for establishing wireless communication connection, and related devices
CN111586128A (en) * 2020-04-28 2020-08-25 百度在线网络技术(北京)有限公司 Method, device and equipment for acquiring applet data and storage medium
CN113656087A (en) * 2020-04-29 2021-11-16 腾讯科技(深圳)有限公司 Applet starting method, device, equipment and storage medium
CN112181147A (en) * 2020-09-29 2021-01-05 北京歌尔泰克科技有限公司 Wearable device interaction method and device based on applet and electronic device
CN114090104A (en) * 2021-01-20 2022-02-25 北京沃东天骏信息技术有限公司 Applet starting control method and device
CN114257579A (en) * 2021-12-20 2022-03-29 支付宝(杭州)信息技术有限公司 Information transmission method, device, equipment and medium
CN114398094A (en) * 2021-12-21 2022-04-26 中国银联股份有限公司 Applet starting method, device, equipment and computer readable storage medium
CN114327685A (en) * 2022-01-04 2022-04-12 北京百度网讯科技有限公司 Method and device for optimizing running speed of small program
CN114299647A (en) * 2022-01-27 2022-04-08 支付宝(杭州)信息技术有限公司 Non-inductive vehicle entering method and system based on small program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于微信小程序LED灯光控制系统的设计;赵光涛;雒伟杰;刘海山;杜世珊;刘巧蓉;雒翠萍;;软件(03);全文 *

Also Published As

Publication number Publication date
CN114924807A (en) 2022-08-19

Similar Documents

Publication Publication Date Title
RU2737478C1 (en) Servicing function of network segmentation
CN101341710B (en) Supporting for integrated WLAN hot customer terminal
US7149510B2 (en) Security access manager in middleware
JP5074424B2 (en) Dependency notification
KR20070014103A (en) System and method for handshaking between wireless devices and servers
WO2013075412A1 (en) Security control method and device for mobile terminal
CN112740642B (en) Communication method and multi-access edge computing server
CN109803252B (en) Secondary eSIM card logout method, eSIM server, terminal and system
CN112306437A (en) Terminal screen projection method, device, equipment, system and computer readable storage medium
US20080133723A1 (en) Extended home service apparatus and method for providing extended home service on p2p networks
CN111147314A (en) Switch upgrading method, device and storage medium
CN114158030B (en) Session binding method, system and storage medium
KR101029364B1 (en) Mobile terminal unit for providing integrated web browsing service, mobile communication system, local area wireless communication system and method thereof
CN114924807B (en) Method and device for improving running speed of applet
KR101264315B1 (en) Method, apparatus and record carrier for interworking between applications on a mobile platform
CN114895974B (en) Method and device for improving opening speed of applet
FI111318B (en) Use of applications in a telecommunications system
CN109890016B (en) Method and device for supporting multiple applications to access Bluetooth equipment
CN106793165B (en) WIFI hotspot connection method and intelligent terminal
US20100029297A1 (en) Wireless data communication system and method for providing wireless data service to sdr terminal
CN112748937A (en) Method and device for updating eUICC operating system
CN111953793B (en) Application distribution method, device, terminal and storage medium
CN111432378B (en) Service information management platform and method
CN117176805A (en) Updating method of client
KR100834569B1 (en) Open service verification apparatus and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant