Method and device for generating cutting path, electronic equipment and program product

By converting the text of the cropped page into cropping instructions supported by multiple operating systems, the problem of unified support for cropping functions among multiple operating systems in the prior art is solved, and the flexibility and efficiency of page cropping is improved.

CN119902766APending Publication Date: 2025-04-29BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510096889.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The prior art is difficult to support page cropping functions uniformly among multiple operating systems, resulting in low cropping flexibility and efficiency.

Method used

By obtaining the crop page text input by the developer and converting it according to a predefined data protocol, cropping instructions that can be supported by multiple development components of different operating systems are generated, thereby generating the cropping path of the page.

Benefits of technology

It realizes multi-operating system adaptation of cropping standards, improving the flexibility and efficiency of page cropping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902766A_ABST
    Figure CN119902766A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a method and device for generating a cutting path, electronic equipment and a program product. The method includes obtaining text for clipping a page, the text being organized according to a grammar of a standard interface of a clipping operation. The method further includes converting the text according to a predefined data protocol to generate a clipping instruction that can be supported by a plurality of development components for different operating systems. In addition, the method also includes executing, by a development component for the operating system, a clipping instruction to generate a clipping path for the page. Through the mode, the text statement based on the cutting standard can be converted into the cutting instruction which can be supported by the multiple development components of the different operating systems at the same time, so that the cutting standard can be suitable for the multiple operating systems, the flexibility of cutting the pages of the multiple operating systems is improved, and the page cutting efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates generally to the field of computers, and more particularly, to a method, apparatus, electronic device, and program product for generating a clipping path. Background Art

[0002] With the continuous development of terminal application development technology, achieving complex and flexible visual effects has gradually become an important part of user experience. As a capability to control the content display area, cropping technology is widely used in user interface, image processing, animation effects and other fields.

[0003] In the page development task, the cropping operation can hide part of the page elements so that only the visible area of ​​the page is displayed. Through the cropping operation, developers can flexibly control the cropping area of ​​page elements to achieve complex page layouts and visual effects. Therefore, how to crop pages accurately and efficiently is an important issue in the field of page development. Summary of the invention

[0004] In an embodiment of the present disclosure, a method, an apparatus, an electronic device, and a program product for generating a clipping path are provided.

[0005] In a first aspect of the present disclosure, a method for generating a clipping path is provided. The method includes obtaining text for clipping a page, the text being organized according to the syntax of a standard interface for clipping operations. The method also includes converting the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems. In addition, the method also includes executing the clipping instruction by the development component for the operating system to generate a clipping path for the page.

[0006] In a second aspect of the present disclosure, a device for generating a clipping path is provided. The device includes a text acquisition module configured to acquire text for clipping a page, the text being organized according to the syntax of a standard interface for clipping operations. The device also includes a text conversion module configured to convert the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems. In addition, the device also includes a clipping path generation module configured to execute the clipping instruction by a development component for the operating system to generate a clipping path for the page.

[0007] In a third aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory coupled to the processor, wherein the memory has instructions stored therein, and when the instructions are executed by the processor, the electronic device executes the method according to the first aspect.

[0008] In a fourth aspect of the present disclosure, a computer program product is provided, comprising computer executable instructions, wherein the computer executable instructions are executed by a processor to implement the method according to the first aspect.

[0009] In a fifth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are executed by a processor to implement the method according to the first aspect.

[0010] The purpose of this Summary is to introduce a selection of concepts in a simplified form that are further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0012] Figure 1 A schematic diagram illustrating an example environment in which some embodiments of the present disclosure may be implemented;

[0013] Figure 2 A flowchart of a method for generating a clipping path according to some embodiments of the present disclosure is shown;

[0014] Figure 3 A schematic diagram showing a process for clipping a page according to some embodiments of the present disclosure;

[0015] Figure 4 A schematic diagram showing multiple clipping paths of some embodiments of the present disclosure;

[0016] Figure 5 A block diagram showing an apparatus for generating a clipping path according to some embodiments of the present disclosure; and

[0017] Figure 6 A block diagram of an electronic device according to some embodiments of the present disclosure is shown.

[0018] Throughout the drawings, the same or similar reference numbers denote the same or similar elements. DETAILED DESCRIPTION

[0019] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0021] For example, when receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0025] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects, unless explicitly stated. Other explicit and implicit definitions may also be included below.

