Method for embedding Beidou third generation based on openHarmony platform

By defining the NAPI interface and socket port connection on the OpenHarmony platform, the seamless integration of Beidou third-generation communication technology and the OpenHarmony platform is achieved, solving the problem of insufficient application of Beidou communication technology in smart devices, improving communication stability and efficiency, and supporting intelligent applications.

CN119561607AInactive Publication Date: 2025-03-04FUZHOU FUDA BEIDOU COMM TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510107913.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Among the prior art, the integration of the OpenHarmony platform and Beidou third-generation communication technology is relatively limited, which limits the application and promotion of Beidou communication technology on smart devices.

Method used

By defining the NAPI interface on the OpenHarmony platform, the communication connection between the application and the Beidou third-generation management process is realized, including turning on the Beidou power supply, turning off the Beidou power supply and sending data, and real-time reception of Beidou data through the socket port connection.

Benefits of technology

It realizes seamless integration of the OpenHarmony platform and Beidou third-generation communication technology, improves the communication stability and efficiency of smart devices in signal-free coverage areas, reduces equipment energy consumption, and supports intelligent and automated applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561607A_ABST
    Figure CN119561607A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Beidou, in particular to a method for embedding a third-generation Beidou based on an openHarmony platform, the method is realized based on a processor and a memory of the openHarmony platform, and the method comprises the following steps: selecting the processor and the memory of the openHarmony platform, and storing a third-generation Beidou API library, a third-generation Beidou management process and the like in the memory. According to the invention, efficient fusion of an OpenHarmony platform and a Beidou third-generation communication technology is realized, the communication stability and efficiency of intelligent equipment in a non-signal coverage area are remarkably enhanced, a user can be ensured to enjoy stable and reliable communication service in any environment, and meanwhile, by introducing an intelligent power supply management strategy, the energy consumption of the equipment is effectively reduced, and the user experience is improved. Compared with the prior art, the method has the advantages that the endurance time is obviously prolonged, more lasting use experience is brought to the user, in addition, the intelligent and automatic degrees of the intelligent equipment are greatly improved by applying the technology, the use scene of the user is further enriched, and the overall satisfaction degree is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Beidou technology, and more specifically to a method for embedding Beidou III based on an openHarmony platform. Background Art

[0002] In the existing technology, there are relatively few methods for using Beidou-3 channel data in the OpenHarmony platform, especially on the Hongmeng embedded platform. Hongmeng system is a full-scenario distributed operating system launched by Huawei, which aims to connect various smart devices and provide a seamless cross-device experience. Hongmeng southbound development is the internal embedded development of smart devices based on the Hongmeng system. It requires developers to be familiar with the architecture and API of the Hongmeng system to implement the functional modules inside the device. However, the methods and technologies for integrating Beidou-3 communication technology into the Hongmeng embedded platform are not yet mature, which limits the application and promotion of Beidou communication technology on more smart devices. Therefore, it is urgent to develop a method to embed BeiDou-3 based on the openHarmony platform to achieve seamless integration between BeiDou-3 communication technology and the openHarmony platform. Summary of the invention

[0003] The purpose of the present invention is to: in view of the limitations of the integration of OpenHarmony platform and BeiDou-3 communication technology under the current technical background, especially the insufficient application on Hongmeng embedded platform, the present invention provides a method for embedding BeiDou-3 based on openHarmony platform to achieve seamless integration between BeiDou-3 communication technology and openHarmony platform.

