A code processing method and apparatus

By compiling only the modified first business source code when developing hybrid applications and using the business placeholder files in the test version of the application to establish a debug communication channel, the problems of low development efficiency and long compilation in the existing technology are solved, and a more efficient development process is achieved.

CN111459494BActive Publication Date: 2025-05-30BEIJING 58 INFORMATION TTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010227062.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-27
Publication Date
2025-05-30
Estimated Expiration
2040-03-27

AI Technical Summary

Technical Problem

When developing hybrid applications, the prior art requires serial development of source code of business modules of each part, resulting in low development efficiency and long compilation and debugging process.

Method used

By obtaining the modified first business source code, the first compiled file is compiled, and a debugging communication channel is established based on the service placeholder files in the test version of the application, and the first compiled file is debugged in the application to avoid recompiling the unmodified SDK and the second business source code.

Benefits of technology

It reduces the amount of compiled data, reduces the time required for compilation, improves the efficiency of developing hybrid applications, and supports parallel development of the second business source code and the first business source code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111459494B_ABST
    Figure CN111459494B_ABST
Patent Text Reader

Abstract

This application discloses a code processing method and apparatus. During the development of a hybrid application, after a developer modifies the first business source code written in a first computer language, only the modified first business source code needs to be compiled to obtain a first compiled file. Then, based on the business placeholder file in the test version of the application, a debugging communication channel is established between the first compiled file and the application. After that, the modified first compiled file can be debugged in the application based on the debugging communication channel. Thus, compared with the prior art, this application only needs to compile the modified first business source code, and does not need to compile the debugging version of the SDK corresponding to the first computer programming language and the second business source code written in a second computer language, thereby reducing the amount of data to be compiled, reducing the time required for compilation, and improving the efficiency of developing hybrid applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technologies, and particularly to a code processing method and apparatus. Background Art

[0002] Currently, in order to expand the functions of an application program, when developing an application program, it is necessary to load multiple different function modules in the application program. However, sometimes multiple different function modules are not developed based on the same computer programming language, but are developed based on different computer programming languages.

[0003] Therefore, when developing such a hybrid application program, first, a developer can write the source code 1 of a part of the business module in the application program based on a computer programming language, then embed the SDK (Software Development Kit) of another computer programming language in the source code 1. After that, on the source code 1 and the SDK, the developer writes the source code 2 of another part of the business module in the application program based on another computer programming language, and then compiles the source code 1, the SDK, and the source code 2 as a whole to obtain a hybrid application program.

[0004] However, the inventor found that the above method has the following problems:

[0005] The prerequisite for developing the source code 2 is that the source code 1 and the SDK need to have been obtained, so that the development of the source code of each part of the business module is a serial development process, resulting in low efficiency in developing a hybrid application program. Secondly, during the process of developing a hybrid application program, if it is found that the source code 2 does not meet the requirements during the compilation and debugging of the source code 2 and the source code 2 needs to be modified, then the source code 1, the SDK, and the modified source code 2 need to be compiled as a whole and then debugged, resulting in a long compilation time. Summary of the Invention

[0006] To solve the above technical problems, the present application discloses a code processing method and apparatus.

[0007] In a first aspect, the present application discloses a code processing method, the method comprising:

[0008] Obtaining a modified first business source code, the modified first business source code being obtained by modifying the first business source code written based on a first computer language;

[0009] Compiling the modified first business source code to obtain a first compilation file;

[0010] Obtain the developed test version of the application, which is obtained by compiling the second business source code written in the second computer language, the software development kit (SDK) corresponding to the first computer programming language, and the business placeholder file corresponding to the first computer programming language;

[0011] Establish a debugging communication channel between the first compiled file and the application based on the business placeholder file;

[0012] Debug the first compiled file in the application based on the debugging communication channel.

[0013] In an alternative implementation, before obtaining the modified first business source code, it further includes:

[0014] Obtain the debugging version of the SDK corresponding to the first computer programming language;

