Application function publishing method, device, equipment and storage medium

By obtaining and processing the target differential code in the application, generating target codes that only contain common and differential codes, solving the problems of poor code readability and large data packets in the prior art, and realizing the lightweight processing and readability of the code Sex improvement.

CN112416426BActive Publication Date: 2025-01-14BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011371036.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2025-01-14
Estimated Expiration
2041-01-14

AI Technical Summary

Technical Problem

In the prior art, processing different logical codes in different applications through if/else statements lead to poor code readability and large data packets, and unnecessary logical code needs to be loaded.

Method used

By obtaining the function release request in the application, obtaining the target difference code, determining the matching pending code, and performing predetermined operations, the generated target code contains only common logic and difference code, avoiding loading code from other platforms.

Benefits of technology

Improves the readability and lightweight processing of the code, reduces the size of the code packet and avoids unnecessary code loading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112416426B_ABST
    Figure CN112416426B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, device, and storage medium for publishing application features. The method includes: obtaining a feature publishing request from an application, the feature publishing request including a target function's application identifier; obtaining a target difference code corresponding to the application identifier based on the feature publishing request; determining a code to be processed that matches the target difference code in a target base code; performing a predetermined operation on the code to be processed using the target difference code, and determining the processed base code as the target code; and publishing the target function corresponding to the target code to the application to be published. This ensures that the target code only includes general logic code and the difference code corresponding to the application to be published. This effectively reduces the data packet size of the code, achieving lightweight processing of the target code. Correspondingly, the application to be published does not need to load code from other platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for publishing a function of an application. Background Art

[0002] With the improvement of terminal device hardware performance and the continuous advancement of artificial intelligence technology, more and more applications (Application, APP for short) are running on terminal devices. Terminal devices are also becoming more and more diverse. And multiple different applications may often have the same functions. Taking short video APP as an example, different short video APPs may have instant messaging (IM) functions. However, the IM function pages and jump methods in different short video APPs may be different, and the IM function pages and jump methods of the same short video APP in different terminal devices may also be different. Therefore, how to realize the construction of the same functions of different applications or the same application in different terminals has become a problem that needs to be solved urgently.

[0003] In the prior art, in the process of writing application codes, different applications or the same application in different terminals generally have some reused logic codes and some different logic codes for the same functions. In order to realize the construction of the same functions in different applications, it is generally necessary to judge the current running environment of the code during the running of the code and use if / else statements to process the different logic codes in different applications.

[0004] However, using the above method to process the code often results in poor code readability. In addition, judging the environment at runtime and processing different logic codes through if / else statements often results in larger code data packets. In addition, a lot of logic codes that do not belong to the application platform will be loaded into a single application platform. Summary of the invention

[0005] The embodiments of the present disclosure provide a method, apparatus, device and storage medium for publishing application functions, which are used to solve the technical problems of poor code readability and large code data packets caused by using if / else statements to process different logic codes in different applications.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for publishing a function of an application program, comprising:

[0007] Obtain a function publishing request from the application, wherein the function publishing request includes an application identifier of a target function to be published;

[0008] According to the function release request, obtaining a target difference code corresponding to the application identifier to be released;

[0009] Determining a code to be processed that matches the target difference code in the target reference code;

[0010] Using the target difference code to perform a predetermined operation on the code to be processed, and determining the processed reference code as the target code;

[0011] The target function corresponding to the target code is published to the application to be published.

[0012] In a second aspect, an embodiment of the present disclosure provides a function publishing device for an application program, including:

[0013] A request acquisition module, used to acquire a function release request in an application, wherein the function release request includes an application identifier of a target function to be released;

[0014] A difference code acquisition module, used for acquiring a target difference code corresponding to the application identifier to be released according to the function release request;

[0015] A determination module, used for determining a to-be-processed code matching the target difference code in the target reference code;

[0016] A processing module, used for performing a predetermined operation on the code to be processed by using the target difference code, and determining the processed reference code as the target code;

[0017] A publishing module is used to publish the target function corresponding to the target code to the application to be published.

[0018] In a third aspect, an embodiment of the present disclosure provides a function publishing device for an application program, including: at least one processor and a memory;

[0019] The memory stores computer-executable instructions;

[0020] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the function publishing method of the application as described in the first aspect and various possible designs of the first aspect.

[0021] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, a function publishing method of an application as described in the first aspect and various possible designs of the first aspect is implemented.

[0022] The function publishing method, apparatus, device and storage medium of the application provided in the present embodiment first obtain the target difference code corresponding to the application identifier of the target function to be published in the function publishing request after obtaining the function publishing request in the application. The target difference code is used to perform a predetermined operation on the to-be-processed code matching the target difference code in the target reference code corresponding to the target function to obtain the target code. The target function corresponding to the target code is published to the application to be published. Since the target code is obtained after the to-be-processed code is subjected to a predetermined operation using the target difference code corresponding to the application identifier to be published, the target code only includes the general logic code and the difference code corresponding to the application to be published. Thereby, the size of the data packet of the code can be effectively reduced, and the lightweight processing of the target code can be realized. Accordingly, the application to be published does not need to load and process the codes of other platforms. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 An application scenario diagram corresponding to the function publishing method of the application provided in the embodiment of the present disclosure;

[0025] Figure 2 A flowchart of a method for publishing a function of an application provided in Embodiment 1 of the present disclosure;

[0026] Figure 3 An instant messaging display interface corresponding to the first application platform provided in the embodiment of the present disclosure;

[0027] Figure 4 An instant messaging display interface corresponding to the second application platform provided in the embodiment of the present disclosure;

[0028] Figure 5 A flowchart of a method for publishing application functions provided in Embodiment 2 of the present disclosure;

[0029] Figure 6 Schematic diagram of the benchmark code and candidate difference codes provided for the present disclosure;

[0030] Figure 7 A schematic diagram of the target code provided for the embodiment of the present disclosure;

[0031] Figure 8 A flowchart of a method for publishing application functions provided in Embodiment 3 of the present disclosure;