[0004] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions: The present invention proposes a method for embedding BeiDou III based on the openHarmony platform. The method is implemented based on a processor and a memory of the openHarmony platform. The method includes: 1) selecting a processor and a memory on the openHarmony platform, wherein the memory stores a BeiDou-3 API library and a BeiDou-3 management process, wherein the BeiDou-3 API library and the BeiDou-3 management process are executed by the processor, and the BeiDou-3 management process includes a BeiDou data receiving process and a BeiDou power state management process; the BeiDou data receiving process is used to receive BeiDou data from the BeiDou-3 module, and the BeiDou power state management process is used to manage the state management of turning on and off the BeiDou power supply; II) defining a NAPI interface, which is stored in a memory and executed by a processor, and includes methods for turning on and off the BeiDou power supply and sending data, for application programs on the OpenHarmony platform to call and communicate with the BeiDou III management process; The method for turning on the Beidou power supply is as follows: receiving the package name provided by the application and a callback function for receiving connection status notification as input parameters; the method attempts to establish a connection with the Beidou III management process inside the Beidou III API library; once the connection is successfully established, a connection success notification is sent to the application through the callback function received previously, thereby allowing the application to perform subsequent Beidou data interaction with the Beidou data receiving process; The method of turning off the Beidou power is as follows: disconnecting from the Beidou III management process is performed inside the Beidou III API library; after disconnecting, the callback function previously registered for the Beidou power on method is used to inform the application that the connection has been disconnected, and the reason or status information of the disconnection is attached; The specific method of sending data is as follows: receiving the data to be sent provided by the application as an input parameter; the sending data method is responsible for sending the received data to be sent to the Beidou-3 management process through the established connection, and returning the sending status or error code to indicate whether the data is successfully sent; III) establishing a socket port connection between the application on the OpenHarmony platform and the BeiDou III management process through the NAPI interface; the socket port is stored in the memory and executed by the processor; the socket port connection includes a socket client program and a local socket service; IV) The Beidou power state management process controls the opening and closing of the Beidou power supply according to the connection request of the application through the NAPI interface, specifically: when at least one application requests a connection through the NAPI interface, the Beidou power state management process turns on the Beidou power supply, and decides whether to maintain the Beidou power on state according to the number of applications currently connected through the NAPI interface; when all applications connected through the NAPI interface are disconnected, the Beidou power state management process turns off the Beidou power supply; V) The BeiDou data receiving process receives BeiDou data from the BeiDou III module and pushes the received BeiDou data to the corresponding application through the established socket port connection; among them, the BeiDou III API library uses the callback function passed in through the NAPI interface to forward the received BeiDou data to the application requesting the data.

[0005] As a preferred technical solution of the present invention, in the method of turning on the Beidou power included in the NAPI interface, the Beidou-3 API library performs the following specific process: ① The Beidou-3 API library starts executing the process; ② Beidou-3 API library initializes the socket client program; ③ The Beidou-3 API library connects to the local socket service; ④ Beidou III API library determines whether the connection is successful. If yes, jump to step ⑤; if no, jump to step ⑦; ⑤The Beidou-3 API library starts the data receiving thread of the socket client program; ⑥ Beidou III API library obtains Beidou card information of Beidou III module; ⑦The Beidou-3 API library ends the execution process.

[0006] As a preferred technical solution of the present invention, the specific execution process of the data receiving thread of the socket client program in step ⑤ is: a. The socket client program starts the process; b. The socket client program sleeps for 10ms; c. The socket client program queries whether the Beidou data of the Beidou-3 management process is received. If yes, jump to step d; if no, jump to step b; d. The socket client program receives the Beidou data and pushes it to the application through the NAPI interface, and jumps to step b.

[0007] As a preferred technical solution of the present invention, the Beidou power state management process includes the following steps: 1) Start: Beidou power status management process starts; 2) Initialization service parameters: Beidou power status management process initializes the socket service parameters; 3) Monitor program access status: Beidou power status management process monitors the socket client program access status; 4) Determine whether the program is connected: Beidou power status management process determines whether there is a socket client program connected, if yes, jump to step 5), if no, jump to step 9); 5) Start thread: The Beidou power status management process starts the Beidou client thread of the Beidou power status management process and adds the thread to the thread pool; 6) Determine whether the power is on: The Beidou power status management process determines whether the Beidou power is on. If yes, jump to step 9); if no, jump to step 7); 7) Turn on the power and start the data receiving process: The Beidou power status management process controls the Beidou power to turn on and starts the Beidou data receiving process; 8) Obtain information: The Beidou power status management process obtains the Beidou card information of the Beidou III module; 9) Determine whether a program is disconnected: The Beidou power status management process determines whether a socket client program is disconnected. If yes, jump to step 10); if no, jump to step 3); 10) Remove thread: Beidou power status management process removes the Beidou client thread of the Beidou power status management process; 11) Determine whether the number of programs is 0: The Beidou power status management process determines whether the number of socket client programs is 0. If yes, jump to step 12); if not, jump to step 3); 12) Power off: Beidou power status management process controls Beidou power off; 13) End: The Beidou power status management process ends and jumps to step 3).