[0015] Obtain the debugging version of the business placeholder file corresponding to the first computer programming language;

[0016] Obtain the second business source code written in the second computer language;

[0017] Compile the debugging version of the SDK, the debugging version of the business placeholder file, and the second business source code to obtain the test version of the application;

[0018] Store the test version of the application.

[0019] In an alternative implementation, the method further includes:

[0020] When the first compiled file meets the release conditions, obtain the release version of the SDK corresponding to the first computer programming language;

[0021] Compile the release version of the SDK, the modified first business source code, and the second business source code to obtain the release version of the application corresponding to the test version of the application.

[0022] In an alternative implementation, the method further includes:

[0023] When the first compiled file meets the release conditions, obtain the release version of the SDK corresponding to the first computer programming language;

[0024] Compile the first compiled file and the release version of the SDK to obtain the release version of the application corresponding to the first computer programming language.

[0025] Second aspect, the present application discloses a code processing device, the device comprising:

[0026] A first acquisition module, configured to acquire a modified first service source code, where the modified first service source code is obtained by modifying the first service source code written in a first computer language;

[0027] A first compilation module, configured to compile the modified first service source code to obtain a first compilation file;

[0028] A second acquisition module, configured to acquire a developed test version of an application program, where the application program is obtained by compiling a second service source code written in a second computer language, a software development kit (SDK) corresponding to the first computer program language, and a service placeholder file corresponding to the first computer program language;

[0029] A establishment module, configured to establish a debugging communication channel between the first compilation file and the application program based on the service placeholder file;

[0030] A debugging module, configured to debug the first compilation file in the application program based on the debugging communication channel.

[0031] In an optional implementation manner, the device further comprises:

[0032] A second acquisition module, configured to acquire a debugging version of the SDK corresponding to the first computer program language;

[0033] A third acquisition module, configured to acquire a debugging version of the service placeholder file corresponding to the first computer program language;

[0034] A fourth acquisition module, configured to acquire the second service source code written in the second computer language;

[0035] A second compilation module, configured to compile the debugging version of the SDK, the debugging version of the service placeholder file, and the second service source code to obtain the test version of the application program;

[0036] A storage module, configured to store the test version of the application program.

[0037] In an optional implementation manner, the device further comprises:

[0038] A fifth acquisition module, configured to acquire a release version of the SDK corresponding to the first computer program language when the first compilation file meets the release condition;

[0039] A third compilation module, configured to compile the SDK of the release version, the modified first service source code, and the second service source code to obtain the application program of the release version corresponding to the test version of the application program.

[0040] In an optional implementation manner, the apparatus further includes:

[0041] A sixth acquisition module, configured to acquire the SDK of the release version corresponding to the first computer program language when the first compilation file meets the release condition;

[0042] A fourth compilation module, configured to compile the first compilation file and the SDK of the release version to obtain the application program of the release version corresponding to the first computer program language.

[0043] In a third aspect, the present application discloses an electronic device, including:

[0044] A processor;

[0045] A memory for storing instructions executable by the processor;

[0046] Wherein, the processor is configured to execute the code processing method as described in the first aspect.

[0047] In a fourth aspect, the present application discloses a non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the code processing method as described in the first aspect.

[0048] In a fifth aspect, the present application discloses a computer program product, when the instructions in the computer program product are executed by a processor of an electronic device, enabling the electronic device to execute the code processing method as described in the first aspect.

[0049] The technical solution provided by the present application may include the following beneficial effects:

[0050] In the development of hybrid application programs, when developers write the first service source code based on the first computer program language, it is usually impossible to write the first service source code that is accurate and meets the requirements at one time. After writing the first service source code for the first time, it is necessary to compile and debug the first service source code, and determine whether the first service source code meets the requirements according to the compilation and debugging results. If it does not meet the requirements, it is necessary to modify the first service source code. Usually, it is necessary to modify the first service source code multiple times, and then after each modification, it is necessary to repeat the compilation and debugging of the modified first service source code, and determine whether the modified first service source code meets the requirements according to the compilation and debugging results until it is determined that the modified first service source code meets the requirements according to the compilation and debugging results.