[0032] Fig. 9 A flowchart of a method for publishing application functions provided in Embodiment 4 of the present disclosure;

[0033] Fig.10 A flowchart of a method for publishing application functions provided in Embodiment 5 of the present disclosure;

[0034] Fig.11 A flowchart of a method for publishing a function of an application provided in Embodiment 6 of the present disclosure;

[0035] Fig.12 A schematic diagram of the structure of a function publishing device for an application provided in Embodiment 7 of the present disclosure;

[0036] Fig.13 A schematic diagram of the structure of a function publishing device for an application provided in Embodiment 8 of the present disclosure. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0038] In response to the above-mentioned technical problems of poor code readability and large code data packets caused by using if / else statements to process different logic codes in different applications, the present disclosure provides a function publishing method, device, equipment and storage medium for an application.

[0039] It should be noted that the method, apparatus, device and storage medium for publishing application functions provided by the present disclosure can be used in any scenario where the same function is published to different application software or the same function is published to different terminals.

[0040] As the functions of applications become more and more diverse, the same functions often exist in different applications. During the code editing process, the code corresponding to the same function generally contains a large amount of general logic code. However, for different applications, or the same application in different terminals, the code corresponding to the same function can also include differentiated logic code. In the prior art, when a function wants to be published to a certain application, it is often necessary to package the general logic code and the differentiated logic code corresponding to all applications. In actual applications, the code can be processed in an if / else manner according to the currently published platform to adapt the code to the publishing platform. However, the use of the above method to publish functions in an application often results in bloated code, poor readability, and a large data packet of the code.

[0041] In the process of solving the above technical problems, the inventors discovered through research that in order to enhance the readability of the code and achieve code lightweighting while publishing the same function to multiple different application platforms, it is possible to choose to reuse the common logic code of each application platform and split the different logic codes of each application platform.

[0042] The inventors further discovered that the base code corresponding to the function to be released and the differential code corresponding to each application can be pre-edited, and the differential code includes the application identifier. Before the function is released, the differential code corresponding to the application to be released can be used to perform a predetermined operation on the code in the base code that matches the differential code, and the target code after the predetermined operation is released. Since the target code is obtained after the target differential code corresponding to the application identifier to be released is used to perform a predetermined operation on the code to be processed, the target code only includes the general logic code and the differential code corresponding to the application to be released. This effectively improves the readability of the target code and achieves lightweight processing of the code.

[0043] Figure 1 An application scenario diagram corresponding to the function publishing method of the application provided in the embodiment of the present disclosure, such as Figure 1As shown, the application scenario of the present disclosure includes at least: a terminal device 1 and a server 2. The server 2 is provided with a function publishing device of an application program, and the function publishing device of the application program is written in a language such as C / C++, Java, Shell or Python; the terminal device 1 can be, for example, a desktop computer, a tablet computer, etc. The terminal device 1 is communicatively connected with the server 2, so that the two can exchange information. Specifically, when a user (such as an application developer) determines that a certain function of a certain application program needs to be published, a function publishing request can be triggered through the operation interface of the terminal device 1, and the terminal device sends the function request to the server. When the server determines that a certain function of the application program needs to be published, the server can send a function publishing request to the server. The base code and the differentiation code of each function in each application program can be stored in advance in the server through a database or a preset storage area. Then, according to the function publishing request, the server obtains the target difference code corresponding to the application identifier to be published. As Figure 1 In the example, the identification of the application to be released is the identification of application A, and the target function is the instant messaging function, then the target difference code corresponding to application A is obtained as "difference code-instant messaging-application A". Secondly, the server determines the code to be processed that matches the target difference code in the target reference code, such as the target reference code is "reference code-instant messaging" and the code to be processed is "code to be processed-instant messaging-application A". Furthermore, the target difference code is used to perform a predetermined operation on the code to be processed, and the processed reference code is determined as the target code; the target function corresponding to the target code is released to the application to be released.

[0044] Figure 2 A flow chart of a method for publishing a function of an application provided in the first embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:

[0045] Step 101: Obtain a function publishing request in an application, wherein the function publishing request includes an application identifier of a target function to be published.

[0046] The execution subject of this embodiment is a function publishing device of an application program, and the function publishing device of the application program can be coupled to a server.

[0047] In this embodiment, different application software may have the same function, but the visual style, interaction habits, jump rules, etc. of the function in different application software may be different. Therefore, in order to accurately release the function in the application to be released, the function release request in the application can be obtained first. Among them, the function release request in the application can specifically include the application identifier of the target function to be released.

[0048] Optionally, the function release request may be triggered by a developer through a terminal device.

[0049] Figure 3 An instant messaging display interface corresponding to the first application platform provided in the embodiment of the present disclosure; Figure 4 The instant messaging display interface corresponding to the second application platform provided in the embodiment of the present disclosure is as follows: Figure 3-Figure 4 As shown, in the instant messaging display interface corresponding to the first application platform, the upper area of ​​the display interface displays a plurality of different icons, namely fans, likes, @my and comments, and users can view the above information by clicking on the above icons. The lower area of ​​the display interface is the private messages sent by different accounts. In the instant messaging display interface corresponding to the second application platform, one side of the upper area of ​​the display interface displays icons related to me, and the other side displays system notification icons. Accordingly, users can view private messages and mentioned information by clicking on the icons related to me, and view notifications sent by system accounts by clicking on the system notification icons. It can be seen that the instant messaging functions corresponding to different application platforms differ in display interfaces and interaction habits.

[0050] Step 102: According to the function publishing request, a target difference code corresponding to the application identifier to be published is obtained.

[0051] In this embodiment, for the same target function, each application software may have its own personalized content. Therefore, in order to improve the readability of the code on the basis of achieving the target function release, for each application software, the difference code corresponding to the application software can be edited, and each difference code can include the identification information corresponding to the application software.

[0052] Accordingly, after the function publishing request is obtained, the target difference code corresponding to the to-be-published application identifier may be obtained according to the function publishing request.

