Object generation method and device, electronic equipment and computer readable medium

By replacing the crop properties with the data crop plug-in in the code to be compiled, the cropping process of the component display content is solved, and the performance loss problem of excessive component display content is improved, and component rendering efficiency and memory usage are improved.

CN119536733APending Publication Date: 2025-02-28BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311090936.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In a page loading or updating scenario, the actual amount of content displayed on the component may be less than the amount of content configured, resulting in performance loss, such as slow rendering speed and increased memory consumption.

Method used

By obtaining the code to be compiled, the code contains crop properties and crop plug-in reference information. The data crop plug-in is used to replace the crop properties with the data crop function during the compilation processing stage, thereby realizing the cropping processing of the component configuration display content.

Benefits of technology

Ensure that executable objects contain component display content cropping logic, reducing storage and processing requirements for component content, thereby reducing performance losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536733A_ABST
    Figure CN119536733A_ABST
Patent Text Reader

Abstract

The invention discloses an object generation method and device, electronic equipment and a computer readable medium. The method comprises the steps of firstly obtaining a to-be-compiled code; the to-be-compiled code comprises cutting attributes and cutting plug-in reference information; the tailoring attribute is used for tailoring the configuration display content of the to-be-processed component; the clipping plug-in reference information is used for representing that a data clipping plug-in is used in a compiling processing stage of the to-be-compiled code, and the data clipping plug-in comprises a data clipping function; then, in response to a compiling trigger operation for the to-be-compiled code, compiling the to-be-compiled code to obtain an executable object; wherein the data cutting plug-in is used for replacing a cutting attribute in the to-be-compiled code with a data cutting function in a compiling processing stage, the data cutting function is used for cutting the configuration display content of the to-be-processed component to obtain to-be-displayed content corresponding to the to-be-processed component, and the to-be-displayed content is part of the configuration display content. Therefore, reduction of performance loss is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an object generation method, device, electronic device, and computer-readable medium. Background Art

[0002] In some application scenarios (for example, page loading scenarios, page update scenarios, etc.), for a component in a page, the amount of content actually displayed on the component may be less than the amount of content configured for the component. This situation will cause a certain performance loss (for example, slower component rendering speed, increased memory consumption, etc.). Summary of the invention

[0003] In order to solve the above technical problems, the present application provides an object generation method, device, electronic device, and computer-readable medium.

[0004] In order to achieve the above objectives, the technical solutions provided by this application are as follows:

[0005] The present application provides an object generation method, the method comprising:

[0006] Obtaining code to be compiled; the code to be compiled includes a clipping attribute and clipping plug-in reference information; the clipping attribute is used to indicate that the configuration display content of the component to be processed is clipped; the clipping plug-in reference information is used to indicate that a data clipping plug-in is used in the compilation processing stage of the code to be compiled, and the data clipping plug-in includes a data clipping function;

[0007] In response to a compilation trigger operation for the code to be compiled, the code to be compiled is compiled to obtain an executable object; the compilation process of the code to be compiled includes using the data clipping plug-in, the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with the data clipping function, and the data clipping function is used to clip the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed includes part of the content in the configuration display content.

[0008] In a possible implementation manner, replacing the clipping attribute in the code to be compiled with the data clipping function includes:

[0009] The clipping attributes in the code to be compiled are replaced with a target clipping function; the target clipping function is determined based on the clipping attributes and the data clipping function, and the target clipping function is used to clip the configuration display content of the component to be processed according to the clipping attributes.

[0010] In a possible implementation, the target clipping function includes at least one input parameter, and the at least one input parameter is determined according to the clipping attribute.

[0011] In a possible implementation manner, the data clipping plug-in includes at least two data clipping functions;

[0012] The data clipping plug-in is further used to determine the data clipping function corresponding to the component to be processed from the at least two data clipping functions according to the data type of the configuration display content of the component to be processed;

[0013] The step of replacing the clipping attribute in the code to be compiled with the data clipping function includes:

[0014] The clipping attributes in the code to be compiled are replaced with the data clipping function corresponding to the component to be processed.

[0015] In a possible implementation manner, replacing the clipping attribute in the code to be compiled with the data clipping function includes:

[0016] Searching for the clipping attribute from the code to be compiled to obtain the position of the clipping attribute;

[0017] The content at the position in the code to be compiled is replaced with the data clipping function.

[0018] In a possible implementation manner, the method further includes:

[0019] In response to an execution trigger operation on the executable object, the executable object is executed; the execution process of the executable object includes running the data clipping function and displaying the function output result of the data clipping function, and the function output result includes the content to be displayed.