[0051] Among them, in the prior art, after modifying the first business source code, it is necessary to perform an overall compilation on the modified first business source code, the second business source code, and the SDK corresponding to the first computer programming language, and then debug the compilation result. It can be seen that the amount of data to be compiled in the prior art is large, resulting in a long compilation time, and thus the efficiency of developing a hybrid application is low.

[0052] However, the applicant of the present application has found that: in fact, the developer only modifies the first business source code, and the debug version of the SDK corresponding to the first computer programming language and the second business source code are not modified. Therefore, it is not necessary to recompile the debug version of the SDK corresponding to the first computer programming language and the second business source code written in the second computer language, and only the modified first business source code needs to be recompiled.

[0053] Therefore, in the present application, it is possible to pre-compile based on the debug version of the SDK corresponding to the first computer programming language, the business placeholder file corresponding to the debug version of the first computer programming language, and the second business source code written in the second computer language to obtain a test version of the application program.

[0054] In this way, after the developer modifies the first business source code written in the first computer language, it is only necessary to compile the modified first business source code to obtain a first compilation file, and then establish a debug communication channel between the first compilation file and the application program based on the business placeholder file in the test version of the application program; thereafter, it is possible to debug the modified first compilation file in the application program based on the debug communication channel.

[0055] In this way, compared with the prior art, after modifying the first business source code, the present application can only compile the modified first business source code, and can not compile the debug version of the SDK corresponding to the first computer programming language and the second business source code written in the second computer language, thereby reducing the amount of data to be compiled, and also reducing the compilation time required, so as to improve the efficiency of developing a hybrid application.

[0056] Secondly, through the method of the present application, since a debug communication channel can be established between the first compilation file and the application program based on the business placeholder file, and then the modified first compilation file is debugged in the application program based on the debug communication channel, therefore, it is not necessary for the developer to write the first business source code on the basis of the second business source code, thereby abandoning this serial development model, and the present application supports parallel development of the second business source code and the first business source code, thereby also improving the efficiency of developing a hybrid application. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 is a flowchart showing the steps of a code processing method shown in this application;

[0058] Figure 2 is a structural block diagram of a code processing device shown in this application;

[0059] Figure 3 is a block diagram of an electronic device shown in this application;

[0060] Figure 4 is a block diagram of an electronic device shown in this application. Detailed implementation manners

[0061] To make the above objects, features, and advantages of this application more obvious and understandable, the following further details this application in conjunction with the accompanying drawings and specific implementation manners.

[0062] Refer to Figure 1 , which shows a flowchart of the steps of a code processing method of this application. The method may specifically include the following steps:

[0063] In step S101, obtain the modified first business source code, where the modified first business source code is obtained by modifying the first business source code written in the first computer language;

[0064] In this application, the first business source code written in the first computer language is written for developing a hybrid application.

[0065] In step S102, compile the modified first business source code to obtain a first compiled file;

[0066] In step S103, obtain the developed test version of the application program, where the test version of the application program is obtained by compiling the second business source code written in the second computer language, the SDK corresponding to the first computer program language, and the business placeholder file corresponding to the first computer program language;

[0067] In this application, the test version of the application program is developed by technicians in advance. Assume that the hybrid application program to be developed is jointly written by at least the first computer program language and the second computer program language. When developing the hybrid application program, if the second business source code written in the second computer program language meets the requirements, then there is no need to modify the second business source code written in the second computer program language, while the first business source code written in the first computer program language does not meet the requirements. In this case, it is necessary to continuously compile and debug the first business source code and modify the first business source code written in the first computer language according to the results of the compilation and debugging until the modified first business source code meets the requirements.

[0068] In this application, during the process of developing a hybrid application, the modified business source code needs to be recompiled and debugged, while the unmodified business source code does not need to be recompiled and debugged.