[0053] Step 103: Determine in the target reference code the code to be processed that matches the target difference code.

[0054] In this embodiment, a target reference code corresponding to the target function can be pre-constructed, and the target reference code includes all codes that can realize the target function. However, since the target reference code cannot meet the personalized needs of the application to be released, the target difference code can be used to edit the target reference code.

[0055] Specifically, in order to implement the editing operation of the target base code, it is first necessary to determine the code to be processed corresponding to the target difference code in the target base code to achieve accurate code processing and ensure that the processed code can achieve the target function when it is run.

[0056] Step 104: Use the target difference code to perform a predetermined operation on the code to be processed, and determine the processed reference code as the target code.

[0057] In this embodiment, after determining the code to be processed that matches the target difference code, the target difference code may be used to perform a predetermined operation on the code to be processed, and the processed reference code is used as the target code.

[0058] Optionally, the predetermined operation includes but is not limited to a replacement operation of the code to be processed.

[0059] Specifically, since the target code only includes the general logic code and the difference code corresponding to the application to be released, and does not include the code of other applications, the target code is highly readable and has a small amount of data, which also brings convenience to subsequent maintenance.

[0060] Step 105: Publish the target function corresponding to the target code to the application to be published.

[0061] In this embodiment, after the target difference code is used to perform a predetermined operation on the code to be processed and the target code is obtained, the target function corresponding to the target code can be published to the application to be published to achieve the launch of the target function.

[0062] The function publishing method of the application provided in this embodiment obtains the target difference code corresponding to the application identifier to be published of the target function in the function publishing request, uses the target difference code to perform a predetermined operation on the to-be-processed code matching the target difference code in the target reference code corresponding to the target function, obtains the target code, and publishes the function corresponding to the target code to the application to be published. Thereby, it can be ensured that the target code only includes the general logic code and the difference code corresponding to the application to be published. Furthermore, the data packet size of the code can be effectively reduced, and the lightweight processing of the target code can be realized. Accordingly, the application to be published does not need to load the code of other platforms.

[0063] Figure 5 The flowchart of the function publishing method of the application provided in the second embodiment of the present disclosure is based on the first embodiment. Figure 5 As shown, step 102 specifically includes:

[0064] Step 201: According to the function release request, a candidate difference code including the to-be-released application identifier in a candidate difference code identifier is obtained from at least one preset candidate difference code.

[0065] Step 202: Determine the candidate difference code including the to-be-released application identifier in the candidate difference code identifier as the target difference code.

[0066] In this embodiment, for the application software to be released with the target function, multiple candidate difference codes are written according to the personalized needs corresponding to the target function in each application software. In order to distinguish the difference codes corresponding to different application software, the identification of the application software can be added to the candidate difference code identification. The identification can be specifically set in the suffix of the candidate difference code. For example, a code file identification in the benchmark code can be File1.js, and the difference code identification corresponding to the code file can be File1.diyipingtai.js.

[0067] Therefore, after the function publishing request is obtained, a candidate difference code including the to-be-published application identifier in at least one preset candidate difference code identifier may be determined according to the to-be-published application identifier as the target difference code.

[0068] Further, based on the first embodiment, the target difference code identifier includes the name of the target difference code; accordingly, step 103 specifically includes:

[0069] According to the name of the target difference code, a code to be processed that matches the target difference code is determined in the target reference code.

[0070] In this embodiment, after the target difference code is determined, for each target difference code, the to-be-processed code corresponding to the target difference code needs to be determined. Specifically, the to-be-processed code matching the target difference code can be determined in the target reference code according to the name of the target difference code.

[0071] For example, the identifier of the target difference code may be File1.diyipingtai.js, that is, the name of the target difference code is File 1. Accordingly, a code file named File 1 may be determined in the target base code as the to-be-processed code that matches the target difference code.

[0072] It should be noted that a webpack plug-in may also be provided in the function publishing device of the application, so that the webpack can be used to determine the code to be processed.

[0073] Figure 6 The schematic diagram of the benchmark code and candidate difference code provided by the present disclosure is as follows: Figure 6 As shown, the benchmark code includes all code information for realizing the target function. According to the personalized needs of each application to be released, each application to be released has a different differential code. Among them, the differential code identifies the application to be released corresponding to the differential code in the form of a suffix.

[0074] Taking actual application as an example, the predetermined operation may be a replacement operation, and the application to be released may be the first platform. The first platform corresponds to two differential codes: File1.diyipingtai.js and File3.diyipingtai.js. The benchmark code includes: File1.js, File2.js, File3.js, File4.js, and File5.js. Therefore, the differential code corresponding to the first platform may be used to replace File1.js and File3.js in the benchmark code to obtain the target code to be released to the first platform. Figure 7 The target code schematic diagram provided for the embodiment of the present disclosure is as follows: Figure 7 As shown, the target code includes File1.diyipingtai.js, File2.js, File3.diyipingtai.js, File4.js, and File5.js.

[0075] The function publishing method of the application provided in this embodiment can accurately determine the differentiated code corresponding to the application to be released by determining the target difference code in each candidate difference code according to the identification of the application to be released, thereby improving the matching degree between the target code and the application to be released, realizing lightweight processing of the code, and improving the readability of the code.

[0076] Figure 8 A flow chart of a method for publishing a function of an application provided in Embodiment 3 of the present disclosure is provided. Based on any of the above embodiments, Figure 8 As shown, step 104 specifically includes:

[0077] Step 301: Determine a target storage path corresponding to the target difference code.

[0078] Step 302: Replace the storage path corresponding to the code to be processed in the target reference code with the target storage path.

[0079] In this embodiment, the predetermined operation may be a replacement operation, and the replacement operation of the code to be processed may be implemented by switching the storage path of the code to be processed. Specifically, the target storage path corresponding to the target difference code may be determined. For each code to be processed, the storage path of the code to be processed may be replaced with the target storage path.

[0080] Specifically, a webpack plug-in may also be provided in the function publishing device of the application, and the webpack may be used to implement a replacement operation of the storage path corresponding to the code to be processed.