[0008] As a preferred technical solution of the present invention, the Beidou client thread of the Beidou power state management process in step 5) executes the following steps: (1) Beidou client thread start process; (2) Beidou client thread sleeps for 10ms; (3) The Beidou client thread queries whether it has received data from the socket client program. If yes, it jumps to step (4); if not, it jumps to step (2); (IV) The data received by the Beidou client thread is forwarded to the Beidou-3 module, and the process goes to step (II).

[0009] As a preferred technical solution of the present invention, the Beidou data receiving process includes the following steps: A. Beidou data receiving process starts; B. Beidou data receiving process sleeps for 10ms; C. The Beidou data receiving process queries whether the Beidou data from the Beidou III module is received. If yes, jump to step D; if not, jump to step B; D. Beidou data receiving process pushes Beidou data to corresponding applications; E. The Beidou data receiving process obtains the power information of the Beidou III module every 2 seconds and jumps to step B.

[0010] As a preferred technical solution of the present invention, the socket port is a stream format socket (TCP).

[0011] As a preferred technical solution of the present invention, in the data sending method, the data to be sent includes a serialized character string or a hexadecimal data stream; the method also receives a parameter representing the data length, and the parameter itself does not contain length information.

[0012] The beneficial effects of the present invention are as follows: the present invention realizes the efficient integration of the OpenHarmony platform and the Beidou-3 communication technology, significantly enhances the communication stability and efficiency of smart devices in areas without signal coverage, and ensures that users can enjoy stable and reliable communication services in any environment. At the same time, by introducing intelligent power management strategies, the present invention effectively reduces the energy consumption of the equipment, significantly extends the battery life, and brings users a more lasting user experience. In addition, the application of this technology has greatly improved the intelligence and automation of smart devices, further enriched the user's usage scenarios, and improved overall satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a schematic diagram of the process of the present invention; Figure 2 It is a flowchart of the steps executed by the Beidou-3 API library of the present invention; Figure 3 It is a schematic diagram of the flow chart of the data receiving thread execution of the socket client program of the present invention; Figure 4 It is a schematic diagram of the flow chart of the Beidou power state management process execution of the present invention; Figure 5 It is a schematic diagram of the flow chart of the Beidou client thread execution of the Beidou power state management process of the present invention; Figure 6 It is a flowchart of the Beidou data receiving process execution of the present invention. DETAILED DESCRIPTION