[0069] Therefore, in this case, since the second business source code written in the second computer programming language does not need to be modified, the second business source code written in the second computer programming language does not need to be recompiled and debugged, and the SDK corresponding to the first computer programming language does not need to be modified either. Therefore, the SDK corresponding to the first computer programming language does not need to be recompiled and debugged. Only the modified first business source code written in the first computer programming language needs to be recompiled and debugged, reducing the amount of data to be compiled, which can reduce the time required for compilation, thereby improving the efficiency of developing hybrid applications.

[0070] In order to be able to only recompile and debug the modified first business source code, in this application, when developing a hybrid application, a test version of the application can be developed first. The development process includes:

[0071] 11) Obtain the debug version of the SDK corresponding to the first computer programming language;

[0072] In this application, before developing a hybrid application, the SDK corresponding to the first computer programming language can be split into a debug version of the SDK and a release version of the SDK in advance.

[0073] Among them, the debug version of the SDK includes not only the content that must be available when the developed hybrid application runs, but also the content required for debugging.

[0074] The release version of the SDK includes the content that must be available when the developed hybrid application runs, and may not include the content required for debugging.

[0075] Since the test version of the application needs to participate in the debugging work of the first compilation file of the modified first business source code, the test version of the application needs to have debugging functions. Therefore, when developing the test version of the application, the debug version of the SDK can be used.

[0076] Among them, the debug version of the SDK and the release version of the SDK can be stored in a remote repository in advance. The remote repository is open to the public and can be called by developers.

[0077] In this way, when a certain version of the SDK is needed, that version of the SDK can be called from the remote repository.

[0078] 12) Obtain the business placeholder file of the debug version corresponding to the first computer program language;

[0079] In this application, before developing a hybrid application, the business placeholder file corresponding to the first computer program language can be split into a business placeholder file of the debug version and a business placeholder file of the release version in advance.

[0080] Among them, the business placeholder file of the debug version includes not only the content that must be available when the developed hybrid application runs, but also the content required for debugging.

[0081] The business placeholder file of the release version includes the content that must be available when the developed hybrid application runs, and may not include the content required for debugging.

[0082] Since the application of the test version needs to participate in the debugging work of the first compilation file of the modified first business source code, the application of the test version needs to have debugging functions. Therefore, when developing the application of the test version, the business placeholder file of the debug version can be used.

[0083] Among them, the business placeholder file of the debug version and the business placeholder file of the release version can be stored in the remote repository respectively in advance. The remote repository is open to the public and can be called by developers.

[0084] In this way, when a certain version of the business placeholder file is needed, that version of the business placeholder file can be called from the remote repository.

[0085] 13) Obtain the second business source code written in the second computer language;

[0086] The second business source code written in the second computer language has been written and stored in the electronic device by developers in advance. Therefore, the second business source code written in the second computer language can be directly obtained in the electronic device.

[0087] 14) Compile the debug version of the SDK, the debug version of the business placeholder file, and the second business source code to obtain the application of the test version;

[0088] 15) Store the application of the test version.

[0089] After storing the test version of the application, during the development of the hybrid application, whenever the first business source code written in the first computer programming language is modified, the first compilation file of the modified first business source code can be directly debugged in the test version of the application, without the need to recompile the SDK of the debug version corresponding to the first computer programming language and the second business source code, reducing the amount of data to be compiled, which can reduce the time required for compilation, thereby improving the efficiency of developing the hybrid application.

[0090] In step S104, a debugging communication channel is established between the first compilation file and the application based on the business placeholder file.

[0091] In this application, the business placeholder file includes at least two interfaces. Through one interface, the business placeholder file can be connected to the second compilation file of the second business source code in the test version of the application, and through another interface, the business placeholder file can be connected to the SDK corresponding to the first computer programming language in the test version of the application. In this way, it is realized that the first compilation file of the modified first business source code can call the SDK corresponding to the first computer programming language, and it is realized that the first compilation file of the modified first business source code and the second compilation file of the second business source code are organically combined, so that the debugging work can be completed in combination.