[0081] The function publishing method of the application provided in this embodiment replaces the storage path corresponding to the code to be processed with the target storage path corresponding to the target difference code, so that the target code can better adapt to the personalized needs of the application to be published. It is also ensured that the target code does not include the differential code corresponding to other platforms, avoiding the problem of bloated code data packets.

[0082] Fig. 9 A flowchart of a method for publishing a function of an application provided in Embodiment 4 of the present disclosure is provided. Based on any of the above embodiments, Fig. 9 As shown, step 104 specifically includes:

[0083] Step 401: Determine the reference relationship between the target difference code and the code to be processed.

[0084] Step 402: According to the reference relationship, the target difference code is used to replace the code to be processed.

[0085] In actual applications, there may or may not be a reference relationship between the target difference code and the code to be processed. When there is a reference relationship between the two, there may be some reused code and some difference code between the two. In this case, directly replacing the code to be processed with the target difference code may cause problems when the code is running and fail to achieve the target function.

[0086] Therefore, in order to achieve accurate replacement operation on the code to be processed, it is first necessary to determine the reference relationship between the target difference code and the code to be processed, and then use the target difference code to replace the code to be processed according to the reference relationship.

[0087] Further, based on any of the above embodiments, step 401 specifically includes:

[0088] If there is no reference relationship between the target difference code and the code to be processed, the target difference code is used to perform a replacement operation on the code to be processed.

[0089] If there is a reference relationship between the target difference code and the code to be processed, determine the reused code between the target difference code and the code to be processed; delete the reused code in the code to be processed, obtain the preprocessing code, and merge the preprocessing code and the target difference code.

[0090] In this embodiment, when there is no reference relationship between the target difference code and the code to be processed, that is, the target difference code and the code to be processed do not include reused code. Therefore, in order to improve the readability of the target code, the code to be processed can be directly replaced with the target code, the reused code in the code to be processed can be deleted, the preprocessing code is obtained, and the preprocessing code and the target difference code are merged.

[0091] On the contrary, when there is a reference relationship between the target difference code and the code to be processed, there may be some reused code between the two. In order to ensure the normal operation of the target code, it is necessary to first determine the reused code between the target difference code and the code to be processed. Delete the reused code in the code to be processed, obtain the preprocessing code, merge the preprocessing code and the target difference code, and obtain the target code.

[0092] The function publishing method of the application provided in this embodiment determines the reference relationship between the target difference code and the code to be processed, and implements the replacement operation of the code to be processed according to the reference relationship, thereby avoiding the problem of directly replacing the code to be processed and causing the code to fail to run normally, and ensures the applicability of the code on the basis of achieving lightweight processing of the code.

[0093] Fig.10 A flowchart of a method for publishing a function of an application provided in Embodiment 5 of the present disclosure is provided. Based on any of the above embodiments, Fig.10 As shown, step 104 specifically includes:

[0094] Step 501: Determine the code type corresponding to the code to be processed.

[0095] Step 502: According to the code type, use the target difference code to perform a predetermined operation on the code to be processed.

[0096] In this embodiment, in the process of code writing, in order to realize different functions, codes of different code types can be used. For example, JS type code is specifically used for the implementation of various logics. CSS type, less type, scss type, and ass type code are specifically used for the implementation of front-end display. Therefore, in order to realize the accurate replacement operation of the code to be processed, the code type corresponding to the code to be processed can be determined first. According to the code type, the target difference code is used to replace the code to be processed.

[0097] Further, based on any of the above embodiments, step 502 specifically includes:

[0098] If the code type corresponding to the code to be processed is a JS type, the target difference code is used to perform a replacement operation on the code to be processed.

[0099] If the code type corresponding to the code to be processed is any one of the css type, the less type, the scss type, and the ass type, then an identifier in the target difference code is determined, and a predetermined operation is performed on the code to be processed using the target difference code according to the identifier, wherein the identifier is used to indicate the operation type of the code to be processed.

[0100] In this embodiment, if the code type corresponding to the code to be processed is a JS type, the target difference code may be directly used to perform a replacement operation on the code to be processed.

[0101] Optionally, if the code type corresponding to the code is any one of the css type, less type, scss type, and ass type, you can choose to replace the code to be processed, or you can choose to merge the code to be processed. In order to determine the specific operation type, you can determine the identifier in the target difference code, and implement the replacement operation of the code to be processed according to the identifier. Among them, the identifier is specifically used to indicate the operation type of the code to be processed.

[0102] Further, based on any of the above embodiments, the performing a predetermined operation on the code to be processed using the target difference code according to the identifier includes:

[0103] If the identifier indicates that the operation type of the code to be processed is a replacement type, performing a replacement operation on the code to be processed using the target difference code;

[0104] If the identifier indicates that the operation type of the code to be processed is a merge type, a merge operation is performed on the target difference code and the replaceable file.

[0105] In this embodiment, if the operation type indicated by the identifier is a replacement type, the target difference code may be directly used to perform a replacement operation on the code to be processed.

[0106] Optionally, if the operation type indicated by the identifier is a merge type, the target difference code and the code to be processed may be retained in the target reference file at the same time to obtain the target code.

[0107] The function publishing method of the application provided in this embodiment can achieve flexible diversity of replacement operations by performing different predetermined operations on the code to be processed according to the code type corresponding to the code to be processed.

[0108] Further, based on any of the above embodiments, the method further includes:

[0109] Compile the target code.

[0110] In this embodiment, after obtaining the replaced target code, a compilation operation may be performed on the target code, and the fine-grained differences in the target code may be corrected through the compilation operation.

[0111] Further, based on any of the above embodiments, the compiling operation on the target code includes:

[0112] The target code is compiled using the environment constant to determine abnormal code in the target code that does not match the application to be released.

[0113] Delete the abnormal code.

[0114] In this embodiment, there are often some common contents in the target reference code, and there may be abnormal codes in the common contents that cannot be adapted to each application software. However, since the abnormal codes are small in size, there is no need to write differentiated codes for them. Therefore, they can be corrected during the compilation process. For example, the abnormal codes can be some words in the copy.