[0014] Reference Figure 1 As shown, the present invention proposes a method for embedding BeiDou III based on the openHarmony platform, the method is implemented based on the processor and memory of the openHarmony platform, and the method includes: 1) selecting a processor and a memory on the openHarmony platform, wherein the memory stores a BeiDou-3 API library and a BeiDou-3 management process, wherein the BeiDou-3 API library and the BeiDou-3 management process are executed by the processor, and the BeiDou-3 management process includes a BeiDou data receiving process and a BeiDou power state management process; the BeiDou data receiving process is used to receive BeiDou data from the BeiDou-3 module, and the BeiDou power state management process is used to manage the state management of turning on and off the BeiDou power supply; II) defining a NAPI interface, which is stored in a memory and executed by a processor, and includes methods for turning on and off the BeiDou power supply and sending data, for application programs on the OpenHarmony platform to call and communicate with the BeiDou III management process; The method for turning on the Beidou power supply is as follows: receiving the package name provided by the application and a callback function for receiving connection status notification as input parameters; the method attempts to establish a connection with the Beidou III management process inside the Beidou III API library; once the connection is successfully established, a connection success notification is sent to the application through the callback function received previously, thereby allowing the application to perform subsequent Beidou data interaction with the Beidou data receiving process; The method of turning off the Beidou power is as follows: disconnecting from the Beidou III management process is performed inside the Beidou III API library; after disconnecting, the callback function previously registered for the Beidou power on method is used to inform the application that the connection has been disconnected, and the reason or status information of the disconnection is attached; The specific method of sending data is as follows: receiving the data to be sent provided by the application as an input parameter; the sending data method is responsible for sending the received data to be sent to the Beidou-3 management process through the established connection, and returning the sending status or error code to indicate whether the data is successfully sent; III) establishing a socket port connection between the application on the OpenHarmony platform and the BeiDou III management process through the NAPI interface; the socket port is stored in the memory and executed by the processor; the socket port connection includes a socket client program and a local socket service; IV) The Beidou power state management process controls the opening and closing of the Beidou power supply according to the connection request of the application through the NAPI interface, specifically: when at least one application requests a connection through the NAPI interface, the Beidou power state management process turns on the Beidou power supply, and decides whether to maintain the Beidou power on state according to the number of applications currently connected through the NAPI interface; when all applications connected through the NAPI interface are disconnected, the Beidou power state management process turns off the Beidou power supply; V) Beidou data receiving process receives Beidou data from Beidou III module, and pushes the received Beidou data to the corresponding application through the established socket port connection; wherein, Beidou III API library uses the callback function passed in through NAPI interface to forward the received Beidou data to the application requesting data; Among them, refer to Figure 2 As shown, in the method of turning on the BeiDou power included in the NAPI interface, the BeiDou III API library performs the following specific process: ① The Beidou-3 API library starts executing the process; ② Beidou-3 API library initializes the socket client program; ③ The Beidou-3 API library connects to the local socket service; ④ Beidou III API library determines whether the connection is successful. If yes, jump to step ⑤; if no, jump to step ⑦; ⑤The Beidou-3 API library starts the data receiving thread of the socket client program; ⑥ Beidou III API library obtains Beidou card information of Beidou III module; ⑦ The Beidou-3 API library ends the execution process; Among them, refer to Figure 3 As shown, the specific execution process of the data receiving thread of the socket client program in step ⑤ is: a. The socket client program starts the process; b. The socket client program sleeps for 10ms; c. The socket client program queries whether the Beidou data of the Beidou-3 management process is received. If yes, jump to step d; if no, jump to step b; d. The socket client program receives the Beidou data and pushes it to the application through the NAPI interface, and jumps to step b; Among them, refer to Figure 4 As shown, the Beidou power status management process includes the following steps: 1) Start: Beidou power status management process starts; 2) Initialization service parameters: Beidou power status management process initializes the socket service parameters; 3) Monitor program access status: Beidou power status management process monitors the socket client program access status; 4) Determine whether the program is connected: Beidou power status management process determines whether there is a socket client program connected, if yes, jump to step 5), if no, jump to step 9); 5) Start thread: The Beidou power status management process starts the Beidou client thread of the Beidou power status management process and adds the thread to the thread pool; 6) Determine whether the power is on: The Beidou power status management process determines whether the Beidou power is on. If yes, jump to step 9); if no, jump to step 7); 7) Turn on the power and start the data receiving process: The Beidou power status management process controls the Beidou power to turn on and starts the Beidou data receiving process; 8) Obtain information: The Beidou power status management process obtains the Beidou card information of the Beidou III module; 9) Determine whether a program is disconnected: The Beidou power status management process determines whether a socket client program is disconnected. If yes, jump to step 10); if no, jump to step 3); 10) Remove thread: Beidou power status management process removes the Beidou client thread of the Beidou power status management process; 11) Determine whether the number of programs is 0: The Beidou power status management process determines whether the number of socket client programs is 0. If yes, jump to step 12); if not, jump to step 3); 12) Power off: Beidou power status management process controls Beidou power off; 13) End: The Beidou power status management process ends and jumps to step 3); Among them, refer to Figure 5 As shown, the Beidou client thread of the Beidou power status management process in step 5) executes the following steps: (1) Beidou client thread start process; (2) Beidou client thread sleeps for 10ms; (3) The Beidou client thread queries whether it has received data from the socket client program. If yes, it jumps to step (4); if not, it jumps to step (2); (iv) The data received by the Beidou client thread is forwarded to the Beidou-3 module, and the process goes to step (ii); Among them, refer to Figure 6 As shown, the Beidou data receiving process includes the following steps: A. Beidou data receiving process starts; B. Beidou data receiving process sleeps for 10ms; C. The Beidou data receiving process queries whether the Beidou data from the Beidou III module is received. If yes, jump to step D; if not, jump to step B; D. Beidou data receiving process pushes Beidou data to corresponding applications; E. The Beidou data receiving process obtains the power information of the Beidou III module every 2 seconds and jumps to step B; Wherein, the socket port is a stream format socket (TCP); Wherein, in the data sending method, the data to be sent includes a serialized character string or a hexadecimal data stream; the method also receives a parameter representing the data length, and the parameter itself does not contain length information.