[0020] In a possible implementation manner, the process of obtaining the code to be compiled includes:

[0021] After the first code is obtained, if the registration condition of the clipping plug-in is met, the clipping plug-in reference information is added to the first code to obtain the code to be compiled.

[0022] In a possible implementation manner, the process of obtaining the code to be compiled includes:

[0023] In response to a request for adding cropping information triggered for a second code, the cropping attribute is added to a target position in the second code to obtain the code to be compiled; the target position and the cropping attribute are determined according to the request for adding cropping information.

[0024] The present application provides an object generation device, comprising:

[0025] An acquisition unit is used to acquire the code to be compiled; the code to be compiled includes a clipping attribute and clipping plug-in reference information; the clipping attribute is used to indicate that the configuration display content of the component to be processed is clipped; the clipping plug-in reference information is used to indicate that a data clipping plug-in is used in the compilation processing stage of the code to be compiled, and the data clipping plug-in includes a data clipping function;

[0026] A compilation unit, used for compiling the code to be compiled in response to a compilation trigger operation for the code to be compiled to obtain an executable object; the compilation process of the code to be compiled includes using the data clipping plug-in, the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with the data clipping function, the data clipping function is used to clip the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed includes part of the configuration display content.

[0027] The present application provides an electronic device, the device comprising: a processor and a memory;

[0028] The memory is used to store instructions or computer programs;

[0029] The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the object generation method provided in the present application.

[0030] The present application provides a computer-readable medium, in which instructions or computer programs are stored. When the instructions or computer programs are executed on a device, the device executes the object generation method provided by the present application.

[0031] The present application provides a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program codes for executing the object generation method provided by the present application.

[0032] Compared with the related art, this application has at least the following advantages:

[0033] In the technical solution provided by the present application, for the code to be compiled (for example, the business code developed for a certain business, etc.), the code to be compiled is first obtained; the code to be compiled includes a trimming attribute and a trimming plug-in reference information; the trimming attribute is used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function; then, in response to a compilation trigger operation for the code to be compiled, the code to be compiled is compiled to obtain an executable object; wherein, the data trimming plug-in is used to replace the trimming attribute in the code to be compiled with the data trimming function in the compilation processing stage, and the data trimming function is used to trim the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed is used to represent part of the configuration display content. In this way, it is possible to automatically add the display content clipping logic corresponding to one or more components to the business code, thereby ensuring that the executable object finally compiled includes at least the display content clipping logic corresponding to these components, and further ensuring that during the execution of the executable object, only part of the configuration display content needs to be obtained and stored, without the need to obtain and store all the configuration display content. This can effectively reduce the resources consumed by content-related processes (such as storage processes, etc.) for the component, thereby minimizing performance losses (such as slower component rendering speed, increased memory consumption, etc.) while meeting the component content display requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flowchart of an object generation method provided in an embodiment of the present application;

[0036] Figure 2 A schematic diagram of the structure of an object generation device provided in an embodiment of the present application;

[0037] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0039] In order to better understand the technical solution provided by the present application, the object generation method provided by the present application is described below with reference to some drawings. Figure 1 As shown, the object generation method provided in the embodiment of the present application includes the following S1-S2. Figure 1 A flowchart of an object generation method provided in an embodiment of the present application.

[0040] S1: Obtain the code to be compiled; the code to be compiled includes trimming attributes and trimming plug-in reference information; the trimming attributes are used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function.

[0041] Among them, the code to be compiled refers to the code that needs to be compiled; and this application does not limit the code to be compiled. For example, the code to be compiled may refer to the business code developed for a certain business (for example, a business that at least includes page display logic, etc.).

[0042] In addition, for the code to be compiled above, the code to be compiled may include a clipping attribute and clipping plug-in reference information. The clipping attribute is used to indicate that the configuration display content of the component to be processed is clipped; the clipping plug-in reference information is used to indicate that a data clipping plug-in is used in the compilation processing stage of the code to be compiled, and the data clipping plug-in includes a data clipping function. For ease of understanding, some technical terms involved in this paragraph are explained below.

[0043] The component to be processed refers to a component that meets the preset clipping conditions; and the present application does not limit the preset clipping conditions, for example, it can be specifically: the data volume of the actual display content of the component to be processed is less than the data volume of the configuration display content of the component to be processed. Among them, the configuration display content refers to the content that needs to be displayed (for example, text, image, voice, etc.) configured in advance for the component to be processed, so that the configuration display content belongs to a pre-set attribute information of the component to be processed. The actual display content refers to the content actually presented on the component to be processed when the component to be processed is displayed on the page; and the present application does not limit the implementation method of the actual display content. For example, in some application scenarios (for example, scenarios where only limited content can be displayed on the component), if the data volume of the configuration display content of the component to be processed is relatively large, the actual display content of the component to be processed can be a part of the configuration display content, so that the data volume of the actual display content is less than the data volume of the configuration display content of the component to be processed.