[0026] As mentioned above, how to perform page clipping accurately and efficiently is an important issue in the field of page development. In page development, relevant development standards, such as Cascading Style Sheets (CSS), provide a wealth of clipping functions, allowing developers to define clipping areas by shape or path. However, relevant development standards are often targeted at specific development fields, such as Cascading Style Sheets are often targeted at the field of computer web page development. For other development fields outside of specific development fields, such as the field of mobile terminal page development, relevant development standards often cannot be uniformly supported. Specifically, the native platforms and mainstream cross-platform frameworks in other development fields have great limitations in supporting clipping functions, and cannot achieve clipping capabilities consistent with the above-mentioned development standards, resulting in the above-mentioned development standards being unable to be uniformly adapted to multiple development fields, and the flexibility of multi-field page clipping is poor, which in turn leads to low efficiency of page clipping.

[0027] In an embodiment of the present disclosure, firstly, a text for clipping a page input by a developer is obtained, wherein the text is organized according to the syntax of a standard interface for clipping operations. Then, the obtained text is converted according to a pre-set data protocol, thereby obtaining clipping instructions that can be adapted to multiple development components of different operating systems. Further, a development component among the multiple development components executes the clipping instructions, thereby generating a clipping path for clipping a page. In this way, a text statement based on a clipping standard can be converted into a clipping instruction that can be supported by multiple development components of different operating systems at the same time, so that the clipping standard can be applied to multiple operating systems, thereby improving the flexibility of clipping pages of multiple operating systems, and further improving the efficiency of page clipping.

[0028] Figure 1 A schematic diagram of an example environment 100 is shown in which some embodiments of the present disclosure may be implemented. Figure 1 , the example environment 100 includes a development platform 102 and a terminal 114, wherein the development platform 102 can be set as a computing system, a single server, a distributed server, or a cloud-based server, etc., and the terminal 114 can be set as a personal computer, a mobile phone, a tablet computer, etc. In some embodiments, the development platform 102 is provided with a multi-system development component 104 and a parser 112, and the multi-system development component 104 is provided with a plurality of development components corresponding to a plurality of operating systems, such as a development component 106 corresponding to a first operating system, a development component 108 corresponding to a second operating system, and a development component 110 corresponding to a third operating system.

[0029] In some embodiments, the parser 112 of the development platform 102 can obtain the text for cutting the page input by the developer, wherein the text is organized by the developer according to the syntax of the standard interface of the cutting operation. For example, the parameters related to the cutting page can be transmitted to the standard interface to obtain the text for cutting the page. Then, the parser 112 parses the text input by the developer and converts the text into a cutting instruction supported by the development component 106 corresponding to the first operating system, the development component 108 corresponding to the second operating system, and the development component 110 corresponding to the third operating system according to the predefined data protocol.

[0030] After converting and obtaining the clipping instruction, the parser 112 transmits the clipping instruction to the multi-system development component 104 in the development platform 102, and the multi-system development component 104 executes the clipping instruction. For example, if the operating system in the terminal 114 is the first operating system, the development component 106 corresponding to the first operating system can execute the clipping instruction to generate a clipping path. Further, the development component 106 corresponding to the first operating system can send the generated clipping path to the terminal 114, so that the terminal 114 clips the page based on the clipping path and renders it for display.

[0031] In the embodiment of the present disclosure, first, the parser 112 obtains the text for cutting the page input by the developer, wherein the text is organized according to the syntax of the standard interface of the cutting operation. Then, the parser 112 converts the obtained text according to the pre-set data protocol, thereby obtaining the cutting instructions of the multi-system development component 104 that can be adapted to different operating systems. Further, the development component (such as the development component 106) in the multi-system development component 104 executes the cutting instructions to generate a cutting path for cutting the page. In this way, the text statement based on the cutting standard can be converted into a cutting instruction that can be supported by multiple development components of different operating systems at the same time, so that the cutting standard can be applied to multiple operating systems, thereby improving the flexibility of cutting pages of multiple operating systems, and then improving the efficiency of page cutting.

[0032] Figure 2 FIG. 2 is a flowchart of a method 200 for generating a clipping path according to some embodiments of the present disclosure. In some embodiments, the method 200 for generating a clipping path may be Figure 1 It should be understood that the development platform 102 can be set as a computing system, a single server, a distributed server, or a cloud-based server, etc.

[0033] At block 202, text for clipping a page is obtained, and the text is organized according to the syntax of the standard interface for clipping operations. In some embodiments, the parser 112 of the development platform 102 can obtain text for clipping a page input by a developer, wherein the text is organized by the developer according to the syntax of the standard interface for clipping operations. For example, parameters related to the clipping page can be transmitted to the standard interface to obtain the text for clipping a page.

