Application architecture, electronic device, and storage medium
By designing the application architecture on the terminal operating system platform and using the native interface of the operating system for information interaction, the problem of poor application architecture scalability and code writing robustness is solved, and the scalability of the application architecture and the stability of code writing are improved.
Patent Information
- Application Number
- CN202110315879.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-03-24
AI Technical Summary
The code structure of applications on the terminal operating system platform is closely related to the operating system, resulting in poor application architecture scalability and code writing robustness, making it difficult to implement high-privilege operations.
An application architecture is proposed, including an application layer, a framework layer and a control layer, which interacts with information through the native interface of the operating system. The framework layer monitors and processes setting values, uses preset application services and compatible services to generate processing results, and the control layer implements application functions. , enhance the scalability of the application architecture and the robustness of code writing.
Information interaction through the operating system interface enhances the scalability of the application architecture and the robustness of code writing, supports the implementation of different applications, and improves the scalability of the preset application services of the target application.
Smart Images

Figure CN113094024B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software technology, and in particular to an application architecture, electronic equipment, and storage medium. Background Art
[0002] Different applications can be implemented on the terminal's operating system platform, and their overall code structure is closely related to the operating system. When an application is implemented on the operating system platform, it requires the cooperation of the operating system's privileged interface or the granting of high permissions to the application. At this time, the application's code structure needs to be adjusted for the operating system platform, resulting in poor scalability of the application architecture and poor robustness of code writing. Summary of the invention
[0003] The embodiments of the present application provide an application architecture, an electronic device, and a storage medium, which can enhance the scalability of the application architecture and the robustness of code writing.
[0004] The technical solution of this application is implemented as follows:
[0005] The embodiment of the present application proposes an application architecture, which includes: an application layer, a framework layer and a control layer; the application layer, the framework layer and the control layer exchange information through a system interface; the application layer includes a target application; the framework layer includes a preset application service corresponding to the target application;
[0006] The framework layer is used to monitor the first setting value corresponding to the target application transmitted in the application layer, and process the first setting value using a preset application service to obtain a processing result; and transmit the processing result to the control layer;
[0007] The control layer is used to control the implementation of the application function corresponding to the processing result according to the processing result.
[0008] In the above architecture, the system interface is an operating system native framework level interface.
[0009] In the above architecture, the application layer also includes other applications related to the target application, and the preset application service also includes compatible services;
[0010] The framework layer is further used to monitor the second setting value corresponding to the other application transmitted in the application layer; and use the compatible service to process the first setting value and the second setting value to obtain a compatible result;
[0011] The control layer is further used to control the implementation of the application function corresponding to the processing result based on the compatibility result and the processing result.
[0012] In the above architecture, the system interface includes an operating system first interface and an operating system second interface, wherein the operating system is an operating system that implements the application architecture.
[0013] In the above architecture, the first operating system interface and the second operating system interface are deployed in the framework layer;
[0014] The framework layer monitors the first setting value through the first interface of the operating system; and calls the second interface of the operating system to transmit the processing result to the control layer.
[0015] In the above architecture, the application layer also includes: an interface display layer, a business management layer, a tool layer and an entry layer; the business management layer includes functional services corresponding to the target application; the tool layer includes system tools and system interfaces; the entry layer includes entry content;
[0016] The interface display layer is used to display the interface, monitor interface operations, and manage interface data.
[0017] In the above architecture, the target application is a color weakness and color blindness detection and correction application; the framework layer includes a correction and compensation algorithm;
[0018] The framework layer is further used to process the first setting value using the correction compensation algorithm to obtain a color compensation matrix;
[0019] The control layer is used to monitor the color compensation matrix and control the display effect of the screen based on the color compensation matrix.
[0020] In the above architecture, the framework layer is further used to process the first setting value and the second setting value using the correction compensation algorithm and the compatibility algorithm to obtain the color compensation matrix.
[0021] An embodiment of the present application provides an electronic device, which includes a processor, a memory, and a communication bus; when the processor executes a running program stored in the memory, an application architecture as described in any one of the above items is implemented.
[0022] An embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the application architecture as described in any one of the above items is implemented.
[0023] The embodiment of the present application provides an application architecture, an electronic device, and a storage medium, the application architecture includes: an application layer, a framework layer, and a control layer; the application layer, the framework layer, and the control layer exchange information through a system interface; the application layer includes a target application; the framework layer includes a preset application service corresponding to the target application; the framework layer is used to monitor the first setting value corresponding to the target application transmitted in the application layer, and use the preset application service to process the first setting value to obtain a processing result; and transmit the processing result to the control layer; the control layer is used to control the application function corresponding to the processing result according to the processing result. Using the above implementation scheme, the embodiment of the present application proposes an application architecture, in which each layer in the application architecture exchanges information through the system interface of the operating system, and deploys the target application in the application layer, and sets the preset application service of the target application in the framework layer. For the preset application service newly added to the target application, it can be written in the framework layer through the system interface, which can enhance the scalability of the application architecture; the above application architecture can implement different applications on the operating system, thereby enhancing the robustness of code writing. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the structure of an application architecture provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of an application architecture of an exemplary color weakness and color blindness detection and correction application provided in an embodiment of the present application;
[0026] Figure 3 An exemplary application-side hierarchical diagram of a color weakness and color blindness detection and correction application provided in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] Embodiment 1
[0030] This application embodiment provides an application architecture 1, such as Figure 1 As shown, the architecture may include: an application layer 10, a framework layer 11 and a control layer 12; the application layer 10, the framework layer 11 and the control layer 12 exchange information through a system interface 13; the application layer 10 includes a target application; the framework layer 11 includes a preset application service corresponding to the target application;
[0031] The framework layer 11 is used to monitor the first setting value corresponding to the target application transmitted in the application layer, and process the first setting value using a preset application service to obtain a processing result; and transmit the processing result to the control layer;
[0032] The control layer 12 is used to control the implementation of the application function corresponding to the processing result according to the processing result.
[0033] An embodiment of the present application proposes an application architecture that spans application ends, framework ends, and hardware ends. The various layers of the application architecture are connected through a system interface, wherein the system interface is an original interface of an operating system in an operating system that can implement the application architecture.
[0034] In the embodiment of the present application, the application architecture can be used on any device with communication and storage functions, such as: tablet computers, mobile phones, personal computers (PCs), laptops, cameras and other terminal devices.
[0035] In the embodiment of the present application, the operating system can be an Android system or other operating systems, which can be selected according to the actual situation, and the embodiment of the present application does not make specific limitations. The application architecture can be divided into an application layer, a framework layer, and a control layer. The application layer and the framework layer exchange information through the Android system's native interface SettingsProvider, and the framework layer and the control layer exchange information through the Android system's native interface displayTransformManager.
[0036] In an embodiment of the present application, services related to functional requirements in the target application can be set in the application layer, and a new service class can be added in the framework layer. The service class includes preset application services corresponding to the target application. At the framework layer, operations requiring higher permissions can be processed based on the preset application services.
[0037] In the embodiment of the present application, the system interface includes an operating system first interface and an operating system second interface. For the Android system, the operating system first interface is the SettingsProvider interface; the operating system second interface is the displayTransformManager interface. The SettingsProvider interface and the displayTransformManager interface can be deployed in the framework layer.
[0038] In an embodiment of the present application, the framework layer actively listens to the first setting value transmitted by the application layer through the SettingsProvider interface, and then processes the first setting value using the preset application service to obtain a processing result; the framework layer calls the DisplayTransformManager interface, and transmits the processing result to the control layer through the DisplayTransformManager interface, and the control layer controls the implementation of the application function corresponding to the processing result according to the processing result.
[0039] In the embodiment of the present application, the preset application service of the framework layer is started when the operating system is started and closed when the operating system is shut down, and the preset application service of the framework layer is passed to the newly added service class of the framework layer through the SettingsProvider interface. If there is a newly added preset application service, it is also passed to the newly added service class of the framework layer through the SettingsProvider interface.
[0040] Furthermore, the application layer also includes other applications related to the target application, and the preset application service also includes compatible services;
[0041] The framework layer is further used to monitor the second setting value corresponding to the other application transmitted in the application layer; and use the compatible service to process the first setting value and the second setting value to obtain a compatible result;
[0042] The control layer is further used to control the implementation of the application function corresponding to the processing result based on the compatibility result and the processing result.
[0043] It should be noted that in the process of the target application realizing the corresponding application function, other applications related to the target application will have a certain impact on the realization of the application function. Therefore, the application layer also includes other applications, and the service class of the framework layer also includes compatible services between the target application and other applications.
[0044] In an embodiment of the present application, the framework layer simultaneously monitors the first setting value transmitted by the target application and the second setting value transmitted by other applications. Then, the first setting value and the second setting value are processed based on the compatible service to obtain a compatible result. Finally, the control layer controls the implementation of the application function based on both the compatible result and the processing result.
[0045] It should be noted that other applications may be applications having the same application functions as the target application. In the latter case, other applications include application functions related to the application functions in the target application. The specific other applications related to the target application can be determined based on actual conditions and will not be elaborated here.
[0046] Furthermore, the application layer also includes: an interface display layer, a business management layer, a tool layer and an entry layer; the business management layer includes functional services corresponding to the target application; the tool layer encapsulates system tools; the entry layer includes entry content imported and exported by the entry tool;
[0047] The interface display layer is used to display the interface, monitor interface operations, and manage interface data.
[0048] In the embodiment of the present application, the application layer architecture such as the interface display layer, the business management layer, the tool layer and the entry layer can be set on the client, and the application is divided by the business dimension. Corresponding to the newly added business, a new business module or layer can be added between the interface display layer and the tool layer.
[0049] In the embodiment of the present application, the main functions of the interface display layer include interface display and business data binding. The data required by the page is stripped from the page through the ViewModel class, so that the page only needs to monitor interface operations, process user interactions, and be responsible for displaying data.
[0050] It should be noted that the interface display layer is the top layer and is not referenced or known by other layers.
[0051] In the embodiment of the present application, the business management layer includes functional businesses corresponding to the target application. If new businesses are added later, they are all added to the business management layer to ensure scalability.
[0052] It should be noted that the business management layer is only referenced and known by the interface presentation layer, and it contains the internal logic of the functional business.
[0053] In the embodiment of the present application, the tool layer does not contain any business logic and can be referenced and known by all levels. The tool layer mainly encapsulates system tools, such as system settings encapsulated as convenient classes; system privileged interfaces, which are uniformly encapsulated again. When the system interface changes, only the system privileged interface of the tool layer needs to be modified; basic and general user interface (UI) tools; general tools, such as log tools, etc. This makes the tool layer highly reusable and extensible.
[0054] In the embodiment of the present application, the entry layer can be referenced and known by all levels, including entries in various languages, which only contain the entry content without any code, so as to facilitate the import and export of entry tools without affecting the code. And it can be dynamically configured according to different regions, models, preferences and other dimensions.
[0055] It can be understood that the embodiment of the present application proposes an application architecture, in which information exchange is achieved between various layers in the application architecture through the system interface of the operating system, and the target application is deployed in the application layer, and the preset application service of the target application is set in the framework layer. For the newly added preset application services in the target application, they can be written in the framework layer through the system interface, which can enhance the scalability of the application architecture; the above-mentioned application architecture can implement different applications on the operating system, thereby enhancing the robustness of code writing.
[0056] In the embodiment of the present application, the target application corresponding to the application architecture can be any application implemented on the operating system platform. The embodiment of the present application takes the target application as a color weakness and color blindness detection and correction application as an example, and the preset application service in the framework layer is a correction compensation algorithm for specific description.
[0057] The framework layer is further used to process the first setting value using the correction compensation algorithm to obtain a color compensation matrix;
[0058] The control layer is used to monitor the color compensation matrix and control the display effect of the screen based on the color compensation matrix.
[0059] Furthermore, the application layer also includes other applications related to the color weakness and color blindness detection and correction application, and the framework layer also includes a compatible algorithm.
[0060] The framework layer is further used to monitor the second setting value transmitted by the other application, and use the compatible algorithm to process the first setting value and the second setting value to obtain a compatible result.
[0061] like Figure 2 As shown, it is the application architecture of the color weakness and color blindness detection and correction application, wherein the application layer includes the personalized color test algorithm module, the mutually exclusive mode module, the color weakness and color blindness main UI and the personalized color test UI module, and the mutually exclusive setting value monitoring and notification module in the color weakness and color blindness detection and correction application, and at the same time, the application layer also includes the own business color setting module in other module applications related to the color weakness and color blindness detection and correction application, as well as the mutually exclusive setting value monitoring and notification module.
[0062] The framework layer is provided with Android native interface SettingsProvider and Android native framework level interface DisplayTransformManager. The framework layer monitors the setting values of color-weakness and color-blindness detection and correction applications and other module applications through the Android native interface SettingsProvider. In order to avoid loop monitoring and disorder, the framework layer only reads the setting values related to color-weakness and color-blindness, that is, the setting values of color-weakness and color-blindness detection and correction applications and other module applications are the setting values related to color-weakness and color-blindness. A new service class VisionCorrectionService is added to the framework layer. VisionCorrectionService includes correction compensation algorithm, native color-blindness compatibility algorithm, color temperature compatibility algorithm and power saving compatibility algorithm. If there are other correction compensation algorithms, they can also be passed through the SettingsProvider interface. During the working process, the framework layer corrects the setting values according to the correction compensation algorithm and generates a color compensation matrix. The framework layer calls the DisplayTransformManager interface to pass the color compensation matrix to the control layer.
[0063] The control layer may include a SurfaceFlinger layer and a hardware structure (HardWare) layer, wherein the SurfaceFlinger layer deploys a SurfaceFlingerService module, the HardWare layer deploys a device screen (DeviceScreen) module, and the control layer is used to control the display effect of the screen based on a color compensation matrix.
[0064] It is understandable that the overall code structure of the color weakness and color blindness detection and correction application uses the Android native interface to achieve color compensation effects. The dependencies between various levels are single, the decoupling effect is good, and the flexibility is strong.
[0065] For color blindness detection and correction applications, the application-side architecture model is as follows Figure 3 The interface display layer is divided into a color weakness mode selection interface and a color weakness detection interface, wherein the color weakness mode selection interface may include a mode selection interface and a mode selection ViewModel, wherein the mode selection interface is used to display and monitor the user's UI operation, and pass the UI operation to the mode selection ViewModel, and the mode selection ViewModel controls the business layer according to the user operation or system setting. The color weakness detection interface includes a color weakness detection interface, a color weakness detection ViewModel, a drag UI and logic, and an abnormal interruption and recovery processing module.
[0066] The business management layer is used to process various color-related visual services, such as color mode, mutual exclusive monitoring, color temperature compatibility, color weakness detection algorithm, etc. If other services are added, they can be at the same level as the visual services and added in the salesperson management layer to ensure scalability.
[0067] The tool layer includes system setting tools, system privilege interface, basics, general UI tools and general tools.
[0068] The term layer can include general terms and sub-package terms, etc.
[0069] Embodiment 2
[0070] The present application embodiment provides an electronic device 2, such as Figure 4 As shown, the electronic device 2 of this embodiment includes: a processor 20, a memory 21 and a communication bus 22. The above-mentioned processor 20 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing image processing device (DSPD), a programmable logic image processing device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and this embodiment does not make specific limitations.
[0071] In the embodiment of the present application, the communication bus 22 is used to realize the connection and communication between the processor 20 and the memory 21; the application architecture is realized when the processor 20 executes the running program stored in the memory 21.
[0072] An embodiment of the present application provides a storage medium having a computer program stored thereon. The computer-readable storage medium stores one or more programs. The one or more programs can be executed by one or more processors and applied in an electronic device. The computer program implements the application architecture as described above.
[0073] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for enabling an image display device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0075] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. An application architecture, It is characterized in that The architecture includes: an application layer, a framework layer and a control layer; the application layer, the framework layer and the control layer exchange information through a system interface; the application layer includes a target application; the framework layer includes a preset application service corresponding to the target application; The framework layer is used to monitor the first setting value corresponding to the target application transmitted in the application layer, and process the first setting value using a preset application service to obtain a processing result; and transmit the processing result to the control layer; The control layer is used to control the implementation of the application function corresponding to the processing result according to the processing result; The target application is a color weakness and color blindness detection and correction application; the framework layer includes a correction and compensation algorithm; The framework layer is further used to process the first setting value using the correction compensation algorithm to obtain a color compensation matrix; The control layer is used to monitor the color compensation matrix and control the display effect of the screen based on the color compensation matrix.
2. The architecture according to claim 1, It is characterized in that The system interface is a native framework level interface of the operating system.
3. The architecture according to claim 1, It is characterized in that The application layer also includes other applications related to the target application, and the preset application service also includes compatible services; The framework layer is further used to monitor the second setting value corresponding to the other application transmitted in the application layer; and using the compatible service to process the first setting value and the second setting value to obtain a compatible result; The control layer is further used to control the implementation of the application function corresponding to the processing result based on the compatibility result and the processing result.
4. The architecture according to claim 1, It is characterized in that The system interface includes an operating system first interface and an operating system second interface, wherein the operating system is an operating system that implements the application architecture.
5. The architecture according to claim 4, It is characterized in that The first operating system interface and the second operating system interface are deployed in the framework layer; The framework layer monitors the first setting value through the first interface of the operating system; and calls the second interface of the operating system to transmit the processing result to the control layer.
6. The architecture according to claim 1, It is characterized in that The application layer also includes: an interface display layer, a business management layer, a tool layer and an entry layer; the business management layer includes functional services corresponding to the target application; the tool layer includes system tools and system interfaces; the entry layer includes entry content; The interface display layer is used to display the interface, monitor interface operations, and manage interface data.
7. The architecture according to claim 1, It is characterized in that The application layer also includes other applications related to the color weakness and color blindness detection and correction application, and the framework layer also includes a compatible algorithm. The framework layer is further used to monitor the second setting value transmitted by the other application, and use the compatible algorithm to process the first setting value and the second setting value to obtain a compatible result.
8. An electronic device, It is characterized in that The device includes a processor, a memory and a communication bus; when the processor executes the running program stored in the memory, the application architecture as described in any one of claims 1-7 is implemented.
9. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the application architecture as described in any one of claims 1 to 7 is implemented.