[0115] Specifically, during the compilation process, the target code can be compiled using environment constants to determine the abnormal code in the target code that does not match the application to be released. For the abnormal code, the abnormal code can be deleted to make the target code fully compatible with the application to be released. Optionally, it can also be modified according to the identifier of the application to be released.

[0116] For example, the abnormal code may be part of the words in the text, and the abnormal code may be deleted during the compilation process, or the words may be adjusted according to the identifier of the application to be released.

[0117] The function publishing method of the application provided in this embodiment processes the abnormal code in the target code that does not match the application to be released during the compilation process, thereby avoiding the code processing operation through if / else during the code use process, and effectively avoiding the technical problems of bloated code and poor readability.

[0118] Fig.11 A flowchart of a method for publishing a function of an application provided in Embodiment 6 of the present disclosure is provided. Based on any of the above embodiments, Fig.11 As shown, the method also includes:

[0119] Step 601: Obtain a code editing request, wherein the code editing request includes a difference code identifier and editing content.

[0120] Step 602: According to the code editing request, an editing operation is performed on the code content and / or the code identifier corresponding to the difference code corresponding to the target difference code identifier.

[0121] In this embodiment, in order to improve the applicability of the difference code, the user can also edit the difference code to make the difference code applicable to more application software.

[0122] Specifically, a code editing request sent by a user may be obtained, wherein the code editing request includes a difference code identifier and editing content. The code editing request may be sent by the user through a terminal device.

[0123] Accordingly, Leduo edits the code content and / or code identifier corresponding to the difference code corresponding to the target difference code identifier according to the code editing request. Editing the code content can enable the code to implement other functions, and editing the code identifier can enable the code to be applicable to other application software.

[0124] The function publishing method of the application provided in this embodiment can implement flexible modification of the difference code and make it adaptable to more scenarios by performing an editing operation on the difference code according to the editing request sent by the user.

[0125] Fig.12 This is a structural diagram of a function publishing device for an application provided in Embodiment 7 of the present disclosure, such as Fig.12 As shown, the device includes: a request acquisition module 71, a difference code acquisition module 72, a determination module 73, a processing module 74 and a publishing module 75. Among them, the request acquisition module 71 is used to obtain a function release request in an application, and the function release request includes the to-be-released application identifier of the target function. The difference code acquisition module 72 is used to obtain the target difference code corresponding to the to-be-released application identifier according to the function release request. The determination module 73 is used to determine the to-be-processed code that matches the target difference code in the target reference code. The processing module 74 is used to use the target difference code to perform a predetermined operation on the to-be-processed code, and determine the processed reference code as the target code. The publishing module 75 is used to publish the target function corresponding to the target code to the to-be-released application.

[0126] The function publishing device of the application provided in this embodiment obtains the target difference code corresponding to the application identifier of the target function to be published in the function publishing request, uses the target difference code to perform a predetermined operation on the to-be-processed code matching the target difference code in the target reference code corresponding to the target function, obtains the target code, and publishes the function corresponding to the target code to the application to be published. Thereby, it can be ensured that the target code only includes the general logic code and the difference code corresponding to the application to be published. Furthermore, the data packet size of the code can be effectively reduced, and the lightweight processing of the target code can be realized. Accordingly, the application to be published does not need to load the code of other platforms.

[0127] Further, based on the seventh embodiment, the difference code acquisition module includes: a candidate difference code acquisition unit and a determination unit. The candidate difference code acquisition unit is used to obtain, according to the function release request, a candidate difference code including the to-be-released application identifier in the candidate difference code identifier from at least one preset candidate difference code. The determination unit is used to determine the candidate difference code including the to-be-released application identifier in the candidate difference code identifier as the target difference code.

[0128] Further, based on the seventh embodiment, the target difference code identifier includes the name of the target difference code; the determination module is used to: determine the code to be processed that matches the target difference code in the target reference code according to the name of the target difference code.

[0129] The function publishing device of the application provided in this embodiment can accurately determine the differentiated code corresponding to the application to be released by determining the target difference code in each candidate difference code according to the identification of the application to be released, thereby improving the matching degree between the target code and the application to be released, realizing lightweight processing of the code, and improving the readability of the code.

[0130] Further, based on any of the above embodiments, the processing module includes: a storage path determination unit and a first replacement unit. The storage path determination unit is used to determine the target storage path corresponding to the target difference code. The first replacement unit is used to replace the storage path corresponding to the code to be processed in the target reference code with the target storage path.

[0131] The function publishing device of the application provided in this embodiment replaces the storage path corresponding to the code to be processed with the target storage path corresponding to the target difference code, so that the target code can better adapt to the personalized needs of the application to be published. It is also ensured that the target code does not include the differential code corresponding to other platforms, avoiding the problem of bloated code data packets.

[0132] Further, based on any of the above embodiments, the processing module includes: a reference relationship determination unit and a second replacement unit. The reference relationship determination unit is used to determine the reference relationship between the target difference code and the code to be processed. The second replacement unit is used to replace the code to be processed with the target difference code according to the reference relationship.

[0133] Further, based on any of the above embodiments, the second replacement unit is used to: if there is no reference relationship between the target difference code and the code to be processed, use the target difference code to replace the code to be processed. If there is a reference relationship between the target difference code and the code to be processed, determine the reused code between the target difference code and the code to be processed; delete the reused code in the code to be processed, obtain the preprocessing code, and merge the preprocessing code and the target difference code.

[0134] The function publishing device of the application provided in this embodiment determines the reference relationship between the target difference code and the code to be processed, and implements the replacement operation of the code to be processed according to the reference relationship, thereby avoiding the problem of directly replacing the code to be processed, which causes the code to be unable to run normally. On the basis of realizing lightweight processing of the code, the applicability of the code is guaranteed.