[0034] At block 204, the text is converted according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems. In some embodiments, the parser 112 parses the text input by the developer and converts the text into a clipping instruction that can be supported by the development component 106 corresponding to the first operating system, the development component 108 corresponding to the second operating system, and the development component 110 corresponding to the third operating system according to the predefined data protocol.

[0035] At block 206, the development component for the operating system executes the clipping instruction to generate a clipping path for the page. In some embodiments, after converting the clipping instruction, the parser 112 passes the clipping instruction to the multi-system development component 104 in the development platform 102, and the multi-system development component 104 executes the clipping instruction. For example, if the operating system in the terminal 114 is the first operating system, the development component 106 corresponding to the first operating system can execute the clipping instruction to generate a clipping path.

[0036] In an embodiment of the present disclosure, firstly, a text for clipping a page input by a developer is obtained, wherein the text is organized according to the syntax of a standard interface for clipping operations. Then, the obtained text is converted according to a pre-set data protocol, thereby obtaining clipping instructions that can be adapted to multiple development components of different operating systems. Further, a development component among the multiple development components executes the clipping instructions, thereby generating a clipping path for clipping a page. In this way, a text statement based on a clipping standard can be converted into a clipping instruction that can be supported by multiple development components of different operating systems at the same time, so that the clipping standard can be applied to multiple operating systems, thereby improving the flexibility of clipping pages of multiple operating systems, and further improving the efficiency of page clipping.

[0037] Figure 3 FIG. 3 is a schematic diagram of a process 300 for clipping a page in some embodiments of the present disclosure. In some embodiments, the process 300 for clipping a page may be performed by Figure 1The development platform 102 (including the multi-system development component 104 and the parser 112) and the terminal 114 are executed. It should be understood that the development platform 102 can be set as a computing system, a single server, a distributed server, or a cloud-based server, etc. Among them, box 302 can be executed by the interactive device of the development platform 102, box 304, box 314-box 318, and box 322 are executed by the multi-system development component 104, box 306-box 312 are executed by the parser 112, and box 320, box 324-box 326 are executed by the terminal 114.

[0038] At box 302, the interactive device sets the clipping style. The interactive device is a device that interacts with the developer, and the developer can enter text in the interactive device to set the style that needs to be clipped. In some embodiments, the present disclosure provides a standard interface for predefined clipping operations, such as a standard interface for cascading style sheets. Through the grammatical rules of the standard interface, the developer can set relevant parameters into the interface to set the clipping style, such as a clipping style based on scalable vector graphics or a clipping style based on geometric figures. In some embodiments, the standard interface can be, for example, clip-path:path, clip-path:inset. The text entered by the developer for setting the clipping style is as follows: clip-path:path("M 10 80C 40 10,65 10,95 80S150 150,180 80"); clip-path:inset(30pxsuper-ellipse 3 3 50px / 50px).

[0039] At block 304, the development component in the multi-system development component 104 receives the clipping style. In some embodiments, after receiving the text of the clipping style, the interactive device sends the text of the clipping style to the development component in the multi-system development component 104. For example, if the terminal 112 runs a first operating system, the development component 106 corresponding to the first operating system receives the text of the clipping style. Since the development component 106 cannot support the syntax of the standard interface, the development component 106 first sends the text of the clipping style to the parser 112 for parsing.

[0040] At box 306, the parser 112 receives a cropping style. At box 308, the parser 112 parses the style string, that is, parses the text of the cropping style. In some embodiments, the parser 112 may first determine the cropping attributes and corresponding attribute values ​​in the text of the cropping style, wherein the cropping attributes are used to identify a specific cropping operation. For example, in the above text, M represents the cropping attribute of the moving brush operation, C and S represent the cropping attributes of the curve drawing operation, and super-ellipse represents the super-ellipse drawing operation. The attribute value is the parameter of the cropping attribute, for example, 10 and 80 are the parameters of the cropping attribute M, which are used to indicate the position of the moving brush. Then, the parser 112 converts the cropping attribute into a first numerical value and converts the attribute value into a second numerical value according to a predefined data protocol. In this way, the text of the cropping style can be converted into a first numerical value and a second numerical value.

[0041] At box 310, the parser 112 serializes the data. In some embodiments, after converting the text of the cropping style into a first value and a second value, the parser 112 can serialize the first value and the second value to obtain an array containing multiple values, which can be used as a cropping instruction uniformly supported by multiple development components. In some embodiments, the first value can be placed at the first position of the array, and the second values ​​can be set in sequence after the first position. For example, the text circle (10px at 50% 50%) can be parsed into an array [1, 10, 1, 0.5, 0.5, 0], where 1 is the first value, representing the circular drawing operation circle, and 10, 1, 0.5, 0.5, 0 are the second values, 10 represents the radius, 1 represents the unit is px (pixel), the coordinates are (0.5, 0.5), and 0 represents the unit is percentage.