[0015] The present invention selects a processor and memory that support the OpenHarmony platform to ensure that the system can run stably. The memory stores the Beidou III API library and Beidou III management process. These components are executed by the processor to handle the reception of Beidou data and the management of power status. The present invention includes: NAPI interface design and efficient communication: Principle: NAPI interface serves as a bridge between the OpenHarmony platform and the BeiDou III management process, achieving efficient communication between the two. By defining core methods such as turning on and off BeiDou power and sending data, NAPI interface provides a convenient way for applications to interact with BeiDou III modules. Effect: This design significantly improves the communication efficiency of smart devices in areas without signals, allowing data to be transmitted stably in emergency situations. At the same time, the standardization and ease of use of the NAPI interface also promotes the activity of the developer community and promotes more innovative applications based on Beidou technology. Socket port connection and data real-time: Principle: Based on the socket port connection of TCP protocol, the application on the OpenHarmony platform can receive the data sent by the BeiDou III module in real time; the collaborative work of the socket client program and the local socket service ensures the timely transmission and processing of data; Effect: This real-time communication mechanism enables smart devices to respond quickly to environmental changes and provide users with more reliable communication methods. For example, in emergency rescue scenarios, smart devices can transmit location information in real time to provide critical support for rescue teams. Beidou power status management and energy saving effect: Principle: The Beidou power status management process dynamically controls the Beidou power on and off according to the application's connection request; when no application needs to receive data, the power will be automatically turned off to save energy; Effect: This intelligent power management strategy significantly extends the battery life of smart devices, allowing users to use Beidou communication functions for a longer period of time; at the same time, the energy-saving effect is also in line with the current society's pursuit of green and low-carbon life; Beidou data reception and push and intelligent application: Principle: The Beidou data receiving process is responsible for receiving and processing the raw data from the Beidou-3 module, and then pushes the data to the corresponding application through the established socket port connection; the Beidou-3 API library uses the callback function mechanism to realize data forwarding and processing; Effect: This data receiving and pushing mechanism provides rich BeiDou data support for applications on the OpenHarmony platform, enabling these applications to achieve more intelligent and automated functions. For example, smart agricultural applications can monitor soil moisture and temperature in farmland in areas without mobile networks to achieve precise irrigation. In summary, the integration of the OpenHarmony platform and BeiDou-3 communication technology not only improves the communication efficiency and stability of smart devices, but also achieves energy saving and intelligent application effects through technical means such as intelligent power management and real-time data transmission. This integrated technology provides strong support for the development of smart devices and also brings users a more convenient, efficient and personalized service experience. Example

[0016] 1. Equipment Configuration Processor: It uses the Unisoc uis7885 chip, which supports the OpenHarmony 4.0 operating system, ensuring stable operation and efficient processing of the system; Memory: The device has 256GB of built-in storage space, which is pre-installed with the BeiDou III API library (version V3.2.0) and BeiDou III management process (version V2.3.1); these components are executed by the processor and are responsible for handling the reception of BeiDou data and the management of power status; 2. Function Implementation and Parameters NAPI interface design and communication: How to turn on Beidou power: Parameters: package name (such as "com.example.navigation"), callback function (used to receive connection status notification); Implementation: When the application requests to turn on the Beidou power through the NAPI interface, the Beidou-3 API library attempts to establish a connection with the Beidou-3 management process; after the connection is successful, a notification of successful connection is sent to the application through the callback function, allowing the application to interact with the Beidou data receiving process for subsequent Beidou data; the connection establishment takes no more than 2 seconds; How to turn off Beidou power: Parameters: None; Implementation: Execute the operation of disconnecting from the BeiDou III management process within the BeiDou III API library; after disconnection, inform the application of the disconnection through the callback function previously registered for the BeiDou power on method, along with the reason or status information for the disconnection; the disconnection takes no more than 1 second; Method to send data: Parameters: data to be sent (serialized string or hexadecimal data stream, length not exceeding 2048 bytes), data length (parameter excluding length information, used for internal processing); Implementation: Receive the data to be sent provided by the application, send it to the BeiDou-3 management process through the established connection, and return the sending status or error code to indicate whether the data is successfully sent; the sending process takes no more than 500 milliseconds; Socket port connection and data real-time: Socket port connection based on TCP protocol, port number is 8888; The application establishes a connection with the BeiDou III management process through the NAPI interface to receive data sent by the BeiDou III module in real time; the data update frequency is set to once per second to ensure the real-time and accuracy of navigation; Beidou power status management and energy saving: The Beidou power status management process dynamically controls the opening and closing of the Beidou power according to the connection request of the application; When at least one application requests a connection through the NAPI interface, the Beidou power state management process turns on the Beidou power supply; when all applications connected through the NAPI interface are disconnected, the Beidou power state management process automatically turns off the Beidou power supply within 5 minutes to save energy; Beidou data reception and push and intelligent application: The Beidou data receiving process is responsible for receiving and processing the raw data from the Beidou III module (including longitude, latitude, altitude and other information); The received BeiDou data is pushed to the corresponding application through the established socket port connection; the BeiDou III API library uses the callback function mechanism to realize data forwarding and processing; The application uses the received Beidou data and combines it with map information to provide users with functions such as optimal route planning and real-time location monitoring; 3. Specific implementation steps