[0044] The cropping attribute refers to the attribute information set in advance for the component to be processed and required to be used as a basis for cropping the configuration display content of the component to be processed, so that the cropping attribute can not only indicate the need to crop the configuration display content of the component to be processed, but also indicate according to which cropping parameters (for example, who is the cropping object, how much content to retain after cropping, etc.) the configuration display content of the component to be processed is cropped. In this way, the cropping attribute can, to a certain extent, represent one or more constraints set in advance for the actual display content of the component to be processed (for example, data volume constraints such as within 10 characters, etc.).

[0045] In addition, the present application does not limit the implementation method of the above cropping attribute. For example, in one possible implementation method, the cropping attribute may at least include a cropping object and a cropping size. The cropping object refers to the content that needs to be cropped (for example, text, image, or voice content), so that the cropped text can indicate which component's configuration display content needs to be cropped; and the present application does not limit the implementation method of the cropping object. The cropping size refers to how much content needs to be retained when cropping the cropping object.

[0046] In addition, the present application does not limit the method for obtaining the clipping attributes in the above to-be-compiled code. For example, in some application scenarios, the clipping attributes may be manually added by relevant personnel.

[0047] For example, in some application scenarios, in order to better improve efficiency, the above-mentioned cropping attributes can be automatically added. Therefore, in order to achieve this requirement, the present application also provides a possible implementation method of the process of obtaining the above-mentioned code to be compiled, which can be specifically: in response to a cropping information addition request triggered for a second code, a cropping attribute is added at a target position in the second code to obtain the code to be compiled, so that the code to be compiled includes at least one cropping attribute; wherein the target position and the cropping attribute are determined based on the cropping information addition request.

[0048] The second code refers to the code that needs to be processed by adding the trimming attribute; and the present application does not limit the implementation method of the second code. For example, in some application scenarios, the second code refers to the business code developed by relevant personnel for a certain business.

[0049] The request to add cropping information is used to request to add cropping attributes to at least one position in the second code; and the present application does not limit the implementation method of the request to add cropping information. For example, in some application scenarios, the request to add cropping information may carry at least one information adding position and the added content corresponding to each information adding position. Among them, the mth information adding position refers to the mth position in the second code where the corresponding cropping attributes need to be added. The added content corresponding to the mth information adding position refers to the cropping attributes that need to be added to the mth information adding position. m is a positive integer, m≤M, M is a positive integer, and M represents the number of positions in the "at least one information adding position".

[0050] In addition, the present application does not limit the triggering method of the above-mentioned request for adding cropping information. For example, in some application scenarios, the user can trigger the request for adding cropping information by means of interface interaction operations.

[0051] The target position refers to the position determined based on the above cropping information adding request, located in the above second code, to which the cropping attribute needs to be added; and the present application does not limit the determination process of the target position, for example, it can be specifically: after detecting the cropping information adding request triggered for the second code, the mth information adding position carried by the cropping information adding request can be determined as the target position, so that the added content corresponding to the mth information adding position can be used as the cropping attribute that needs to be added to the target position, m is a positive integer, m≤M, so that the corresponding cropping attribute can be added to at least one position in the second code.

[0052] Based on the above content, it can be known that in some application scenarios (for example, the scenario of automatic addition of cutting attributes), for a business code (for example, the second code above), after detecting the cutting information addition request triggered for the business code, the corresponding cutting attributes can be added to the corresponding positions in the business code according to at least one information addition position carried by the cutting information addition request and the added content corresponding to each information addition position (for example, cutting attributes), and the business code after the attribute is added is obtained, so that there is at least one cutting attribute in the business code after the attribute is added, so that the code to be compiled above can be determined based on the business code after the attribute is added. In this way, the cutting attributes can be automatically added to the business code, which is conducive to improving efficiency.

[0053] The trimming plug-in reference information is used to uniquely represent the pre-built data trimming plug-in, so that the trimming plug-in reference information in the above code to be compiled can indicate that the code to be compiled registers and uses the data trimming plug-in, so that the trimming plug-in reference information in the code to be compiled can indicate that the data trimming plug-in is used in the compilation processing stage of the code to be compiled. Among them, the data trimming plug-in includes a data trimming function, and the data trimming plug-in is used to realize the automatic addition of the data trimming function to the corresponding position in the compilation processing stage. The data trimming function is used to realize the function of trimming the configuration display content of a component, and the present application does not limit the data trimming function. For example, in some application scenarios (such as trimming the text information displayed on the component, etc.), the data trimming function can be implemented using a slice algorithm.