[0042] It should be understood that in order to ensure that the cropping instruction can be uniformly supported by multiple development components, it is necessary to ensure that the data protocol can be uniformly supported by multiple development components. In this way, the cropping instruction in array form can be quickly generated based on the data protocol, and the array is easily understood and supported by multiple development components, thereby improving the parsing efficiency of the cropping style text.

[0043] In some embodiments, when parsing the cropping attribute in the text, the parser 112 may first parse the parser into a corresponding cropping operation, for example, parsing the cropping attribute M in the above text into a move brush operation moveTo. Then, the parser 112 converts the cropping operation into a first value according to the data protocol. In some embodiments, in the data protocol, there is a mapping relationship between the cropping operation and the first value, through which the first value can be used to represent the cropping operation.

[0044] In some embodiments, the clipping operation may include a clipping operation based on scalable vector graphics and a clipping operation based on geometric figures. The clipping operation based on scalable vector graphics includes a brush moving operation, a straight line drawing operation, and a curve drawing operation, and the clipping operation based on geometric figures includes a rectangle drawing operation, a polygon drawing operation, a circle drawing operation, and an ellipse drawing operation.

[0045] In some embodiments, the text of the clipping style set by the developer may contain multiple clipping attributes and related attribute values. Therefore, the parser 112 may first determine multiple clipping attributes in the text. For example, for the text clip-path:path("M 10 80C 40 10,65 10,95 80S150 150,180 80"), the parser 112 may first determine the clipping attribute M, the clipping attribute C, and the clipping attribute S therein. Then, the parser 112 may segment the text according to the multiple clipping attributes, thereby obtaining a key-value pair of each clipping attribute and the attribute value belonging to the clipping attribute. For example, after segmenting the text clip-path:path("M 10 80C 40 10,65 10,95 80S150 150,180 80"), multiple key-value pairs (M 1080), (C 40 10,65 10,95 80), and (S150 150,180 80) can be obtained. In this way, the text can be segmented by clipping attributes first, which improves the parsing efficiency of the text.

[0046] At box 312, parser 112 sends data to the development component. In some embodiments, after parser 112 parses the text of the clipping style and obtains the clipping instruction in array form, the clipping instruction can be sent to the development component corresponding to the operating system of terminal 114 in multi-system development component 104, such as development component 106 (hereinafter described by taking development component 106 as an example). At box 314, development component 106 receives serialized data, i.e., the clipping instruction in array form. At box 316, development component 106 sets data for the clipping operation manager. In some embodiments, after receiving the clipping instruction, development component 106 passes the relevant data in the clipping instruction, i.e., the first data and the second data, into the clipping operation manager, thereby preparing to perform the clipping operation.

[0047] At box 318, the development component 106 requests drawing. In some embodiments, the development component 106 sends a request for rendering a page to the terminal 114, thereby asking whether the terminal 114 agrees to render the page. At box 320, the terminal 114 accepts the drawing request. In some embodiments, if the terminal 114 agrees to render, a response agreeing to render the page can be sent to the development component 106. At box 322, the development component 106 draws a clipping path. In some embodiments, after receiving the response agreeing to render the page sent by the terminal 114, the development component 106 executes the clipping instruction to generate a clipping path for the clipping operation. Then, the development component 106 sends the clipping path to the terminal 114. At box 324, the terminal 114 receives the clipping path. At box 326, the terminal 114 clips the page. In some embodiments, after receiving the clipping path, the terminal 114 can clip the page based on the clipping path.

[0048] In some embodiments, the clipping instruction executed by the development component 106 can be used as the first clipping instruction, and the clipping path generated can be used as the first clipping path. After completing the execution of the first clipping instruction, the development platform 102 can save the first clipping path to the storage unit. After obtaining the next clipping instruction (which can be used as the second clipping instruction), the development platform 102 can first determine whether the next clipping instruction is the same as the first clipping instruction. If the two are the same, the development platform 102 does not need to generate the next clipping path (which can be called the second clipping path), but can directly read the first clipping path from the storage unit and use it as the next clipping path. In this way, the development platform 102 can implement a path caching mechanism, thereby avoiding multiple operations on repeated clipping styles, thereby improving the performance of clipping operations. In addition, during the clipping process, the development platform 102 can use hardware to accelerate and optimize the rendering performance of complex paths.