[0092] In step S105, the first compilation file is debugged in the test version of the application based on the debugging communication channel.

[0093] In the development of hybrid applications, when developers write the first business source code based on the first computer programming language, it is usually impossible to write the first business source code that is accurate and meets the requirements at one time. After the first business source code is written, it is necessary to compile and debug the first business source code, and determine whether the first business source code meets the requirements according to the compilation and debugging results. If it does not meet the requirements, the first business source code needs to be modified. Usually, the first business source code needs to be modified multiple times, and then after each modification, it is necessary to repeat the compilation and debugging of the modified first business source code, and determine whether the modified first business source code meets the requirements according to the compilation and debugging results, until it is determined that the modified first business source code meets the requirements according to the compilation and debugging results.

[0094] Among them, in the prior art, after the first business source code is modified, it is necessary to compile the modified first business source code, the second business source code, and the SDK corresponding to the first computer programming language as a whole, and then debug the compilation result. It can be seen that the amount of data to be compiled in the prior art is large, resulting in a long compilation time, and thus the efficiency of developing hybrid applications is low.

[0095] However, the applicant of the present application has found that: In fact, the developer has only modified the first business source code, while the SDK of the debug version corresponding to the first computer programming language and the second business source code have not been modified. Therefore, it is not necessary to recompile the SDK of the debug version corresponding to the first computer programming language and the second business source code written in the second computer language. It is only necessary to recompile the modified first business source code.

[0096] Therefore, in the present application, it is possible to pre-compile based on the SDK of the debug version corresponding to the first computer programming language, the business placeholder file of the debug version corresponding to the first computer programming language, and the second business source code written in the second computer language to obtain a test version of the application program.

[0097] In this way, after the developer modifies the first business source code written in the first computer language, it is only necessary to compile the modified first business source code to obtain a first compilation file, and then establish a debug communication channel between the first compilation file and the application program based on the business placeholder file in the test version of the application program; then it is possible to debug the modified first compilation file in the application program based on the debug communication channel.

[0098] In this way, compared with the prior art, after modifying the first business source code, the present application can only compile the modified first business source code, and can not compile the SDK of the debug version corresponding to the first computer programming language and the second business source code written in the second computer language, thereby reducing the amount of data to be compiled, and thus reducing the time required for compilation, and thus improving the efficiency of developing a hybrid application program.

[0099] Secondly, through the method of the present application, since a debug communication channel can be established between the first compilation file and the application program based on the business placeholder file, and then the modified first compilation file is debugged in the application program based on the debug communication channel, therefore, it is not necessary for the developer to write the first business source code based on the second business source code, thus this serial development model can be abandoned, and the present application supports parallel development of the second business source code and the first business source code, thus also improving the efficiency of developing a hybrid application program.

[0100] In this application, after modifying the first business source code written in the first computer language multiple times and debugging the first compiled file of the modified first business source code in the test version of the application each time, if the developer determines that the first compiled file meets the release conditions, it indicates that the modified first business source code can be put into production. Therefore, in order to generate a hybrid application, when the first compiled file meets the release conditions, the SDK of the release version corresponding to the first computer program language can be obtained. Among them, the developer has previously stored the SDK of the release version corresponding to the first computer program language in the remote repository. Therefore, the electronic device can obtain the SDK of the release version corresponding to the first computer program language from the remote repository, and then compile the SDK of the release version, the modified first business source code, and the second business source code to obtain the release version of the application corresponding to the test version of the application.

[0101] Among them, the release version of the application is an application that can be used by the general customers. The release version of the application is a hybrid application written based on the first computer program language and the second computer program language.

[0102] Since the release version of the application is directly released to the general users and is an application that the general users can directly use, thus, the release version of the application does not need to have a debugging function. Therefore, the SDK can use the SDK of the release version corresponding to the first computer program language.