[0054] In addition, the present application does not limit the implementation method of the above data clipping plug-in. For example, in some application scenarios, the data clipping plug-in can be implemented using a lynx plug-in.

[0055] In addition, the present application does not limit the method for obtaining the above-mentioned data cropping plug-in. For example, in some application scenarios, if only a certain type of content (such as text, etc.) needs to be cropped, the process of obtaining the data cropping plug-in can be: first select the algorithm with the best cropping performance from a large number of cropping algorithms corresponding to this type of content as the data cropping function; and package the data cropping function into a data cropping plug-in.

[0056] For example, in some application scenarios, it may be necessary to perform cropping processing on multiple types of content (for example, text, images, voice, etc.). Therefore, in order to better meet such cropping requirements, the present application also provides a possible implementation method of the acquisition process of the above-mentioned data cropping plug-in. Under this implementation method, the acquisition process of the data cropping plug-in can be: first, select the algorithm with the best cropping performance from a large number of cropping algorithms corresponding to the nth type of content as the data cropping function corresponding to the nth type of content, where n is a positive integer, n≤N, N is a positive integer, and N represents the number of content types; then, the data cropping function corresponding to the first type of content, the data cropping function corresponding to the second type of content, ..., and the data cropping function corresponding to the Nth type of content are packaged into a data cropping plug-in, so that the data cropping plug-in includes data cropping functions corresponding to multiple types of content, so that the data cropping plug-in can be used to better complete the automatic addition process of data cropping functions corresponding to each type of content. It can be seen that, in one possible implementation, the data cropping plug-in may include data cropping functions corresponding to at least two types of content; and the present application does not limit the implementation methods of the at least two types of content. For example, the at least two types of content may include text, images, voice, and one or more of a certain set of candidate items.

[0057] In addition, the present application does not limit the implementation method of the above-mentioned clipping plug-in reference information. For example, it can be implemented by using any existing or future reference information that can realize the registration and use function for a plug-in (for example, the identification information of the plug-in). It can be seen that in a possible implementation method, the clipping plug-in reference information can at least include the identification information of the above-mentioned data clipping plug-in. Among them, the identification information of the data clipping plug-in is used to uniquely identify the data clipping plug-in.

[0058] Furthermore, the present application does not limit the method for obtaining the trimming plug-in reference information in the above to-be-compiled code. For example, in some application scenarios, the trimming plug-in reference information may be manually added by relevant personnel.

[0059] For example, in some application scenarios, in order to better improve efficiency, the above-mentioned trimming plug-in reference information can be automatically added. Therefore, in order to achieve this requirement, the present application also provides a possible implementation method of the above-mentioned process of obtaining the code to be compiled, which can be specifically: after obtaining the first code, if the trimming plug-in registration condition is met, the trimming plug-in reference information is added to the first code to obtain the code to be compiled, so that the code to be compiled at least includes the trimming plug-in reference information, so that the automatic addition of the trimming plug-in reference information can be achieved.

[0060] The first code refers to the code that needs to determine whether to add the reference information of the clipping plug-in; and this application does not limit the implementation method of the first code. For example, in some application scenarios, the first code refers to the business code developed by relevant personnel for a certain business. For another example, in some application scenarios, the first code may refer to the business code with clipping attributes added (for example, the code obtained by executing the step of "adding clipping attributes to the target position in the second code" above, etc.).

[0061] The registration condition of the clipping plug-in refers to the condition that must be met to register and use the code of the data clipping plug-in above; and the present application does not limit the registration condition of the clipping plug-in. For example, in some application scenarios, the registration condition of the clipping plug-in may specifically be: detecting a registration and use clipping plug-in request triggered by a business code (for example, the first code above). The registration and use clipping plug-in request is used to request the business code to register and use the data clipping plug-in.

[0062] For example, in some application scenarios, the above registration condition for the clipping plug-in may specifically be: a business code can indicate that one or more components need to be clipped. It can be seen that in a possible implementation, the registration condition for the clipping plug-in may specifically be: there is at least one clipping attribute in the business code.

[0063] Based on the relevant content above, it can be known that in some application scenarios, for the first code above, after obtaining the first code, it can be determined whether the cropping plug-in registration conditions are met (for example, whether a registration and use cropping plug-in request triggered by the first code is detected or whether there is a cropping attribute in the first code, etc.), so that when it is determined that the cropping plug-in registration conditions are met, the cropping plug-in reference information is directly added to the first code to obtain the code to be compiled, so that the code to be compiled at least includes the cropping plug-in reference information, so that the cropping plug-in reference information can be automatically added, which is beneficial to improve efficiency.