[0017] Selected devices that support the OpenHarmony platform and use the Unisoc UIs7885 chip and 256GB of storage space; The BeiDou-3 API library (version V3.2.0) and BeiDou-3 management process (version V2.3.1) are pre-installed in the memory; Define the NAPI interface, including methods for turning on and off BeiDou power and sending data, for applications on the OpenHarmony platform to call; Through the NAPI interface, the application on the OpenHarmony platform establishes a socket port connection based on the TCP protocol with the BeiDou-3 management process (port number is 8888); The Beidou power status management process dynamically controls the opening and closing of the Beidou power according to the connection request of the application; The Beidou data receiving process receives Beidou data from the Beidou III module and pushes the data to the corresponding application through the established socket port connection; The application uses the received Beidou data to provide navigation services and other intelligent applications for users; To sum up, the smart device in this embodiment realizes efficient, stable and energy-saving Beidou communication function by integrating Beidou third-generation communication technology; at the same time, through technical means such as NAPI interface and socket port connection, it realizes seamless integration with the OpenHarmony platform and real-time data transmission; this integration technology provides strong support for the development of smart devices, and also brings users a more convenient, efficient and personalized service experience.

[0018] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved.

[0019] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for embedding BeiDou III based on the openHarmony platform, the method is implemented based on the processor and memory of the openHarmony platform, and is characterized by: The method comprises: Ⅰ) Select the processor and memory of the openHarmony platform. The memory stores the BeiDou-3 API library and BeiDou-3 management process. The BeiDou-3 API library and BeiDou-3 management process are executed by the processor. The BeiDou-3 management process includes the BeiDou data receiving process and the BeiDou power status management process. The BeiDou data receiving process is used to receive BeiDou data from the BeiDou-3 module, and the BeiDou power status management process is used to manage the on and off status of the BeiDou power. II) Define the NAPI interface, which is stored in the memory and executed by the processor. The NAPI interface includes methods for turning on the Beidou power, turning off the Beidou power and sending data, which is called by the application on the OpenHarmony platform and communicates with the Beidou-3 management process; The method for turning on the Beidou power supply is as follows: receiving the package name provided by the application and a callback function for receiving connection status notification as input parameters; the method attempts to establish a connection with the Beidou III management process inside the Beidou III API library; once the connection is successfully established, a connection success notification is sent to the application through the callback function received previously, thereby allowing the application to perform subsequent Beidou data interaction with the Beidou data receiving process; The method of turning off the Beidou power is as follows: disconnecting from the Beidou III management process is performed inside the Beidou III API library; after disconnecting, the callback function previously registered for the Beidou power on method is used to inform the application that the connection has been disconnected, and the reason or status information of the disconnection is attached; The specific method of sending data is as follows: receiving the data to be sent provided by the application as an input parameter; the sending data method is responsible for sending the received data to be sent to the Beidou-3 management process through the established connection, and returning the sending status or error code to indicate whether the data is successfully sent; III) Through the NAPI interface, the application on the OpenHarmony platform establishes a socket port connection with the BeiDou-3 management process; the socket port is stored in the memory and executed by the processor; the socket port connection includes a socket client program and a local socket service; IV) The Beidou power status management process controls the turning on and off of the Beidou power according to the connection request of the application through the NAPI interface. Specifically, when at least one application requests a connection through the NAPI interface, the Beidou power status management process turns on the Beidou power and decides whether to keep the Beidou power on according to the number of applications currently connected through the NAPI interface; when all applications connected through the NAPI interface are disconnected, the Beidou power status management process turns off the Beidou power; V) The BeiDou data receiving process receives BeiDou data from the BeiDou-3 module and pushes the received BeiDou data to the corresponding application through the established socket port connection; the BeiDou-3 API library uses the callback function passed in through the NAPI interface to forward the received BeiDou data to the application requesting the data.