[0135] Further, based on any of the above embodiments, the processing module includes: a code type unit and a third replacement unit. The code type unit is used to determine the code type corresponding to the code to be processed. The third replacement unit is used to perform a predetermined operation on the code to be processed using the target difference code according to the code type.

[0136] Further, based on any of the above embodiments, the third replacement unit is used to: if the code type corresponding to the code to be processed is JS type, then use the target difference code to replace the code to be processed. If the code type corresponding to the code to be processed is any one of css type, less type, scss type, and ass type, then determine the identifier in the target difference code, and use the target difference code to perform a predetermined operation on the code to be processed according to the identifier, wherein the identifier is used to indicate the operation type of the code to be processed.

[0137] Further, based on any of the above embodiments, the third replacement unit is used to: if the identifier indicates that the operation type of the code to be processed is a replacement type, use the target difference code to perform a replacement operation on the code to be processed; if the identifier indicates that the operation type of the code to be processed is a merge type, merge the target difference code and the replaceable file.

[0138] The function publishing device for an application provided in this embodiment can achieve flexible and diverse replacement operations by performing different replacement operations on the code to be processed according to the code type corresponding to the code to be processed.

[0139] Furthermore, based on any of the above embodiments, the device further includes: a compiling module, configured to compile the target code.

[0140] Further, based on any of the above embodiments, the compiling module is used to: compile the target code using environment constants to determine abnormal codes in the target code that do not match the application to be released, and delete the abnormal codes.

[0141] The function publishing device for the application provided in this embodiment processes the abnormal code in the target code that does not match the application to be published during the compilation process, thereby avoiding the code processing operations through if / else during the code use process, and effectively avoiding the technical problems of bloated code and poor readability.

[0142] Further, based on any of the above embodiments, the device further comprises: an editing request acquisition module and an editing module. The editing request acquisition module is used to acquire a code editing request, wherein the code editing request includes a difference code identifier and editing content. The editing module is used to perform an editing operation on the code content and / or code identifier corresponding to the difference code corresponding to the target difference code identifier according to the code editing request.

[0143] The function publishing device for an application provided in this embodiment can implement flexible modification of the difference code to adapt it to more scenarios by performing an editing operation on the difference code according to an editing request sent by a user.

[0144] The function publishing device of the application provided in this embodiment can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0145] Fig.13 A schematic diagram of the structure of a function publishing device for an application provided in Embodiment 8 of the present disclosure, such as Fig.13As shown, it shows a schematic diagram of the structure of a function publishing device 800 suitable for implementing an application program in an embodiment of the present disclosure, and the function publishing device 800 of the application program may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.13 The function publishing device of the application 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.

[0146] like Fig.13 As shown, the application function publishing device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. Various programs and data required for the operation of the application function publishing device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0147] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; storage devices 807 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 808. The communication device 808 may allow the application function publishing device 800 to communicate with other devices wirelessly or by wire to exchange data. Fig.13 The function publishing device 800 of the application program having various devices is shown, 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.

[0148] 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 computer-readable storage 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 908, or installed from the storage device 907, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0149] It should be noted that the computer-readable storage 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 can 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 electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable storage 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 storage 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.

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

[0151] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0152] 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 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 an independent software package, partially on the user's computer and partially on a remote computer, or entirely 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., via the Internet using an Internet service provider).

[0153] 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.

[0154] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0155] 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.

[0156] 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.

[0157] In a first aspect, according to one or more embodiments of the present disclosure, a method for publishing a function of an application is provided, comprising:

[0158] Obtain a function publishing request from the application, wherein the function publishing request includes an application identifier of a target function to be published;

[0159] According to the function release request, obtaining a target difference code corresponding to the application identifier to be released;

[0160] Determining a code to be processed that matches the target difference code in the target reference code;

[0161] Using the target difference code to perform a predetermined operation on the code to be processed, and determining the processed reference code as the target code;

[0162] The target function corresponding to the target code is published to the application to be published.

[0163] According to one or more embodiments of the present disclosure, acquiring a target difference code corresponding to the to-be-released application identifier according to the function release request includes:

[0164] According to the function release request, obtaining a candidate difference code including the to-be-released application identifier in the candidate difference code identifier from at least one preset candidate difference code;

[0165] The candidate difference code including the to-be-published application identifier among the candidate difference code identifiers is determined as the target difference code.

[0166] According to one or more embodiments of the present disclosure, the target difference code identifier includes a name of the target difference code;

[0167] The step of determining the to-be-processed code that matches the target difference code in the target reference code comprises:

[0168] According to the name of the target difference code, a code to be processed that matches the target difference code is determined in the target reference code.

[0169] According to one or more embodiments of the present disclosure, the step of replacing the to-be-processed code with the target difference code includes:

[0170] Determine a target storage path corresponding to the target difference code;

[0171] The storage path corresponding to the code to be processed in the target reference code is replaced with the target storage path.

[0172] According to one or more embodiments of the present disclosure, the step of replacing the to-be-processed code with the target difference code includes:

[0173] Determining a reference relationship between the target difference code and the code to be processed;

[0174] According to the reference relationship, the target difference code is used to perform a replacement operation on the code to be processed.

[0175] According to one or more embodiments of the present disclosure, the replacing operation of the to-be-processed code with the target difference code according to the reference relationship includes:

[0176] If there is no reference relationship between the target difference code and the code to be processed, replacing the code to be processed with the target difference code;

[0177] If there is a reference relationship between the target difference code and the code to be processed, determine the reused code between the target difference code and the code to be processed; delete the reused code in the code to be processed, obtain the preprocessing code, and merge the preprocessing code and the target difference code.

[0178] According to one or more embodiments of the present disclosure, the step of replacing the to-be-processed code with the target difference code includes:

[0179] Determine the code type corresponding to the code to be processed;

[0180] According to the code type, a predetermined operation is performed on the code to be processed using the target difference code.

[0181] According to one or more embodiments of the present disclosure, the replacing operation of the to-be-processed code with the target difference code according to the code type includes:

[0182] If the code type corresponding to the code to be processed is a JS type, the target difference code is used to replace the code to be processed;

