Communication method, communication system, storage medium and communication equipment
By mounting independent processes in the init service and configuring permission domains, direct communication between the App and Modem is achieved, solving the problem of large and inflexible communication resources in the existing technology, and improving communication efficiency and security.
Patent Information
- Application Number
- CN202411561313.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art has problems such as large resource utilization, inflexibility and efficiency in the communication between the App end and the Modem end in smartphones, especially when facing higher security and fast data transmission needs.
By mounting independent processes in the init service, listen to changes in attribute values set in the App process. When the attribute values change, start the init service and specify the shell script as the executor, configure the permission domain and process domain, so that the shell script can be passed The property value is given to the executable file of the vendor partition, thereby calling the Modem control logic-related interface to realize direct communication between the App and Modem.
It realizes direct, efficient and secure communication between the App end and the Modem end, improves communication efficiency, simplifies the integration process, and reduces the amount of code.
Smart Images

Figure CN119420835A_ABST
Abstract
Description
Technical Field
[0001] The technical field of the present invention belongs to communication technology, and in particular, relates to a communication method, a communication system, a storage medium and a communication device. Background Art
[0002] In smartphones, apps usually run in a higher-level space of the system (such as the system space), while the control logic of the modem runs in a more restricted area (such as the vendor space). These two parts cannot communicate directly due to restrictions on permissions and security policies.
[0003] In the current field of communication technology, the communication between the mobile phone app and the modem is an important technical link. Traditional communication methods, such as the communication between the Qualcomm platform app and the modem, are usually carried out through the HIDL (HAL Interface Definition Language, Hardware Abstraction Layer Interface Definition Language) method. However, this method occupies relatively more system overhead and resources when implementing integrated functions, which has certain limitations for the pursuit of efficient and lightweight communication solutions.
[0004] Specifically, apps usually run in the system space, while the modem control logic of the Qualcomm platform runs in the vendor space. Due to the isolation between the two spaces, apps cannot communicate directly with the modem and must transmit data through the middle layer. Although the HIDL method can achieve this function, its complex interface definition and high resource usage make it inflexible and inefficient in some application scenarios.
[0005] In addition, as smartphones become increasingly rich and complex, higher requirements are placed on the communication between apps and modems. Not only does it need to ensure the security of communication, but it also needs to achieve fast and accurate data transmission without violating security policies such as Google Sepolicy. Traditional HIDL methods often seem unable to cope with these new requirements. Summary of the invention
[0006] The purpose of the present invention is to provide a communication method, a communication system, a storage medium and a communication device, aiming to achieve direct, efficient and secure communication between an App end and a Modem end, so as to meet the new demands for communication technology in the current smart phone field.
[0007] According to a first aspect of the present invention, there is provided a communication method, the communication method comprising the following steps:
[0008] Set at least one attribute value in the App process in the advanced permission space;
[0009] Mount at least one independent process in the init service process in the restricted permission space;
[0010] When the independent process monitors that the attribute value changes, the init service is started, and the Modem control logic related interface in the restricted permission space is called by the init service to complete the communication between the App end and the Modem end.
[0011] Furthermore, after monitoring the change of the attribute value, the independent process starts the init service, and the init service specifies at least one shell script as an execution program.
[0012] Furthermore, it is characterized in that the shell script passes the attribute value to the executable file of the restricted permission partition.
[0013] Furthermore, the init service specifies the shell script as an execution program, and the shell script has an independent permission domain, and the permission domain is granted permissions of high-level permission users and groups.
[0014] Furthermore, the independent process is configured in a new process domain, and the processes in the new process domain are allowed to execute executable files in the restricted permission partition.
[0015] Furthermore, when the init service is started, the process domain of the shell script is switched from the default init process domain to the new process domain.
[0016] Furthermore, the configuration of the new process domain includes declaring a new type and configuring the type with the permission to execute the restricted permission partition executable file, declaring the shell script as a role belonging to the type, so that the shell script has the permission to execute the restricted permission partition executable file.
[0017] Furthermore, the executable file is compiled by combining and compiling the Modem control logic related interfaces, and can directly call the Modem control logic related interfaces.
[0018] Furthermore, the attribute value is set to the basic data type that needs to be transferred.
[0019] Furthermore, the attribute value includes at least one key and a value, the key and the value correspond to each other one by one, the key is used to indicate that the attribute is transmitted to the Modem, and the value indicates specific data to be transmitted.
[0020] Furthermore, the advanced permission space is the system space, and the restricted permission space is the vendor space.
[0021] According to a second aspect of the present invention, there is provided a communication system, the communication system comprising:
[0022] At least one attribute value set in the advanced permission space App process;
[0023] At least one independent process mounted in the init service process of the restricted permission space; when the independent process monitors the change of the attribute value, the init service is started, and the Modem control logic related interface in the restricted permission space is called by the init service to complete the communication between the App end and the Modem end.
[0024] Furthermore, the communication system also includes at least one shell script executable program, which is used to transfer the attribute value to the executable file of the restricted permission partition.
[0025] Furthermore, the communication system also includes at least one executable file for calling a method on the Modem side to complete the function of communication between the App side and the Modem side.
[0026] Furthermore, the communication system also includes a process domain for defining a permission domain of the shell script executable program.
[0027] According to a third aspect of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the communication method described in the first aspect of the present invention is executed.
[0028] According to a fourth aspect of the present invention, a communication device is provided, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected; the at least one processor calls the instructions in the memory so that the communication device executes the communication method described in the first aspect of the present invention.
[0029] Compared with the prior art, the present invention has at least the following technical effects:
[0030] By mounting an independent process in the init service to monitor the changes in the property values set in the App process, the init service process starts the init service when the property value changes. At this time, the init service will specify a shell script as the execution program, and by configuring the permission domain and process domain for the shell script, the shell script has the permission to pass the property value to the executable file in the vendor partition, thereby calling the Modem control logic-related interface in the vendor space to complete the communication between the App and the Modem, thereby improving communication efficiency.
[0031] Furthermore, compared with the Qualcomm platform solution that integrates more functions, the present invention implements the mobile phone APP end and the Modem end by mounting an independent process in the init service process, which can simplify the integration process and reduce the amount of code. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flow chart of the method for communication between the mobile phone APP end and the Modem end in an embodiment of the present invention;
[0033] Figure 2 A schematic diagram of the structure of a communication device provided in an embodiment of the present invention.
[0034] Among them, 1. Memory; 2. Processor; 3. Bus. DETAILED DESCRIPTION
[0035] A communication method, a communication system, a storage medium and a communication device of the present invention will be described in more detail below in conjunction with schematic diagrams, wherein preferred embodiments of the present invention are shown, and it should be understood that those skilled in the art may modify the present invention described herein while still achieving the advantageous effects of the present invention. Therefore, the following description should be understood as being widely known to those skilled in the art, and not as a limitation of the present invention.
[0036] For the sake of clarity, not all features of the actual embodiments are described. In the following description, well-known functions and structures are not described in detail because they would clutter the invention with unnecessary detail. It should be recognized that in the development of any actual embodiment, a large number of implementation details must be made to achieve the developer's specific goals, such as changing from one embodiment to another according to the limitations of the relevant system or the relevant business. In addition, it should be recognized that such development work may be complex and time-consuming, but it is just a routine task for those skilled in the art.
[0037] The present invention is described in more detail in the following paragraphs by way of example with reference to the accompanying drawings. The advantages and features of the present invention will become more apparent from the following description. It should be noted that the accompanying drawings are in very simplified form and are not in exact proportions, and are only used to facilitate and clearly assist in illustrating the purpose of the embodiments of the present invention.
[0038] In the existing technology, the communication between the APP side and the Modem side of the Qualcomm platform is usually carried out through the HIDL method. This method integrates more functions, resulting in large system overhead and resource usage. In addition, since the App runs in the System space and the Modem control logic of the Qualcomm platform runs in the Vendor space, there is no direct communication between the two, which limits the flexibility and efficiency of communication.
[0039] like Figure 1 As shown, an embodiment of the present invention provides a method for communication between a mobile phone App terminal and a Modem terminal, and the method includes the following steps:
[0040] Set at least one attribute value in the App process in the advanced permission space;
[0041] Mount at least one independent process in the init service process in the restricted permission space;
[0042] When the independent process monitors that the attribute value changes, the init service is started, and the Modem control logic related interface in the restricted permission space is called by the init service to complete the communication between the App end and the Modem end.
[0043] As an example, the high-level permission space is the system space, and the limited permission space is the vendor space.
[0044] Specifically, an attribute value is set in the App process in the system space, and the attribute value is set to the basic type that needs to be passed, such as int type, which is used to represent the data that needs to be passed to the Modem. The attribute value includes a key and a value, and the key and value correspond one to one. Among them, the key is a custom attribute. When setting the attribute value, the key is represented by a specific string to indicate that this attribute is passed to the Modem and is distinguished from other attributes; the value is set corresponding to the key and represents the specific data to be passed. By setting the attribute value, the App can easily encapsulate the data to be passed and prepare for subsequent communication. In addition, this method is simple, direct, and easy to implement.
[0045] In one embodiment, an independent process is mounted in the init service (Initialization Service) process of the vendor space, and the independent process monitors whether the above-set attribute value changes. By monitoring the change of the attribute value, the independent process in the init service process can obtain the data that the App wants to transmit in real time, thereby triggering the subsequent communication process. This method can ensure the timeliness and accuracy of communication.
[0046] In one embodiment, when the attribute value in the App process changes, the init service process will start the init service and specify a shell script as the execution program of the init service, so that the shell script has an independent permission domain and can execute the executable file of the vendor partition without violating the Google Sepolicy security policy. Therefore, by starting the init service and specifying the shell script, an independent process with specific permissions and functions can be implemented. The shell script passes the attribute value to the executable file of the vendor partition to complete the communication between the App and the Modem. This method not only ensures the security of communication, but also improves the flexibility of communication.
[0047] Specifically, without violating the Google Sepolicy security policy, a method is designed to allow the shell script to have the permission to execute the vendor partition executable file. The method of the present invention complies with the Google Sepolicy security policy, can ensure the security of communication, and make the communication process between the mobile phone APP and the Modem safe and reliable. Specifically, the type in the Google Sepolicy security policy refers to a set of roles with the same permissions. By declaring a new type and configuring the permission to execute the vendor partition executable file for the type. Then, declare the shell script as a role belonging to this newly defined type, so that the shell script has the permission to execute the vendor partition executable file.
[0048] It is worth noting that the shell script is specified as an executable program in the init service and is given the permissions of the system user and group. This means that by specifying the shell script as the permissions of the system user and group, it can be ensured that the script has sufficient permissions to access and call the executable files in the vendor partition when executed; the permission settings of the system user and group ensure that only authorized scripts and processes can perform specific operations, thereby improving the security of the system and preventing unauthorized access.
[0049] In one embodiment, a new process domain is configured for the independent process, and a security label is specified as the new process domain. The new process domain is specifically defined for the shell script, and the process in the new process domain is allowed to execute executable files in the vendor partition. When the init service is started, the process domain of the shell script is switched from the default init process domain to the new process domain, which can ensure that the shell script runs in the correct permissions and security context. In the Android system, the process domain can be regarded as a logically isolated environment for running processes with specific permissions.
[0050] In one embodiment, after the settings in the above independent process are completed, the shell script can call the executable file on the Modem side and pass the property values set in the App process to the Modem side.
[0051] In one embodiment, the executable file added to the Modem side is compiled by combining the Modem control logic related interfaces, and the executable file can directly call the Modem control logic related interfaces to pass the APP end communication message to the Modem process. By calling the Modem control logic related interfaces, the shell script can accurately pass the data that the App wants to pass to the Modem, thereby completing the communication process. This method can ensure the reliability and efficiency of communication.
[0052] Using the communication method of this embodiment, direct, efficient and secure communication between the App and the Modem can be achieved. The specific steps are as follows:
[0053] 1. Attribute value setting:
[0054] The app sets an attribute value in the process of the system space, such as query_network_status, indicating that the app wants to query the network status.
[0055] 2. Independent process mounting:
[0056] An independent process is mounted in the init service process of the vendor space, which is responsible for monitoring the property values set by the App.
[0057] 3. Monitoring and response:
[0058] When the independent process monitors the query_network_status attribute value changes, it starts the init service.
[0059] 4. Execute shell script:
[0060] The init service specifies a shell script as the executable program, which has sufficient permissions to call the executable file of the vendor partition.
[0061] 5. Communication and data transmission:
[0062] The shell script passes the attribute value query_network_status to the executable file on the modem side.
[0063] 6. Modem control logic call:
[0064] The executable file directly calls the Modem control logic related interface to obtain the current network status information.
[0065] 7. Return results:
[0066] The obtained network status information is sent back to the App through the init service and shell script. After receiving the information, the App can display the current network status on the user interface.
[0067] An embodiment of the present invention further provides a communication system, including:
[0068] A property value set in the App process in the system space;
[0069] An independent process mounted in the init service process of the vendor space; when the independent process monitors the change of the attribute value, the init service is started, and the modem control logic related interface in the vendor space is called by the init service to complete the communication between the App end and the Modem end;
[0070] A shell script executable program for passing the property value to the executable file in the vendor partition;
[0071] An executable file used to call the method on the Modem side to complete the communication function between the App side and the Modem side.
[0072] A process domain is used to define the permission domain of the shell script executable program.
[0073] In addition, if the functions of the present invention are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for the processor to implement all or part of the steps of the method described in each embodiment of the present invention when executed.
[0074] That is, those skilled in the art should understand that the embodiments of the present invention may be implemented in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware.
[0075] Based on this, an embodiment of the present invention further provides a program product, which may be a storage medium such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, and a computer program may be stored on the storage medium, and the computer program is executed by a processor to perform the steps of the method described in the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0076] Optionally, an embodiment of the present invention further provides a communication device, which may be a server, a computer or other equipment. Figure 2 A schematic diagram of the structure of a communication device provided by an embodiment of the present invention is shown.
[0077] like Figure 2 As shown, the communication device may include: a memory 1 and at least one processor 2, the memory 1 stores instructions, and the memory 1 and the at least one processor 2 are interconnected; when the capacitance data processing device based on the noise model is running, the processor 2 communicates with the memory 1 through the bus 3, and the processor 2 calls the instructions in the memory 1 to execute the steps of the method described in the above embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0078] For ease of explanation, only one processor is described in the above electronic device. However, it should be noted that in some embodiments, the device in the present invention may also include multiple processors, so the steps performed by one processor described in the present invention may also be performed jointly or individually by multiple processors. For example, if the processor of the device performs step A and step B, it should be understood that step A and step B may also be performed jointly by two different processors or individually in one processor. For example, the first processor performs step A, the second processor performs step B, or the first processor and the second processor perform steps A and B together, etc.
[0079] In some embodiments, the processor may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (S)). By way of example only, the processor may include a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), or a microprocessor, or any combination thereof.
[0080] In summary, in a method for communication between a mobile phone APP and a Modem provided in an embodiment of the present invention, an independent process is mounted in the init service to monitor changes in attribute values set in the App process. When the attribute value changes, the init service process starts the init service. At this time, the init service will specify a shell script as the execution program, and by configuring the permission domain and process domain for the shell script, the shell script has the permission to pass the attribute value to the executable file of the vendor partition, thereby calling the Modem control logic-related interface in the vendor space to complete the communication between the App and the Modem, thereby improving communication efficiency.
[0081] Furthermore, the present invention only needs to mount an independent process in the init service process to realize the communication between the App end and the Modem end. Compared with the solution of the Qualcomm platform that integrates more functions, runs more services, and occupies more system overhead and resources, the present invention mounts an independent process in the init service process, which is simple to integrate, has a small amount of code, a fast running speed, and occupies less system overhead and resources. It is a lightweight communication solution between the App end and the Modem end, which can realize efficient and secure communication between the App and the modem.
[0082] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.
Claims
1. A communication method, characterized in that: The communication method comprises the following steps: Set at least one attribute value in the App process in the advanced permission space; Mount at least one independent process in the init service process in the restricted permission space; When the independent process monitors that the attribute value changes, the init service is started, and the Modem control logic related interface in the restricted permission space is called by the init service to complete the communication between the App end and the Modem end.
2. The communication method according to claim 1, characterized in that: After monitoring the change of the attribute value, the independent process starts the init service, and the init service specifies at least one shell script as an execution program.
3. The communication method according to claim 2, characterized in that: The shell script passes the attribute value to the executable file in the restricted permission partition.
4. The communication method according to claim 2, characterized in that: The init service specifies the shell script as an execution program, and the shell script has an independent permission domain, and the permission domain is granted with permissions of high-level permission users and groups.
5. The communication method according to claim 2, characterized in that: The independent process is configured in a new process domain, and the processes in the new process domain are allowed to execute executable files in the restricted permission partition.
6. The communication method according to claim 5, characterized in that: When the init service is started, the process domain of the shell script is switched from the default init process domain to the new process domain.
7. The communication method according to claim 5, characterized in that: The configuration of the new process domain includes declaring a new type and configuring the permission to execute the restricted permission partition executable file for the type, declaring the shell script as a role belonging to the type, so that the shell script has the permission to execute the restricted permission partition executable file.
8. The communication method according to claim 3, characterized in that: The executable file is compiled by combining the Modem control logic related interfaces and can directly call the Modem control logic related interfaces.
9. The communication method according to claim 1, characterized in that: The attribute value is set to the basic data type that needs to be transferred.
10. The communication method according to claim 1, characterized in that: The attribute value includes at least one key and a value, and the key and the value correspond to each other. The key is used to indicate that the attribute is to be transmitted to the Modem, and the value indicates the specific data to be transmitted.
11. The communication method according to claim 1, characterized in that: The high-level permission space is the system space, and the limited permission space is the vendor space.
12. A communication system, characterized in that: include: At least one attribute value set in the advanced permission space App process; At least one independent process mounted in the init service process in a restricted permission space; When the independent process monitors that the attribute value changes, the init service is started, and the Modem control logic related interface in the restricted permission space is called by the init service to complete the communication between the App end and the Modem end.
13. The communication system according to claim 12, characterized in that: The communication system further comprises at least one shell script executable program, which is used to transfer the attribute value to the executable file of the restricted permission partition.
14. The communication system according to claim 13, wherein: The communication system also includes at least one executable file for calling a method on the Modem side to complete the function of communication between the App side and the Modem side.
15. The communication system according to claim 14, characterized in that: The communication system also includes a process domain, which is used to define the permission domain of the shell script executable program.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the communication method according to any one of claims 1 to 11 is executed.
17. A communication device, characterized in that: include: A memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected; The at least one processor calls the instructions in the memory to enable the communication device to execute the communication method according to any one of claims 1-11.