2. The method for embedding BeiDou III based on the openHarmony platform according to claim 1, characterized in that: In the method of turning on the Beidou power included in the NAPI interface, the Beidou-3 API library performs the following specific process: ① The BeiDou-3 API library starts executing the process; ② The BeiDou-3 API library initializes the socket client program; ③ The Beidou-3 API library connects to the local socket service; ④ The Beidou-3 API library determines whether the connection is successful. If yes, jump to step 5; if no, jump to step 7; ⑤ The Beidou-3 API library starts the data receiving thread of the socket client program; ⑥ The BeiDou III API library obtains the BeiDou card information of the BeiDou III module; ⑦ The Beidou-3 API library ends the execution process.

3. The method for embedding BeiDou III based on the openHarmony platform according to claim 2, characterized in that: The specific execution process of the data receiving thread of the socket client program in step 5 is as follows: a. The socket client program starts the process; b. The socket client program sleeps for 10ms; c. The socket client program queries whether the Beidou data of the Beidou III management process is received. If yes, jump to step d; if not, jump to step b; d. The socket client program receives the Beidou data and pushes it to the application through the NAPI interface, and jumps to step b.

4. The method for embedding BeiDou-3 based on openHarmony platform according to claim 1, characterized in that: The Beidou power status management process includes the following steps: 1) Start: Beidou power status management process starts; 2) Initialization service parameters: Beidou power status management process initializes the socket service parameters; 3) Monitor program access status: Beidou power status management process monitors the socket client program access status; 4) Determine whether the program is connected: Beidou power status management process determines whether there is a socket client program connected, if yes, jump to step 5), if no, jump to step 9); 5) Start thread: The Beidou power status management process starts the Beidou client thread of the Beidou power status management process and adds the thread to the thread pool; 6) Determine whether the power is on: The Beidou power status management process determines whether the Beidou power is on. If yes, jump to step 9); if no, jump to step 7); 7) Turn on the power and start the data receiving process: The Beidou power status management process controls the Beidou power to turn on and starts the Beidou data receiving process; 8) Obtain information: The Beidou power status management process obtains the Beidou card information of the Beidou III module; 9) Determine whether a program is disconnected: The Beidou power status management process determines whether a socket client program is disconnected. If yes, jump to step 10); if no, jump to step 3); 10) Remove thread: Beidou power status management process removes the Beidou client thread of the Beidou power status management process; 11) Determine whether the number of programs is 0: The Beidou power status management process determines whether the number of socket client programs is 0. If yes, jump to step 12); if not, jump to step 3); 12) Power off: Beidou power status management process controls Beidou power off; 13) End: The Beidou power status management process ends and jumps to step 3).

5. The method for embedding BeiDou-3 based on openHarmony platform according to claim 4, characterized in that: In step 5), the Beidou client thread of the Beidou power status management process executes the following steps:

1. Beidou client thread start process; (2) The Beidou client thread sleeps for 10ms; (3) The Beidou client thread queries whether it has received data from the socket client program. If yes, it jumps to step (4); if not, it jumps to step (2); (IV) The data received by the BeiDou client thread is forwarded to the BeiDou III module, and the process goes to step (II).

6. The method for embedding BeiDou-3 based on openHarmony platform according to claim 1, characterized in that: The Beidou data receiving process includes the following steps: A. The Beidou data receiving process starts; B. Beidou data receiving process sleeps for 10ms; C. The Beidou data receiving process queries whether Beidou data from the Beidou III module is received. If yes, jump to step D; if no, jump to step B; D. The Beidou data receiving process pushes Beidou data to the corresponding application; E. The Beidou data receiving process obtains the power information of the Beidou III module every 2 seconds and jumps to step B.

7. The method for embedding BeiDou-3 based on openHarmony platform according to claim 1, characterized in that: The socket port is a stream format socket (TCP).

8. The method for embedding BeiDou-3 based on openHarmony platform according to claim 1, characterized in that: In the data sending method, the data to be sent includes a serialized character string or a hexadecimal data stream; the method also receives a parameter representing the data length, and the parameter itself does not contain length information.

Citation Information

Patent Citations

  • General Beidou application system based on HarmonyOS

    CN113917493A

  • Beidou third-generation management system and method based on Android platform

    CN116680059A

  • Multi-Focal Point Transducer for High- Frequency Ultrasound Applications, Apparatus and Method for Manufacturing thereof

    KR1020200051453A