[0103] The debug version of the SDK includes, in addition to the content that must be available when the developed hybrid application runs, the content required for debugging. The release version of the SDK includes the content that must be available when the developed hybrid application runs, but does not include the content required for debugging. Therefore, using the SDK of the release version corresponding to the first computer program language can avoid the existence of useless content in the release version of the application, achieve the refinement of the release version of the application, and reduce the redundancy of the release version of the application.

[0104] In this application, after modifying the first business source code written in the first computer language multiple times and debugging the first compiled file of the modified first business source code in the test version of the application each time, if the developer determines that the first compiled file meets the release conditions, it indicates that the modified first business source code can be put into production. In order to enable the modified first business source code to be directly combined with the business source code written in other computer languages to generate other hybrid applications, in this application, the first compiled file of the modified first business source code can be packaged with the SDK of the release version corresponding to the first computer program language.

[0105] For example, when the first compilation file meets the release conditions, the SDK of the release version corresponding to the first computer program language can be obtained, and then the first compilation file and the SDK of the release version corresponding to the first computer program language are compiled to obtain the application program of the release version corresponding to the first computer program language.

[0106] In this way, if it is necessary to load the third service source code written in the third computer program language onto the application program of the release version corresponding to the first computer program language to obtain another hybrid application program later, the SDK of the debug version corresponding to the third computer program language can be directly integrated into the application program of the release version corresponding to the first computer program language to obtain the test version of the application program, and then reference can be made to Figure 1 the method shown to debug the third compilation file of the third service source code in the test version of the application program, thereby improving the efficiency of debugging the third compilation file in the test version of the application program, and further improving the efficiency of developing the hybrid application program.

[0107] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by this application.

[0108] Referring to Figure 2 , a structural block diagram of a code processing device of this application is shown. The device may specifically include the following modules:

[0109] The first acquisition module 11 is used to acquire the first service source code, where the first service source code is obtained by modifying the historical service source code written in the first computer language;

[0110] The first compilation module 12 is used to compile the modified first service source code to obtain the first compilation file;

[0111] The second acquisition module 13 is used to acquire the developed test version of the application program, where the application program is obtained by compiling the second service source code written in the second computer language, the software development kit (SDK) corresponding to the first computer program language, and the service placeholder file corresponding to the first computer program language;

[0112] The establishment module 14 is used to establish a debug communication channel between the first compilation file and the application program based on the service placeholder file;

[0113] A debugging module 15 for debugging the first compiled file in the application based on the debugging communication channel.

[0114] In an optional implementation, the device further includes:

[0115] A second acquisition module for acquiring the SDK of the debugging version corresponding to the first computer programming language;

[0116] A third acquisition module for acquiring the business placeholder file of the debugging version corresponding to the first computer programming language;

[0117] A fourth acquisition module for acquiring the second business source code written in the second computer language;

[0118] A second compilation module for compiling the SDK of the debugging version, the business placeholder file of the debugging version, and the second business source code to obtain the application program of the test version;

[0119] A storage module for storing the application program of the test version.

[0120] In an optional implementation, the device further includes:

[0121] A fifth acquisition module for acquiring the SDK of the release version corresponding to the first computer programming language when the first compiled file meets the release conditions;

[0122] A third compilation module for compiling the SDK of the release version, the modified first business source code, and the second business source code to obtain the application program of the release version corresponding to the application program of the test version.

[0123] In an optional implementation, the device further includes:

[0124] A sixth acquisition module for acquiring the SDK of the release version corresponding to the first computer programming language when the first compiled file meets the release conditions;

[0125] A fourth compilation module for compiling the first compiled file and the SDK of the release version to obtain the application program of the release version corresponding to the first computer programming language.

[0126] In the development of hybrid applications, when developers write the first business source code based on the first computer programming language, it is usually impossible to write the first business source code that is accurate and meets the requirements at one time. After the first business source code is written, it is necessary to compile and debug the first business source code, and determine whether the first business source code meets the requirements according to the compilation and debugging results. If it does not meet the requirements, it is necessary to modify the first business source code. Usually, it is necessary to modify the first business source code multiple times. Then, after each modification, it is necessary to repeat the compilation and debugging of the modified first business source code, and determine whether the modified first business source code meets the requirements according to the compilation and debugging results, until it is determined according to the compilation and debugging results that the modified first business source code meets the requirements.