[0049] In some embodiments, in the process of developing and rendering the page of the terminal 114, clipping operations that do not exist in the relevant standards may be involved, for example, there is no clipping operation related to super ellipse in the cascading style sheet. Therefore, in some embodiments, the parser 112 can first obtain the statement for the super ellipse drawing operation input by the developer, wherein the syntax format of the super ellipse drawing operation can be set by the developer. Then, the parser 112 converts the statement of the super ellipse drawing operation according to the data protocol, thereby obtaining a super ellipse drawing instruction that can be uniformly supported by multiple development systems in the multi-system development component 104, such as a super ellipse drawing instruction in array form.

[0050] Further, the parser 112 sends the generated superellipse drawing instruction to the multi-system development component 104, and the development component corresponding to the operating system of the terminal 114 in the multi-system development component 104 executes the superellipse drawing instruction, thereby generating a superellipse path of the page. For example, if the operating system in the terminal 112 is the second operating system, the superellipse drawing instruction is executed by the development component 108. In this way, the clipping operations supported in the standard library can be broadened, thereby increasing the diversity of page clipping.

[0051] Figure 4 Schematic diagram of multiple clipping paths 400 of some embodiments of the present disclosure is shown. In some embodiments, clipping path 402 is a circular clipping path, clipping path 404 is an elliptical clipping path, clipping path 406 is a superelliptical clipping path, and clipping path 408 is a clipping path based on scalable vector graphics, which can be obtained by a cubic Bezier curve. It should be understood that Figure 4 The clipping paths shown in FIG. 1 are merely examples of partial clipping paths in the present disclosure.

[0052] Figure 5 FIG. 5 is a block diagram of an apparatus 500 for generating a clipping path according to some embodiments of the present disclosure. Figure 5 The device 500 includes a text acquisition module 502, which is configured to acquire text for clipping a page, and the text is organized according to the syntax of the standard interface of the clipping operation. The device 500 also includes a text conversion module 504, which is configured to convert the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems. In addition, the device 500 also includes a clipping path generation module 506, which is configured to execute the clipping instruction by the development component for the operating system to generate a clipping path for the page.

[0053] It can be understood that the device 500 of the present disclosure can achieve at least one of the many advantages that can be achieved by the method or process described above. For example, the device 500 first obtains the text for cutting the page input by the developer, wherein the text is organized according to the syntax of the standard interface of the cutting operation. Then, the obtained text is converted according to the pre-set data protocol to obtain the cutting instructions that can be adapted to multiple development components of different operating systems. Further, the cutting instructions are executed by the development components in the multiple development components to generate a cutting path for cutting the page. In this way, the text statement based on the cutting standard can be converted into a cutting instruction that can be supported by multiple development components of different operating systems at the same time, so that the cutting standard can be applied to multiple operating systems, thereby improving the flexibility of cutting pages of multiple operating systems, and then improving the efficiency of page cutting.

[0054] Figure 6 1 is a block diagram of an electronic device 600 according to some embodiments of the present disclosure. The device 600 may be a device or apparatus described in the embodiments of the present disclosure. Figure 6 As shown, the device 600 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 602, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 604 or loaded from a storage unit 616 to a random access memory (RAM) 606. In the RAM 606, various programs and data required for the operation of the device 600 can also be stored. The CPU / GPU 602, the ROM 604, and the RAM 606 are connected to each other via a bus 608. An input / output (I / O) interface 610 is also connected to the bus 608. Although not shown in FIG. Figure 6 As shown in FIG. 6 , device 600 may further include a co-processor.

[0055] A number of components in the device 600 are connected to the I / O interface 610, including: an input unit 612, such as a keyboard, a mouse, etc.; an output unit 614, such as various types of displays, speakers, etc.; a storage unit 616, such as a disk, an optical disk, etc.; and a communication unit 618, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 618 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0056] The various methods or processes described above may be performed by the CPU / GPU 602. For example, in some embodiments, the methods may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 616. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 604 and / or the communication unit 618. When the computer program is loaded into the RAM 606 and executed by the CPU / GPU 602, one or more steps or actions in the methods or processes described above may be performed.

[0057] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0058] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0059] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0060] The computer program instructions for performing the disclosed operation may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, programming languages ​​including object-oriented programming languages, and conventional procedural programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In certain embodiments, by utilizing the state information of a computer-readable program instruction to customize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the present disclosure.

[0061] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0062] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0063] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the equipment, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved. It should also be noted that each frame in the block diagram and / or flow chart, and the combination of frames in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0064] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