[0064] In addition, the “compilation processing stage of the code to be compiled” in S1 above refers to the time period occupied when the compilation processing is performed on the code to be compiled.

[0065] Based on the relevant content of S1 above, it can be known that in some application scenarios, the code to be compiled can be obtained in a certain way so that the code to be compiled includes a trimming attribute and a trimming plug-in reference information. Among them, the trimming attribute is used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function.

[0066] S2: In response to a compilation trigger operation for the code to be compiled, the code to be compiled is compiled to obtain an executable object; the compilation process of the code to be compiled includes using a data clipping plug-in, the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with a data clipping function, and the data clipping function is used to clip the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed includes part of the content in the configuration display content.

[0067] The compilation trigger operation is used to trigger the compilation process for the code to be compiled; and the present application does not limit the implementation method of the compilation trigger operation.

[0068] An executable object refers to a result obtained by compiling the code to be compiled; and this application does not limit the implementation method of the executable object.

[0069] The content to be displayed refers to the result obtained by cutting the configuration display content of the component to be processed, so that the content to be displayed can represent the partial content cut from the configuration display content of the component to be processed. It can be seen that the content to be displayed includes part of the configuration display content.

[0070] In addition, the present application does not limit the implementation method of the content to be displayed above. For example, when the compilation process for the code to be compiled includes at least using a data clipping plug-in, and the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with a data clipping function (for example, a slice algorithm), the content to be displayed may refer to the function output result obtained by running the data clipping function during the execution of the executable object above. The function output result refers to the result obtained by clipping the configuration display content of the component to be processed with the help of the data clipping function (for example, the clipped content).

[0071] Based on the above content, it can be known that in some application scenarios, after obtaining the code to be compiled, the code to be compiled can be compiled, and during the compilation process of the code to be compiled, the data cropping plug-in mentioned above automatically replaces the cropping attributes in the code to be compiled with a data cropping function (for example, a slice algorithm), so that the executable object finally compiled (for example, the online code corresponding to a certain business, etc.) at least includes running the data cropping function, so that the data cropping function can be run during the execution of the executable object, and after obtaining the function output result of the data cropping function (for example, the cropped content), the function output result is displayed on the screen.

[0072] In addition, the present application does not limit the implementation method of the step of "replacing the trimming attributes in the code to be compiled with the data trimming function" in the previous paragraph. For example, it can be specifically: the data trimming plug-in searches for the trimming attributes from the code to be compiled and obtains the position of the trimming attributes, so that the "position of the trimming attributes" can indicate the position of the trimming attributes in the code to be compiled; and then replaces the content at this position in the code to be compiled with the data trimming function.

[0073] In fact, in some application scenarios, the display content constraints corresponding to different components may be different, so that the clipping attributes of different components may be different, so that the parameters required for clipping the configuration display content of different components are different. Therefore, in order to better meet this demand, this application also provides a possible implementation of the above data clipping plug-in. Under this implementation, the data clipping plug-in is specifically used to replace the clipping attributes in the above code to be compiled with the target clipping function. Among them, the target clipping function is determined based on the clipping attributes and the above data clipping function, and the target clipping function is used to clip the configuration display content of the component to be processed according to the clipping attributes.

[0074] In addition, the present application does not limit the determination process of the target cropping function in the above paragraph. For example, it can be specifically as follows: after finding the cropping attribute from the code to be compiled, at least one input parameter (that is, a function input parameter) can be determined based on the cropping attribute, so that the at least one input parameter can represent the cropping reference information described by the cropping attribute (for example, cropping object, cropping size, etc.); then, the input parameters of the above data cropping function are adjusted based on the at least one input parameter to obtain the target cropping function, so that the input parameters of the target cropping function include the at least one input parameter, so that the input parameters of the target cropping function can match the cropping reference information described by the cropping attribute, which is conducive to realizing the cropping processing of the configuration display content of the component in various situations, thereby facilitating the improvement of cropping flexibility. Among them, the input parameter refers to the function input parameter; and the present application does not limit the at least one input parameter, for example, it can at least include cropping text and cropping numbers, etc.