[0127] Among them, in the prior art, after modifying the first business source code, it is necessary to compile the modified first business source code, the second business source code, and the SDK corresponding to the first computer programming language as a whole, and then debug the compilation result. It can be seen that the amount of data compiled in the prior art is large, resulting in a long compilation time, and thus the efficiency of developing hybrid applications is low.

[0128] However, the applicant of the present application found that: in fact, the developer only modified the first business source code, and the SDK of the debug version corresponding to the first computer programming language and the second business source code were not modified. Therefore, it is not necessary to recompile the SDK of the debug version corresponding to the first computer programming language and the second business source code written based on the second computer language, and only the modified first business source code needs to be recompiled.

[0129] Therefore, in the present application, it is possible to compile in advance based on the SDK of the debug version corresponding to the first computer programming language, the business placeholder file of the debug version corresponding to the first computer programming language, and the second business source code written based on the second computer language to obtain a test version of the application.

[0130] In this way, after the developer modifies the first business source code written based on the first computer language, it is only necessary to compile the modified first business source code to obtain a first compilation file, and then establish a debugging communication channel between the first compilation file and the application based on the business placeholder file in the test version of the application; then, it is possible to debug the modified first compilation file in the application based on the debugging communication channel.

[0131] Thus, compared with the prior art, after modifying the first service source code, the present application can only compile the modified first service source code, and does not need to compile the SDK of the debug version corresponding to the first computer program language and the second service source code written in the second computer language, thereby reducing the amount of data to be compiled, reducing the time required for compilation, and improving the efficiency of developing hybrid application programs.

[0132] Secondly, through the method of the present application, since a debug communication channel can be established between the first compilation file and the application program based on the service placeholder file, and then the modified first compilation file is debugged in the application program based on the debug communication channel, therefore, it is not necessary for developers to write the first service source code based on the second service source code, thus abandoning this serial development model, and the present application supports parallel development of the second service source code and the first service source code, thereby also improving the efficiency of developing hybrid application programs.

[0133] For the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, refer to the partial description of the method embodiment.

[0134] Figure 3 It is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0135] Refer to Figure 3 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0136] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0137] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0138] The power supply component 806 provides power to various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0139] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

[0140] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0141] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0142] The sensor assembly 814 includes one or more sensors for providing a status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 can detect the on / off state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0143] The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices in a wired or wireless manner. The electronic device 800 can access a wireless network based on communication standards, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0144] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.

[0145] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the above instructions can be executed by a processor 820 of the electronic device 800 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0146] Figure 4FIG. 0 is a block diagram of an electronic device 1900 shown in the present application. For example, the electronic device 1900 may be provided as a server.

[0147] Referring to Figure 4 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application programs stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0148] The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

[0149] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments may be referred to each other.

[0150] Those skilled in the art should understand that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.

[0151] The present application is described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable test case generation terminal devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable test case generation terminal devices generate for implementing in the process Figure 1 a process or multiple processes and / or blocks Figure 1means for the functions specified in one or more boxes.

[0152] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable test case generation terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements in the process Figure 1 one process or multiple processes and / or boxes Figure 1 the functions specified in one box or multiple boxes.

[0153] These computer program instructions can also be loaded onto a computer or other programmable test case generation terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or boxes Figure 1 one box or multiple boxes.

[0154] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0155] Finally, it should also be noted that in this article, relational terms such as first and second 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 term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or terminal device including the said element.