[0183] If the code type corresponding to the code to be processed is any one of the css type, the less type, the scss type, and the ass type, then an identifier in the target difference code is determined, and a predetermined operation is performed on the code to be processed using the target difference code according to the identifier, wherein the identifier is used to indicate the operation type of the code to be processed.

[0184] According to one or more embodiments of the present disclosure, the replacing operation of the to-be-processed code with the target difference code according to the identifier includes:

[0185] If the identifier indicates that the operation type of the code to be processed is a replacement type, performing a replacement operation on the code to be processed using the target difference code;

[0186] If the identifier indicates that the operation type of the code to be processed is a merge type, a merge operation is performed on the target difference code and the replaceable file.

[0187] According to one or more embodiments of the present disclosure, before publishing the target function corresponding to the target code to the application to be published, the process further includes:

[0188] Compile the target code.

[0189] According to one or more embodiments of the present disclosure, the compiling operation on the target code includes:

[0190] Compiling the target code using environment constants to determine abnormal code in the target code that does not match the application to be released;

[0191] Delete the abnormal code.

[0192] According to one or more embodiments of the present disclosure, the method further includes:

[0193] Obtaining a code editing request, wherein the code editing request includes a difference code identifier and editing content;

[0194] According to the code editing request, an editing operation is performed on the code content and / or the code identifier corresponding to the difference code corresponding to the target difference code identifier.

[0195] In a second aspect, according to one or more embodiments of the present disclosure, there is provided a function publishing device for an application program, comprising:

[0196] A request acquisition module, used to acquire a function release request in an application, wherein the function release request includes an application identifier of a target function to be released;

[0197] A difference code acquisition module, used for acquiring a target difference code corresponding to the application identifier to be released according to the function release request;

[0198] A determination module, used for determining a to-be-processed code matching the target difference code in the target reference code;

[0199] A processing module, configured to use the target difference code to replace the code to be processed, and determine the replaced reference code as the target code;

[0200] A publishing module is used to publish the target function corresponding to the target code to the application to be published.

[0201] According to one or more embodiments of the present disclosure, the difference code acquisition module includes:

[0202] A candidate difference code acquisition unit, configured to acquire, according to the function release request, from each candidate difference code, a candidate difference code whose candidate difference code identifier includes the to-be-released application identifier;

[0203] A determination unit is configured to determine the candidate difference code including the to-be-released application identifier among the candidate difference code identifiers as the target difference code.

[0204] According to one or more embodiments of the present disclosure, the target difference code identifier includes a name of the target difference code;

[0205] The determination module is used for:

[0206] According to the name of the target difference code, a code to be processed that matches the target difference code is determined in the target reference code.

[0207] According to one or more embodiments of the present disclosure, the processing module includes:

[0208] A storage path determining unit, used to determine a target storage path corresponding to the target difference code;

[0209] The first replacement unit is used to replace the storage path corresponding to the code to be processed in the target reference code with the target storage path.

[0210] According to one or more embodiments of the present disclosure, the processing module includes:

[0211] A reference relationship determination unit, used to determine a reference relationship between the target difference code and the code to be processed;

[0212] The second replacement unit is used to replace the to-be-processed code with the target difference code according to the reference relationship.

[0213] According to one or more embodiments of the present disclosure, the second replacement unit is used to:

[0214] If there is no reference relationship between the target difference code and the code to be processed, replacing the code to be processed with the target difference code;

[0215] If there is a reference relationship between the target difference code and the code to be processed, determine the reused code between the target difference code and the code to be processed; delete the reused code in the code to be processed to obtain a preprocessing code, and merge the preprocessing code and the target difference code.

[0216] According to one or more embodiments of the present disclosure, the processing module includes:

[0217] A code type unit, used to determine the code type corresponding to the code to be processed;

[0218] The third replacing unit is used to perform a predetermined operation on the code to be processed by using the target difference code according to the code type.

[0219] According to one or more embodiments of the present disclosure, the third replacement unit is used to:

[0220] If the code type corresponding to the code to be processed is a JS type, the target difference code is used to replace the code to be processed;

[0221] If the code type corresponding to the code to be processed is any one of the css type, the less type, the scss type, and the ass type, then an identifier in the target difference code is determined, and a replacement operation is performed on the code to be processed using the target difference code according to the identifier, wherein the identifier is used to indicate a replacement mode of the code to be processed.

[0222] According to one or more embodiments of the present disclosure, the third replacement unit is used to:

[0223] If the identifier indicates that the replacement mode of the code to be processed is a replacement type, the target difference code is used to perform a replacement operation on the code to be processed;

[0224] If the identifier indicates that the replacement mode of the code to be processed is a merge type, a merge operation is performed on the target difference code and the replaceable file.

[0225] According to one or more embodiments of the present disclosure, the device further includes:

[0226] A compiling module is used to compile the target code.

[0227] According to one or more embodiments of the present disclosure, the compiling module is used to:

[0228] Compiling the target code using environment constants to determine abnormal code in the target code that does not match the application to be released;

[0229] Delete the abnormal code.

[0230] According to one or more embodiments of the present disclosure, the device further includes:

[0231] An editing request acquisition module, used to acquire a code editing request, wherein the code editing request includes a difference code identifier and editing content;

[0232] The editing module is used to edit the code content and / or the code identifier corresponding to the difference code corresponding to the target difference code identifier according to the code editing request.

[0233] In a third aspect, according to one or more embodiments of the present disclosure, there is provided a function publishing device for an application program, comprising: at least one processor and a memory;

[0234] The memory stores computer-executable instructions;

[0235] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the function publishing method of the application as described in the first aspect and various possible designs of the first aspect.

[0236] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the function publishing method of the application described in the first aspect and various possible designs of the first aspect is implemented.

