Note capability open framework, method, device and storage medium
By presetting a note-taking ability sharing library in the electronic device operating system and providing handwriting and element editing capabilities, the problems of difficult development and large amount of data of text editing applications are solved, and the effect of simplifying development and improving text editing efficiency is achieved.
Patent Information
- Application Number
- CN202311870155.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
When developing text editing applications, you need to consider the coordination and cooperation of software and hardware of electronic devices, which makes it difficult to develop and increase the amount of application file data and increase the difficulty of promotion.
The note-taking ability sharing library is preset in the operating system of electronic devices, providing handwriting and element editing capabilities. Applications can directly use this library to implement text editing functions, reducing development difficulty and data volume.
Through the system's underlying note-taking ability sharing library, simplify the development process, reduce the amount of application file data, and improve the development experience and text editing efficiency.
Smart Images

Figure CN120276713A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and particularly to a note capability open framework, method, device, and storage medium. Background Art
[0002] During the use of text-based files such as pictures, documents, and handwritten diaries, there is often a need to perform secondary editing on existing files by means of handwritten drawing or inserting elements (such as text boxes or pictures). For example, secondary editing of a Portable Document Format (PDF) courseware is used to record course notes. Based on this, there is a development need for corresponding types of applications (APPs) to perform text editing on existing files through such APPs.
[0003] Currently, when developers develop such APPs, they usually need to pre-write logic code for implementing text editing capabilities in the application files of the APP. However, the implementation of text editing capabilities needs to consider the coordination and cooperation with the software and hardware of the electronic device, and the development difficulty is relatively large. Moreover, these logic codes will greatly increase the data volume of the application files, thereby increasing the difficulty of promoting the APP. Summary of the Invention
[0004] This application provides a note capability open framework, method, device, and storage medium, which can reduce the development difficulty of text editing APPs and the data volume of APPs. The technical solutions are as follows:
[0005] In a first aspect, a note capability open framework is provided. The note capability open framework includes a note capability sharing library pre-set in the operating system of an electronic device. The note capability sharing library can provide text editing capabilities for any application. Among them, the note capability sharing library includes at least one of a handwriting capability module and an element capability module; the handwriting capability module is used to provide handwriting editing capabilities for the application; the element capability module is used to provide element editing capabilities for the application.
[0006] In the embodiments of the present application, a note ability sharing library capable of providing text editing ability for any application is preset in the operating system of the electronic device, that is, the note ability sharing library can be opened for any application to use, so that any application can utilize the text editing ability provided by the note ability sharing library to implement business functions related to text editing. In this way, by improving the underlying layer of the electronic device system, it is convenient for developers to directly use the note ability sharing library publicly disclosed by the underlying layer of the electronic device system to develop text editing services for the APP, without the need to fully understand the specific software and hardware information of the electronic device and consider the coordination and cooperation with the software and hardware of the electronic device, reducing the development difficulty and improving the development experience of developers. In addition, since the APP can directly utilize the text editing ability provided by the note ability sharing library of the electronic device to implement the text editing service, there is no need to integrate the specific implementation code of the text editing ability in the application file of the APP, thus greatly reducing the data volume of the application file and further reducing the promotion difficulty of the APP. In addition, in the embodiments of the present application, different APPs can use different abilities of the note ability sharing library according to business requirements to implement different business functions, thus greatly reducing the business implementation difficulty.
[0007] Among them, the handwriting editing ability refers to the ability to draw corresponding handwriting according to the handwriting operation, that is, the ability to draw corresponding curves or graphics according to the handwriting operation. Exemplarily, the handwriting ability module can provide a handwriting editing layer for the application, and the handwriting editing layer is used to draw corresponding handwriting according to the handwriting operation, so that the user can perform handwriting drawing through the handwriting editing layer. Among them, the handwriting operation can be a handwriting pen operation or a finger sliding operation, etc., and the embodiments of the present application do not make any limitations in this regard.
[0008] Among them, the element editing ability refers to the ability to insert corresponding elements according to the element editing operation, and the ability to edit (modify or delete) the inserted elements, etc. Exemplarily, the element editing ability can provide an element editing layer for the application, and the element editing layer is used to insert corresponding elements according to the element editing operation, and can also be used to edit the inserted elements, so that the user can perform element editing through the element editing layer. Among them, the elements can include one or more of text boxes, pictures, formulas, graphics, tables, charts, web links, or bookmarks, etc.
[0009] In one embodiment, the note ability sharing library further includes a service management module, and the service management module is used to provide service management ability for the text editing service of the application, such as providing service management ability for modules such as the handwriting ability module or the element ability module. Exemplarily, the service management module can provide layer management functions and operation management functions for layers such as the handwriting editing layer and the element editing layer.
[0010] In one embodiment, the layer management function is used to manage one or more of the following layer functions: visibility configuration of layers, editability configuration of layers, and copying of layer elements. That is, according to the layer management function, any of the above layers can be set to visible or invisible, or set to editable or non-editable, and elements in the layer can be copied, etc.
[0011] In one embodiment, the operation management function is used to manage one or more of the following operations: push operation, pop operation, and disk write operation. That is, the operations on the layer can be managed using a stack storage structure. After the user performs an operation on the layer, the executed operation can be pushed onto or popped from the stack. By pushing an operation onto the stack, the recording of the operation can be achieved, and by popping an operation from the stack, the undo and recovery of the operation can be achieved. Disk write refers to storing the relevant data of the operation. It should be understood that the general operation logic may also include other operation logics, such as logic modules for implementing screenshot operations, touch event control, and gesture recognition.
[0012] In one embodiment, the note ability sharing library may further include a background module, and the background module is used to set the file to be edited in the application as the editing background. Exemplarily, the background module can provide a background layer for the application, and the background layer is used to set the file to be edited in the application as the editing background. Among them, the background layer is located below other layers such as the handwritten editing layer and the element editing layer to serve as the background of other layers. In this way, the file to be edited in the application can be set as the editing background for secondary editing on the file to be edited.
[0013] In one embodiment, the note ability sharing library further includes a paging management module. At least one layer provided by the note ability sharing library is used to stack and generate a canvas corresponding to the file to be edited in the application. The paging management module is used to page the canvas, and each paged part is generated by stacking at least one of these layers and has the capabilities of the corresponding layers. For example, each paged part has a background layer, an element editing layer, and a handwritten editing layer, and has the capabilities of setting the background, handwritten editing, and element editing, etc.
[0014] In one embodiment, the note ability sharing library includes at least one code file, and the at least one code file is used to implement the capabilities of the above logic modules. The file name of the at least one code file is obtained by obfuscating the original file name of the at least one code file using a first obfuscation strategy, and the first obfuscation strategy is different from the second obfuscation strategy used for the file names of the code files in the application.
[0015] In the embodiments of the present application, in order to prevent the code files in the application file from being overwritten by the code files with the same names in the note capability sharing library during the process of loading the note capability sharing library, a specific obfuscation strategy can be adopted to obfuscate the original file names of the initial code files of the note capability sharing library, so as to reduce the probability of the note capability sharing library and the application file having code files with the same names. If the code files of the note capability sharing library also adopt the same general obfuscation strategy as the application file for file name obfuscation, the probability of the obfuscated file names of the two being the same is also relatively high. Therefore, by adopting a first obfuscation strategy different from the second obfuscation strategy adopted by the file names of the code files of the application to obfuscate the original file names of at least one code file included in the note capability sharing library, the probability of having code files with the same names as the application file can be reduced.
[0016] In one embodiment, the file names obtained by obfuscation using the first obfuscation strategy have a fixed string. The fixed string is a preset string, which can be set as needed, for example, it can be set as "penkit", etc. In the embodiments of the present application, in order to distinguish from the general obfuscation strategy adopted by the code file names of the application file, the first obfuscation strategy adopted by the code file names of the note capability sharing library can also be referred to as a directional obfuscation strategy.
[0017] For example, the original file names of at least one code file included in the note capability sharing library can be initially obfuscated using the second obfuscation strategy, and then a fixed string can be added to the file names after the initial obfuscation. For example, the fixed string can be added to each of the strings separated by a delimiter in the file names after the initial obfuscation, so as to distinguish from the code file names of the application obfuscated using the second obfuscation strategy by the fixed string.
[0018] Furthermore, the file names after the initial obfuscation can be first converted between upper and lower cases, for example, converting lowercase characters to uppercase characters, and then a fixed string can be added to the file names after the case conversion. For example, the fixed string can be added to each of the strings separated by a delimiter in the file names after the case conversion.
[0019] In one embodiment, the note capability sharing library further includes a paging management module. At least one layer provided by the note capability sharing library is used to overlay and generate a canvas corresponding to the file to be edited of the application. The paging management module is used to page the canvas, and the pages divided are all generated by overlaying the at least one layer, and have the capabilities corresponding to the layers. For example, each page has a background layer, an element editing layer, and a handwriting editing layer, and has capabilities such as setting the background, handwriting editing, and element editing.
[0020] In one embodiment, the note capability sharing library further includes a cross-layer operation control module; the cross-layer operation control module is used to provide cross-layer operation capabilities for applications, such as providing cross-layer copy operation capabilities.
[0021] In one embodiment, the note capability open framework further includes an application management module pre-installed in the operating system of the electronic device; the application management module is used to load the note capability sharing library into the application process of the application. For example, the application management module is used to load the note capability sharing library into the application process of the application when it detects that the application is integrated with a target SDK, and the target SDK is used to call the note capability sharing library. By loading the note capability sharing library into the application process of the APP, the latency of the application using the text editing capability of the terminal can be reduced, and the text editing efficiency can be improved.
[0022] In a second aspect, a note capability open method is provided, which is applied to an electronic device. The electronic device is installed with a first application, and the operating system of the electronic device includes a note capability sharing library and an application management module. The note capability sharing library is used to provide text editing capabilities for any application. The method includes: after the first application is started, the application management module loads the note capability sharing library into the application process of the first application; the first application realizes the text editing function through the loaded note capability sharing library in the application process.
[0023] In the embodiments of the present application, for the note capability sharing library that is open to the outside at the system bottom layer, the note capability sharing library at the system bottom layer can be loaded into the application process so that the application can use the capabilities of the note capability sharing library in its own application process to realize the text editing function. In this way, the latency of the application using the text editing capability of the terminal can be reduced, and the text editing efficiency can be improved.
[0024] In one embodiment, after the first application is started, if the application management module detects that the first application is integrated with a target SDK, it will load the note capability sharing library into the application process of the first application, and the target SDK is used to call the note capability sharing library.
[0025] In one embodiment, after the note capability sharing library is loaded into the application process of the first application, the first application can call the note capability sharing library through the target SDK in the application process to realize the text editing function through the called note capability sharing library. For example, the first application can, in the application process, through the called note capability sharing library, display a canvas for text editing on the application interface, and the canvas is generated by superimposing one or more of the following layers: an element editing layer, a handwriting editing layer, and a background layer. In this way, it is convenient for the user to perform secondary editing on the existing file on the canvas, improving the user experience.
[0026] In one embodiment, the canvas includes multiple pages, and each page is generated by overlaying one or more of the following layers: an element editing layer, a handwritten editing layer, and a background layer. Exemplarily, the file to be edited includes at least one page, and the background layer of at least one page among the multiple pages is used to set the at least one page as the editing background respectively. In this way, it is convenient for the user to perform paged editing on the existing file, improving the flexibility of text editing.
[0027] In one embodiment, in response to a page addition operation on the canvas, the added page is displayed on the canvas, and the editing background of the background layer of the added page is the page of the file to be edited or a blank background. In this way, it is convenient for the user to add pages on the canvas according to needs, improving the flexibility of text editing.
[0028] In a third aspect, a note capability opening device is provided. The note capability opening device has the function of implementing the note capability opening framework in the first aspect above. The note capability opening device includes at least one module, and the at least one module is used to implement the note capability opening framework provided in the first aspect above.
[0029] In a fourth aspect, a note capability opening device is provided. The note capability opening device has the function of implementing the note capability opening method behavior in the second aspect above. The note capability opening device includes at least one module, and the at least one module is used to implement the note capability opening method provided in the second aspect above.
[0030] In a fifth aspect, a note capability opening device is provided. The structure of the note capability opening device includes a processor and a memory. The memory is used to store a program that supports the note capability opening device to execute the note capability opening framework provided in the first aspect above.
[0031] In a sixth aspect, a note capability opening device is provided. The structure of the note capability opening device includes a processor and a memory. The memory is used to store a program that supports the note capability opening device to execute the note capability opening method provided in the second aspect above, and store data involved in implementing the note capability opening method described in the first aspect above. The processor is configured to execute the program stored in the memory. The note capability opening device may further include a communication bus, and the communication bus is used to establish a connection between the processor and the memory.
[0032] In a seventh aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to execute the note capability opening method described in the second aspect above.
[0033] In an eighth aspect, there is provided a computer program product including instructions, which when running on a computer, causes the computer to execute the note capability opening method described in the second aspect above.
[0034] The technical effects obtained in the second, third, fourth, fifth, sixth, seventh, and eighth aspects are similar to those obtained by the corresponding technical means in the first aspect above, and will not be elaborated here. Description of the Drawings
[0035] Figure 1 is a schematic structural diagram of a terminal provided by an embodiment of the present application;
[0036] Figure 2 is a block diagram of a software system of a terminal provided by an embodiment of the present application;
[0037] Figure 3 is a comparative schematic diagram of performing obfuscation processing on the code file names of a note capability sharing library by using different obfuscation strategies provided by an embodiment of the present application;
[0038] Figure 4 is a schematic logical structure diagram of a note capability sharing library provided by an embodiment of the present application;
[0039] Figure 5 is a schematic diagram of canvas paging provided by an embodiment of the present application;
[0040] Figure 6 is a schematic flowchart of a note capability opening method provided by an embodiment of the present application;
[0041] Figure 7 is a schematic flowchart of initializing a note capability sharing library provided by an embodiment of the present application. Detailed Embodiments
[0042] To make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0043] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means "or". For example, A / B can mean A or B; the "and / or" in this article is just a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solution of this application, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the words such as "first" and "second" do not limit the quantity and execution order, and the words such as "first" and "second" do not necessarily limit being different.
[0044] During the use of text files such as pictures, documents, and electronic notebooks, there is often a need to perform secondary editing on existing files by means of handwritten drawing or inserting elements (such as text boxes or pictures). Among them, documents can include documents in formats such as word format, PDF format, and text format. For example, a user may need to draw a signature or a graphic on a picture through a handwritten operation to edit the picture; or, a user may need to draw text or a graphic on an electronic notebook through a handwritten operation, and insert elements such as text boxes or pictures on the notebook to make a personalized notebook; or, a user may need to make annotations on a courseware in a document format such as PDF format to record course notes. It should be understood that there are also other scenario requirements for secondary editing of existing files, and the embodiments of this application will not list them one by one.
[0045] Based on the above requirements for secondary editing of existing files, there has emerged a development requirement for an APP (such as a note-taking APP) that can meet such requirements, so that users can perform text editing on existing files through such an APP.
[0046] Currently, when developers develop such an APP, they usually need to pre-write specific logic code for implementing text editing capabilities in the application file (such as the application program package) of the APP. However, there are the following problems with this development method:
[0047] 1) The implementation of text editing capabilities highly depends on the coordination between the software and hardware of the electronic device. Therefore, when writing the specific logic code for implementing text editing capabilities, developers need to fully understand the software and hardware information of the electronic device, and need to ensure that the written logic code can coordinate with the software and hardware of the electronic device, which is difficult to develop.
[0048] 2) These logic codes will greatly increase the data volume of the application file, thereby increasing the difficulty of promoting the APP. For example, to implement the handwriting drawing function, a rendering engine capable of realizing handwriting rendering capabilities needs to be integrated into the application file, and the rendering engine will cause a drastic increase in the data volume of the application file.
[0049] 3) Since there are various text editing methods, different business logics need to be written for different business requirements, and the business logic writing is complex, so the business implementation is difficult.
[0050] In view of the above problems, the embodiments of the present application provide a note ability open framework, that is, a note ability sharing library capable of providing text editing capabilities for any application is preset in the operating system of the electronic device. The note ability sharing library can be opened for any application to use, so that any application can utilize the text editing capabilities provided by the note ability sharing library to implement business functions related to text editing. In this way, by improving the underlying system of the electronic device, it is convenient for developers to directly use the note ability sharing library publicly provided by the underlying system to develop text editing services for the APP, without the need to fully understand the specific software and hardware information of the electronic device and consider the coordination with the software and hardware of the electronic device, thereby reducing the development difficulty and improving the development experience of developers. In addition, since the APP can directly utilize the text editing capabilities provided by the note ability sharing library of the electronic device to implement text editing services, there is no need to integrate the specific implementation codes of text editing capabilities in the application file of the APP, thereby greatly reducing the data volume of the application file and further reducing the difficulty of promoting the APP. In addition, in the embodiments of the present application, different APPs can use different capabilities of the note ability sharing library according to business requirements to implement different business functions, thereby greatly reducing the business implementation difficulty.
[0051] The note ability open framework and method provided by the embodiments of the present application are applicable to an electronic device. A note ability sharing library is preset in the operating system of the electronic device, and the note ability sharing library is used to provide text editing capabilities for any application. The electronic device can also be referred to as a terminal, user equipment (UE), mobile station (MS), or mobile terminal (MT), etc. The electronic device can be a terminal such as a mobile phone, a tablet computer, a computer, a smart wearable device, or a smart TV. The embodiments of the present application do not make any limitations in this regard. The embodiments of the present application do not make any limitations on the specific technologies and specific device forms adopted by the electronic device. Next, the electronic device is taken as an example of a terminal for illustration.
[0052] Before explaining the note-taking capability open framework and the note-taking capability open method provided in the embodiments of the present application in detail, the terminals involved in the embodiments of the present application will be described first.
[0053] Figure 1 It is a schematic structural diagram of a terminal provided in the embodiments of the present application. Refer to Figure 1 , the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0054] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0055] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0056] Among them, the controller can be the nerve center and command center of the terminal 100. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching instructions and executing instructions.
[0057] A memory can also be set in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0058] The wireless communication function of the terminal 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, and baseband processor, etc. The terminal 100 can implement the shooting function through ISP, camera 193, video codec, GPU, display screen 194, and application processor, etc. The terminal 100 can implement the audio function, such as music playback, recording, etc., through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor, etc.
[0059] The terminal 100 can implement the display function through GPU, display screen 194, and application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0060] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal 100 may include 1 or N display screens 194, where N is an integer greater than 1.
[0061] The external memory interface 120 can be used to connect to an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the terminal 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0062] The internal memory 121 can be used to store computer-executable program codes, and the computer-executable program codes include instructions. The processor 110 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the terminal 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0063] The electronic device 100 further includes various sensors that can convert various different physical signals into electrical signals. Exemplarily, the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. The barometric pressure sensor 180C is used to measure barometric pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance through infrared or laser. The proximity light sensor 180G can include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc. The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 executes a temperature processing strategy using the temperature detected by the temperature sensor 180J. The bone conduction sensor 180M can obtain vibration signals.
[0064] The pressure sensor 180A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor may include at least two parallel plates having conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The terminal 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal 100 detects the intensity of the touch operation according to the pressure sensor 180A. The terminal 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the pressure threshold acts on the short message application icon, the instruction to create a new short message is executed. Exemplarily, in the embodiments of the present application, the movement trajectory of a handwriting operation can be calculated according to the detection signal of the pressure sensor 180A, such as calculating the movement trajectory of a stylus or the movement trajectory of a user's finger, etc., so as to draw a corresponding handwriting according to the movement trajectory, such as drawing a corresponding curve or graphic, etc.
[0065] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch display screen". The touch sensor 180K is used to detect a touch operation acting thereon or nearby. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. Exemplarily, in the embodiments of the present application, the touch sensor 180K can detect a click operation of a user on an icon of an application program, and transmit the detected click operation to the application processor to determine that the click operation is used to start or run the application program, and then execute the running operation of the application program.
[0066] Next, the software system of the terminal 100 will be described.
[0067] The software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, the Android system with a layered architecture is taken as an example to exemplarily describe the software system of the terminal 100.
[0068] Figure 2 is a block diagram of a software system of a terminal 100 provided by the embodiments of the present application. Refer toFigure 2 , the layered architecture divides software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer (also called the app layer), the application framework layer (also called the app framework layer), and the kernel layer.
[0069] The application layer may include a series of application packages. Such as Figure 2 shown, the application packages may include APP1, APP2, and APP3, etc. These APPs can be applications such as a gallery, a calendar, a map, a short message, an office software, or an application developed specifically for secondary editing of text files. The embodiments of the present application do not make any limitations in this regard.
[0070] In one embodiment, for the APPs in the application layer, in order to enable these APPs to use the capabilities provided by the note capability sharing library in the application framework layer, developers can pre-integrate the SDK corresponding to the note capability sharing library in the application framework layer in the application files of the corresponding APPs during development. In this way, the APPs can call the relevant capabilities provided by the note capability sharing library through the integrated SDK to implement text editing functions and related services. Such as Figure 2 shown, the SDKs corresponding to the note capability sharing library are integrated in both APP1, APP2, and APP3, and the SDKs have corresponding SDK identifiers.
[0071] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. Such as Figure 2 shown, the application framework layer may include a note capability sharing library and an application management module. The note capability sharing library is used to provide text editing capabilities for any application. That is to say, the note capability sharing library is the logical code that opens up the text editing capabilities of the terminal to the outside world. For example, the note capability sharing library includes a handwriting capability module, an element capability module, a service management module, and a rendering engine, etc.
[0072] The handwriting capability module is used to provide handwriting editing capabilities, that is, the ability to draw corresponding handwriting strokes according to handwriting operations. For example, the ability to draw corresponding curves or graphics according to handwriting operations. Exemplarily, the handwriting capability module can provide a handwriting editing layer for the application. The handwriting editing layer is used to draw corresponding handwriting strokes according to handwriting operations, such as drawing corresponding curves or graphics, etc., so that users can perform handwriting drawing through the handwriting editing layer. Among them, the handwriting operation can be a handwriting pen operation or a finger sliding operation, etc. The embodiments of the present application do not make any limitations in this regard.
[0073] The rendering engine is used to provide rendering capabilities for the handwriting ability module. For example, according to the movement trajectory of the handwriting operation, handwriting can be rendered on the handwriting editing layer so that the handwriting editing layer can display the corresponding handwriting. Of course, the rendering engine can also provide rendering capabilities for other modules, which is not limited in the embodiments of the present application.
[0074] The element ability module is used to provide element editing capabilities, that is, the ability to insert corresponding elements according to element editing operations, and the ability to edit (modify or delete) the inserted elements, etc. Exemplarily, the element editing ability can provide an element editing layer for the application. The element editing layer is used to insert corresponding elements according to element editing operations, and can also be used to edit the inserted elements so that users can perform element editing through the element editing layer. Among them, the elements can include one or more of text boxes, pictures, formulas, graphics, tables, charts, web links, or bookmarks, etc.
[0075] The service management module is used to provide service management capabilities for text editing services, such as providing service management capabilities for modules such as the handwriting ability module or the element ability module. Exemplarily, the service management module can provide layer management functions and operation management functions for layers such as the handwriting editing layer and the element editing layer. Among them, the layer management function is used to manage one or more of the following layer functions: visibility configuration of the layer, editability configuration of the layer, and one or more of copying layer elements. The operation management function is used to manage one or more of the following operations: push operation, pop operation, and disk drop operation.
[0076] As an example, the note ability sharing library may further include a background module. The background module is used to set the file to be edited as the editing background. Exemplarily, the background module can provide a background layer for the application. The background layer is used to set the file to be edited by the application as the editing background. Among them, the background layer is located below other layers such as the handwriting editing layer and the element editing layer to serve as the background of other layers. In this way, the file to be edited by the application can be set as the editing background for secondary editing on the file to be edited.
[0077] As an example, the note ability sharing library may further include a cross-layer operation control module for the background module. The cross-layer operation control module is used to provide cross-layer operation capabilities for the application, such as providing capabilities for operations such as cutting, copying, or pasting between layers such as the handwriting editing layer and the element editing layer.
[0078] As an example, the note capability sharing library further includes a pagination management module. At least one layer provided by the note capability sharing library is used to overlay and generate a canvas corresponding to the file to be edited in the application. The pagination management module is used to paginate the canvas, and the divided pages are all generated by overlaying at least one of these layers and have the capabilities corresponding to the layers. For example, each page has a background layer, an element editing layer, and a handwriting editing layer, and has capabilities such as background setting, handwriting editing, and element editing.
[0079] The application management module is used to load the note capability sharing library into the application process of the APP in the application layer, so that the APP can call the note capability sharing library in its own application process. For example, the application management module can be a package manager service (PMS), etc. By loading the note capability sharing library into the application process of the APP, the time delay for the APP to call the note capability sharing library can be reduced, and the business response efficiency can be improved.
[0080] As an example, after the APP is started, if the application management module detects that the APP integrates the software development kit (SDK) corresponding to the note capability sharing library, it will load the note capability sharing library into the application process of the APP in the application layer. For example, the application management module can determine that the APP integrates the target SDK when detecting the SDK identifier of the target SDK in the APP, and then load the note capability sharing library into the application process of the APP in the application layer. Among them, the target SDK is the SDK corresponding to the note capability sharing library, and the SDK identifier can be the name or ID of the target SDK, etc. The embodiments of the present application do not limit this.
[0081] As an example, after the APP is cold-started, if the application management module detects that the APP integrates the SDK corresponding to the note capability sharing library, it will load the note capability sharing library into the application process of the APP in the application layer.
[0082] As an example, the application framework layer can further include a class loader. The application management module can use the class loader to load the note capability sharing library into the application process of the APP. For example, the application framework layer can further include a first class loader and a second class loader. The application management module uses the first class loader to load the application files of the APP into the application process of the APP, and uses the second class loader to load the note capability sharing library into the application process of the APP.
[0083] Different APPs in the application layer can utilize the capabilities provided by the note capability sharing library in the application framework layer to develop different text editing services. For example, such as Figure 2As shown in the figure, APP1 can provide an element editing layer and business management for the text editing service of pictures. APP2 can provide a handwriting editing layer, an element editing layer, and business management for the text editing service of handwritten notebooks. APP3 can provide a handwriting editing layer and business management for the text editing service of documents.
[0084] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a sensor driver, a stylus driver, etc., and the embodiments of the present application do not limit this.
[0085] As an example, the software system may further include an Android Runtime and a system layer. The Android Runtime and the system layer are located between the software framework layer and the kernel layer.
[0086] Android Runtime includes a core library and a virtual machine. Android Runtime is responsible for the scheduling and management of the Android system. The core library includes two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0087] The system library may include multiple functional modules, such as: a surface manager, Media Libraries, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is the drawing engine for 2D drawing.
[0088] It can be understood that Figure 2 the software system shown does not limit the software system of the terminal. The software system of the terminal may further include more or fewer modules than the Figure 2 software system shown, or modify and replace the relevant modules of Figure 2 as needed. The embodiments of the present application do not limit this.
[0089] It can be understood that in order for the terminal to implement the note capability open framework and the note capability open method in the embodiments of the present application, it includes the corresponding hardware and / or software modules for executing each function. Combining the algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described function for each specific application in combination with the embodiments.
[0090] It should be noted that although the embodiments of the present application are described by taking the Android system as an example, its basic principle also applies to electronic devices based on operating systems such as iOS or Windows.
[0091] First, the note capability open method provided by the embodiments of the present application will be briefly introduced in combination with the above software architecture.
[0092] In the APP development stage, developers can add the SDK corresponding to the note capability sharing library and the SDK identifier in the APP according to business requirements. This SDK is used to call the note capability sharing library. For example, this SDK can include one or more interfaces, and different interfaces are used to call different capabilities of the note capability sharing library. As Figure 2 shown, the SDK corresponding to the note capability sharing library is integrated in APP1, APP2, and APP3, and the SDK has the corresponding SDK identifier.
[0093] After the electronic device downloads and installs the APP, the APP can be displayed on the screen of the terminal 100 in the form of an icon. When the icon of the APP is clicked by the user to be triggered, the terminal 100 starts to launch the APP. After the APP is launched, the APP can create an APP process. If the application management module in the application framework layer detects the SDK identifier of the target SDK integrated in the APP, it can load the note capability sharing library in the application framework layer into the APP process. The APP can directly call the note capability sharing library by calling the target SDK in the APP process to use the text editing capability provided by the note capability sharing library to implement the text editing function.
[0094] In addition, different APPs can use different capabilities of the note capability sharing library according to business requirements to implement different business functions. For example, APP1 can utilize the element editing capability and business management capability of the note capability sharing library to provide an element editing layer and related business management functions for pictures. APP2 can utilize the handwriting editing capability, element editing capability, and business management capability of the note capability sharing library to provide a handwriting editing layer, an element editing layer, and related business management functions for a sticker album. APP3 can utilize the handwriting editing capability and business management capability of the note capability sharing library to provide a handwriting editing layer and related business management functions for documents.
[0095] Next, the note capability open framework provided by the embodiments of the present application will be introduced in detail from the following aspects.
[0096] 1) Capability preset management
[0097] In the note capability open framework of the embodiments of the present application, the logic module capable of implementing text editing capabilities in the electronic device (i.e., the note capability sharing library) can be preset in the application framework layer of the operating system in a system-built-in manner, so as to open the text editing capabilities of the electronic device for any APP to use.
[0098] As an example, the note capability open framework can also provide a corresponding capability identifier for the APP. The capability identifier is used to indicate the note capability sharing library and can be used as an index of the capabilities of the note capability sharing library. Exemplarily, the capability identifier can be an aar. For an APP, if a developer wants to develop a text editing service for the APP, the developer can add the capability identifier to the APP. In this way, during the startup process of the APP, if the application management module detects that the capability identifier is integrated in the APP, it can load the note capability sharing library into the APP process of the APP, so that the APP can directly call the note capability sharing library in its own APP process, thereby implementing text editing-related services.
[0099] It should be noted that in the traditional APP development method of pre-writing the logic code for realizing text editing capabilities in the application file of the APP, after the developed APP is started, it is necessary to call the relevant services of the application framework layer through the APP process. This calling method requires the application framework layer to start the system process, and then feed back the task results to the application process after running the relevant tasks through the system process. That is, it is necessary to run two processes (APP process and system process) at the same time, and the APP process needs to obtain the required task results across processes, which has large delays and power consumption, and low business response efficiency. In the embodiment of the present application, by loading the note-taking capability shared library into the APP process, the APP can directly call the note-taking capability shared library in its own APP process and obtain relevant task results without starting and running the system process at the same time, thereby reducing the delay of the APP in obtaining data, reducing device power consumption, and improving business response efficiency.
[0100] As an example, the capability identifier can be the SDK identifier of the SDK related to the note-taking capability sharing library. For example, the APP can integrate the target SDK and the SDK identifier of the target SDK in the APP according to business needs. The target SDK is an SDK related to the note-taking capability sharing library and can be used to call the note-taking capability sharing library. For example, the target SDK can provide one or more interfaces, and different interfaces are used to call different capabilities of the note-taking capability sharing library. Accordingly, during the APP startup process, if the application management module detects that the SDK identifier of the target SDK is integrated in the APP, the note-taking capability sharing library will be loaded into the APP process.
[0101] As an example, the note-taking capability opening framework can also provide different capability identifiers for the APP, and different capability identifiers are used to indicate different capability ranges of the note-taking capability sharing library, so that the external opening scope of the note-taking capability sharing library can be controlled by different capability identifiers in different business scenarios.
[0102] For example, different capability identifiers may include a first capability identifier, a second capability identifier, and a third capability identifier. The first capability identifier is used to indicate the handwriting editing capability of the open note capability sharing library, but not the element editing capability, that is, the first capability identifier indicates that the loaded note capability sharing library includes a handwriting editing module, but not an element capability module; the second capability identifier is used to indicate the element editing capability of the open note capability sharing library, but not the handwriting editing capability, that is, the second capability identifier indicates that the loaded note capability sharing library includes an element capability module, but not a handwriting editing module; the third capability identifier is used to indicate the handwriting editing capability and element editing capability of the open note capability sharing library, that is, the third capability identifier indicates that the loaded note capability sharing library includes an element capability module and a handwriting editing module.
[0103] As another example, the note capability open framework can provide different SDKs for the APP. Different SDKs have different SDK identifiers, and different SDKs provide different interfaces. The capabilities of the interfaces provided by different SDKs to call the note capability shared library vary.
[0104] In addition, during the startup process of the APP, in addition to loading the note capability shared library into the APP process, the application management module also needs to first load the application file of the APP into the APP process. For example, the application management module can use the first type of loader to load the application file of the APP into the APP process, and use the second type of loader to load the note capability shared library into the APP process. Both the application file and the note capability shared library include one or more code files. The code file can be a class file or a method file, etc. The embodiments of the present application do not limit this. For example, the note capability shared library includes at least one code file, and this at least one code file is used to implement the capabilities of one or more modules in the note capability shared library mentioned above.
[0105] In the embodiments of the present application, in order to ensure the loading success rate of the note capability shared library, the loading priority of the note capability shared library needs to be greater than the loading priority of the application file of the APP. However, in the case where the loading priority of the note capability shared library is greater than the loading priority of the application file of the APP, if there are code files with the same file name in the note capability shared library and the application file, the code file in the note capability shared library will overwrite the code file with the same name in the application file, that is, the code file in the application file will be replaced by the code file with the same name in the note capability shared library, which may cause the APP to run incorrectly or the business to be chaotic.
[0106] In the embodiments of the present application, in order to avoid the code file in the application file being overwritten by the code file with the same name in the note capability shared library during the loading of the note capability shared library, a specific obfuscation strategy can be adopted to obfuscate the initial code file name of the note capability shared library to reduce the probability of the note capability shared library and the application file having code files with the same name.
[0107] For an APP, if the developer does not want to open-source the developed APP, then before the APP is released, it is usually necessary to obfuscate the original file names of the code files in the APP so that other people cannot reverse-engineer the original file names based on the obfuscated file names, thereby avoiding reverse-engineering the source code of the APP based on the reverse-engineered original file names. Currently, APPs usually use a general obfuscation strategy for file name obfuscation. The general obfuscation strategy is usually an obfuscation strategy that replaces the strings in the original file name with preset characters. For example, each string in the original file name can be replaced with characters such as a, b, c, etc. Exemplarily, file names are usually separated by the "." symbol. For the strings before the separators in the same order in each original file name, they can be sequentially replaced with characters such as a, b, c, etc. in alphabetical order of the first letter.
[0108] In the case of not open-sourcing the note capability sharing library, before pre-setting the note capability sharing library in the application framework layer, it is also necessary to first obfuscate the original file names of the code files for loading the note capability sharing library. However, if the code files of the note capability sharing library also use the same general obfuscation strategy as the application files of the APP for file name obfuscation, then the probability of the obfuscated file names of the two being the same is also relatively high. In the embodiments of the present application, in order to reduce the probability of having the same code file names as the application files, a first obfuscation strategy different from the second obfuscation strategy used for the file names of the code files of the APP can be used to obfuscate the original file names of at least one code file included in the note capability sharing library.
[0109] As an example, the file names obtained by obfuscation using the first obfuscation strategy have a fixed string. This fixed string is a preset string, which can be set as needed, for example, it can be set as "penkit", etc. In the embodiments of the present application, in order to distinguish from the general obfuscation strategy used for the code file names of the application files, the first obfuscation strategy used for the code file names of the note capability sharing library can also be referred to as a directional obfuscation strategy.
[0110] For example, the original file names of at least one code file included in the note capability sharing library can be initially obfuscated using the second obfuscation strategy, and then the fixed string can be added to the obfuscated file names. For example, the fixed string can be added to each string separated by the separator in the obfuscated file names to distinguish from the code file names of the application obfuscated using the second obfuscation strategy through the fixed string.
[0111] Further, the case of the file name after the initial obfuscation process can be converted first. For example, lowercase characters can be converted to uppercase characters, and then a fixed string can be added to the file name after the case conversion. For example, the fixed string can be added to each of the strings separated by a delimiter included in the file name after the case conversion.
[0112] Please refer to Figure 3 , Figure 3 FIG. is a comparison schematic diagram of obfuscating the code file names of a note ability sharing library using different obfuscation strategies provided by an embodiment of the present application. As Figure 3 shown, the source code written by a developer for the note ability sharing library may include system class files and class files developed additionally outside the system class files. The additionally developed class files may reference the system class files. Subsequently, the system class files and the additionally developed class files can be packaged to obtain the original file package of the note ability sharing library. For the packaged original file package, an appropriate obfuscation strategy can be adopted to obfuscate the class file names in the original file package, so that the application management module can load the obfuscated file package into the application process of the APP through a class loader when needed. For example, the processing results of obfuscating the class file names in the original file package using the current general obfuscation strategy and the targeted obfuscation strategy provided by an embodiment of the present application can be as shown in Table 1 below:
[0113] Table 1
[0114]
[0115] As shown in Table 1 above, for the class file names in the original file package, if the general obfuscation strategy is adopted for obfuscation, the string before the first delimiter '.' in the class file name can be sequentially replaced with a, b, c, etc. in alphabetical order of the first letter. For example, "com" can be replaced with "a", and "org" can be replaced with "b". For class file names with the same string before the first delimiter '.', the string before the second delimiter '.' can continue to be sequentially replaced with a, b, c, etc. and so on, to obtain the processing results of the general obfuscation strategy in Table 1 above, and the obfuscation of the class file names is realized.
[0116] In the embodiments of the present application, in order to reduce the probability of the same-named code files appearing in the note ability sharing library and application files, a directional obfuscation strategy different from the general obfuscation strategy can be adopted to obfuscate the class file names in the original file package. As can be seen from the processing results of the directional obfuscation strategy in Table 1 above, each string separated by a delimiter after obfuscation includes the fixed string "penkit", that is, the replacement strings used in the directional obfuscation strategy all have the fixed string "penkit". For example, the general obfuscation strategy can be first adopted to perform initial obfuscation processing on the class file names in the original file package, then the lowercase characters in the file names after initial obfuscation processing are converted into uppercase characters, and the fixed string "penkit" is added before the converted uppercase characters, so as to obtain the final obfuscation processing result.
[0117] According to Figure 3 and Table 1 above, it can be seen that the file names obtained after obfuscation processing using the general obfuscation strategy and the directional obfuscation strategy provided in the embodiments of the present application are quite different, and the probability of the same name is relatively low. Therefore, adopting the directional obfuscation strategy to obfuscate the original code file names of the note ability sharing library can reduce the probability of the same-named code files appearing in the note ability sharing library and application files, and thus can, to a certain extent, avoid the possible overwriting of code files during the process of loading application files and the note ability sharing library.
[0118] 2) Hierarchical management
[0119] The note ability open framework in the embodiments of the present application can adopt a hierarchical management mechanism. The hierarchical management mechanism includes a horizontal management mechanism and a vertical management mechanism.
[0120] For example, for independent functional modules, a horizontal management mechanism is adopted to ensure that all capabilities can be relatively independent and can be used separately when in use, so that sufficient expandable space can be reserved.
[0121] For another example, for general operation logics, a vertical management mechanism can be adopted so that each independent functional module can share these general operation logics. For example, these general operation logics are encapsulated in each independent functional module to ensure business coherence. Among them, the general operation logics can include layer management, operation management, screenshot operation, touch event control, and gesture recognition, etc.
[0122] In the embodiments of the present application, by adopting the hierarchical management mechanism, the relevant capabilities of text editing can be carried by different layers, and the capabilities of each layer can be used and managed through general operation logics.
[0123] As an example, the above functional modules managed by the horizontal management mechanism can also be designed using the adapter pattern. The adapter pattern is a structural design pattern that allows incompatible objects to be converted into compatible interfaces, enabling incompatible interfaces to work properly without changing the existing code by creating an intermediate conversion adapter to convert an object into the interface required by the business. That is, corresponding adapters can be created in advance for the above functional modules to convert the above functional modules into corresponding interfaces. In this way, the accessed APP can manage its own content according to the adapter list without paying attention to the capabilities of the note capability sharing library. When the corresponding capabilities are needed, the corresponding layer can be enabled.
[0124] Please refer to Figure 4 , Figure 4 which is a schematic logical structure diagram of a note capability sharing library provided by an embodiment of the present application. As Figure 4 shown, the note capability sharing library may include an element editing layer, a handwriting editing layer, a synthesis layer, and a background layer, and these layers can be managed using a horizontal management mechanism. Among them, the element editing layer is the editing position of the synthesis layer, and corresponding elements can be inserted according to element editing operations, and the inserted elements can be modified or deleted, etc. The handwriting editing layer is used to draw corresponding handwriting strokes according to handwriting operations. The synthesis layer is used to display the elements edited by the element editing operations, such as text boxes, pictures, or formulas, etc. The background layer is used to set the file to be edited as the editing background, and the file to be edited can be a document, a picture, a sticker book, or a control, etc. The document can be a document in PDF format, text format, or word format, etc., and the control can be a user control, an extended control, or a custom control.
[0125] As an example, the layer positions of these layers are, from top to bottom, the handwriting editing layer, the synthesis layer, and the background layer. The element editing layer can be triggered according to the user's element editing operation and is displayed above other layers for the user to perform element editing; after the user finishes editing, the element editing layer is displayed below the handwriting editing layer and becomes the synthesis layer, so as to avoid the elements in the element editing layer blocking the handwriting strokes in the handwriting editing layer. It should be understood that the element editing layer can also be displayed above the handwriting editing layer according to pre-configuration or user operations, such as displaying the element editing layer above other layers according to the user's layer topmost operation or layer up operation, and the embodiments of the present application do not limit this. The background layer is displayed below other layers to configure the file to be edited as the editing background of other layers, facilitating the user to perform secondary editing with the file to be edited as the background. In a possible implementation manner, the editing background of the background layer can be set in an injected form, and a maintenance interface based on the life cycle can also be provided for the background layer.
[0126] As Figure 4 shown, the note-taking ability sharing library may further include general operation logics managed by a vertical management mechanism: a layer management module and an operation management module. Among them, the layer management function is used to manage the related functions of the layer, such as managing one or more of the following functions of the layer: visibility configuration of the layer, editability configuration of the layer, and copying of layer elements. That is, according to the layer management function, any of the above layers can be set to visible or invisible, or set to editable or non-editable, and the elements in the layer can be copied, etc. Among them, the operation management function is used to manage the operations in the layer, such as one or more of the following management operations: operation push, operation pop, and data disk write. That is, the operations on the layer can be managed using a stack storage structure. After the user performs an operation on the layer, the executed operation can be pushed or popped onto the stack. By pushing an operation onto the stack, the recording of the operation can be achieved, and by popping an operation off the stack, the undo and recovery of the operation can be achieved. Data disk write means storing the relevant data of the operation. It should be understood that the general operation logic may further include other operation logics, such as logic modules for implementing screenshot operations, touch event control, and gesture recognition.
[0127] As Figure 4 shown, the note-taking ability sharing library may further include a cross-layer operation control module, a canvas size management module, a paging management module, etc., which are not limited in the embodiments of the present application. Among them, the cross-layer operation control module is used to provide cross-layer operation capabilities, such as the ability to copy or paste elements across layers.
[0128] In the embodiments of the present application, one or more of the above element editing layer, handwritten editing layer, composite layer, and background layer can be combined into a canvas for text editing. The canvas size management module is used to manage the size of the canvas and can provide the ability to enlarge or reduce the size of the canvas. For example, the canvas size management module can manage the size of the canvas according to preset canvas parameters or the user's canvas size setting operation. Among them, the canvas size setting operation can be a configuration operation for canvas size parameters, such as configuring the width parameter and / or height parameter of the canvas through a relevant setting interface. Or, the canvas size setting operation can be an operation to enlarge or reduce the canvas, such as enlarging or reducing the size of the canvas by dragging the boundary of the canvas. Of course, the size of the canvas can also be enlarged or reduced through other operations, which are not limited in the embodiments of the present application.
[0129] As an example, the note-taking ability sharing library can also provide the ability to bind the canvas to the background layer, and operations such as zooming in or out of the canvas and sliding the canvas can be synchronized to the background layer. For example, the background layer can be zoomed in or out according to the zooming in or out operation of the canvas, and the background layer can be scrolled and displayed according to the sliding of the canvas. For instance, the background layer can be scrolled upward for display according to the downward sliding operation of the user on the canvas, and scrolled downward for display according to the upward sliding operation of the user on the canvas.
[0130] It should be noted that the embodiment of the present application also provides a paging management function for the canvas. The paging management function is used to provide the ability to page the canvas, so that the canvas can be divided into multiple pages, and each of these multiple pages includes one or more of the above-mentioned layers, and the corresponding functions can be implemented through the above-mentioned layers. For example, the paging management function can determine the number of pages of the canvas according to the number of pages of the file to be edited, so as to page the canvas according to the determined number of pages. For another example, the paging management function can add a page to the canvas according to the user's page addition operation.
[0131] In the embodiment of the present application, the note-taking ability sharing library provides the ability to set the editing background for the application by providing a background layer, such as the ability to customize the background. By providing a paging management module, the ability to insert pages is opened for the application. By providing the ability to bind the canvas to the background layer, the ability to zoom in, zoom out or slide and display the editing background according to the canvas operation is opened for the application.
[0132] Please refer to Figure 5 , Figure 5 which is a schematic diagram of canvas paging provided by the embodiment of the present application. As shown in the canvas 10 in Figure 5 , when the PDF document to be edited has 2 pages of documents, the canvas can be divided into two pages. The editing background of page 1 is the first page of the PDF document, and the editing background of page 2 is the second page of the PDF document. In addition, page addition controls can be displayed between each page, and before the first page and after the last page. The page addition control is used to trigger the paging management function to add a page to the canvas. For example, if the user wants to add a blank page between page 1 and page 2 to record notes on the blank page, the user can click the page addition control between page 1 and page 2. As shown in the canvas 20 in Figure 5 , in response to the user's click operation, the paging management function can add 1 page (page 3) between page 1 and page 2, and the editing background of page 3 is a blank background. It should be noted that Figure 5Each page in it includes one or more of the above-mentioned layers. For example, each page includes a handwriting editing layer, an element editing layer, and a background layer. For example, the editing background set for the background layer of page 1 in the canvas 20 is the first page of the PDF document, the editing background set for the background layer of page 2 is the second page of the PDF document, and the background layer of page 3 has no editing background or the set editing background is a blank page. In addition, for each page, through the layer management module, the user can also configure any layer on the page to be visible or invisible to display or hide the layer; or, configure any layer on the page to be uneditable or editable to lock or unlock the layer. It should be understood that the text editing function can also be implemented through the note ability sharing library, and the embodiments of the present application will not list them one by one here.
[0133] The following describes the specific implementation process of the note ability opening method provided by the embodiments of the present application with reference to the accompanying drawings.
[0134] Figure 6 is a schematic flowchart of a note ability opening method provided by the embodiments of the present application, and this method can be executed by an electronic device. The hardware structure diagram of the electronic device can be as Figure 1 shown, and the software structure block diagram of the electronic device can be as Figure 2 shown, but the embodiments of the present application are not limited to this.
[0135] Step 601: The developer imports SDK 1 and the corresponding SDK identifier in the note APP.
[0136] In the embodiments of the present application, in order to enable the note APP to use the capabilities opened by the note ability sharing library at the underlying layer of the terminal system, when developing the note APP, the developer can import SDK 1 and the corresponding SDK identifier in the note APP according to business requirements.
[0137] Among them, SDK 1 is the SDK corresponding to the note ability sharing library at the underlying layer of the terminal system and is used to call the note ability sharing library. SDK 1 can provide multiple interfaces, and these multiple interfaces are used to call different capabilities of the note ability sharing library. The multiple interfaces of SDK 1 can be set according to business requirements to call the capabilities provided by the note ability sharing library that can meet business requirements through these multiple interfaces. The SDK identifier of SDK 1 can be the name or ID of SDK 1, etc., and the embodiments of the present application do not limit this.
[0138] It should be noted that the embodiments of the present application only take the developer developing the note APP based on the note ability sharing library at the underlying layer of the terminal system as an example for illustration. It should be understood that the note APP can also be replaced by other APPs, and the embodiments of the present application do not limit this.
[0139] Step 602: The developer publishes the note APP to the app store.
[0140] After the developer finishes developing the note APP, the developed note APP can be published for users to download and install. It should be noted that in this embodiment of the application, only the example of publishing the note APP to the app store is used for illustration. It should be understood that the note APP can also be published to other downloadable locations, such as the website corresponding to the note APP, etc.
[0141] Step 603: The user uses the terminal to download and install the note APP from the app store.
[0142] Step 604: After the note APP is started, an APP process is created.
[0143] After the note APP is installed, the user can start the note APP. For example, the user can start the note APP by clicking the icon of the note APP. In response to the user's operation of starting the note APP, the terminal can start the note APP.
[0144] After the note APP is started, the note APP can create a corresponding APP process.
[0145] Step 605: The PMS in the application framework layer detects the SDK identifier of SDK1 integrated in the note APP.
[0146] Step 606: The PMS loads the one in the application framework layer into the APP process of the note APP.
[0147] After the note APP is started, if the PMS in the application framework layer detects the SDK identifier of SDK1 integrated in the note APP, it can load the note capability sharing library in the application framework layer into the APP process of the note APP, so that the note APP can directly use the capabilities of the note capability sharing library in its own APP process, thereby reducing the latency of the note APP using the text editing capability of the terminal and improving the text editing efficiency.
[0148] In addition, after the note APP is started, the PMS can also load the application files of the note APP in the APP process. For example, the PMS can use the class loader 1 in the application framework layer to load the application files of the note APP into the APP process, and use the class loader 2 in the application framework layer to load the note capability sharing library into the APP process.
[0149] It should be noted that the PMS can load the application files first and then load the note capability sharing library, or load the note capability sharing library first and then load the application files, or load both synchronously. This embodiment of the application does not limit the loading sequence of the two.
[0150] Step 607: In the APP process, initialize the note capability sharing library by calling Interface 1 provided by SDK 1.
[0151] After the note capability sharing library is loaded into the APP process, the note APP can call Interface 1 provided by SDK 1 in the APP process to initialize the note capability sharing library through Interface 1. Among them, Interface 1 is the initialization interface of the note capability sharing library.
[0152] In the embodiments of this application, the initialization operation for initializing the note capability sharing library may include one or more of the following operations: setting the storage directory of the note file, implementing the storage monitoring of attachments, initializing the paging management module, initializing the canvas for text editing, displaying the canvas on the application interface of the note APP, and initializing the text editing parameters.
[0153] Among them, implementing the storage monitoring of attachments means configuring the monitoring of storage events of attachments such as note files to achieve data synchronization. Initializing the paging management module includes initializing parameters such as the paging quantity of the paging management module. Initializing the canvas for text editing may include synthesizing the canvas according to each initialized layer, for example, synthesizing the canvas according to the initialized element editing layer, handwriting editing layer, and background layer. Initializing the text editing parameters may include initializing the relevant parameters of the element editing layer and / or the handwriting editing layer, such as the pen shape and other parameters of the handwriting editing layer.
[0154] As an example, the above initialization operation may further include setting the editing background of the background layer. For example, when the file to be edited is not loaded, the blank background can be set as the editing background of the background layer; when the file to be edited is loaded, the file to be edited is set as the editing background of the background layer. For the sake of understanding, the embodiments of this application will take the scenario where the file to be edited has not been loaded during the initialization process as an example for description.
[0155] Please refer to Figure 7 , Figure 7 which is a schematic flowchart for initializing the note capability sharing library provided by the embodiments of this application. As shown in Figure 7As shown, after the note capability sharing library is loaded into the APP process, the note APP can call the initialization interface provided by SDK1 to set the storage directory of the note file, implement the storage monitoring of attachments, initialize the paging management module, set the custom background, set the canvas, and initialize the text editing parameters. Among them, the operation of setting the custom background may include: determining the background adapted to the background layer and injecting the adapted background into the background layer. The operation of setting the canvas may include: reading the canvas from the note capability sharing library and displaying the read canvas on the application interface of the note APP. The operation of initializing the text editing parameters may include: calling the relevant interface and setting parameters such as the pen shape through the relevant interface. Among them, setting the canvas is an optional operation.
[0156] Step 608: Display a canvas for text editing on the application interface of the note APP.
[0157] Among them, the canvas may include one or more of an element editing layer, a handwritten editing layer, a composite layer, and a background layer. For example, the canvas can be obtained by synthesizing the above layers.
[0158] Step 609: In response to the user's selection operation on Document 1, load Document 1 in the APP process.
[0159] Among them, Document 1 is the document to be text-edited selected by the user. It should be understood that Document 1 can also be other files to be edited, such as pictures or handwritten records, etc.
[0160] As an example, the note APP can provide an entry for the user to select the file to be edited, and the user can select one or more files from the local files as the files to be edited through this entry.
[0161] Step 610: In the APP process, set Document 1 as the background of the canvas by calling Interface 2 provided by SDK 1.
[0162] Among them, Interface 2 can be the capability opening interface of the background module for calling the background module. Through Interface 2, Document 1 can be set as the editing background of the background layer in the canvas, so that the user can perform text editing with Document 1 as the background, thereby realizing the secondary editing of Document 1.
[0163] Step 611: In response to the user's text editing operation on the canvas, in the APP process, call the initialized note capability sharing library by calling the relevant interface provided by SDK 1 to implement the corresponding text editing function.
[0164] Among them, the text editing operation can be a handwriting editing operation or an element editing operation, etc., and the embodiments of the present application do not limit this. For different operations, different interfaces provided by the SDK 1 can be called to call different capabilities of the note capability sharing library to implement the corresponding text editing functions.
[0165] In one embodiment, the canvas may include multiple pages, and each page is composed of one or more of the following layers: an element editing layer, a handwriting editing layer, a composite layer, and a background layer. For example, after loading Document 1, the canvas can be paged according to the number of pages of Document 1 to split the canvas into corresponding numbers of pages. For instance, if Document 1 has n pages, the canvas can be split into n pages, and the backgrounds of the n pages correspond one by one to the n pages of Document 1.
[0166] In one embodiment, the user can also continue to add pages to the canvas. In response to the page addition operation on the canvas, the note APP can display the added pages on the canvas. The editing background of the background layer of the added pages can be a blank background or the page of Document 1. For example, please refer to Figure 5 , the user can click the page addition control on the canvas to add a page to the canvas.
[0167] Step 612: In response to the user's save operation, save the edited Document 1 in the note file format.
[0168] After the user finishes editing Document 1 through the note APP, the edited Document 1 can be saved. For example, it can be saved by clicking the save control provided by the note APP.
[0169] In the embodiments of the present application, for the edited Document 1, the note APP can save it as a new file independent of the original Document 1. For example, save the edited Document 1 in the note file format. It should be understood that it can also be saved in other file formats, and the embodiments of the present application do not limit this. For instance, the edited Document 1 can be saved to the storage location corresponding to the storage directory of the note file set during the initialization process.
[0170] In the embodiments of the present application, for the note capability sharing library opened to the outside by the system underlying layer, the note capability sharing library of the system underlying layer can be loaded into the APP process so that the APP can use the capabilities of the note capability sharing library in its own APP process to implement the text editing function. In this way, the latency of the APP using the text editing capability of the terminal can be reduced, and the text editing efficiency can be improved.
[0171] The present application also provides a chip, which is coupled to the memory. The chip is used to read and execute the computer program or instructions stored in the memory to execute the methods in the above embodiments.
[0172] The present application also provides an electronic device, which includes a chip for reading and executing a computer program or instruction stored in a memory, so that the methods in the embodiments are executed.
[0173] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute the above-related method steps to implement the method in the above embodiment.
[0174] This embodiment also provides a computer program product. The computer-readable storage medium stores program code. When the computer program product runs on a computer, the computer is caused to execute the above-related steps to implement the method in the above embodiment.
[0175] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor may execute the computer execution instructions stored in the memory, so that the chip executes the methods in the above method embodiments.
[0176] Among them, the electronic device, the computer-readable storage medium, the computer program product or the chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved may refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.
[0177] The embodiment of the present application does not particularly limit the specific structure of the execution subject of the method provided in the embodiment of the present application. As long as it can run a program recording the code of the method provided in the embodiment of the present application to perform text editing according to the method provided in the embodiment of the present application. For example, the execution subject of the method provided in the embodiment of the present application may be an electronic device, or a functional module in the electronic device that can call and execute the program.
[0178] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other may be through some interfaces. The indirect coupling or communication connection of the device or unit may be in an electrical, mechanical or other form.
[0179] The unit described as a separation component may or may not be physically separated, and the component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0180] In addition, each functional unit in various embodiments of the present application can be integrated into one processing unit, can exist separately as individual physical units, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium may include, but is not limited to: USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs and other media that can store program codes.
[0182] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A note-taking ability open framework, characterized in that The described note ability open framework includes a note ability sharing library pre-set in the operating system of the electronic device. The note ability sharing library is used to provide text editing ability for any application, and the note ability sharing library includes at least one of a handwriting ability module and an element ability module; The handwriting ability module is used to provide handwriting editing ability for the application, and the handwriting editing ability refers to the ability to draw corresponding handwriting according to handwriting operations; The element ability module is used to provide element editing ability for the application, and the element editing ability refers to the ability to insert corresponding elements according to element editing operations.
2. The frame according to claim 1, wherein The note ability sharing library includes at least one code file, and the at least one code file is used to implement the abilities of the handwriting ability module and / or the element ability module. The file name of the at least one code file is obtained by obfuscating the original file name of the at least one code file using a first obfuscation strategy, and the first obfuscation strategy is different from the second obfuscation strategy used for the file names of the code files of the application.
3. The frame according to claim 2, wherein The file name obtained by obfuscating using the first obfuscation strategy has a fixed string.
4. The frame according to any one of claims 1-3, characterized in that, The note ability sharing library further includes a service management module, and the service management module is used to provide service management ability for the text editing service of the application.
5. The frame according to any one of claims 1-4, characterized in that, The note ability sharing library further includes a background module, and the background module is used to set the file to be edited by the application as the editing background.
6. The framework according to any one of claims 1-5, characterized in that The handwriting ability module is used to provide a handwriting editing layer for the application, and the handwriting editing layer is used to draw corresponding handwriting according to handwriting operations; The element ability module is used to provide an element editing layer for the application, and the element editing layer is used to insert corresponding elements according to element editing operations.
7. The frame according to claim 6, characterized in that, The note ability sharing library further includes a service management module, and the service management module is used to provide layer management functions and operation management functions for the layer; Among them, the layer management function is used to manage one or more of the following functions of the layer: the visible function of the layer, the editable function of the layer, and the element copying function of the layer; Among them, the operation management function is used to manage one or more of the following operations in the layer: operation push, operation pop, and data disk write.
8. The frame according to claim 6 or 7, characterized in that, The note ability sharing library further includes a background module; The background module is used to provide a background layer for the application, and the background layer is used to set the file to be edited by the application as the editing background, and the background layer is located below the handwriting editing layer and the element editing layer.
9. The frame according to any one of claims 6-8, characterized in that, At least one layer provided by the note ability sharing library is used to synthesize a canvas corresponding to the file to be edited by the application, and the note ability sharing library further includes a paging management module; The paging management module is used to page the canvas, and each page includes one or more layers provided by the note ability sharing library.
10. The frame according to any one of claims 6-9, characterized in that, The note ability sharing library further includes a cross-layer operation control module; The cross-layer operation control module is used to provide cross-layer operation ability for the application.
11. The frame according to any one of claims 1 to 10, characterized in that, The note-taking ability open framework further includes an application management module pre-installed in the operating system of the electronic device; The application management module is used to load the note-taking ability shared library into the application process of the application.
12. The frame according to claim 11, characterized in that, The application management module is used to load the note-taking ability shared library into the application process of the application when it detects that the application integrates a target SDK, and the target SDK is used to call the note-taking ability shared library.
13. A method for opening note-taking capabilities, characterized in that, Applied to an electronic device, the electronic device installs a first application, and the operating system of the electronic device includes a note-taking ability shared library and an application management module. The note-taking ability shared library is used to provide text editing ability for any application. The method includes: After the first application is started, the application management module loads the note-taking ability shared library into the application process of the first application; In the application process, the first application realizes the text editing function through the loaded note-taking ability shared library.
14. The method according to claim 13, wherein After the first application is started, the application management module loads the note-taking ability shared library into the application process of the first application, including: After the first application is started, if the application management module detects that the first application integrates a target SDK, it loads the note-taking ability shared library into the application process of the first application, and the target SDK is used to call the note-taking ability shared library.
15. The method according to claim 14, wherein In the application process, the first application realizes the text editing function through the loaded note-taking ability shared library, including: In the application process, the first application calls the note-taking ability shared library through the target SDK, and realizes the text editing function through the called note-taking ability shared library.
16. The method according to claim 15, wherein The realization of the text editing function through the called note-taking ability shared library includes: In the application process, the first application displays a canvas for text editing on the application interface through the called note-taking ability shared library. The canvas is generated by superimposing one or more of the following layers: An element editing layer, which is used to insert corresponding elements according to element editing operations; A handwriting editing layer, which is used to draw corresponding handwriting strokes according to handwriting operations; A background layer, which is used to set the file to be edited as the editing background.
17. The method according to claim 16, characterized in that, The canvas includes multiple pages, and each page is generated by superimposing one or more of the following layers: the element editing layer, the handwriting editing layer, and the background layer.
18. The method according to claim 17, wherein The file to be edited includes at least one page, and the background layer of at least one page among the multiple pages is used to set the at least one page as the editing background respectively.
19. The method according to any one of claims 16-17, characterized in that, The method further includes: In response to a page addition operation on the canvas, a added page is displayed on the canvas, and the background of the background layer of the added page is the page of the file to be edited or a blank background.
20. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program includes the note-taking ability open framework according to any one of the above claims 1-12.
21. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the method according to any one of claims 13 to 19 is implemented.
22. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium. When it runs on a computer, the computer is caused to execute the method according to any one of claims 13 to 19.
Citation Information
Patent Citations
Note-taking generation method, electronic device, and computer storage medium
CN109085965A
Memo information collection method and device, electronic equipment and storage medium
CN114117269A
Display method of annotation box, electronic equipment and readable storage medium
CN116719459A
Device, method and graphical user interface for handwritten interaction
WO2017031048A1
Tiled display method, electronic device, and system
WO2022179390A1