[0156] The above has introduced in detail a code processing method and device provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A code processing method, characterized in that, the method includes: obtaining a modified first business source code, which is obtained by modifying the first business source code written in a first computer language; the first business source code is used to develop a hybrid application; the hybrid application is at least jointly written by a first computer program language and a second computer program language; compiling the modified first business source code to obtain a first compiled file; obtaining a developed test version of an application, which is obtained by compiling a second business source code written in a second computer language, a software development kit (SDK) corresponding to the first computer program language, and a business placeholder file corresponding to the first computer program language, and is used to develop the hybrid application; establishing a debugging communication channel between the first compiled file and the application based on the business placeholder file; the business placeholder file includes at least two interfaces for connecting the business placeholder file with a second compiled file of the second business source code and connecting the business placeholder file with the SDK corresponding to the first computer program language; debugging the first compiled file in the application based on the debugging communication channel.

2. The method according to claim 1, characterized in that, before obtaining the modified first business source code, it further includes: obtaining a debug version of the SDK corresponding to the first computer program language; obtaining a debug version of the business placeholder file corresponding to the first computer program language; obtaining the second business source code written in the second computer language; compiling the debug version of the SDK, the debug version of the business placeholder file, and the second business source code to obtain the test version of the application; storing the test version of the application.

3. The method according to claim 1, characterized in that, the method further includes: when the first compiled file meets the release condition, obtaining a release version of the SDK corresponding to the first computer program language; compiling the release version of the SDK, the modified first business source code, and the second business source code to obtain a release version of the application corresponding to the test version of the application.

4. The method according to claim 1, characterized in that, the method further includes: when the first compiled file meets the release condition, obtaining a release version of the SDK corresponding to the first computer program language; compiling the first compiled file and the release version of the SDK to obtain a release version of the application corresponding to the first computer program language.

5. A code processing device, characterized in that, the device includes: A first acquisition module, configured to acquire a modified first business source code, where the modified first business source code is obtained by modifying the first business source code written in a first computer language; the first business source code is used to develop a hybrid application; the hybrid application is at least jointly written by a first computer programming language and a second computer programming language; A first compilation module, configured to compile the modified first business source code to obtain a first compilation file; A second acquisition module, configured to acquire a developed test version of an application, where the application is obtained by compiling a second business source code written in a second computer language, a software development kit (SDK) corresponding to the first computer programming language, and a business placeholder file corresponding to the first computer programming language, and is used to develop the hybrid application; A establishment module, configured to establish a debugging communication channel between the first compilation file and the application based on the business placeholder file; the business placeholder file includes at least two interfaces, which are used to connect the business placeholder file with a second compilation file of the second business source code, and to connect the business placeholder file with the software development kit (SDK) corresponding to the first computer programming language; A debugging module, configured to debug the first compilation file in the application based on the debugging communication channel.

6. The apparatus according to claim 5, wherein, the apparatus further includes: A second acquisition module, configured to acquire a debug version of the SDK corresponding to the first computer programming language; A third acquisition module, configured to acquire a debug version of the business placeholder file corresponding to the first computer programming language; A fourth acquisition module, configured to acquire the second business source code written in the second computer language; A second compilation module, configured to compile the debug version of the SDK, the debug version of the business placeholder file, and the second business source code to obtain the test version of the application; A storage module, configured to store the test version of the application.

7. The apparatus according to claim 5, wherein, the apparatus further includes: A fifth acquisition module, configured to acquire a release version of the SDK corresponding to the first computer programming language when the first compilation file meets the release conditions; A third compilation module, configured to compile the release version of the SDK, the modified first business source code, and the second business source code to obtain a release version of the application corresponding to the test version of the application.

8. The apparatus according to claim 5, wherein, the apparatus further includes: A sixth acquisition module, configured to acquire a release version of the SDK corresponding to the first computer programming language when the first compilation file meets the release conditions; A fourth compilation module, configured to compile the first compilation file and the release version of the SDK to obtain a release version of the application corresponding to the first computer programming language.

9. An electronic device, wherein, the electronic device includes: A processor; A memory for storing processor-executable instructions; Among them, the processor is configured to execute the code processing method according to any one of claims 1-4.

10. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the code processing method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Generation method and device of software development kit and terminal device

    CN109976761A

  • Software development kit modification method and device and electronic equipment

    CN110083344A