Program processing method and electronic device
By querying and updating the NFC module's mini-program version in wearable devices, the issue of unstable compatibility between pre-installed mini-programs and applications was resolved, ensuring the stability of device functions and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-18
- Publication Date
- 2026-06-19
AI Technical Summary
In wearable devices, the compatibility between pre-installed mini-programs and applications cannot be maintained stably in the production line stage for a long time, which may lead to anomalies during the update and installation process and affect the normal operation of the device.
By querying the current version number of the mini-program on the NFC module of the wearable device and comparing it with the target version number, if they are inconsistent, the mini-program is uninstalled and an updated version is installed. Feedback information is then used to ensure successful installation, thus avoiding compatibility issues caused by version inconsistencies.
It enables stable updates of mini-programs on wearable devices, improves device functionality and user experience, and ensures the normal operation of the devices.
Smart Images

Figure CN122240135A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wearable devices, and more particularly to a program processing method and an electronic device. Background Technology
[0002] With the advancement of technology and people's increasing pursuit of a healthy and convenient life, wearable devices have experienced rapid development and widespread adoption in recent years.
[0003] To further enhance functionality, more and more wearable devices are incorporating near-field communication (NFC) modules, which allow wearable devices to exchange data when they are close to each other or when they are near other electronic devices. At the same time, more and more manufacturers are choosing to pre-install corresponding app programs into the NFC modules when configuring wearable devices in their production lines.
[0004] However, in wearable devices, the pre-installed mini-programs configured in the near-field communication module during the production line stage cannot maintain long-term stable compatibility with the corresponding applications. Summary of the Invention
[0005] This application provides a program processing method and an electronic device, applied in the field of wearable devices. The method involves querying and comparing the current version number of a pre-installed program with the target version number for updating. If the version numbers do not match, the wearable device sends a series of instructions to a first module, causing it to uninstall the current pre-installed program and install the pre-installed program corresponding to the target version number. After the update is completed, applications and mini-programs in the wearable device are compatible and can run smoothly relying on the corresponding pre-installed program.
[0006] In a first aspect, embodiments of this application propose a program processing method applied to a wearable device. The wearable device includes a first module, which carries at least one preset program. The preset program is used to implement at least some functions of a corresponding target application.
[0007] The methods include:
[0008] Obtain the latest first version number of the first preset program, and obtain the current second version number of the first preset program in the first module;
[0009] If the second version number is different from the first version number, the first pre-installed program in the first module is uninstalled according to the uninstallation instruction corresponding to the second version number.
[0010] Obtain at least one installation instruction corresponding to the first version number, and install the first pre-installed program corresponding to the first version number into the first module according to the at least one installation instruction.
[0011] In this implementation, the pre-installed program can be understood as a small program, which can be installed into the first module when the wearable device is configured on the production line. The pre-installed program can be called by the target application in the wearable device to implement some functions. In the above method, the first version number of the first pre-installed program can be understood as the current version number of the first pre-installed program in the wearable device, and correspondingly, the second version number can be understood as the target version number that needs to be updated. The first module in the wearable device can be a near-field communication module.
[0012] The above method can be executed by the control module or control unit in the wearable device. The control module interacts with the first module, sending uninstallation and installation commands sequentially to update the first pre-installed program within the first module. After updating the first pre-installed program, the corresponding application can invoke it to perform some functions, enhancing the wearable device's practicality, versatility, and security, and further improving the user experience.
[0013] In one possible implementation, obtaining the current second version number of the first preset program in the first module includes:
[0014] Send a first query instruction to the first module. The first query instruction is used to request the second version number of the first preset program.
[0015] Obtain the first return information sent by the first module, which includes the second version number.
[0016] In this implementation, the control module in the wearable device sends a first query command to the first module, and compares the second version number contained in the returned result with the first version number. If the first version number and the second version number are inconsistent, an update is performed; otherwise, no update is performed. This step avoids wasting network traffic and system computing resources by performing an update when the first preset program already has the first version number.
[0017] In one possible implementation, the method also includes:
[0018] Call the start interface of the first module to start the first channel;
[0019] A first selection instruction is sent to the first module based on the first channel. The first selection instruction is used to indicate the selection of the first preset program.
[0020] Obtain the second return information sent by the first module. The second return information is used to indicate the selection result for the first preset program.
[0021] In one possible implementation, sending a first query instruction to the first module includes:
[0022] If the selection result indicates a successful selection, a first query instruction is sent to the first module.
[0023] In one possible implementation, the method also includes:
[0024] If the selection result indicates failure, the first channel is closed;
[0025] Call the start interface of the first module to start the second channel;
[0026] The first module is sent an installation command corresponding to the first version number via the second channel to install the first pre-installed program corresponding to the first version number into the first module.
[0027] In this implementation, before the wearable device's control module sends the first query command to the first module, the first module's enable interface is called and the first channel is started. The first channel is then used to send a first selection command, which selects the first preset program from among multiple preset programs in the first module.
[0028] Then, the second returned information can be used to determine whether the selection was successful. If the selection was successful, it means that the first pre-installed program has already been installed, and the version number of the first pre-installed program can be checked to see if it equals the first version number. If the selection was unsuccessful, it means that the wearable device has not yet installed the first pre-installed program and needs to proceed with the installation process directly. If the selection result indicates a failure, in order to successfully execute the installation process, the original first channel is first closed, and then the startup interface is called to start the second channel, which is used to install the first pre-installed program.
[0029] In this way, the method is further improved. By checking in advance whether the first pre-installed program has been installed in the first module of the wearable device, and performing different processing based on the check results, the overall execution efficiency of the method can be improved.
[0030] In one possible implementation, after sending at least one installation command corresponding to the first version number to the first module, the method further includes:
[0031] Obtain feedback information sent by the first module. The feedback information is used to indicate whether the first pre-installed program corresponding to the first version number has been installed successfully.
[0032] If the feedback indicates successful installation, close the target channel, which was used to send at least one installation command.
[0033] In one possible implementation, the method further includes the following before closing the target channel:
[0034] Send a second selection instruction to the first module, the second selection instruction being used to instruct the selection of the first preset program;
[0035] Obtain the third return information sent by the first module. The third return information is used to indicate the selection result for the first preset program.
[0036] If the third return message indicates that the selection result is successful, it is confirmed that the first pre-installed program corresponding to the first version number has been successfully installed.
[0037] In this implementation, after the wearable device's control module sends an installation command to the first module, considering the possibility of installation failure in some cases, a method to verify successful installation is added. First, the feedback information from the installation command allows for a preliminary judgment on installation success. For example, it checks whether the file data of the first pre-installed program has been completely written to the first module. If not, the installation was unsuccessful. Further, if the installation command feedback indicates successful installation, the control module can send a second selection command to the first module, and the installation is then verified based on the third return information. For example, if the third return information indicates a successful selection, it means the first pre-installed program has been completely written and registered in the first module, allowing external applications to interact with it. This method determines whether the first pre-installed program has been successfully installed, and if installation fails, further processing can be performed.
[0038] In one possible implementation, the method also includes:
[0039] If the feedback message indicates that the installation has failed, close the target channel;
[0040] Call the start interface of the first module to start the third channel;
[0041] Based on the third channel, at least one installation command corresponding to the first version number is resent to the first module to install the first pre-installed program corresponding to the first version number into the first module.
[0042] This implementation describes a process of checking for successful installation and, if installation fails, reopening a new channel and attempting installation again. Understandably, the installation success check is performed after each installation attempt. In other words, if installation fails again, the above method can be repeated until successful, or until certain conditions are met. This approach maximizes the assurance that the first pre-installed program is actually installed into the first module of the wearable device, preventing installation failures due to unforeseen circumstances that could prevent the wearable device's applications from calling the first pre-installed program in the first module.
[0043] In one possible implementation, before uninstalling the first pre-installed program in the first module according to the uninstallation instruction corresponding to the second version number, the method further includes:
[0044] According to the initialization instruction, the state of the first preset program in the first module is set to the initial state.
[0045] In this implementation, before uninstalling the first pre-installed program of the first module of the wearable device, an initialization command is sent to the first module, causing the first pre-installed program to enter its initial state. It's understandable that during the operation of the wearable device's system and applications, the first pre-installed program may be called at any time, keeping it in a running state. If it were uninstalled directly under these circumstances, it could very likely cause system errors, thus affecting the normal operation of the application. Therefore, by changing the state of the first pre-installed program before uninstallation, preventing it from being in a running state, problems such as application process conflicts or errors can be avoided.
[0046] In one possible implementation, obtaining the latest version number of the first preset program includes:
[0047] During the boot process of the wearable device, obtain the latest version number of the first pre-installed program; or...
[0048] In response to a request command for detecting updates, obtain the latest first version number of the first preset program.
[0049] This implementation describes when to obtain the latest version number of the first pre-installed program. One feasible approach is to pre-set the process, for example, executing it after the wearable device starts up. Another approach is to allow the user to decide whether to update; for example, the user can click the update check control in the application settings to issue a corresponding request command to obtain the latest version number of the first pre-installed program. It is understandable that obtaining the latest version number of the first pre-installed program also corresponds to the update process of the first pre-installed program. In other words, different methods can be chosen to trigger the update process of the first pre-installed program, enhancing the flexibility of this method.
[0050] In one possible implementation, the pre-installed program type is a mini-program; and,
[0051] The first version number and at least one installation command corresponding to the first version number were obtained from the cloud.
[0052] In one possible implementation, the first module includes a first chip unit, and a pre-installed program is installed in the first chip unit.
[0053] In this implementation, the first module includes a first chip unit, and a pre-installed program is installed in the first chip unit. The first chip unit can be a secure chip unit with independent processing and storage functions, which can largely prevent physical and logical attacks.
[0054] Wearable devices can retrieve relevant data resources from the cloud during idle periods or before actively running pre-installed program update processes to complete updates. The data resources retrieved from the cloud may include the first version number of the pre-installed program and the corresponding installation instructions. It is understood that the pre-installed program itself may be included in the installation instructions or may be retrieved as a separate data resource. This approach further enhances the security of wearable devices.
[0055] In a second aspect, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory is used to store code instructions and the processor is used to execute the code instructions to perform the methods described in the first aspect or any possible implementation thereof.
[0056] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0057] Fourthly, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0058] Fifthly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the methods described in the first aspect or any possible implementation thereof. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.
[0059] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).
[0060] It should be understood that the second to fifth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0061] Figure 1 A schematic diagram of a wearable device provided in an embodiment of this application;
[0062] Figure 2 A schematic diagram of the application interface of a wearable device provided in an embodiment of this application;
[0063] Figure 3 A schematic diagram of the implementation of mini-program updates for wearable devices provided in this application embodiment. Figure 1 ;
[0064] Figure 4 Schematic diagram of the structure of the wearable device provided in the embodiments of this application Figure 1 ;
[0065] Figure 5 This is a schematic diagram illustrating the use of the wearable device provided in the embodiments of this application;
[0066] Figure 6 This is a schematic diagram of the hardware architecture of a wearable device provided in an embodiment of this application;
[0067] Figure 7 This is a schematic diagram of the software architecture of a wearable device provided in an embodiment of this application;
[0068] Figure 8Flowchart of the program processing method provided in the embodiments of this application Figure 1 ;
[0069] Figure 9 Schematic diagram of the structure of the wearable device provided in the embodiments of this application Figure 2 ;
[0070] Figure 10 Flowchart of the program processing method provided in the embodiments of this application Figure 2 ;
[0071] Figure 11 Flowchart of the program processing method provided in the embodiments of this application Figure 3 ;
[0072] Figure 12 Flowchart of the program processing method provided in the embodiments of this application Figure 4 ;
[0073] Figure 13 Flowchart of the program processing method provided in the embodiments of this application Figure 5 ;
[0074] Figure 14 Flowchart of the program processing method provided in the embodiments of this application Figure 6 ;
[0075] Figure 15 Flowchart of the program processing method provided in the embodiments of this application Figure 7 ;
[0076] Figure 16 A schematic diagram illustrating the process of updating a mini-program as provided in this application embodiment;
[0077] Figure 17 A schematic diagram of the interface for updating a wearable device provided in an embodiment of this application;
[0078] Figure 18 Schematic diagram of the structure of the wearable device provided in the embodiments of this application Figure 3 ;
[0079] Figure 19 This is a schematic diagram of the structure of the APDU provided in the embodiments of this application;
[0080] Figure 20 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0081] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0082] 1. RTOS
[0083] A Real-Time Operating System (RTOS) is a special type of computer operating system designed to handle time-critical tasks, ensuring that it responds to events or completes computations within strict time constraints. Key features of RTOS include: real-time performance, multitasking, priority scheduling, interrupt handling, determinism and predictability, efficient resource management, miniaturization, and configurability.
[0084] RTOS (Real-Time Operating Systems) are commonly used in wearable devices and are generally considered lightweight systems, such as LiteOS. Most RTOSs are designed to consume very little memory and processing resources, which is crucial for resource-constrained wearable devices. RTOSs also have excellent power management capabilities, adjusting power consumption according to the device's operating status. Furthermore, RTOSs typically offer high configurability and modular design, allowing developers to trim unnecessary components to further reduce resource consumption.
[0085] 2. NFC
[0086] Near Field Communication (NFC) is a short-range wireless communication technology that allows electronic devices to exchange data when they are close to each other. NFC typically operates within a few centimeters, making it ideal for secure transactions, data exchange, and simple setup processes.
[0087] NFC technology evolved from Radio Frequency Identification (RFID) technology. Its main characteristics include simplicity, speed, high security, low power consumption, and support for a variety of applications. For example, NFC can be used in mobile payments, access control systems, ticket verification, and device pairing, among other scenarios.
[0088] 3. eSE
[0089] An embedded secure element (eSE) is a hardware security module integrated into a device, primarily used to store sensitive information and perform security-related operations. An eSE can be viewed as an independent computing environment with its own processor, operating system, and storage space, specifically designed to protect data security and integrity, preventing unauthorized access and tampering.
[0090] Compared to traditional software solutions, eSE offers a higher level of security because it effectively resists both physical and logical attacks, ensuring that even if the device is lost or stolen, the data stored within it cannot be easily accessed illegally. Furthermore, since eSE is a standalone hardware component, its presence does not affect the performance of the main system, while also reducing security risks caused by software vulnerabilities.
[0091] 4. APDU
[0092] Application Protocol Data Unit (APDU) instructions are a basic unit of communication. APDUs are divided into two types: command APDUs (C-APDUs) and response APDUs (R-APDUs). Command APDUs are instructions sent by external devices, such as terminals or computers, to smart cards or chips, while response APDUs are replies returned by smart cards or chips to external devices or modules.
[0093] A typical APDU instruction may include instruction type, instruction code, parameters, data field length, and optional data fields. The specific format of each APDU may vary depending on the protocol version used and the specific application environment. Correctly constructing and parsing APDUs is crucial for achieving secure and reliable communication.
[0094] 5. OTA
[0095] Over-the-Air (OTA) technology generally refers to updating a device's software or configuration data via a wireless network. The term originated in the broadcasting industry, referring to the transmission of data via radio waves, but it is now widely used in mobile communications and the Internet of Things (IoT) fields.
[0096] In wearable devices, smartphones, tablets, and other smart devices, OTA updates allow manufacturers to push software updates, including operating system upgrades, security patches, and application updates, directly to users' devices without requiring users to connect to a computer or use a wired connection. This simplifies the update process, enabling users to easily and quickly access the latest features and security protections.
[0097] 6. Applet
[0098] In this application embodiment, an applet refers to a small application running on a chip. These applets are typically used to perform specific security functions, such as authentication, data encryption, and payment processing. Applets are designed to perform sensitive operations in a highly secure environment, ensuring data integrity and confidentiality.
[0099] The main characteristics of applets include: security, as applets generally run in the isolated environment of a secure chip; independence, as applets communicate with each other through predefined interfaces without affecting each other; and standardization, as applets typically follow international standards to ensure that applets from different manufacturers can run on various chips.
[0100] 7. SDK
[0101] A Software Development Kit (SDK) is a set of tools and documentation used to help software developers create applications for a specific platform. A typical SDK may include the following components: API, code examples, library files, documentation, debugging tools, and license information.
[0102] SDKs help developers develop applications more quickly and efficiently because they typically provide encapsulation of the underlying system or services, eliminating the need for developers to build everything from scratch. For example, if you're developing an application for the Android operating system, you'd use the Android SDK; if you're developing an application for a specific cloud service platform, you'd use the cloud service SDK provided by that platform.
[0103] 8. Other terms
[0104] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0105] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0106] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0107] 9. Wearable devices
[0108] In this application, wearable devices refer to electronic devices designed to be worn on the body. They typically integrate microcomputer technology, sensors, and other hardware, enabling them to perform various functions, such as tracking health data, receiving notifications, and playing music. These devices are often paired with smartphones or other computing devices, but can also operate independently.
[0109] Common wearable devices include smartwatches and smart bracelets, which can display the time, receive call and message notifications, and are often equipped with heart rate monitors, GPS, and other functions, and can also track users' exercise and sleep quality.
[0110] Wearable devices also include smart glasses, which may be used for navigation, taking photos or making video calls; ear-worn devices, in addition to basic audio playback, may also have noise reduction and health monitoring functions, such as detecting body temperature.
[0111] Wearable devices can also be clothing and accessories, such as smart garments, shoes, or other accessories with built-in sensors, which can be used to monitor physical condition or improve athletic performance.
[0112] Based on the above introduction, the relevant technologies involved in this application will be further described in detail below.
[0113] With the advancement of technology, wearable devices have become an indispensable part of modern life. These smart devices not only include the early popular smartwatches and smart bracelets, but have also expanded into a wider range of fields, such as smart glasses, health monitoring devices, smart clothing, and ear-worn devices. Figure 1 As shown in (a), this is a smartwatch that can not only display the time, but also receive notifications, track health data, and even function as a standalone communication tool. Figure 1As shown in (b), smart bracelets focus on providing functions such as motion analysis, heart rate monitoring, and sleep pattern recording.
[0114] Technological advancements have made wearable devices smaller and more powerful, offering users obvious convenience. Progress in sensor technology allows wearable devices to collect more accurate data; for example, continuous glucose monitoring (CGM) technology provides significant benefits to people with diabetes. Meanwhile, advancements in microprocessor and battery technology have enabled wearable devices to have longer battery life and support greater local processing power, reducing reliance on smartphones. Furthermore, better network support brings faster data transmission speeds and lower latency to wearable devices, making real-time data analysis and cloud interaction possible.
[0115] Wearable devices seamlessly integrate into daily life, allowing users to easily manage their health. For example, fitness enthusiasts can track their workout progress using built-in heart rate sensors and GPS modules; the elderly or those with chronic diseases can remotely monitor their health through medical-grade wearable devices, reducing the number of hospital visits. Furthermore, some smart glasses products are incorporating augmented reality (AR) technology, providing users with a more immersive experience, making navigation and information retrieval more intuitive. Many devices also support voice assistants, making operation simple and quick, eliminating the need for manual input to complete commands.
[0116] Beyond personal use, wearable devices have a wide-ranging impact on society. They help facilitate public health management, particularly during pandemics, by tracking and controlling the spread of disease. Furthermore, businesses are leveraging employee-worn health monitoring devices to improve the work environment and increase productivity. In short, as technology continues to evolve, wearable devices will continue to revolutionize how we interact with the digital world and profoundly influence our lifestyles and social structures.
[0117] With continuous technological advancements, wearable devices such as smartwatches and smart bracelets are no longer merely fashion accessories or fitness trackers. Today, these devices integrate an increasing number of functions originally found in smartphones, offering users unprecedented convenience and functionality. For example, modern smartwatches and some high-end smart bracelets support the installation of official or third-party applications, greatly expanding their functionality. Users can use these applications to access social networks, listen to music, check weather forecasts, and even shop online. Some apps are also specifically optimized for health and fitness, providing professional exercise guidance and detailed health data analysis. Figure 2The smart bracelet can display the current time, such as 12:05, the current location, such as city A, and the current weather conditions, such as a rainy day with a temperature of 20°C. It can also offer multiple applications for the user, such as application A, application B, application C, and application D.
[0118] Virtual SIM (eSIM) technology is a major breakthrough in mobile communications in recent years, and it has also been introduced into smartwatches and smart bands. With a built-in eSIM, these devices can directly connect to cellular networks, enabling calls and data transfer without a physical SIM card. This means that even without a mobile phone, users can stay connected through their wearable devices to receive important notifications, make emergency calls, or use navigation services. This technology offers immense convenience for travelers and outdoor enthusiasts.
[0119] like Figure 3 As shown, relying on the development of wireless communication technologies such as OTA (Over-The-Air), wearable devices, such as smartwatches, can download and install the data resources needed for applications from cloud servers. In one implementation, the wearable device can send a download request to the cloud server. Upon receiving the request, the cloud server can wirelessly transmit the relevant data resources to the smartwatch's wireless communication unit. The downloaded data resources are then transmitted to the wearable device's control unit via the wireless communication unit. After processing by the control unit, the data is written to and installed into the storage unit for subsequent user use.
[0120] However, the aforementioned implementation of wearable device program updates has some shortcomings or problems. To better illustrate this issue, we will first explain it using some practical scenarios.
[0121] As wearable devices process increasingly diverse data types, ensuring the security of users' personal information has become paramount. Manufacturers are employing advanced encryption technologies and robust access control systems to protect user privacy. For example, some smartwatches are equipped with biometric sensors, such as fingerprint scanners or heart rate sensors, for authentication; meanwhile, software-level security updates are regularly released to fix potential vulnerabilities and enhance protection. Furthermore, the pairing process between devices has become more secure, preventing unauthorized access.
[0122] Meanwhile, secure and reliable mobile payment and verification functions have become standard features in wearable devices such as smartwatches and smart bracelets. These functions can be achieved using NFC technology, such as... Figure 4As shown, suppose that in a smartwatch, in addition to the existing functional modules, such as the control unit, wireless communication unit, and storage unit, an NFC module is added, and the NFC module can interact with the control unit of the smartwatch.
[0123] Near Field Communication (NFC) technology plays a crucial role in modern wearable devices, simplifying user interaction and providing efficient and secure solutions for various applications. NFC is a short-range wireless communication technology that enables data exchange between two electronic devices, activating when they are within a few centimeters of each other. One of NFC's most significant applications is in mobile payments. By linking credit card information or third-party payment platforms to a smartwatch or wristband, users can quickly make payments at NFC-enabled terminals with a simple wave of their wrist. This contactless payment method not only increases transaction speed and reduces waiting time but also greatly facilitates daily life, especially in scenarios such as supermarkets, convenience stores, and public transportation, as it eliminates the need to take out a phone or wallet.
[0124] Beyond payment functionality, NFC also simplifies the pairing process for Bluetooth or other wireless protocols. For example, when connecting headphones, speakers, or other smart devices, users no longer need to tediously search for and select devices; simply bringing the two devices close together automatically initiates the pairing process, instantly completing the connection. This makes device interaction more intuitive and faster, improving the user experience.
[0125] NFC technology can also be applied to secure access control. Some businesses and residences use NFC-based authentication systems, allowing employees or residents to unlock doors by wearing NFC-enabled wearable devices, eliminating the need for traditional keys or cards. This not only enhances security but also improves access control by managing entry and exit records and reducing the risk of losing physical credentials.
[0126] like Figure 5 As shown, in Figure 5 There is an access control system 501. The automatic door of access control system 501 will only open after user 503 completes identity verification, allowing the user to pass through. An identity verification device 502 is installed on one side of access control system 501. Generally, users can use an identification card issued by the relevant organization for verification. However, such cards are often forgotten, which may result in being denied entry by access control system 501. User 503 carries a wearable device 504, let's say a smartwatch, equipped with an NFC module and linked to user 503's identity. This device can be used for verification by access control system 501, allowing user 503 to successfully pass through access control system 501 using the wearable device 504.
[0127] Understandably, many wearable devices today, such as smartwatches and smart bracelets, are designed with user comfort in mind, and some are even waterproof. This allows users to wear them for extended periods without removing them. Furthermore, when wearable devices incorporate some of the functions of other mobile devices or cards, the user experience can be significantly enhanced.
[0128] Furthermore, NFC allows wearable devices to exchange simple data with other NFC tags or devices, such as obtaining specific information or settings from an NFC tag. This can be used to provide personalized services or experiences; for example, when visiting a museum, visitors can tap on an NFC tag next to an exhibit to access more detailed text descriptions or multimedia content.
[0129] To better integrate applications with NFC modules, more and more manufacturers are choosing to pre-install corresponding applets into the NFC module during the wearable device production line configuration. These applets can perform some of the application's functions. This pre-installation allows applications to leverage NFC to achieve the various use cases mentioned above. Furthermore, pre-installing the applets during the production line stage enhances security.
[0130] In conclusion, NFC technology, with its convenience, security, and versatility, has profoundly changed the functionality and service models of wearable devices, enabling these small personal accessories to seamlessly integrate into our digital lives and provide users with a smoother and more efficient daily experience. As NFC technology continues to advance and become more widespread, it is foreseeable that it will play a crucial role in even more innovative applications.
[0131] The scenarios described above demonstrate how wearable devices equipped with NFC modules can significantly benefit our lives and work. However, even after a wearable device uses an NFC module and pre-installs a mini-program, the mini-program still needs to be updated with system or application updates. Otherwise, incompatibility in interfaces or functions may occur, rendering the device unusable. Furthermore, some wearable devices may not have pre-installed mini-programs during the production line configuration phase, or may lack pre-installation for specific target mini-programs. This can result in the target mini-program not being present in the NFC module, potentially causing some applications to malfunction.
[0132] However, existing methods for updating or installing mini-programs are difficult to apply directly to wearable devices equipped with NFC modules. Due to the special nature of NFC modules, conventional methods for updating or installing mini-programs cannot be successfully used and may even cause NFC modules to malfunction, which could affect the operation of the entire wearable device system.
[0133] Based on this, the embodiments of this application propose the following technical concept: For the NFC module in a wearable device, based on the unique interface and command interaction mode of the NFC module, the current version number of the target mini-program in the NFC module can be queried first and compared with the updated version number. If the current version number of the target mini-program is the same as the updated version number, then it means that no update is needed. Conversely, if the current version number of the target mini-program is different from the updated version number, then a command to uninstall the target mini-program is first sent to the NFC module. After the uninstallation is completed, a command to write the target mini-program is then sent to the NFC module.
[0134] Furthermore, to ensure successful updating of the target mini-program on the wearable device, after sending the command to write the target mini-program to the NFC module, the feedback information from the NFC module can be used to determine whether the installation was successful. If the writing fails, the update process can be exited, and a reinstallation can be performed.
[0135] The method proposed in this application embodiment enables the smooth updating or installation of mini-programs in wearable devices equipped with NFC modules, making the wearable devices more powerful and improving the user experience.
[0136] The technical solution provided in this application can be applied to terminal devices. The terminal devices will be briefly introduced below.
[0137] For example, Figure 6 This is a schematic diagram of the hardware structure of a wearable device provided in an embodiment of this application. The wearable device may include a processor 610, a mobile communication module 620, a wireless communication module 630, a display screen 640, a charging management module 650, a power management module 651, a battery 652, an internal memory 660, and an audio module 670, etc.
[0138] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the wearable device. In other embodiments of this application, the wearable device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0139] Processor 610 may include one or more processing units. These processing units may be independent devices or integrated within one or more processors. Processor 610 may also include memory for storing instructions and data. In one implementation, for example, processor 601 may perform related data processing tasks to implement the embodiments described below.
[0140] In this embodiment, the processor 610 can also be understood as a control module that can send instruction information to other modules in the wearable device, control other modules to run according to instructions, and receive feedback information from other modules.
[0141] The wireless communication function of the wearable device can be implemented through an antenna, a mobile communication module 620, a wireless communication module 630, a modem, and a baseband processor. Additionally, a charging management module 650 is used to receive charging input from a charger. A power management module 651 is used to connect the battery 652, the charging management module 650, and the processor 610.
[0142] Wireless communication capabilities combined with eSIM enable wearable devices to independently download data resources from the cloud, including using the downloaded data resources to install or update applications.
[0143] Wearable devices utilize a GPU, a display screen 640, and an application processor to achieve display functionality. The GPU is a microprocessor for image processing, connecting the display screen 640 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. For example, the interface display implementations described in the above embodiments can be performed by the GPU, the display screen 640, and the application processor.
[0144] Wearable devices can achieve audio functions such as music playback and recording through audio modules 670, speakers, receivers, and application processors.
[0145] In this embodiment, the wearable device may further include a first module 680. The first module 680 can function as an independent module, interacting with the processor 610, receiving instructions from the processor 610, and performing corresponding operations. The first module 680 may also have near-field communication (NFC) functionality, enabling the wearable device to easily exchange data with other electronic devices at close range.
[0146] For example, the system of the wearable device in this application embodiment can be a lightweight Internet of Things Operating System (LiteOS), or the software system of the wearable device in this application embodiment can also be an Android system. For example, the software architecture of the wearable device can be described using the layered architecture of the LiteOS system as an example. This application embodiment does not specifically limit the software system of the wearable device.
[0147] The software system of wearable devices can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc. This application uses a layered architecture system as an example to illustrate the software structure of a wearable device.
[0148] For example, taking a smartwatch as a wearable device, Figure 7 This is a schematic diagram of the software structure of a smartwatch provided in an embodiment of this application.
[0149] like Figure 7 As shown, the layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the software architecture of a smartwatch can be divided into five layers, from top to bottom: Application (APP) layer, System Service (Framework) layer, Algorithm layer, Hardware Abstraction layer (HAL), and Kernel layer.
[0150] This application layer can include a series of applications. For example, these applications could include: watch face applications, activity tracking applications, calling applications, secure payment applications, and workout applications.
[0151] The system service layer provides system support for applications in the application layer. For example, the system service layer may include modules such as step counting, heart rate monitoring, calorie tracking, and heart health services.
[0152] In this embodiment, the system service layer may further include a mini-program update service. This mini-program update service can be used to update or install mini-programs on wearable devices equipped with the first module. The wearable device's system can pre-set the triggering time for the mini-program update service, for example, it can be triggered when the wearable device's system starts. Alternatively, it can be triggered actively, such as when the user checks version information in settings.
[0153] This algorithm layer provides algorithmic support for the system service layer. For example, this algorithm layer may include: heart rate algorithm, dimming algorithm, sleep algorithm, security algorithm, and wearability algorithm, etc.
[0154] In the Hardware Abstraction Layer (HAL), all hardware-related operations required by the upper layers of the system need to call the relevant Application Programming Interface (API) of the HAL. Each hardware device's software architecture layer specifies certain functionalities, which the HAL layer can use to implement.
[0155] This hardware abstraction layer may include interfaces for C++ libraries, storage interfaces, display interfaces, touch interfaces, Bluetooth interfaces, and Global Positioning System (GPS) interfaces.
[0156] The kernel layer can be the layer between hardware and software. The kernel refers to system software that provides functions such as a hardware abstraction layer, disk and file system control, and multitasking. The kernel is the core of an operating system and its most fundamental part. It is responsible for managing system processes, memory, device drivers, file and network systems, and determines the system's performance and stability. It is part of the software that provides secure access to computer hardware for numerous applications; this access is limited, and the kernel determines when a program can operate on a particular part of the hardware and for how long. This kernel layer can be the operating system kernel (OS kernel).
[0157] Based on the above, the methods provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0158] First, combine Figure 8 and Figure 9 A program processing method provided in an embodiment of this application will be described. Figure 8 Flowchart of the program processing method provided in the embodiments of this application Figure 1 , Figure 9 Schematic diagram of the structure of the wearable device provided in the embodiments of this application Figure 2 .
[0159] refer to Figure 8 The steps and flow of the control module and the first module are as follows:
[0160] S801, Obtain the latest version number of the first preset program.
[0161] In this embodiment, the first pre-installed program can be understood as a program pre-installed in the wearable device during the configuration of the wearable device production line. The first version number can be understood as the version number of the expected update of the first pre-installed program.
[0162] In some implementations, the wearable device can retrieve a preliminary version number from a cloud server via a wireless network before proceeding with subsequent processing. This ensures that the latest version number is always obtained each time the program's processing method is executed.
[0163] In some implementations, wearable devices can retrieve and store the first version number from the cloud when idle, and then retrieve it directly from the stored data when executing the program's processing method. This allows for faster execution of this step and saves time.
[0164] S802, Obtain the current second version number of the first preset program in the first module.
[0165] like Figure 9 As shown in the embodiments of this application, the wearable device may include a control module and a first module. The control module can be understood as a module capable of performing various calculations and processing, as well as controlling other modules. The first module can interact with the control module as an independent module. Pre-set programs can be set in the first module, and the control module can use the pre-set programs to complete some functions through the interface with the first module.
[0166] The second version number can be understood as the version number of the first pre-installed program currently installed in the first module.
[0167] In this step, the control module in the wearable device obtains the second version number of the first preset program. Similarly, in some implementations, the control module can obtain the second version number from the first preset program of the first module during the execution of this method. In other implementations, the control module can also obtain the second version number from the first preset program of the first module in advance and store it in a specific location, and then obtain the second version number from the stored location when executing this step.
[0168] S803. Determine whether the second version number is the same as the first version number.
[0169] After obtaining the first version number to be updated and the second version number of the first pre-installed program, the wearable device's control module compares the first and second version numbers. Understandably, if the first and second version numbers match, it means the current first pre-installed program is the latest version relative to the current application, and therefore no further update is needed.
[0170] S804. If the version numbers are different, send the uninstallation command corresponding to the second version number.
[0171] If the first version number and the second version number are inconsistent, the control module of the wearable device will first send an uninstallation command to the first module, in order to clear the first pre-installed program in the first module.
[0172] It should be noted that in this embodiment, the first pre-installed program in the first module needs to be uninstalled first. If the direct overwrite installation method is used, it may cause subsequent installation failures.
[0173] Furthermore, the uninstallation command must correspond to the first pre-installed program with the second version number. In other words, uninstalling different versions of the first pre-installed program corresponds to different uninstallation commands. Alternatively, it can be understood that the uninstallation command contains the version information of the first pre-installed program. Due to the characteristics of the first module in a wearable device, if the uninstallation command does not match the version number of the first pre-installed program, it may lead to serious problems, even rendering the first module unusable and requiring formatting or other procedures to continue functioning.
[0174] Understandably, in wearable devices, the first module is treated as a separate module, and security is a crucial consideration. This means that, for security and other reasons, there are relatively strict restrictions on the interaction commands between the first module and the control module. Generally, specific pre-programmed interaction commands can be obtained from the manufacturer of the first module.
[0175] S805. Uninstall the first pre-installed program according to the uninstallation command.
[0176] After receiving an uninstallation command from the wearable device's control module, the first module removes the first pre-installed program. After the first pre-installed program is removed, applications in the wearable device can no longer use it to perform their corresponding functions.
[0177] S806. Obtain at least one installation command corresponding to the first version number.
[0178] In this step, the control module in the wearable device obtains at least one installation instruction of the first pre-installed program corresponding to the first version number, which is used to implement the installation of the new first pre-installed program.
[0179] Regarding the method for the control module in a wearable device to obtain at least one installation command, some implementations can temporarily retrieve it from a cloud server via a wireless network during this step. In another implementation, the command can be retrieved in advance from the cloud server via a wireless network when the wearable device is idle, saved to the wearable device's storage, and then directly retrieved from the wearable device's storage during this step.
[0180] In this embodiment of the application, one installation instruction or multiple installation instructions can be obtained, and the choice can be made according to the actual situation.
[0181] In some implementations, the data of the first pre-installed program can be included in an installation command, so that the installation of the first pre-installed program can be completed with a single installation command.
[0182] In other implementations, an installation command can be used to instruct the first module to install a first pre-installed program, and the data of the first pre-installed program can be included in other subsequent installation commands. That is, a data channel can be established between the first module and the first module through an installation command, and then the first pre-installed program can be written based on subsequent installation commands to complete the installation.
[0183] Understandably, this step only needs to be executed before S807; there are no further restrictions here.
[0184] S807, Send at least one installation command.
[0185] As mentioned above, the control module in the wearable device sends at least one installation command to the first module for the installation of the first pre-installed program.
[0186] S808, Install the first pre-installed program corresponding to the first version number.
[0187] After receiving at least one installation command from the control module in the wearable device, the first module executes the installation process according to the installation command, writes and saves the first pre-installed program, and completes the installation. In some implementations, during the process of installing the first pre-installed module, the first module needs to first complete the writing of the first pre-installed module data, then perform security verification, and then register and activate it so that the application in the wearable device can access and call it.
[0188] Based on the above description, the following is a further summary and explanation of the program processing method. In this embodiment, the need to update the first pre-installed program is determined by comparing whether the current version number of the first pre-installed program in the first module of the wearable device is consistent with the desired update version number. When the version numbers are inconsistent, the control module in the wearable device sends a series of instructions to the first module, causing the first module to first uninstall the current first pre-installed program and then install the first pre-installed program corresponding to the updated version number.
[0189] The program processing method provided in this application embodiment enables the updating of pre-installed programs in the first module of a wearable device. This allows users to enjoy the convenience brought by the first module of the wearable device while avoiding the problem of incompatibility or unavailability with applications in the wearable device due to the inability to update the pre-installed programs in the first module, thus effectively improving the user experience.
[0190] Based on the above embodiments, the following will combine... Figure 10 and Figure 11 The program processing method provided in the embodiments of this application will be described in detail. Figure 10 Flowchart of the program processing method provided in the embodiments of this application Figure 2 , Figure 11 Flowchart of the program processing method provided in the embodiments of this application Figure 3 .
[0191] refer to Figure 10 The steps in the process are as follows:
[0192] S1001. Obtain the latest version number of the first preset program.
[0193] For details regarding this step, please refer to [link / reference]. Figure 8 The S801 in the text will not be discussed further here.
[0194] S1002. Call the start interface of the first module to start the first channel.
[0195] In this embodiment of the application, before the control module in the wearable device interacts with the first module, it needs to call the first module's enable interface. After the control module calls the first module's enable interface, an interaction channel for communication is opened between the two, which can be referred to as the first channel.
[0196] Understandably, the first module in a wearable device, being an independent module and involving critical security functions, requires a more stringent process when interacting with the wearable device or its control module. The control module in the wearable device calls the first module's activation interface and starts the first channel before interacting. This ensures a safer interaction process, avoids interference from other processes or channels, and guarantees the accuracy of the interaction.
[0197] S1003. Send a first selection command to the first module based on the first channel.
[0198] After establishing a first channel between the control module and the first module of the wearable device, the control module can send instructions to the first module to perform specific operations based on the first channel.
[0199] The first selection instruction in this step is used to select the first preset program in the first module. It is understood that the first module may contain multiple preset programs, and the first preset program can be considered the one among the multiple preset programs that is expected to be updated.
[0200] Understandably, some processes that require a first preset procedure to execute, or some flows involving a first preset procedure, generally need to send a first selection instruction first. After selecting the first preset procedure through the first selection instruction, subsequent related steps are then executed, such as having the first preset procedure perform some functions.
[0201] S1004, Send the second return information.
[0202] After receiving the first selection command, the first module in the wearable device attempts to select a first preset program. Then, the first module returns second feedback information to the control module. This second feedback information includes whether the first preset program was successfully selected.
[0203] S1005. Determine whether the selection was successful based on the second returned information. If the selection was successful, proceed to S1006; otherwise, proceed to... Figure 11 S1106 in the middle.
[0204] The success of selecting the first preset program in the first module can be determined based on the second return information. For example, the second return information may include return codes, where one return code can be used to indicate successful selection, while another one or more return codes can be used to indicate selection failure.
[0205] Understandably, the first pre-installed program is not always installed in the first module of a wearable device. If the first pre-installed program is already installed in the first module, then upon receiving the first selection command, the first module will successfully select the first pre-installed program, and the second return message will include a success message. Conversely, if the first pre-installed program is not yet installed in the first module, and the first pre-installed program cannot be selected upon receiving the first selection command, then the second return message will include a failure message.
[0206] By using the second return information from the first module to determine whether the selection was successful, it can be determined whether the first pre-installed program has been installed in the first module of the wearable device. Furthermore, based on whether the first pre-installed program has been installed in the first module, the subsequent steps can be determined.
[0207] S1006. If the selection is successful, send the first query command.
[0208] Assuming the wearable device's control module sends a first selection command to the first module and determines that the selection was successful based on the second return information, it means that the first pre-installed program has been installed in the first module. At this point, the subsequent update process can be executed.
[0209] In order to determine whether the currently installed first pre-installed program is the version number to be updated, the control module in the wearable device sends a first query command to the first module to query the current version number of the first pre-installed program in the first module, which is the second version number.
[0210] For more information on this step, please refer to [link / reference]. Figure 8 The S802 in the text will not be discussed further here.
[0211] S1007, Send the first return information.
[0212] Upon receiving the first query command, the first module in the wearable device checks the current version number of the first preset program and returns first return information to the control module. This first return information includes the second version number of the first preset program.
[0213] For more information on this step, please refer to [link / reference]. Figure 8 The S802 in the text will not be discussed further here.
[0214] S1008. Determine whether the second version number is the same as the first version number.
[0215] Upon receiving the first return information, the control module in the wearable device can compare the acquired first version number with the second version number in the first return information. If the second version number equals the first version number, it means that the version number of the first pre-installed program in the first module is the same as the expected update version number, and no further update is needed. Conversely, if the second version number does not equal the first version number, it means that subsequent processes are required to update the first pre-installed program.
[0216] In this embodiment of the application, if the second version number is the same as the first version number, the target channel, that is, the first channel, can be closed again.
[0217] For more information on this step, please refer to [link / reference]. Figure 8 The S803 in the text will not be discussed further here.
[0218] S1009. If the version numbers are different, send an initialization command.
[0219] In this embodiment, if the second version number is different from the first version number, an initialization command is sent to the first module before the control module in the wearable device sends an uninstallation command to the first module. It is understood that the first preset program in the first module can have different states, such as being in a running state, an initialization state, or a paused state, and each state possesses different functions and characteristics.
[0220] Furthermore, applications in wearable devices may invoke the first pre-installed program in the first module based on user interaction to implement certain functions. If an application in the wearable device is currently invoking the first pre-installed program to perform a task, directly uninstalling it might prevent the task from completing and could also cause other errors. In some cases, the first pre-installed program, or during its operation, may generate data that, for security reasons, may also need to be deleted.
[0221] Therefore, before uninstalling the first pre-installed program, it is necessary to ensure that the first pre-installed program is in a state that can be safely uninstalled and to remove unnecessary data. The initialization instructions in this step can serve this purpose; for example, they can ensure that the first pre-installed program is no longer called or run after completing its task, so that it can be uninstalled subsequently.
[0222] S1010, Initialize the first preset program.
[0223] After receiving the initialization command, the first module initializes the first preset program according to the information in the initialization command, so that it can be safely unloaded.
[0224] S1011. Send the uninstall command corresponding to the second version number.
[0225] After initializing the first pre-installed program, an uninstallation command corresponding to the second version number can be sent to the first module.
[0226] For more details on this step, please refer to [link / reference]. Figure 8 The S804 in the text will not be discussed further here.
[0227] S1012. Uninstall the first pre-installed program according to the uninstallation command.
[0228] Upon receiving an uninstallation command, the first module in the wearable device removes the first pre-installed program based on the information of the first pre-installed program corresponding to the second version number contained in the uninstallation command. In some implementations, this involves deactivating and registering the first pre-installed program from the first module's pre-installed program list, and then clearing the data of the first pre-installed program in the first module.
[0229] For more information on this step, please refer to [link / reference]. Figure 8 The S805 in the text will not be discussed further here.
[0230] S1013. Obtain at least one installation command corresponding to the first version number.
[0231] The control module in the wearable device acquires at least one installation instruction corresponding to the first version number, for installing a first pre-installed program in the first module.
[0232] For more information on this step, please refer to [link / reference]. Figure 8 The S806 in the text will not be discussed further here.
[0233] S1014. Send at least one installation command.
[0234] For more information on this step, please refer to [link / reference]. Figure 8 The S807 in the text will not be discussed further here.
[0235] S1015. Install the first pre-installed program corresponding to the first version number.
[0236] For more information on this step, please refer to [link / reference]. Figure 8 The S808 in this context will not be discussed further here.
[0237] S1016, Close the target channel.
[0238] After installing the first pre-installed program in the first module of the wearable device, it is also necessary to shut down the target channel, which is the first channel mentioned above. Similarly, the control module in the wearable device can call the shutdown interface of the first module to shut down the target channel.
[0239] Understandably, the control module and the first module in a wearable device interact based on the target channel. If the target channel isn't closed, it might remain open for extended periods. Wearable devices generally have limited energy, and keeping the target channel open for a long time would undoubtedly waste energy and resources. Furthermore, a target channel that is constantly active could also affect other interaction processes. Therefore, after installation, it is essential to call the first module's shutdown interface to close the target channel.
[0240] Combination Figure 10 This explains the steps to be executed if the first preset program is successfully selected in the first module. The following will be combined with... Figure 11 This document outlines the steps to take if selecting the first preset program in the first module fails.
[0241] S1106. If the selection fails, close the first channel.
[0242] If the first module receives the first selection command but has not installed the first pre-installed program, the selection will fail. Upon determining that the selection has failed, the control module in the wearable device will call the first module's shutdown interface to close the first channel.
[0243] S1107. Call the start interface of the first module to start the second channel.
[0244] Understandably, the failure to select the first pre-installed program indicates that it has not yet been installed in the first module of the wearable device. Therefore, in this case, there is no need to check the version number of the first pre-installed program to determine whether an update is needed; simply proceed with the installation.
[0245] Before installing the first pre-installed program, similarly, the control module in the wearable device calls the first module's enable interface to start the second channel. Regarding the second channel, please refer to the first channel mentioned earlier; they are functionally identical, but are distinguished here for ease of understanding of the steps.
[0246] S1113. Obtain at least one installation command corresponding to the first version number.
[0247] This step can be referred to. Figure 10 S1013 in the text will not be elaborated upon here.
[0248] S1114. Send at least one installation command.
[0249] This step can be referred to. Figure 10 S1014 in the text will not be elaborated upon here.
[0250] S1115. Install the first pre-installed program corresponding to the first version number.
[0251] This step can be referred to. Figure 10 S1015 in the text will not be elaborated upon here.
[0252] S1116. Close the target channel.
[0253] Similarly, after the installation of the first pre-installed program is completed, the control module in the wearable device calls the shutdown interface of the first module to shut down the target channel, which corresponds to the second channel.
[0254] For more information on this step, please refer to [link / reference]. Figure 10 S1016 in the text will not be elaborated upon here.
[0255] In summary, the program processing method proposed in this application adds a selection of the first preset program in the first module before updating or installing the first preset program. The subsequent steps are executed based on whether the selection is successful. Successful selection indicates that the first preset program has been installed in the first module; conversely, unsuccessful selection indicates that the first preset program has not yet been installed in the first module, thus eliminating the need for additional version number checks. This approach, by implementing different update or installation strategies for different situations, further enhances the overall efficiency of the method.
[0256] Furthermore, the method incorporates management of the interaction channel between the control module and the first module in the wearable device, enabling and disabling the channel at appropriate times. This enhances security while preventing power consumption loss. Additionally, initializing the first pre-installed program before uninstallation ensures safe uninstallation without impacting business operations, preventing system errors.
[0257] Based on the above embodiments, the following will further combine... Figures 12 to 15 Another program processing method provided in the embodiments of this application will be described in detail. Among them, Figure 12 Flowchart of the program processing method provided in the embodiments of this application Figure 4 , Figure 13 Flowchart of the program processing method provided in the embodiments of this application Figure 5 , Figure 14 Flowchart of the program processing method provided in the embodiments of this application Figure 6 , Figure 15 Flowchart of the program processing method provided in the embodiments of this application Figure 7 .
[0258] To facilitate understanding of the program processing method proposed in the embodiments of this application, the following will first describe... Figure 12 The steps and procedures are explained below. Figure 12 The steps and processes described can be understood as the processing flow executed by the control module in a wearable device. Figure 12 The steps enclosed by dashed boxes 1220 and 1221 can be understood as steps that are added and improved based on the previous embodiments.
[0259] S1201. Check if the preset program is installed. If the preset program is installed, proceed to S1202; otherwise, proceed to S1206.
[0260] Before updating a pre-installed program, the wearable device will first check if the target pre-installed program is already installed. This step may correspond to the part of sending a selection command to the first module in the above embodiment, for example... Figure 10 S1001 to S1005 in the embodiments of this application. It can be understood that the target preset program in the embodiments of this application may also be referred to as the first preset program.
[0261] S1202, Query the second version number.
[0262] If the target pre-installed program has already been installed, the wearable device will then query the current version number of the target pre-installed program, also known as the second version number. This step corresponds to the part of sending the query command to the first module in the above embodiment, for example, see the following reference: Figure 10 S1006 and S1007 in the text will not be elaborated on here.
[0263] S1203. Determine if it is equal to the first version number. If they are equal, proceed to S1207; otherwise, proceed to S1204.
[0264] The wearable device determines whether the second version number of the target pre-installed program matches the first version number of the expected update, and decides whether to perform the update process based on whether the version numbers match.
[0265] S1204, Uninstall pre-installed programs.
[0266] This step can refer to the relevant content in the previous embodiments, for example... Figure 10 S1009 to S1012 are not described in detail here.
[0267] S1205, Install the pre-installed program.
[0268] After uninstalling the already installed target pre-installed program, the wearable device can install the target pre-installed program in the first module.
[0269] S1208. Verify successful installation. If successful installation is detected, proceed to S1209; otherwise, re-execute S1205.
[0270] Understandably, successful installation of the target pre-installed app is not guaranteed and may fail due to various factors. Therefore, in addition to installing the target pre-installed app on the wearable device, it is necessary to further verify whether the installation was successful. There are several ways to confirm successful installation, which will be explained in detail below.
[0271] S1209, Installation confirmed successful.
[0272] Once it is confirmed in S1208 that the target preset program has been successfully installed, the process can be completed and exited.
[0273] S1207. It is determined that no update is required.
[0274] In S1203, if the second version number found is the same as the first version number, it means that the version number of the current target preset program is already the version number that is expected to be updated, and it is determined that no further update processing is needed.
[0275] S1206. Install the pre-installed program.
[0276] This step is similar to S1205 above. If it is found in S1201 that the target pre-installed program has not been installed in the first module of the current wearable device, then it is not necessary to perform the relevant steps of querying the current version number of the target pre-installed program in the wearable device. Instead, the installation of the target pre-installed program can be started directly in the first module.
[0277] S1210. Verify successful installation. If successful, proceed to S1211; otherwise, re-execute S1206.
[0278] Similarly, after installing the target pre-installed program into the wearable device, it is necessary to further verify whether the installation has been successful.
[0279] This step can be referred to in S1208, and will not be repeated here.
[0280] S1211, Installation confirmed successful.
[0281] Once the target pre-installed program is confirmed to be installed successfully, this process can be completed.
[0282] Next, let's combine... Figure 13 for Figure 12 The steps enclosed by dashed boxes 1220 and 1221 are described in detail. It can be understood that the steps within dashed boxes 1220 and 1221 are similar. (Refer to...) Figure 13 The steps in:
[0283] S1301. Install the first pre-installed program corresponding to the first version number.
[0284] This step can be referred to. Figure 10 The relevant content of S1015 will not be elaborated here.
[0285] S1302, Send feedback information.
[0286] After installing the first pre-installed program according to the installation instructions sent by the control module, the first module in the wearable device also sends feedback information to the control module. This feedback information includes whether the installation was successful.
[0287] S1303. Determine whether the installation was successful based on the feedback information.
[0288] After receiving feedback information from the first module, the control module determines whether the first pre-installed program has been successfully installed based on the feedback information. For example, the feedback information may include a return code; some return codes may indicate successful installation, while others may indicate installation failure.
[0289] S1304. If the installation is successful, close the target channel.
[0290] If the installation is deemed successful based on the feedback information in step S1303, the target channel is closed. The target channel in this step can refer to the target channel in the previous embodiment, for example... Figure 10 The first channel in the corresponding embodiment is described in the relevant section, and will not be repeated here.
[0291] The above Figure 13 The corresponding process describes the steps to be executed when the first pre-installed program is installed in the first module and the installation is successful. The following section combines... Figure 14 The process outlines the steps to take in case of installation failure:
[0292] S1405. In case of installation failure, shut down the target channel.
[0293] Even if the installation fails based on feedback information in S1303, it is still necessary to close the target channel first. The target channel here can correspond to... Figure 11 The second channel in the wearable device is the second channel that is activated when the control module sends the first selection command to the first module and the selection fails.
[0294] S1406. Call the start interface of the first module to start the third channel.
[0295] After the second channel is closed, the control module in the wearable device calls the first module's activation interface again to start the third channel. This third channel functions identically to the first and second channels mentioned earlier, and will not be elaborated upon further here.
[0296] S1407. Send at least one installation command.
[0297] Based on the third channel, the control module in the wearable device sends at least one installation command to the first module to install the first pre-installed program corresponding to the first version number. More related content can be found in the previous text. Figure 10 S1014 in the text will not be elaborated upon here.
[0298] S1408. Install the first pre-installed program corresponding to the first version number.
[0299] After receiving the installation instruction, the first module of the wearable device executes the installation of the first preset program for the first version number. In this embodiment, S1408 corresponds to S1301. That is, it can be understood that executing S1408 is equivalent to re-executing S1301. After executing S1408, S1302 and S1303 are subsequently executed.
[0300] In some implementations, if an installation failure is detected, the installation can be repeatedly re-executed until it succeeds.
[0301] In other implementations, a threshold number of attempts can be preset, allowing for repeated reinstallation if installation fails. The installation process stops once this threshold is reached. This avoids continuous energy consumption in wearable devices.
[0302] For more related content, please refer to the previous article. Figure 10 S1015 in the text will not be elaborated upon here.
[0303] After combination Figure 13 and Figure 14 The process involves verifying the successful installation of the first pre-installed program in the first module, and reinstalling if the installation fails. To further strengthen the verification of successful installation, the following steps are combined with... Figure 15 Further explanation:
[0304] S1504. If the feedback information indicates that the installation was successful, send a second selection command.
[0305] After steps S1301 to S1303, and based on the feedback information returned by the first module, if the installation is deemed successful, the control module in the wearable device continues to send a second selection command to the first module. The second selection command functions identically to the first selection command in the previous embodiment; both select the first preset program from among multiple preset programs installed in the first module.
[0306] Understandably, after the first module completes the installation of the first pre-installed program, it will return feedback information to the control module in the wearable device. However, in some possible cases, the above feedback information cannot completely confirm that the first pre-installed program has been successfully installed, or in other words, it cannot completely confirm that the first pre-installed program can be used normally by the application in the wearable device after installation. Therefore, after receiving the feedback information and determining that the installation was successful, a second selection command can be sent to further confirm whether the installation was successful.
[0307] S1505, Send the third return information.
[0308] After receiving the second selection command from the control module, the first module in the wearable device attempts to select the first preset program from multiple preset programs according to the second selection command, and sends a third return message to the control module. The third return message contains information indicating whether the selection was successful. The function and related content of the third return message in this step can be referred to the second return message in the previous embodiment, and will not be repeated here.
[0309] S1506. Determine whether the installation was successful based on the third returned information.
[0310] After receiving the third return information, the control module determines whether the installation was successful based on whether the selection was successful in the third return information. For example, if the third return information indicates that the first preset program was successfully selected, it means that the installation was successful, including writing and storing the first preset program in the first module, and that the application in the wearable device can call the first preset program in the first module.
[0311] S1507. If the installation is successful, close the target channel.
[0312] For details regarding this step, please refer to the previous text. Figure 13 S1304 in the text will not be elaborated upon here.
[0313] To summarize the above explanation: In this embodiment, after installing the first pre-installed program in the first module of the wearable device, a check is performed to verify whether the installation was successful. If the installation fails, the first pre-installed program is reinstalled in the first module to avoid the problem of the version number of the first pre-installed program not matching the corresponding application version number due to accidental factors. Furthermore, in the step of verifying successful installation, in addition to the feedback information based on the installation command, a selection command is added to further improve the accuracy of determining whether the installation was successful, ensuring that the installed first pre-installed program can run normally.
[0314] Next, based on the content described in the above embodiments, and in conjunction with... Figures 16 to 19 Another program processing method provided in the embodiments of this application will be described in detail. Among them, Figure 16 This is a schematic diagram of the mini-program update process provided in an embodiment of this application. Figure 17 This is a schematic diagram of the interface for updating a wearable device provided in an embodiment of this application. Figure 18 Schematic diagram of the structure of the wearable device provided in the embodiments of this application Figure 3 , Figure 19This is a schematic diagram of the structure of the APDU provided in the embodiments of this application.
[0315] exist Figure 16 The above embodiments illustrate the overall flow of a program processing method using the above-described methods:
[0316] S1601, Download, update, or install related resources.
[0317] In this embodiment, the wearable device can download necessary updates or installations via OTA (Over-The-Air) when idle. This means it can download data resources from a cloud server via wireless communication, such as eSIM. The downloaded data resources may include applications on the wearable device, application update packages, and corresponding mini-programs. The mini-programs in this embodiment can also be called pre-installed programs, which are generally pre-installed during the wearable device production line configuration phase.
[0318] The specific data resources and timing for download can be designed according to the specific circumstances. For example, in some implementations, the resources of the applications or mini-programs that need to be downloaded can be bound to the system version of the wearable device. When the wearable device's system version is updated, or after the update, the corresponding data resources are downloaded based on the system version information.
[0319] In some implementations, the wearable device's load and network traffic can be monitored, and certain thresholds can be preset, such as processor load thresholds and network traffic thresholds. When the wearable device's status meets the threshold requirements, for example, when the processor load is lower than the set processor load threshold and the network is idle, the corresponding data resources are downloaded.
[0320] like Figure 17 As shown, in Figure 17 (a) is a smart bracelet. The settings interface of application A includes a version check function. After the user clicks the version check control, they are redirected to... Figure 17 The image shown in (b) is in Figure 17 In (b), the smart bracelet's interface displays the current version and the latest version. This can be understood as the latest version information being obtained in advance, and the version numbers of the current version and the latest version are not the same. After clicking "Update Now," the user can be redirected to... Figure 17 The screen shown in (c) indicates the start of the update process according to the procedure provided in the above embodiment, where a progress bar can also be displayed to allow the user to track the progress. In some designs, this update process can be executed in the background, without the user having to wait. This embodiment does not impose specific limitations on this, but only provides an example. After the update is completed, you can see... Figure 17 The screen in (d) shows that the update was successful.
[0321] After downloading, you can first store the downloaded data resources in the wearable device's storage space, and then retrieve them when you need to update or install them later.
[0322] S1602. When the wearable device system starts up, a corresponding event is triggered.
[0323] In this embodiment, corresponding events can be triggered when the wearable device system starts up, including the program processing method proposed in the above embodiments, that is, the method for updating or installing the mini-program.
[0324] In some implementations, a series of events that need to be triggered can be pre-arranged in a certain order and triggered when the wearable device system starts up. Each triggered event can also be assigned a thread for execution. The execution order or priority can be determined by the importance of the events or by the resources and time required for their execution. For example, important events such as updating or installing a mini-program can be prioritized.
[0325] In other implementations, the mini-program update method provided in the above embodiments can be triggered in response to a request command for detecting updates. For example, a function control for detecting mini-program updates can be added to the system settings of the wearable device, allowing users to actively use this function control to trigger mini-program updates. In this way, in some cases, when users find that some functions of the application are not working properly, they can try to resolve the issue in this way, rather than having to deal with it passively.
[0326] S1603. Perform the installation or update of the pre-installed programs.
[0327] In this embodiment of the application, after the corresponding event is triggered in S1602, the installation or update of the preset program is executed. For example... Figure 18 As shown, assuming the wearable device is a smartwatch, the smartwatch contains a control unit, or control module, which can be the smartwatch's processor. The smartwatch also includes an NFC module, which contains a first chip unit. This first chip unit can be a security chip, such as an eSE. Applets, or pre-installed programs, can be installed into this first chip unit; for example, pre-installed programs A, B, and C are all installed within it. The smartwatch's control unit can interact with the pre-installed programs in the first chip unit via the NFC module. By calling these pre-installed programs, some of the application's functions can be implemented, such as identity verification and secure payment.
[0328] During the pre-installed program update or installation process, the control module in the wearable device sends a series of commands to the NFC module, including commands such as start, select, uninstall, install, and shut down. These commands are generally obtained from the NFC module manufacturer and can be APDU commands. (See reference here.) Figure 18 Explanation of APDU instructions.
[0329] like Figure 19 As shown, Figure 19 (a) illustrates the data structure of a command APDU (C-APDU), which is an instruction sent from an external module to the NFC module. A typical command APDU structure includes a command header and a command body. The command header includes: CLA (Instruction Category), used to distinguish different applications or indicate the nature of a transaction; INS (Instruction Code), representing the specific operation command; and P1 and P2 (Parameter 1 and Parameter 2), providing additional information on how to execute the command. The command body includes: Lc (Data Field Length), indicating the number of bytes in the subsequent data field; D (Data), an optional data field used to carry the data required by the command; and Le (Expected Response Data Length), an optional field used to specify the maximum amount of data requested to be returned.
[0330] Figure 19 (b) shows the data structure of a response APDU (R-APDU), which is a reply returned by the NFC to an external module. A response APDU typically contains: D (Data), the data returned by the card; and SW1 and SW2, status words used to indicate the result of command execution.
[0331] The specific format of each APDU may vary depending on the protocol version used and the specific application environment. In related technologies, the correct construction and parsing of APDUs are crucial for achieving secure and reliable communication.
[0332] S1604. After successful installation or update, load and run the corresponding application.
[0333] In wearable devices, after updating or installing a mini-program, the corresponding application can be loaded, allowing the application to call the mini-program in the NFC module to perform some functions. Alternatively, in some implementations, the application can call the mini-program in the NFC module through the SDK. Since the application and mini-program, or the SDK and mini-program, are of the same version and have compatible interfaces, they can run smoothly without encountering any issues or errors.
[0334] To summarize the above: In this application embodiment, the proposed program processing method is described more completely, including how to download relevant data resources in advance using OTA, how to trigger corresponding events to execute the program processing method, and how, after the update is completed, the application in the wearable device can call the mini-program to run. Thus, through the description of this application embodiment, the program processing method can be well integrated into the wearable device system, making it easy to implement and use.
[0335] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.
[0336] The program processing method of the embodiments of this application has been described above. The apparatus including the above-described program processing method is described below. Those skilled in the art will understand that the method and apparatus can be combined with and referenced by each other, and the related apparatus can control the above-described method or process the data information output by the above-described method.
[0337] In one implementation, this application provides an electronic device. Figure 20 This is a schematic diagram of the hardware structure of an electronic device.
[0338] like Figure 20 As shown, the electronic device 200 includes: a processor 2001 and a memory 2002; the memory 2002 stores computer execution instructions; the processor 2001 executes the computer execution instructions stored in the memory 2002, causing the electronic device 200 to control the aforementioned circuit.
[0339] When the memory 2002 is set up independently, the electronic device also includes a bus 2003 for connecting the memory 2002 and the processor 2001.
[0340] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0341] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A program processing method characterized by comprising: The invention is applied to wearable devices, the wearable devices including a first module, the first module carrying at least one preset program, the preset program being used to implement at least some of the functions of a corresponding target application; The method includes: Obtain the latest first version number of the first preset program, and obtain the current second version number of the first preset program in the first module; If the second version number is different from the first version number, the first preset program in the first module is uninstalled according to the uninstallation instruction corresponding to the second version number. Obtain at least one installation instruction corresponding to the first version number, and install the first preset program corresponding to the first version number into the first module according to the at least one installation instruction.
2. The method of claim 1, wherein, The step of obtaining the current second version number of the first preset program in the first module includes: Send a first query instruction to the first module, the first query instruction being used to request the second version number of the first preset program; Obtain the first return information sent by the first module, wherein the first return information includes the second version number.
3. The method of claim 2, wherein, The method further includes: Call the start interface of the first module to start the first channel; A first selection instruction is sent to the first module based on the first channel, and the first selection instruction is used to indicate the selection of the first preset program; Obtain the second return information sent by the first module, the second return information being used to indicate the selection result for the first preset program.
4. The method of claim 3, wherein, Sending the first query instruction to the first module includes: If the selection result indicates a successful selection, the first query instruction is sent to the first module.
5. The method of claim 3, wherein, The method further includes: If the selection result indicates that the selection has failed, the first channel shall be closed; Call the start interface of the first module to start the second channel; Based on the second channel, at least one installation command corresponding to the first version number is sent to the first module to install the first preset program corresponding to the first version number into the first module.
6. The method according to any one of claims 1 to 5, characterized in that, After sending at least one installation command corresponding to the first version number to the first module, the method further includes: Obtain feedback information sent by the first module, wherein the feedback information is used to indicate whether the first preset program corresponding to the first version number has been successfully installed; If the feedback indicates successful installation, the target channel, which was used to send the at least one installation command, is closed.
7. The method of claim 6, wherein, Before closing the target channel, the method further includes: Send a second selection instruction to the first module, the second selection instruction being used to instruct the selection of the first preset program; Obtain the third return information sent by the first module, the third return information being used to indicate the selection result for the first preset program; If the third return information indicates that the selection result is successful, it is determined that the first preset program corresponding to the first version number has been successfully installed.
8. The method of claim 6, wherein, The method further includes: If the feedback indicates that the installation has failed, the target channel will be shut down. Call the start interface of the first module to start the third channel; Based on the third channel, at least one installation command corresponding to the first version number is resent to the first module to install the first preset program corresponding to the first version number into the first module.
9. The method according to any one of claims 1 to 8, characterized in that, Before uninstalling the first preset program in the first module according to the uninstallation instruction corresponding to the second version number, the method further includes: According to the initialization instruction, the state of the first preset program in the first module is set to the initial state.
10. The method according to any one of claims 1 to 9, characterized in that, The step of obtaining the latest version number of the first preset program includes: During the startup process of the wearable device, the latest version number of the first preset program is obtained; or, In response to a request instruction for detecting updates, the latest first version number of the first preset program is obtained.
11. The method according to any one of claims 1-10, characterized in that, The preset program is a mini-program; and, The first version number and at least one installation instruction corresponding to the first version number are obtained from the cloud.
12. The method according to claim 10, characterized in that, The first module includes a first chip unit, and the preset program is installed in the first chip unit.
13. An electronic device, characterized in that, The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 12.
14. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 12.
16. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 12.