[0065] Some example implementations of the present disclosure are listed below.

[0066] Example 1. A method for generating a clipping path, comprising:

[0067] Obtaining text for clipping a page, wherein the text is organized according to the syntax of a standard interface for clipping operations;

[0068] According to a predefined data protocol, the text is converted to generate a clipping instruction that can be supported by multiple development components for different operating systems; and

[0069] The clipping instruction is executed by a development component for the operating system to generate a clipping path for the page.

[0070] Example 2. The method according to Example 1, wherein the clipping instruction is an array including multiple numerical values, and converting the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems includes:

[0071] Determining clipping attributes and corresponding attribute values ​​in the text;

[0072] Determining a first value in the cropping instruction based on the cropping attribute, and determining a second value in the cropping instruction based on the attribute value corresponding to the cropping attribute; and

[0073] The first value and the second value are serialized to generate the trimming instruction in array form that can be supported by the multiple development components.

[0074] Example 3. The method of example 1 or 2, wherein determining the first value in the cropping instruction based on the cropping attribute comprises:

[0075] Based on the clipping attribute, determining a corresponding clipping operation, the clipping operation comprising a clipping operation based on scalable vector graphics or a clipping operation based on geometric figures; and

[0076] Based on the cropping operation, the first value in the cropping instruction is determined.

[0077] Example 4. A method according to any one of Examples 1-3, wherein the cropping operation based on scalable vector graphics includes at least one of a brush moving operation, a straight line drawing operation, and a curve drawing operation, and the cropping operation based on geometric figures includes at least one of a rectangle drawing operation, a polygon drawing operation, a circle drawing operation, and an ellipse drawing operation.

[0078] Example 5. The method according to any one of Examples 1-4, wherein determining the clipping attribute and the corresponding attribute value in the text comprises:

[0079] determining a plurality of clipping attributes in the text; and

[0080] The text is segmented according to the multiple cropping attributes to determine multiple attribute values ​​corresponding to the multiple cropping attributes in the text.

[0081] Example 6. The method according to any one of Examples 1-5, further comprising:

[0082] Get the statement used for superellipse drawing operation;

[0083] According to the data protocol, the statement is converted to generate a superellipse drawing instruction that can be supported by multiple development components; and

[0084] The super ellipse drawing instruction is executed by the development component to generate a super ellipse path of the page.

[0085] Example 7. The method according to any one of Examples 1-6, wherein executing the clipping instruction by a development component for an operating system to generate a clipping path for the page comprises:

[0086] The development component for the operating system executes a first clipping instruction to generate a first clipping path for the page;

[0087] And the method also includes:

[0088] saving the first clipping path to a storage unit; and

[0089] In response to the second clipping instruction being the same as the first clipping instruction, the first clipping path is obtained from the storage unit, so as to use the first clipping path as the clipping path corresponding to the second clipping instruction.

[0090] Example 8. The method according to any one of Examples 1-7, wherein executing the clipping instruction by a development component for an operating system to generate a clipping path for the page comprises:

[0091] The development component sends a request for rendering a page to a terminal of the operating system; and

[0092] In response to receiving a response from the terminal agreeing to render the page to the request, the development component executes the clipping instruction to generate the clipping path of the page;

[0093] And the method also includes:

[0094] The development component sends the clipping path to the terminal, so that the terminal clips the page based on the clipping path.

[0095] Example 9. An apparatus for generating a clipping path, comprising:

[0096] A text acquisition module, configured to acquire text for clipping a page, wherein the text is organized according to the syntax of a standard interface for clipping operations;

[0097] a text conversion module configured to convert the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems; and

[0098] The clipping path generation module is configured to execute the clipping instruction by a development component for the operating system to generate a clipping path for the page.

[0099] Example 10. The apparatus according to Example 9, wherein the cropping instruction is an array including a plurality of numerical values, and the text conversion module is further configured to:

[0100] Determining clipping attributes and corresponding attribute values ​​in the text;

[0101] Determining a first value in the cropping instruction based on the cropping attribute, and determining a second value in the cropping instruction based on the attribute value corresponding to the cropping attribute; and

[0102] The first value and the second value are serialized to generate the trimming instruction in array form that can be supported by the multiple development components.

[0103] Example 11. The apparatus of example 9 or 10, wherein the text conversion module is further configured to:

[0104] Based on the clipping attribute, determining a corresponding clipping operation, the clipping operation comprising a clipping operation based on scalable vector graphics or a clipping operation based on geometric figures; and

[0105] Based on the cropping operation, the first value in the cropping instruction is determined.