[0075] Based on the above two paragraphs, it can be known that in some application scenarios, after obtaining the code to be compiled, the code to be compiled can be compiled, and during the compilation process of the code to be compiled, the data clipping plug-in mentioned above automatically combines the clipping attributes in the code to be compiled with the data clipping function, so that the executable object finally compiled (for example, the online code corresponding to a certain business, etc.) at least includes running the combined function (for example, the target clipping function mentioned above, etc.), so that the combined function can be run during the execution of the executable object, and after obtaining the function output result of the combined function (for example, the clipped content), the function output result is displayed on the screen.

[0076] In fact, in some application scenarios, in order to better improve the flexibility of clipping, the present application also provides a possible implementation method of the above-mentioned target clipping function determination process. Under this implementation method, when the above-mentioned data clipping plug-in includes at least two data clipping functions (for example, data clipping functions corresponding to different data types), the target clipping function determination process can specifically include the following steps 11-12.

[0077] Step 11: According to the data type of the configuration display content of the component to be processed above, determine the data clipping function corresponding to the component to be processed from the at least two data clipping functions above.

[0078] Among them, the data type of the configuration display content of the component to be processed is used to indicate what kind of data the configuration display content belongs to; and this application does not limit the implementation method of the "data type of the configuration display content of the component to be processed", for example, it can be text, image or voice.

[0079] The data clipping function corresponding to the component to be processed refers to the data clipping function determined from the above data clipping plug-in and corresponding to the data type of the configuration display content of the component to be processed.

[0080] Step 12: Determine the target clipping function based on the clipping attributes above and the data clipping function corresponding to the component to be processed.

[0081] It should be noted that the implementation of step 12 is similar to the implementation of the target clipping function shown above, and for the sake of brevity, it will not be repeated here.

[0082] Based on the relevant contents of steps 11 to 12 above, it can be known that in some application scenarios, after the code to be compiled is obtained, the code to be compiled can be compiled, and in the compilation process of the code to be compiled, the data clipping plug-in above first automatically determines the location of the clipping attribute from the code to be compiled, and determines the data clipping function corresponding to the clipping attribute according to the data type of the clipping object in the clipping attribute (for example, the configuration display content of the component to be processed); then, the content at the position in the code to be compiled is replaced with the data clipping function corresponding to the clipping attribute, so that the executable object finally compiled (for example, the online code corresponding to a certain business, etc.) at least includes running the data clipping function, so that the data clipping function corresponding to the clipping attribute can be run later during the execution of the executable object, and after the function output result of the data clipping function (for example, the clipped content) is obtained, the function output result is displayed on the screen.

[0083] Based on the relevant contents of S1 to S2 above, it can be known that for the object generation method provided in the embodiment of the present application, the code to be compiled is first obtained; the code to be compiled includes trimming attributes and trimming plug-in reference information; the trimming attributes are used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function; then, in response to the compilation trigger operation for the code to be compiled, the code to be compiled is compiled to obtain an executable object; wherein, the data trimming plug-in is used to replace the trimming attributes in the code to be compiled with the data trimming function during the compilation processing stage, and the data trimming function is used to trim the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed is used to represent part of the configuration display content. In this way, it is possible to automatically add the display content clipping logic corresponding to one or more components to the business code, thereby ensuring that the executable object finally compiled includes at least the display content clipping logic corresponding to these components, and further ensuring that during the execution of the executable object, only part of the configuration display content needs to be obtained and stored, without the need to obtain and store all the configuration display content. This can effectively reduce the resources consumed by content-related processes (such as storage processes, etc.) for the component, thereby minimizing performance losses (such as slower component rendering speed, increased memory consumption, etc.) while meeting the component content display requirements.

[0084] In fact, in some application scenarios, after obtaining the executable object, the object can be executed. Based on this, the present application also provides a possible implementation of the above object generation method, in which the object generation method not only includes the above S1-S2, but also includes the following step 21.

[0085] Step 21: In response to the execution trigger operation for the above executable object, the executable object is executed; the execution process of the executable object includes running a data clipping function and displaying a function output result of the data clipping function, and the function output result includes content to be displayed.

[0086] Among them, the execution trigger operation is used to trigger the execution process for the above executable object; and this application does not limit the implementation method of the execution trigger operation.

[0087] The function output result of the data clipping function refers to the result obtained by running the data clipping function, so that the function output result can represent the clipped content (that is, the content to be displayed above) obtained by clipping the configuration display content of the above component to be processed.

[0088] Based on the relevant content of step 21 above, it can be known that in some application scenarios, for the above executable object, after the executable object is obtained, if an execution trigger operation for the executable object is detected, the executable object can be executed, and the above data cropping function (or the above target cropping function) is run during the execution of the executable object to obtain the function output result of the data cropping function (or the target cropping function), so that the function output result can represent the cropped content (that is, the above content to be displayed) obtained by cropping the configuration display content of the above component to be processed, and display the function output result, so as to ensure that the display content obtained and stored for a component is consistent with the content actually displayed on the component, thereby effectively avoiding the performance loss caused by the amount of data of the display content obtained and stored for the component being greater than the amount of data of the content actually displayed on the component.

