Business logic implementation method and device, communication module, internet of things terminal and medium
By integrating business logic into the communication module of the IoT terminal and mapping the underlying interface to the application layer, the high cost problem caused by external MCU is solved, and efficient resource utilization and cost reduction are achieved.
Patent Information
- Application Number
- CN202211320137.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-10-26
AI Technical Summary
The external MCU in the IoT terminal increases the cost, and the business logic implemented by the MCU leads to waste of resources.
Integrate the business logic into the communication module, map it to the application layer through the underlying interface of the communication module, and use the computing resources of the communication module to implement the business logic.
It reduces the cost of IoT terminals, fully utilizes the computing resources of communication modules, and improves the success rate of business logic implementation.
Smart Images

Figure CN115695192B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of communication, in particular to a service logic implementation method and device, a communication module, an Internet of Things terminal and a medium. BACKGROUND
[0002] Under the background of all things being interconnected, various Internet of Things terminals using 2G, 3G, 4G, 5G, Narrow Band (NB) and other wireless communication modules as data transmission means are developing rapidly. Generally, the communication module of the Internet of Things terminal only has a wireless communication function, and the implementation of the application layer service logic is realized by a microcontroller unit (MCU) externally connected to the Internet of Things terminal, that is, the Internet of Things terminal is used in cooperation with the MCU, the application developer develops a service logic program based on the MCU, and the MCU sends an AT command to the Internet of Things terminal through a serial port to control the communication module in the Internet of Things terminal to transmit service data.
[0003] However, the present inventors have found that the MCU is an external hardware, and its configuration, development and maintenance all require certain costs. In today's rapid development of the Internet of Things and rapid growth of the number of Internet of Things terminals, the external MCU greatly increases the cost of the Internet of Things terminal. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a service logic implementation method and device, a communication module, an Internet of Things terminal and a medium, which can integrate the implementation of the service logic in the communication module, greatly reducing the cost of the Internet of Things terminal, and at the same time, fully utilizing the remaining computing resources in the communication module.
[0005] To solve the above technical problems, the embodiments of the present application provide a service logic implementation method, comprising the following steps: running a bottom layer program of the communication module, determining an interface supported by the bottom layer of the communication module; running an application program of the communication module, mapping the interface supported by the bottom layer of the communication module to a corresponding interface of an application layer of the communication module in the form of a parameter through the application program; running a preset service logic program in the communication module, the service logic program calling the corresponding interface of the application layer of the communication module to implement the corresponding service logic of the service logic program.
[0006] The embodiment of the present application further provides a business logic implementation device, comprising a bottom layer running module and an application layer running module; the bottom layer running module is used for running a bottom layer program of the communication module and determining interfaces supported by the bottom layer of the communication module; the application layer running module is used for running an application program of the communication module and mapping the interfaces supported by the bottom layer of the communication module to corresponding interfaces of an application layer of the communication module in the form of parameters through the application program; and the application layer running module is further used for running a preset business logic program, wherein the business logic program calls the corresponding interfaces of the application layer of the communication module to implement corresponding business logic of the business logic program.
[0007] The embodiment of the present application further provides a communication module, comprising at least an antenna, a memory and the above-mentioned business logic implementation device; the antenna is used for transmitting and receiving signals; the memory is used for storing a bottom layer program, an application layer program and a preset business logic program; and the business logic implementation device is used for implementing the above-mentioned business logic implementation method.
[0008] The embodiment of the present application further provides an Internet of Things terminal, comprising at least a terminal shell and the above-mentioned communication module.
[0009] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program; when the computer program is executed by a processor, the above-mentioned business logic implementation method is implemented.
[0010] The business logic implementation method, device, communication module, Internet of Things terminal and medium provided by the embodiment of the present application can implement business logic in a communication module; first, a bottom layer program of the communication module is run to determine interfaces supported by the bottom layer of the communication module; then, an application program of the communication module is run to map the interfaces supported by the bottom layer of the communication module to corresponding interfaces of an application layer of the communication module in the form of parameters through the application program; finally, a preset business logic program is run in the communication module; the business logic program calls the corresponding interfaces of the application layer of the communication module, that is, calls the interfaces supported by the bottom layer of the communication module to implement corresponding business logic of the business logic program. Considering that the communication module of the Internet of Things terminal in the industry is generally used only for communication, and business logic is implemented by an externally connected MCU, but the externally connected MCU greatly increases the cost of the Internet of Things terminal, the embodiment of the present application provides a business logic implementation method, which maps the interfaces supported by the bottom layer of the communication module to the corresponding interfaces of the application layer, and the business logic program calls the corresponding interfaces of the application layer, which is actually calling the interfaces supported by the bottom layer, so that the business logic can be implemented in the communication module, greatly reducing the cost of the Internet of Things terminal, and fully utilizing the remaining computing resources in the communication module to maximize resource utilization.
[0011] In addition, the bottom layer program, the application program and the business logic program are C language programs, the application program running the communication module maps the interface supported by the bottom layer of the communication module to the corresponding interface of the application layer of the communication module in the form of parameters through the application program, including: defining a structure variable API_TABLE, the API_TABLE defines a plurality of function pointers; the addresses of the interfaces supported by the bottom layer of the communication module are respectively assigned to the plurality of function pointers; wherein each function pointer corresponds to an address, and different function pointers correspond to different addresses; the API_TABLE is passed into the application program as a main function parameter, and the application program is started; the application program assigns the plurality of function pointers in the API_TABLE to the interface function pointers of the application layer respectively. C language is a commonly used language for the design and development of Internet of Things terminals and communication modules. The two tools of structure variable and function pointer in C language are used to jump and pass the addresses of the interfaces supported by the bottom layer of the communication module to the application layer of the communication module. The bottom layer program and the application program are independent of each other and can be developed separately. Only the function pointers pointing to the addresses of the interfaces supported by the bottom layer are shared through the API_TABLE, which further reduces the development cost and better utilizes the remaining computing resources in the communication module.
[0012] In addition, the business logic program calls the corresponding interface of the application layer of the communication module to realize the corresponding business logic of the business logic program, specifically: the business logic program calls the interface function pointers of the application layer to realize the corresponding business logic of the business logic program. Since the interface function pointers of the application layer of the communication module have been assigned to the plurality of function pointers in the API_TABLE, and the plurality of function pointers in the API_TABLE point to the addresses of the interfaces supported by the bottom layer of the communication module, the interface function pointers of the application layer of the communication module also point to the addresses of the interfaces supported by the bottom layer of the communication module. The business logic program calls the interface function pointers of the application layer of the communication module, which is equivalent to using the interfaces supported by the bottom layer of the communication module, so as to realize the business logic in the communication module.
[0013] In addition, the assigning of the addresses of the interfaces supported by the bottom layer of the communication module to the function pointers respectively comprises: executing a bottom layer initialization function initsdkopen api of the communication module, and initializing the function pointers in the API TABLE to the addresses of the interfaces supported by the bottom layer of the communication module respectively; and the assigning of the function pointers in the API TABLE to the interface function pointers of the application layer by the application program comprises: executing an application layer initialization function appinit, and initializing the interface function pointers of the application layer to the function pointers in the API TABLE respectively.
[0014] In addition, the passing of the API TABLE as a main function argument into the application program and the starting of the application program comprise: executing a jump function startopenapp, jumping from the bottom layer to the application layer with the API TABLE, passing the API TABLE as a main function argument into the application program, and starting the application program.
[0015] In addition, the running of the preset business logic program in the communication module comprises: running a preset test program in the communication module, the test program being used to check whether the interfaces supported by the bottom layer of the communication module can be called; and if the test program confirms that the interfaces supported by the bottom layer can be called, ending the test program and running a preset business logic program in the communication module. After the interfaces supported by the bottom layer of the communication module are mapped to the corresponding interfaces of the application layer, a preset program can be run to check whether the interfaces supported by the bottom layer can be called in the application layer, and the business logic program is run after it is confirmed that the interfaces supported by the bottom layer can be called, so that the success rate of the implementation of the business logic is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0016] One or more embodiments are illustrated by way of example in the figures that are part of this document, and which illustrate by way of example the principles of the embodiments.
[0017] Figure 1 FIG. 1 is a schematic diagram of the relationship between a communication module of an Internet of Things terminal and an external MCU;
[0018] Figure 2 FIG. 2 is a flowchart of a business logic implementation method provided by one embodiment of the present application Figure One ;
[0019] Figure 3 FIG. 3 is a flowchart of a business logic implementation method provided by another embodiment of the present application Figure Two ;
[0020] Figure 4 is a flowchart of a business logic implementation method provided by another embodiment of the present application Figure Three ;
[0021] Figure 5 is a schematic diagram of a business logic implementation device provided by another embodiment of the present application
[0022] Figure 6 is a schematic diagram of a communication module provided by another embodiment of the present application DETAILED DESCRIPTION
[0023] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the drawings. However, those skilled in the art can understand that in the embodiments of the present application, many technical details are proposed in order to make the readers better understand the present application. However, the technical solutions claimed by the present application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present application, and the embodiments can be combined with each other and cited to each other without contradiction.
[0024] The communication module in the Internet of Things terminal in the industry usually only undertakes the task of wireless communication, and the business logic to be implemented by the Internet of Things terminal is implemented by the externally hung MCU. The externally hung MCU exists independently of the Internet of Things terminal, and the relationship between the communication module of the Internet of Things terminal and the externally hung MCU can be as shown in Figure 1 The application developer develops his own business logic program based on the MCU. There is a serial port connection between the communication module and the MCU, and the MCU sends AT interaction instructions to the communication module through the serial port to control the networking communication of the communication module and transmit business data.
[0025] However, with the rapid development of the Internet of Things in recent years and the rapid growth of the number of Internet of Things terminals, reducing the cost of the Internet of Things terminal has become a problem that needs to be solved urgently, and removing the externally hung MCU and integrating the application layer business logic into the module can greatly reduce the cost of the Internet of Things terminal.
[0026] In order to solve the problem that the externally hung MCU leads to high cost of the Internet of Things terminal, an embodiment of the present application proposes a business logic implementation method applied to a communication module of an Internet of Things terminal. The implementation details of the business logic implementation method of the present embodiment will be described in detail below. The following content is only provided for the implementation details for the convenience of understanding, and is not necessary for implementing the present solution.
[0027] The specific flow of the business logic implementation method of the present embodiment can be as shown in Figure 2 , which includes:
[0028] Step 101, running the bottom layer program of the communication module, determining the interface supported by the bottom layer of the communication module.
[0029] Specifically, to implement the business logic in the communication module of the Internet of Things terminal, first, the communication module of the Internet of Things terminal needs to start working, and start running the bottom layer program of the communication module (i.e. the program implementing the bottom layer function of the communication module), and determine the interface supported by the bottom layer of the communication module in the process of running the bottom layer program.
[0030] In a specific implementation, the bottom layer program of the communication module can be stored in the storage inside the communication module, and the running of the bottom layer program can make the communication module implement the basic communication function, such as networking, etc. The communication module can call and run the bottom layer program of the communication module after the Internet of Things terminal is powered on.
[0031] In one example, the bottom layer program of the communication module can also be stored in a storage independent of the communication module, that is, the storage of the Internet of Things terminal, which belongs to a part of the Internet of Things terminal.
[0032] Step 102, running the application program of the communication module, mapping the interface supported by the bottom layer of the communication module to the corresponding interface of the application layer of the communication module in the form of parameters through the application program.
[0033] Specifically, after determining the interface supported by the bottom layer of the communication module, the application program of the communication module (i.e. the program implementing the application layer function of the communication module) can be started, and at this time the interface supported by the bottom layer of the communication module can be mapped to the corresponding interface of the application layer of the communication module in the form of parameters through the bottom layer program, and thereafter the corresponding interface of the application layer of the communication module actually points to the interface supported by the bottom layer of the communication module.
[0034] In a specific implementation, the application program of the communication module can be stored in the storage inside the communication module, and the running of the application program can make the communication module implement the function of the application layer, such as data transmission, etc. The communication module can run the application program after the bottom layer program is completed.
[0035] In one example, the application program of the communication module can also be stored in a storage independent of the communication module.
[0036] Step 103, running the preset business logic program in the communication module, the business logic program calling the corresponding interface of the application layer of the communication module, and implementing the corresponding business logic of the business logic program.
[0037] Specifically, after the interface mapping of the application layer of the communication module is completed, a preset business logic program (i.e., a program for implementing a preset business logic) can be run in the communication module. The business logic program can call the interface of the application layer of the communication module, that is, call the interface supported by the bottom layer of the communication module, to implement the business logic corresponding to the business logic program. The preset business logic program can be selected and input by a person skilled in the art according to actual needs, and the embodiments of the present application do not make specific limitations thereto.
[0038] In a specific implementation, a business developer can develop a business logic program corresponding to a business of the business developer for the communication module. The business logic program can be burned into an internal memory of the communication module when the communication module is shipped, or burned into a memory independent of the communication module in the Internet of Things terminal when the Internet of Things terminal is assembled and shipped, or burned into the internal memory of the communication module or the memory independent of the communication module in the Internet of Things terminal after the Internet of Things terminal is put into use.
[0039] In the embodiment, the bottom layer program of the communication module is first run to determine the interface supported by the bottom layer of the communication module, then the application program of the communication module is run, the interface supported by the bottom layer of the communication module is mapped to the interface of the application layer of the communication module in the form of a parameter through the application program, and finally the preset business logic program is run in the communication module. The business logic program calls the interface of the application layer of the communication module, that is, calls the interface supported by the bottom layer of the communication module, to implement the business logic corresponding to the business logic program. Considering that the communication module of the Internet of Things terminal in the industry is generally used only for communication, and the business logic is implemented by an externally connected MCU, but the externally connected MCU greatly increases the cost of the Internet of Things terminal, therefore, the business logic implementation method provided in the embodiments of the present application maps the interface supported by the bottom layer of the communication module to the interface of the application layer, and the business logic program calling the interface of the application layer actually calls the interface supported by the bottom layer, so that the business logic can be implemented in the communication module, greatly reducing the cost of the Internet of Things terminal, and fully utilizing the remaining computing resources in the communication module to maximize resource utilization.
[0040] Another embodiment of the present application relates to a business logic implementation method applied to a communication module of an Internet of Things terminal. The implementation details of the business logic implementation method of the embodiment are described below. The following details are provided for easy understanding, and are not essential for implementing the present solution. In the embodiment, the bottom layer program of the communication module, the application program of the communication module, and the preset business logic program are all C language programs. The specific process of the business logic implementation method of the embodiment can be as shown in FIG. 2, including: Figure 3
[0041] Step 201, running the bottom layer program of the communication module, determining the interfaces supported by the bottom layer of the communication module.
[0042] Step 201 is substantially the same as step 101, and thus is not described here.
[0043] Step 202, defining a structure variable API TABLE, wherein the API TABLE defines a plurality of function pointers.
[0044] Step 203, assigning the addresses of the interfaces supported by the bottom layer of the communication module to the plurality of function pointers respectively.
[0045] Specifically, after determining the interfaces supported by the bottom layer of the communication module, the communication module can define a structure variable API TABLE, wherein the API TABLE defines a plurality of function pointers, and the communication module assigns the addresses of the interfaces supported by the bottom layer of the communication module to the plurality of function pointers defined in the API TABLE respectively. Each function pointer in the API TABLE corresponds to the address of an interface supported by the bottom layer, and different function pointers correspond to different addresses.
[0046] In a specific implementation, after defining the structure variable API TABLE, the communication module can execute the bottom layer initialization function initsdk open api of the communication module, and initsdk open api can initialize the plurality of function pointers in the API TABLE as the addresses of the interfaces supported by the bottom layer of the communication module respectively.
[0047] In an example, the assignment results of the plurality of function pointers in the API TABLE can be recorded and stored in the form of a mapping table.
[0048] Step 204, passing the API TABLE as a main function argument to the application program of the communication module, and starting the application program.
[0049] Specifically, after the plurality of function pointers in the API TABLE are assigned, the communication module can pass the API TABLE as a main function argument to the application program of the communication module, and start the application program.
[0050] In a specific implementation, after the plurality of function pointers in the API TABLE are assigned, the communication module can execute the jump function start open app, carry the API TABLE, jump from the bottom layer of the communication module to the application layer of the communication module, pass the API TABLE as a main function argument to the application program, and start the application program.
[0051] Step 205, the application program assigns the function pointers in the API_TABLE to the interface function pointers of the application layer respectively.
[0052] Specifically, the API_TABLE jumps to the application layer of the communication module, i.e. can be used in the application layer of the communication module, after the application program starts running, the application program can assign the function pointers in the API_TABLE to the interface function pointers of the application layer respectively, i.e. the interface function pointers of the application layer of the communication module are actually assigned to the addresses of the interfaces supported by the bottom layer of the communication module.
[0053] In a specific implementation, after the API_TABLE jumps to the application layer of the communication module, the communication module can execute the application layer initialization function app init of the communication module, and initialize the interface function pointers of the application layer to the function pointers in the API_TABLE respectively.
[0054] It can be understood that C language is a commonly used language for the design and development of Internet of Things terminals and communication modules, and the embodiment uses the two tools of structure body variable and function pointer in C language to jump and pass the addresses of the interfaces supported by the bottom layer of the communication module to the application layer of the communication module, and the bottom layer program and the application program are independent of each other and can be developed separately, and only through the API_TABLE, the function pointers pointing to the addresses of the interfaces supported by the bottom layer are shared, which further reduces the development cost and better utilizes the remaining computing resources in the communication module.
[0055] Step 206, running a preset business logic program in the communication module, the business logic program calling the corresponding interface of the application layer of the communication module to realize the corresponding business logic of the business logic program.
[0056] In a specific implementation, after the communication module starts running the preset business logic program, the business logic program can call the interface function pointers of the application layer, which actually calls the interfaces supported by the bottom layer of the communication module, thereby realizing the corresponding business logic of the business logic program. Since the interface function pointers of the application layer of the communication module have been assigned to the function pointers in the API_TABLE, and the function pointers in the API_TABLE point to the addresses of the interfaces supported by the bottom layer of the communication module, the interface function pointers of the application layer of the communication module also point to the addresses of the interfaces supported by the bottom layer of the communication module. Therefore, the business logic program calling the interface function pointers of the application layer of the communication module is equivalent to using the interfaces supported by the bottom layer of the communication module, so as to realize the business logic in the communication module.
[0057] Another embodiment of the present application relates to a service logic implementation method applied to a communication module of an Internet of Things terminal. The implementation details of the service logic implementation method of the present embodiment are described below. The following details are provided for the convenience of understanding and are not essential to the implementation of the present embodiment. The service logic implementation method of the present embodiment can be implemented as shown in FIG. 3, including the following steps. Figure 4
[0058] Step 301: Running a bottom program of the communication module to determine the interfaces supported by the bottom layer of the communication module.
[0059] Step 302: Running an application program of the communication module to map the interfaces supported by the bottom layer of the communication module to the corresponding interfaces of the application layer of the communication module in the form of parameters.
[0060] Steps 301 to 302 are substantially the same as steps 101 to 102, which are not described again here.
[0061] Step 303: Running a preset test program in the communication module, which is used to check whether the interfaces supported by the bottom layer of the communication module can be invoked.
[0062] Step 304: If the test program confirms that the interfaces supported by the bottom layer of the communication module can be invoked, the test program is ended, and a preset service logic program is run in the communication module, which invokes the corresponding interfaces of the application layer of the communication module to implement the corresponding service logic of the service logic program.
[0063] Specifically, after the corresponding interfaces of the application layer of the communication module are mapped to the interfaces supported by the bottom layer of the communication module, the communication module can first run a preset test program, which is used to check whether the interfaces supported by the bottom layer of the communication module can be invoked, i.e., whether the corresponding interfaces of the application layer of the communication module are correctly mapped to the interfaces supported by the bottom layer of the communication module. If the test program confirms that the interfaces supported by the bottom layer of the communication module can be invoked, the test program is ended, and a preset service logic program is run in the communication module. If the test program confirms that the interfaces supported by the bottom layer of the communication module cannot be invoked, it indicates that the mapping relationship is incorrect, and the communication module re-maps the corresponding interfaces of the application layer of the communication module.
[0064] In the present embodiment, after the interfaces supported by the bottom layer of the communication module are mapped to the corresponding interfaces of the application layer, a preset program can be run for testing to check whether the interfaces supported by the bottom layer can be invoked in the application layer. After confirming that the interfaces can be invoked, the service logic program is run, which effectively improves the success rate of service logic implementation.
[0065] The step division of the above various methods is only for the purpose of clear description, and can be combined into one step or split into multiple steps in actual implementation, as long as the same logical relationship is included, and all are within the protection scope of the patent; adding insignificant modifications or introducing insignificant designs in the algorithm or flow, but not changing the core design of the algorithm and flow, are within the protection scope of the patent.
[0066] In one example, the bottom layer program of the communication module is as follows:
[0067]
[0068]
[0069]
[0070]
[0071] Another embodiment of the application relates to a service logic implementation device, and the implementation details of the service logic implementation device in the embodiment will be specifically explained as follows. The following content is only provided for the implementation details for the convenience of understanding, and is not necessary for implementing the scheme. The schematic diagram of the service logic implementation device in the embodiment can be as shown in the figure, and includes a bottom layer running module 401 and an application layer running module 402. Figure 5
[0072] The bottom layer running module 401 is used for running the bottom layer program of the communication module, and determining the interfaces supported by the bottom layer of the communication module.
[0073] The application layer running module 402 is used for running the application program of the communication module, and mapping the interfaces supported by the bottom layer of the communication module to the corresponding interfaces of the application layer of the communication module in the form of parameters through the application program.
[0074] The application layer running module 402 is also used for running the preset service logic program, wherein the service logic program calls the corresponding interfaces of the application layer of the communication module, and realizes the corresponding service logic of the service logic program.
[0075] It is worth mentioning that all the modules involved in the embodiment are logical modules, and in actual application, one logical unit can be one physical unit, or a part of one physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the application, the units not closely related to solving the technical problems proposed in the application are not introduced in the embodiment, but this does not mean that there are no other units in the embodiment.
[0076] Another embodiment of the present application relates to a communication module, and implementation details of the communication module are specifically described as follows. The following implementation details are provided for the convenience of understanding, and are not essential to implement the present application. A schematic diagram of the communication module of the embodiment can be as shown in FIG. 5. Figure 6 The communication module 51 at least includes an antenna 511, a memory 512, and a service logic implementation device 513, which is the service logic implementation device provided in the above-mentioned service logic implementation device embodiment.
[0077] The antenna 511 is configured to transceive signals.
[0078] The memory 512 is configured to store a bottom layer program, an application layer program, and a preset service logic program.
[0079] The service logic implementation device 513 is configured to implement the service logic implementation method provided in the above-mentioned service logic implementation method embodiment.
[0080] Another embodiment of the present application relates to an Internet of Things terminal, which at least includes a terminal housing and the communication module provided in the above-mentioned communication module embodiment.
[0081] Another embodiment of the present application relates to a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the above-mentioned method embodiment.
[0082] That is, those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by programs instructing related hardware, the programs are stored in a storage medium, and the programs include a plurality of instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The above-mentioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage medium that can store program codes.
[0083] Those skilled in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A method for implementing business logic, characterized in that: Applied to communication modules, including: Running the underlying program of the communication module to determine the interface supported by the underlying program of the communication module; Running the application of the communication module, mapping the interface supported by the bottom layer of the communication module to the corresponding interface of the application layer of the communication module in the form of parameters through the application; Running a preset business logic program in the communication module, wherein the business logic program calls an interface corresponding to the application layer of the communication module to implement the business logic corresponding to the business logic program; The interface supported by the bottom layer of the communication module is mapped to the corresponding interface of the application layer of the communication module in the form of parameters through the application program, including: Encapsulate the addresses of the interfaces supported by the bottom layer of the communication module into a single structure variable; The single structure variable is passed as a main function input parameter to the function pointer of the interface corresponding to the application layer of the communication module.
2. The business logic implementation method according to claim 1, characterized in that: The underlying program, the application program, and the business logic program are all C language programs. The application program running the communication module maps the interface supported by the underlying layer of the communication module to the corresponding interface of the application layer of the communication module in the form of parameters through the application program, including: Define a structure variable API_TABLE, wherein several function pointers are defined in the API_TABLE; Assigning addresses of interfaces supported by the bottom layer of the communication module to the function pointers respectively; wherein each function pointer corresponds to one address, and different function pointers correspond to different addresses; Pass the API_TABLE as a main function parameter to the application and start the application; The application program assigns the several function pointers in the API_TABLE to the interface function pointers of the application layer respectively.
3. The business logic implementation method according to claim 2, characterized in that: The business logic program calls the interface corresponding to the application layer of the communication module to implement the business logic corresponding to the business logic program, specifically: The business logic program calls the interface function pointer of the application layer to implement the business logic corresponding to the business logic program.
4. The business logic implementation method according to claim 2, characterized in that: The assigning the addresses of the interfaces supported by the bottom layer of the communication module to the plurality of function pointers respectively includes: Execute the bottom layer initialization function init sdk open api of the communication module, and initialize the several function pointers in the API_TABLE to the addresses of the interfaces supported by the bottom layer of the communication module; The application program assigns the function pointers in the API_TABLE to the interface function pointers of the application layer, including: The application layer initialization function app init of the communication module is executed to initialize the interface function pointers of the application layer to the several function pointers in the API_TABLE respectively.
5. The business logic implementation method according to claim 2, characterized in that: The step of passing the API_TABLE as a main function parameter to the application and starting the application includes: Execute the jump function start open app, carry the API_TABLE from the bottom layer to the application layer, pass the API_TABLE as the main function input parameter to the application, and start the application.
6. The service logic implementation method according to any one of claims 1 to 5, characterized in that: The running of a preset business logic program in the communication module includes: Running a preset test program in the communication module, the test program is used to check whether an interface supported by the bottom layer of the communication module can be called; If the test program confirms that the interface supported by the bottom layer can be called, the test program is terminated and a preset business logic program is run in the communication module.
7. A business logic implementation device, characterized in that: Including bottom layer operation module and application layer operation module; The bottom layer operation module is used to run the bottom layer program of the communication module and determine the interface supported by the bottom layer of the communication module; The application layer running module is used to run the application of the communication module, and map the interface supported by the bottom layer of the communication module to the corresponding interface of the application layer of the communication module in the form of parameters through the application; wherein, mapping the interface supported by the bottom layer of the communication module to the corresponding interface of the application layer of the communication module in the form of parameters through the application includes: encapsulating the address of the interface supported by the bottom layer of the communication module in a single structure variable; and passing the single structure variable as a main function input parameter to the function pointer of the interface corresponding to the application layer of the communication module; The application layer operation module is further used to run a preset business logic program, wherein the business logic program calls the interface corresponding to the application layer of the communication module to implement the business logic corresponding to the business logic program.
8. A communication module, characterized in that: The communication module at least includes an antenna, a memory and the service logic implementation device according to claim 7; The antenna is used to send and receive signals; The memory is used to store bottom-layer programs, application-layer programs, and preset business logic programs; The business logic implementation device is used to implement the business logic implementation method according to any one of claims 1 to 6.
9. An Internet of Things terminal, characterized in that: The Internet of Things terminal comprises at least a terminal housing and the communication module as claimed in claim 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the service logic implementation method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Communication method and device, electronic equipment and storage medium
CN114579334A