[0237] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0238] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0239] Although the subject matter 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. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for publishing a function of an application, characterized in that: include: Obtain a function publishing request from the application, wherein the function publishing request includes an application identifier of a target function to be published; According to the function release request, obtaining a target difference code corresponding to the application identifier to be released; Determining a code to be processed that matches the target difference code in the target reference code; Using the target difference code to perform a predetermined operation on the code to be processed, and determining the processed reference code as the target code; Publishing the target function corresponding to the target code to the application to be published; The using the target difference code to perform a predetermined operation on the code to be processed includes: Determining a reference relationship between the target difference code and the code to be processed; According to the reference relationship, the target difference code is used to perform a replacement operation on the code to be processed.

2. The method according to claim 1, characterized in that: The step of obtaining a target difference code corresponding to the application identifier to be released according to the function release request includes: According to the function release request, obtaining a candidate difference code including the to-be-released application identifier in the candidate difference code identifier from at least one preset candidate difference code; The candidate difference code including the to-be-published application identifier among the candidate difference code identifiers is determined as the target difference code.

3. The method according to claim 1, characterized in that The target difference code identifier includes the name of the target difference code; The step of determining the to-be-processed code that matches the target difference code in the target reference code comprises: According to the name of the target difference code, a code to be processed that matches the target difference code is determined in the target reference code.

4. The method according to claim 1, characterized in that The using the target difference code to perform a predetermined operation on the code to be processed includes: Determine a target storage path corresponding to the target difference code; The storage path corresponding to the code to be processed in the target reference code is replaced with the target storage path.

5. The method according to claim 1, characterized in that The step of performing a predetermined operation on the code to be processed by using the target difference code according to the reference relationship includes: If there is no reference relationship between the target difference code and the code to be processed, replacing the code to be processed with the target difference code; If there is a reference relationship between the target difference code and the code to be processed, determine the reused code between the target difference code and the code to be processed; delete the reused code in the code to be processed, obtain the preprocessing code, and merge the preprocessing code and the target difference code.

6. The method according to claim 1, characterized in that The using the target difference code to perform a predetermined operation on the code to be processed includes: Determine the code type corresponding to the code to be processed; According to the code type, a predetermined operation is performed on the code to be processed using the target difference code.

7. The method according to claim 6, characterized in that The step of performing a predetermined operation on the code to be processed by using the target difference code according to the code type includes: If the code type corresponding to the code to be processed is a JS type, the target difference code is used to replace the code to be processed; If the code type corresponding to the code to be processed is any one of the css type, the less type, the scss type, and the ass type, then an identifier in the target difference code is determined, and a predetermined operation is performed on the code to be processed using the target difference code according to the identifier, wherein the identifier is used to indicate the operation type of the code to be processed.

8. The method according to claim 7, characterized in that The step of performing a predetermined operation on the code to be processed by using the target difference code according to the identifier includes: If the identifier indicates that the operation type of the code to be processed is a replacement type, performing a replacement operation on the code to be processed using the target difference code; If the identifier indicates that the operation type of the code to be processed is a merge type, a merge operation is performed on the target difference code and the file to be processed.

9. The method according to any one of claims 1 to 8, characterized in that: Before publishing the target function corresponding to the target code to the application to be published, the method further includes: Compile the target code.

10. The method according to claim 9, characterized in that The compiling operation of the target code includes: Compiling the target code using environment constants to determine abnormal code in the target code that does not match the application to be released; Delete the abnormal code.

11. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: Obtaining a code editing request, wherein the code editing request includes a difference code identifier and editing content; According to the code editing request, an editing operation is performed on the code content and / or the code identifier corresponding to the difference code corresponding to the target difference code identifier.

12. A function publishing device for an application, characterized in that: include: A request acquisition module, used to acquire a function release request in an application, wherein the function release request includes an application identifier of a target function to be released; A difference code acquisition module, used for acquiring a target difference code corresponding to the application identifier to be released according to the function release request; A determination module, used for determining a to-be-processed code matching the target difference code in the target reference code; A processing module, used for performing a predetermined operation on the code to be processed by using the target difference code, and determining the processed reference code as the target code; A publishing module, used for publishing the target function corresponding to the target code to the application to be published; The processing module includes: a reference relationship determination unit and a second replacement unit; wherein the reference relationship determination unit is used to determine the reference relationship between the target difference code and the code to be processed; the second replacement unit is used to replace the code to be processed with the target difference code according to the reference relationship.

13. The device according to claim 12, characterized in that The difference code acquisition module includes: A candidate difference code acquisition unit, configured to acquire, according to the function release request, from each candidate difference code, a candidate difference code whose candidate difference code identifier includes the to-be-released application identifier; A determination unit is configured to determine the candidate difference code including the to-be-released application identifier among the candidate difference code identifiers as the target difference code.

14. The device according to claim 12, characterized in that The processing module comprises: A storage path determining unit, used to determine a target storage path corresponding to the target difference code; The first replacement unit is used to replace the storage path corresponding to the code to be processed in the target reference code with the target storage path.

15. The device according to claim 12, characterized in that The processing module comprises: A code type unit, used to determine the code type corresponding to the code to be processed; The third replacement unit is used to replace the to-be-processed code with the target difference code according to the code type.

16. The device according to claim 15, characterized in that The third replacement unit is used for: If the code type corresponding to the code to be processed is a JS type, the target difference code is used to replace the code to be processed; If the code type corresponding to the code to be processed is any one of the css type, the less type, the scss type, and the ass type, then an identifier in the target difference code is determined, and a predetermined operation is performed on the code to be processed using the target difference code according to the identifier, wherein the identifier is used to indicate the operation type of the code to be processed.

17. The device according to any one of claims 12 to 16, characterized in that: The device also includes: An editing request acquisition module, used to acquire a code editing request, wherein the code editing request includes a difference code identifier and editing content; The editing module is used to edit the code content and / or the code identifier corresponding to the difference code corresponding to the target difference code identifier according to the code editing request.

18. A function publishing device for an application, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the function publishing method of the application program according to any one of claims 1 to 11.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the function publishing method of the application program according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Small program code compiling method and device, equipment and medium

    CN111045683A

  • Small program conversion method and device,equipment and storage medium

    CN111610978A