[0089] In addition, the present application does not limit the execution subject of the above object generation method. For example, any implementation of the object generation method provided in the embodiment of the present application can be applied to a device with data processing function such as a terminal device or a server. For another example, any implementation of the object generation method provided in the embodiment of the present application can also be implemented by means of a data communication process between different devices (for example, a terminal device and a server, two terminal devices, or two servers). Among them, the terminal device can be a smart phone, a computer, a personal digital assistant (PDA) or a tablet computer, etc. The server can be a stand-alone server, a cluster server or a cloud server.

[0090] Based on the object generation method provided in the embodiment of the present application, the embodiment of the present application also provides an object generation device. Figure 2 Explain and illustrate. Figure 2 This is a schematic diagram of the structure of an object generation device provided in an embodiment of the present application. It should be noted that for the technical details of the object generation device provided in an embodiment of the present application, please refer to the relevant content of the object generation method above.

[0091] like Figure 2 As shown, the object generation device 200 provided in the embodiment of the present application includes:

[0092] The acquisition unit 201 is used to acquire the code to be compiled; the code to be compiled includes a trimming attribute and a trimming plug-in reference information; the trimming attribute is used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function;

[0093] The compilation unit 202 is used to compile the code to be compiled in response to the compilation trigger operation for the code to be compiled to obtain an executable object; the compilation processing process of the code to be compiled includes using the data clipping plug-in, the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with the data clipping function, and the data clipping function is used to clip the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed includes part of the content in the configuration display content.

[0094] In one possible implementation, the data clipping plug-in is specifically used to: replace the clipping attributes in the code to be compiled with a target clipping function; the target clipping function is determined based on the clipping attributes and the data clipping function, and the target clipping function is used to clip the configuration display content of the component to be processed according to the clipping attributes.

[0095] In a possible implementation, the target clipping function includes at least one input parameter, and the at least one input parameter is determined according to the clipping attribute.

[0096] In a possible implementation manner, the data clipping plug-in includes at least two data clipping functions;

[0097] The data clipping plug-in is further used to determine the data clipping function corresponding to the component to be processed from the at least two data clipping functions according to the data type of the configuration display content of the component to be processed;

[0098] The data clipping plug-in is specifically used to replace the clipping attributes in the code to be compiled with the data clipping function corresponding to the component to be processed.

[0099] In a possible implementation manner, the data clipping plug-in is specifically used to: search for the clipping attribute from the code to be compiled to obtain the position of the clipping attribute; and replace the content at the position in the code to be compiled with the data clipping function.

[0100] In a possible implementation manner, the object generating device 200 further includes:

[0101] An execution unit is used to execute the executable object in response to an execution trigger operation on the executable object; the execution process of the executable object includes running the data clipping function and displaying the function output result of the data clipping function, and the function output result includes the content to be displayed.

[0102] In a possible implementation manner, the acquisition unit 201 is specifically configured to: after acquiring the first code, if the cropping plug-in registration condition is met, add the cropping plug-in reference information to the first code to obtain the code to be compiled.

[0103] In one possible implementation, the acquisition unit 201 is specifically used to: in response to a cropping information adding request triggered for a second code, add the cropping attribute at a target position in the second code to obtain the code to be compiled; the target position and the cropping attribute are determined based on the cropping information adding request.

[0104] Based on the relevant content of the above-mentioned object generation device 200, it can be known that for the object generation device 200 provided in the embodiment of the present application, the code to be compiled is first obtained; the code to be compiled includes trimming attributes and trimming plug-in reference information; the trimming attributes are used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function; then, in response to the compilation trigger operation for the code to be compiled, the code to be compiled is compiled to obtain an executable object; wherein, the data trimming plug-in is used to replace the trimming attributes in the code to be compiled with the data trimming function in the compilation processing stage, and the data trimming function is used to trim the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed is used to represent part of the configuration display content. In this way, it is possible to automatically add the display content clipping logic corresponding to one or more components to the business code, thereby ensuring that the executable object finally compiled includes at least the display content clipping logic corresponding to these components, and further ensuring that during the execution of the executable object, only part of the configuration display content needs to be obtained and stored, without the need to obtain and store all the configuration display content. This can effectively reduce the resources consumed by content-related processes (such as storage processes, etc.) for the component, thereby minimizing performance losses (such as slower component rendering speed, increased memory consumption, etc.) while meeting the component content display requirements.