[0106] Example 12. An apparatus according to any one of Examples 9-11, wherein the cropping operation based on scalable vector graphics includes at least one of a brush moving operation, a straight line drawing operation, and a curve drawing operation, and the cropping operation based on geometric figures includes at least one of a rectangle drawing operation, a polygon drawing operation, a circle drawing operation, and an ellipse drawing operation.

[0107] Example 13. The apparatus of any one of Examples 9-12, wherein the text conversion module is further configured to:

[0108] determining a plurality of clipping attributes in the text; and

[0109] The text is segmented according to the multiple cropping attributes to determine multiple attribute values ​​corresponding to the multiple cropping attributes in the text.

[0110] Example 14. The apparatus of any one of Examples 9-13, further comprising:

[0111] A statement acquisition module is configured to acquire a statement for a superellipse drawing operation;

[0112] A statement conversion module is configured to convert the statement according to the data protocol to generate a superellipse drawing instruction that can be supported by multiple development components; and

[0113] The instruction execution module is configured to execute the super ellipse drawing instruction by the development component to generate a super ellipse path of the page.

[0114] Example 15. The apparatus according to any one of Examples 9-14, wherein the clipping path generation module is further configured to:

[0115] The development component for the operating system executes a first clipping instruction to generate a first clipping path for the page;

[0116] And the device also includes:

[0117] saving the first clipping path to a storage unit; and

[0118] In response to the second clipping instruction being the same as the first clipping instruction, the first clipping path is obtained from the storage unit, so as to use the first clipping path as the clipping path corresponding to the second clipping instruction.

[0119] Example 16. The apparatus according to any one of Examples 9-15, wherein the clipping path generation module is further configured to:

[0120] The development component sends a request for rendering a page to a terminal of the operating system; and

[0121] In response to receiving a response from the terminal agreeing to render the page to the request, the development component executes the clipping instruction to generate the clipping path of the page;

[0122] And the device also includes:

[0123] The development component sends the clipping path to the terminal, so that the terminal clips the page based on the clipping path.

[0124] Example 17. An electronic device comprising:

[0125] Processor; and

[0126] A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device performs actions, the actions comprising:

[0127] Obtaining text for clipping a page, wherein the text is organized according to the syntax of a standard interface for clipping operations;

[0128] According to a predefined data protocol, the text is converted to generate a clipping instruction that can be supported by multiple development components for different operating systems; and

[0129] The clipping instruction is executed by a development component for the operating system to generate a clipping path for the page.

[0130] Example 18. The electronic device according to Example 17, wherein the clipping instruction is an array including multiple numerical values, and converting the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems includes:

[0131] Determining clipping attributes and corresponding attribute values ​​in the text;

[0132] Determining a first value in the cropping instruction based on the cropping attribute, and determining a second value in the cropping instruction based on the attribute value corresponding to the cropping attribute; and

[0133] The first value and the second value are serialized to generate the trimming instruction in array form that can be supported by the multiple development components.

[0134] Example 19. An electronic device according to Example 17 or 18, wherein based on the cropping attribute, determining the first value in the cropping instruction comprises:

[0135] Based on the clipping attribute, determining a corresponding clipping operation, the clipping operation comprising a clipping operation based on scalable vector graphics or a clipping operation based on geometric figures; and

[0136] Based on the cropping operation, the first value in the cropping instruction is determined.

[0137] Example 20. An electronic device according to any one of Examples 17-19, wherein the cropping operation based on scalable vector graphics includes at least one of a brush moving operation, a straight line drawing operation, and a curve drawing operation, and the cropping operation based on geometric figures includes at least one of a rectangle drawing operation, a polygon drawing operation, a circle drawing operation, and an ellipse drawing operation.

[0138] Example 21. An electronic device according to any one of Examples 17-20, wherein determining a cropping attribute and a corresponding attribute value in the text comprises:

[0139] determining a plurality of clipping attributes in the text; and

[0140] The text is segmented according to the multiple cropping attributes to determine multiple attribute values ​​corresponding to the multiple cropping attributes in the text.

[0141] Example 22. The electronic device of any of Examples 17-21, further comprising:

[0142] Get the statement used for superellipse drawing operation;

[0143] According to the data protocol, the statement is converted to generate a superellipse drawing instruction that can be supported by multiple development components; and

[0144] The super ellipse drawing instruction is executed by the development component to generate a super ellipse path of the page.

[0145] Example 23. An electronic device according to any one of Examples 17-22, wherein executing the clipping instruction by a development component for an operating system to generate a clipping path for a page comprises:

[0146] The development component for the operating system executes a first clipping instruction to generate a first clipping path for the page;

[0147] And the actions also include:

[0148] saving the first clipping path to a storage unit; and

[0149] In response to the second clipping instruction being the same as the first clipping instruction, the first clipping path is obtained from the storage unit, so as to use the first clipping path as the clipping path corresponding to the second clipping instruction.

[0150] Example 24. The electronic device according to any one of Examples 17-23, wherein executing the clipping instruction by a development component for an operating system to generate a clipping path for a page comprises:

[0151] The development component sends a request for rendering a page to a terminal of the operating system; and

[0152] In response to receiving a response from the terminal agreeing to render the page to the request, the development component executes the clipping instruction to generate the clipping path of the page;

[0153] And the actions also include:

[0154] The development component sends the clipping path to the terminal, so that the terminal clips the page based on the clipping path.

[0155] Example 25. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement a method according to any one of Examples 1 to 8.

[0156] Example 26. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform a method according to any one of Examples 1 to 8.

[0157] Although the disclosure has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Instead, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for generating a clipping path, comprising: Obtaining text for clipping a page, wherein the text is organized according to the syntax of a standard interface for clipping operations; According to a predefined data protocol, the text is converted to generate a cutting instruction that can be supported by multiple development components for different operating systems; as well as The clipping instruction is executed by a development component for the operating system to generate a clipping path for the page.

2. The method according to claim 1, wherein the clipping instruction is an array including a plurality of numerical values, and converting the text according to a predefined data protocol to generate a clipping instruction supported by a plurality of development components for different operating systems comprises: Determining clipping attributes and corresponding attribute values ​​in the text; Determining a first value in the cropping instruction based on the cropping attribute, and determining a second value in the cropping instruction based on the attribute value corresponding to the cropping attribute; as well as The first value and the second value are serialized to generate the trimming instruction in array form that can be supported by the multiple development components.

3. The method according to claim 2, wherein determining the first value in the cropping instruction based on the cropping attribute comprises: Based on the clipping attribute, determining a corresponding clipping operation, wherein the clipping operation includes a clipping operation based on scalable vector graphics or a clipping operation based on geometric figures; as well as Based on the cropping operation, the first value in the cropping instruction is determined.

4. The method according to claim 3, wherein the clipping operation based on scalable vector graphics includes at least one of a brush moving operation, a straight line drawing operation, and a curve drawing operation, and the clipping operation based on geometric figures includes at least one of a rectangle drawing operation, a polygon drawing operation, a circle drawing operation, and an ellipse drawing operation.

5. The method of claim 2, wherein determining the clipping attributes and corresponding attribute values ​​in the text comprises: determining a plurality of clipping attributes in the text; as well as The text is segmented according to the multiple cropping attributes to determine multiple attribute values ​​corresponding to the multiple cropping attributes in the text.

6. The method according to claim 1, further comprising: Get the statement used for superellipse drawing operation; According to the data protocol, the statement is converted to generate a superellipse drawing instruction that can be supported by multiple development components; as well as The super ellipse drawing instruction is executed by the development component to generate a super ellipse path of the page.

7. The method according to claim 1, wherein executing the clipping instruction by a development component for an operating system to generate a clipping path for a page comprises: The development component for the operating system executes a first clipping instruction to generate a first clipping path for the page; And the method also includes: Saving the first clipping path to a storage unit; as well as In response to the second clipping instruction being the same as the first clipping instruction, the first clipping path is obtained from the storage unit, so as to use the first clipping path as the clipping path corresponding to the second clipping instruction.

8. The method according to any one of claims 1 to 7, wherein executing the clipping instruction by a development component for an operating system to generate a clipping path for a page comprises: The development component sends a request for rendering a page to a terminal of the operating system; as well as In response to receiving a response from the terminal agreeing to render the page to the request, the development component executes the clipping instruction to generate the clipping path of the page; And the method also includes: The development component sends the clipping path to the terminal, so that the terminal clips the page based on the clipping path.

9. A device for generating a clipping path, comprising: A text acquisition module, configured to acquire text for clipping a page, wherein the text is organized according to the syntax of a standard interface for clipping operations; A text conversion module, configured to convert the text according to a predefined data protocol to generate a clipping instruction that can be supported by multiple development components for different operating systems; as well as The clipping path generation module is configured to execute the clipping instruction by a development component for the operating system to generate a clipping path for the page.

10. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 8.

11. A computer program product comprising computer executable instructions, wherein the computer executable instructions are executed by a processor to implement the method according to any one of claims 1 to 8.