[0105] In addition, an embodiment of the present application also provides an electronic device, which includes a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device executes any implementation of the object generation method provided in the embodiment of the present application.

[0106] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device 300 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0107] like Figure 3As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0108] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0109] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0110] The electronic device provided by the embodiment of the present disclosure and the method provided by the above embodiment belong to the same inventive concept, and the technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0111] The embodiment of the present application also provides a computer-readable medium, in which instructions or computer programs are stored. When the instructions or computer programs are executed on a device, the device executes any implementation of the object generation method provided in the embodiment of the present application.

[0112] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0113] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0114] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0115] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can execute the method.

[0116] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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., through the Internet using an Internet service provider).

[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0118] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit / module does not, in some cases, constitute a limitation on the unit itself.

[0119] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0120] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0121] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0122] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0123] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0124] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0125] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating an object, characterized in that: The method comprises: Obtaining code to be compiled; the code to be compiled includes a clipping attribute and clipping plug-in reference information; the clipping attribute is used to indicate that the configuration display content of the component to be processed is clipped; the clipping plug-in reference information is used to indicate that a data clipping plug-in is used in the compilation processing stage of the code to be compiled, and the data clipping plug-in includes a data clipping function; In response to a compilation trigger operation for the code to be compiled, the code to be compiled is compiled to obtain an executable object; the compilation process of the code to be compiled includes using the data clipping plug-in, the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with the data clipping function, and the data clipping function is used to clip the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed includes part of the content in the configuration display content.

2. The method according to claim 1, characterized in that The step of replacing the clipping attribute in the code to be compiled with the data clipping function includes: The clipping attributes in the code to be compiled are replaced with a target clipping function; the target clipping function is determined based on the clipping attributes and the data clipping function, and the target clipping function is used to clip the configuration display content of the component to be processed according to the clipping attributes.

3. The method according to claim 2, characterized in that The target clipping function includes at least one input parameter, and the at least one input parameter is determined according to the clipping attribute.

4. The method according to claim 1, characterized in that: The data clipping plug-in includes at least two data clipping functions; The data clipping plug-in is further used to determine the data clipping function corresponding to the component to be processed from the at least two data clipping functions according to the data type of the configuration display content of the component to be processed; The step of replacing the clipping attribute in the code to be compiled with the data clipping function includes: The clipping attributes in the code to be compiled are replaced with the data clipping function corresponding to the component to be processed.

5. The method according to claim 1, characterized in that The step of replacing the clipping attribute in the code to be compiled with the data clipping function includes: Searching for the clipping attribute from the code to be compiled to obtain the position of the clipping attribute; The content at the position in the code to be compiled is replaced with the data clipping function.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to an execution trigger operation on the executable object, the executable object is executed; the execution process of the executable object includes running the data clipping function and displaying the function output result of the data clipping function, and the function output result includes the content to be displayed.

7. The method according to claim 1, characterized in that The process of obtaining the code to be compiled includes: After the first code is obtained, if the registration condition of the clipping plug-in is met, the clipping plug-in reference information is added to the first code to obtain the code to be compiled; or, The process of obtaining the code to be compiled includes: In response to a request for adding cropping information triggered for a second code, the cropping attribute is added to a target position in the second code to obtain the code to be compiled; the target position and the cropping attribute are determined according to the request for adding cropping information.

8. An object generation device, characterized in that: include: An acquisition unit, used to acquire the code to be compiled; The code to be compiled includes clipping attributes and clipping plug-in reference information; The trimming attribute is used to indicate that the configuration display content of the component to be processed is trimmed; the trimming plug-in reference information is used to indicate that a data trimming plug-in is used in the compilation processing stage of the code to be compiled, and the data trimming plug-in includes a data trimming function; A compilation unit, used for compiling the code to be compiled in response to a compilation trigger operation for the code to be compiled to obtain an executable object; the compilation process of the code to be compiled includes using the data clipping plug-in, the data clipping plug-in is used to replace the clipping attributes in the code to be compiled with the data clipping function, the data clipping function is used to clip the configuration display content of the component to be processed to obtain the content to be displayed corresponding to the component to be processed, and the content to be displayed includes part of the configuration display content.

9. An electronic device, characterized in that: The device comprises: a processor and a memory; The memory is used to store instructions or computer programs; The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable medium, characterized in that The computer-readable medium stores instructions or computer programs, and when the instructions or computer programs are executed on a device, the device is enabled to execute the method according to any one of claims 1 to 7.