CN117724726B - Data processing method and related device - Google Patents

Data processing method and related device Download PDF

Info

Publication number
CN117724726B
CN117724726B CN202410164437.2A CN202410164437A CN117724726B CN 117724726 B CN117724726 B CN 117724726B CN 202410164437 A CN202410164437 A CN 202410164437A CN 117724726 B CN117724726 B CN 117724726B
Authority
CN
China
Prior art keywords
project
target
compiling
engineering
native
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410164437.2A
Other languages
Chinese (zh)
Other versions
CN117724726A (en
Inventor
何冲
李斌
文孝木
郭永智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202410164437.2A priority Critical patent/CN117724726B/en
Publication of CN117724726A publication Critical patent/CN117724726A/en
Application granted granted Critical
Publication of CN117724726B publication Critical patent/CN117724726B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses a data processing method and a related device, wherein, firstly, when compiling a primary project, local variables aiming at a target project are obtained, and the primary project and the target project are application data developed under different development environments. When the local variable indicates to compile the target project, acquiring the target project, compiling to obtain a first compiled product, combining the first compiled product with a second compiled product obtained by compiling the original project to obtain an operation package of the mixed project, wherein the mixed project is the original project integrated with the target project; and responding to the local variable to indicate that the target project is not compiled, acquiring a first compiling product obtained through historical compiling, and combining the first compiling product and the second compiling product to obtain a running package of the hybrid project. The method can realize decoupling of the original project and the target project in the compiling stage, and can selectively determine whether to compile the target project when compiling the original project, thereby effectively improving the compiling efficiency.

Description

Data processing method and related device
Technical Field
The present application relates to the field of data processing, and in particular, to a data processing method and related apparatus.
Background
The target engineering developed in the non-native running environment can be accessed into the native engineering developed in the native running environment in a mixed engineering processing mode, and when the application program corresponding to the native engineering runs, a new functional service can be provided for a user through the target engineering.
In order to ensure the quality of service, in the development process of the target engineering and the native engineering, possible problems need to be determined through compiling of the target engineering and the native engineering so as to be adjusted in time.
However, due to the coupling of the target engineering and the native engineering, the debugging cost in development is high and the efficiency is low.
Disclosure of Invention
In order to solve the technical problems, the application provides a data processing method and a related device, which can realize decoupling of a primary project and a target project in a compiling stage, and can selectively determine whether to compile the target project when compiling the primary project, thereby effectively improving the compiling efficiency.
The embodiment of the application discloses the following technical scheme:
in one aspect, an embodiment of the present application provides a data processing method, including:
when compiling a native project, acquiring local variables aiming at a target project in the native project, wherein the native project and the target project are application data developed under different development environments, and the target project is used for being integrated into the native project;
Responding to the local variable to instruct compiling the target project, acquiring the target project, compiling to obtain a first compiling product, and combining the first compiling product with a second compiling product obtained by compiling the original project to obtain an operation package of a mixed project, wherein the mixed project is the original project integrated with the target project;
And responding to the local variable to indicate that the target project is not compiled, acquiring the first compiling product obtained through historical compiling, and combining the first compiling product with the second compiling product to obtain the running package of the hybrid project.
In another aspect, an embodiment of the present application provides a data processing apparatus, including: the system comprises an acquisition module, a first compiling module and a second compiling module;
The acquisition module is used for acquiring local variables aiming at a target project in the original project when compiling the original project, wherein the original project and the target project are application data developed under different development environments, and the target project is used for being integrated into the original project;
The first compiling module is configured to obtain a first compiling product by compiling the target project in response to the local variable indication, and combine the first compiling product with a second compiling product obtained by compiling the native project to obtain an operation package of a hybrid project, where the hybrid project is the native project integrated with the target project;
The second compiling module is configured to obtain the first compiling product obtained through historical compiling in response to the local variable indicating that the target project is not compiled, and combine the first compiling product with the second compiling product to obtain an operation package of the hybrid project.
In yet another aspect, an embodiment of the present application provides a computer device including a processor and a memory:
the memory is used for storing a computer program;
The processor is configured to perform the method according to the above aspect according to a computer program.
In yet another aspect. Embodiments of the present application provide a computer readable storage medium storing a computer program for executing the method described in the above aspect.
In yet another aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method of the above aspect.
It can be seen from the above technical solution that, when the hybrid engineering development of the original engineering and the target engineering is performed, a local variable for the target engineering is added to the original engineering, the local variable indicating whether the target engineering is compiled simultaneously when the original engineering is compiled. When the native project and the target project need to be compiled simultaneously to find problems, the local variable can be adjusted to instruct to compile the target project, so that the native project and the target project can be compiled simultaneously to generate a running package of the hybrid project under the instruction of the local variable. When only the native project needs to be compiled to find a problem, the local variable may be adjusted to indicate that the target project is not compiled, so that only the native project may be compiled under the direction of the local variable, and the running package of the hybrid project may be generated in combination with the first compiled product of the target project that has completed compiling. Therefore, the native engineering and the target engineering are decoupled in the compiling stage by adding the local variable in the native engineering and adjusting the indication function of the local variable based on the compiling requirement, and whether the target engineering is compiled or not can be selectively determined in the compiling process of the native engineering, so that the compiling efficiency is effectively improved, the compiling resource consumption is reduced in some scenes, and the debugging cost is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a method for data processing according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for data processing according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a flutter project compiling process according to an embodiment of the present application;
FIG. 4 is one of the flow charts of a process for obtaining a hybrid engineering run-time package according to an embodiment of the present application;
FIG. 5 is a second flowchart of a method for obtaining a hybrid engineering run-time package according to an embodiment of the present application;
FIG. 6 is a third flowchart of a method for obtaining a hybrid engineering run-time package according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a code storage directory according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a process for managing a page route according to an embodiment of the present application;
fig. 9 is a schematic diagram of an implementation process of a communication function according to an embodiment of the present application;
FIG. 10 is a block diagram of a hybrid engineering of the native engineering and flutter engineering provided by an embodiment of the present application;
FIG. 11 is a schematic diagram of a model determining apparatus according to an embodiment of the present application;
Fig. 12 is a block diagram of a terminal device according to an embodiment of the present application;
fig. 13 is a block diagram of a server according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings.
The target engineering and the native engineering are application data developed under the environment without development, and in the related technology, there is a need to access the target engineering developed under the non-native running environment into the native engineering developed under the native running environment, and when the application program corresponding to the native engineering runs, the new functional service can be provided for the user through the target engineering by means of engineering access. In the process of developing the target engineering and the original engineering, the target engineering and the original engineering need to be compiled, and problems possibly occurring in the development process are determined through the compiling process so as to be adjusted in time. However, in the related art, the target engineering and the native engineering are in a strong coupling relationship, so that the debugging cost is high in the debugging process, and the debugging efficiency is low.
The embodiment of the application provides a data processing method and a related device, wherein a local variable aiming at a target project is set, and the local variable indicates whether the target project is compiled simultaneously when the original project is compiled. The method can realize decoupling of the original project and the target project in the compiling stage, and can selectively determine whether to compile the target project when compiling the original project, thereby effectively improving the compiling efficiency.
The data processing method provided by the embodiment of the application can be implemented through computer equipment, wherein the computer equipment can be terminal equipment or a server, and the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server for providing cloud computing service. Terminal devices include, but are not limited to, cell phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle terminals, aircraft, and the like. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
Fig. 1 is a schematic diagram of a data processing method according to an embodiment of the present application, where the foregoing computer device is a server.
As shown in fig. 1, the server may integrate the target project with the native project, and may obtain the hybrid project by integrating the target project into the native project, and after the integration, in the operating environment of the native project, may enable the native project to provide the functional service corresponding to the target project by operating the target project.
The application data compiled by the original engineering is added with local variables aiming at the target engineering. The local variable is used for indicating whether the target engineering is compiled or not, and when the local variable indicates that the target engineering is compiled, the target engineering is compiled while the original engineering is compiled to obtain a first compiling product. And then merging the first compiled product with a second compiled product obtained by compiling the original engineering to obtain the operation package of the hybrid engineering. When the local variable indicates that the target engineering is not compiled, the target engineering is not compiled when the original engineering is compiled, a first compiling product obtained through historical compiling is obtained, and then the first compiling product and a second compiling product obtained through compiling the original engineering are combined to obtain the running package of the mixed engineering.
The target engineering and the original engineering can be decoupled in the compiling stage by selecting whether to compile the target engineering according to actual requirements when compiling the original engineering through the indication of the local variables, so that the compiling efficiency is improved.
Fig. 2 is a flowchart of a method for data processing according to an embodiment of the present application, and as shown in fig. 2, the method may be performed by a computer device, and in this embodiment, the computer device is illustrated as a server.
The method comprises the following steps:
S201: and when compiling the original engineering, acquiring local variables aiming at the target engineering in the original engineering.
The native project mentioned in S201 and the target project may be understood as application data developed under different development environments, wherein the target project is application data for integration into the native project to implement addition of corresponding functional services in the native project. The above-mentioned local variables for the target engineering can be set with different variable values, and the compiling of the target engineering can be indicated simultaneously or not when the original engineering is compiled through the different variable values. Compilation refers to the process of compiling code in a target project or a native project for implementing specific application functions.
In the process of developing the original project and the target project by the server, possible problems need to be determined by compiling the target project and the original project so as to be adjusted in time. In the embodiment of the application, the requirement of compiling adjustment is predetermined, and the indication of the local variable can be correspondingly adjusted according to different requirements of compiling adjustment. When compiling the original engineering, acquiring a local variable aiming at the target engineering, and determining whether to compile the target engineering according to the indication of the local variable.
S202: and responding to the local variable to instruct compiling the target project, acquiring the target project, compiling to obtain a first compiling product, and combining the first compiling product with a second compiling product obtained by compiling the original project to obtain an operation package of the hybrid project.
The first compiling product and the second compiling product refer to a compiling product obtained by compiling application data of a target project and a compiling product obtained by compiling application data of a primary project respectively. The running package refers to an application package obtained under a development environment corresponding to the original engineering after the first compiling product and the second compiling product are integrated.
The hybrid engineering is a native engineering integrating the target engineering. When the target engineering exists in the original engineering, two scenes exist when the original engineering needs to be debugged, wherein one scene is that both the original engineering and the target engineering need to be debugged, and the other scene is that only the original engineering needs to be debugged. The application scenario corresponding to S202 is that the debugging needs to be performed on both the original engineering and the target engineering.
In the embodiment of the application, when the need of debugging both the original engineering and the target engineering is determined, the two engineering are compiled simultaneously so as to achieve the effect of synchronous debugging. Specifically, when compiling the native project, a local variable for the target project is acquired, and whether to compile the target project is determined according to the indication of the local variable. When the local variable indicates to compile the target project, synchronous debugging of the original project and the target project is proved to be needed, and at the moment, the target project is compiled and a first compiling product is obtained. And compiling the original engineering while compiling the target engineering, and compiling the original engineering to obtain a second compiling product. And then combining the first compiling product and the second compiling product to obtain the running package of the hybrid engineering.
The local variable indicates the condition of compiling the target engineering, and is suitable for the scene of adjusting the original engineering and the target engineering simultaneously. Under the scene, the target engineering is compiled to obtain a first compiling product, and meanwhile, the original engineering is compiled to obtain a second compiling product. And then combining the first compiled product and the second compiled product to obtain the running package of the hybrid engineering.
That is, in the application scenario corresponding to S202, that is, the application scenario in which both the native engineering and the target engineering need to be debugged. At the moment, the original engineering is compiled, meanwhile, the target engineering is required to be compiled, and then the second compiling product corresponding to the original engineering and the first compiling product corresponding to the target engineering are combined to obtain the running package of the hybrid engineering. In the compiling process, the original engineering and the target engineering belong to the dependency relationship on the source code.
Assuming that the target project is flutter project, fig. 3 is a schematic diagram of a compiling process of flutter project provided by the embodiment of the application, flutter, in order to realize the capability of cross-platform (i.e. development environment), uses c++ as a development language to realize the function of the bottom layer, and in order to realize that c++ codes can be embedded into the native project, compiles c++ into products of each development environment in advance, and uploads the products to a cos file storage platform, such as. So/. Framework/. Dill. The process of compiling flutter engineering to obtain android compiled products and ios compiled products is shown in the figure, flutter products are divided into products generated by Dart service codes and flutter Engine codes, dart codes in the figure comprise service codes written by developers, and Engine codes are Engine codes. The Dart Code passes through frontend _server to obtain app.dil (DART KERNEL), and one Dart Code can be compiled to generate a double-end product, so that the cross-platform capability is realized. Double-end products, namely android compiled products and ios compiled products in the graph, can be generated after being processed by a compiling tool, and the compiling tools such as frontend _server, gen_snapshot and ninja are used in the process.
S203: and responding to the local variable to indicate that the target project is not compiled, acquiring the first compiling product obtained through historical compiling, and combining the first compiling product with the second compiling product to obtain the running package of the hybrid project.
The historical compilation refers to compilation of the target engineering, and the first compilation product obtained through the historical compilation refers to a first compilation product which is selected according to requirements from the first compilation products of the compilation of the target engineering, is matched with the original engineering, and is used as a first compilation product which is combined with a second compilation product of the original engineering in the compilation.
The above-mentioned two scenarios exist when debugging the original engineering, and the corresponding application scenario in S203 is that only the original engineering needs to be debugged. In this scenario, the target project does not need to be recompiled, and the first compiling product of the history and the second compiling product of the original project can be used for merging to generate the running package of the mixed project.
Whether the target engineering needs to be compiled or not is determined according to the indication of the local variable, when the local variable indicates that the target engineering is not compiled, the target engineering is compiled only to obtain a second compiling product, the target engineering is not compiled any more, and the compiling product meeting the requirements of the target engineering in historical compiling is selected as the current first compiling product. And combining the first compiling product with a second compiling product obtained by compiling the original engineering to obtain the running package of the mixed engineering.
The local variable indicates the situation that the target project is not compiled, and is applicable to the scene that only needs to be adjusted on the original project. Because the target engineering is integrated in the original engineering, if the setting of the local variable in the embodiment of the application is not performed, when only the compiling adjustment is needed for the original engineering, the target engineering is inevitably compiled due to the strong coupling relation between the original engineering and the target engineering. By setting the local variable in the embodiment of the application, when the local variable indicates that the target project is not compiled, the first compiling product can be obtained by compiling only the original project, and the compiling product of the target project obtained in the historical compiling can be obtained as the first compiling product for the target project.
That is, only the native engineering needs to be debugged in the application scenario corresponding to S203. Decoupling between the target engineering and the native engineering can be achieved at this time, that is, the native engineering alone compiles to obtain the second compiled product, during which the compiling operation of the target engineering (which can be understood as partial compiling) is not required. Before generating the running package of the hybrid engineering, a compiled product of the target engineering meeting the requirements in historical compilation can be selected as a current first compiled product. And then merging the first compiled product with the second compiled product to obtain the running package of the hybrid engineering. It can be seen that in this scenario the relationship between the target project and the native project is a remote dependency.
From the above detailed description of the application scenarios corresponding to S202 and S203, it can be seen that the indication conditions by the local variables are different, and may correspond to two different compiling processes. The local variable can be adjusted based on the compiling joint debugging requirements, different compiling instructions are carried out according to different compiling joint debugging requirements, and different compiling effects are achieved.
Fig. 4 is one of flowcharts of a method for obtaining a running package of a hybrid engineering according to an embodiment of the present application, as shown in fig. 4, in one possible implementation, the target engineering is flutter, and the native engineering is an android engineering. Then when compilation of android engineering is required, a determination is made as to whether synchronization compilation of flutter is required. The local variable may be represented as "isBuildFlutter" and the corresponding variable value of the local variable may be true or false (yes or no in the figure) according to the compiling requirement to correspondingly adjust the value of the local variable. When isBuildFlutter =true, it represents that compiling flutter is required. The specific process can be as follows: first, gradle (configuration script for android engineering development) is loaded, then, the flutter engineering is compiled and packed and integrated into aar (aar file is a dependency format in android engineering and can be understood as a compressed file) to obtain a first compiled product, and then, the first compiled product and the second compiled product are integrated to obtain a running package of the hybrid engineering.
When isBuildFlutter =false, no compilation of flutter is required on behalf of the user. The specific process can be as follows: and performing gradle to compile and package the android project to obtain a second compiled product, judging whether to pull flutter aar, pulling flutter aar to obtain a first compiled product of the flutter project compiled in history, and merging and packaging the second compiled product and the first compiled product to obtain the operation package of the hybrid project. If it is determined that the pull flutter aar is not to be performed, then an action is performed that meets the criteria for the determination.
FIG. 5 is a second flowchart of a method for obtaining a running package of a hybrid engineering according to an embodiment of the present application, as shown in FIG. 5, in one possible implementation, the target engineering is flutter and the native engineering is mac/ios engineering. Then when the mac/ios project needs to be compiled, a determination is made as to whether or not the flutter needs to be compiled synchronously. The local variable can be expressed as 'isBuildFlutter', and the corresponding local variable can be true or false (yes or no in the figure). When isBuildFlutter =true ("yes" in the figure), it is represented that compiling flutter is required. The specific process can be as follows: firstly, loading a shell, compiling flutter engineering into a framework (framework for windows engineering) framework to obtain a first compiled product, and then merging and packaging the first compiled product and a second compiled product obtained by compiling mac/ios engineering to obtain a running package of the hybrid engineering.
When isBuildFlutter =false ("no" in the figure), no compilation of flutter is required on behalf. The specific process can be as follows: and acquiring a first compiling product of the historical compilation of flutter, judging whether the acquired first compiling product of the historical compilation of flutter is the latest version, and merging and packaging the first compiling product and a second compiling product obtained by compiling the original engineering when the first compiling product is the latest version. If the obtained first compiling product is not the latest version, the first compiling product of the corresponding flutter project meeting the compiling requirement of the original project is pulled remotely through conan (dependent items of C and C++ languages and a program package manager). And merging and packaging the second compiled product obtained by compiling the original engineering and the pulled first compiled product to obtain the operation package of the hybrid engineering.
FIG. 6 is a third flowchart of a method for obtaining a running package of a hybrid engineering according to an embodiment of the present application, as shown in FIG. 6, in one possible implementation, the target engineering is flutter and the native engineering is windows engineering. Then when the windows project needs to be compiled, it is determined whether the flutter project needs to be compiled synchronously. The local variable can be expressed as 'isBuildFlutter' according to the compiling requirement, and the corresponding local variable can be true or false. When isBuildFlutter =true ("yes" in the figure), it is represented that compiling flutter is required. The specific process can be as follows: firstly, loading batch processing, then compiling flutter engineering to obtain a first compiled product, wherein the form of the first compiled product in windows engineering is dll form. And merging and packaging the obtained first compiling product and a second compiling product obtained by compiling the windows engineering to obtain the running package of the hybrid engineering.
When isBuildFlutter =false ("no" in the figure), no compilation of flutter is required on behalf. The specific process can be as follows: and acquiring a first compiling product obtained by historical compiling of flutter, judging whether the acquired first compiling product of historical compiling of flutter is the latest version, and merging and packaging the first compiling product with a second compiling product obtained by compiling a native project (i.e. windows project) when the first compiling product is the latest version. If the obtained first compiling product is not the latest version, the latest version of the first compiling product in the stored flutter historical compiling is pulled remotely through a git (distributed version control system). And merging and packaging the second compiled product obtained by compiling the original engineering and the pulled first compiled product to obtain the operation package of the hybrid engineering.
According to the data processing method provided by the embodiment of the application, when the mixed engineering development of the original engineering and the target engineering is carried out, the local variable aiming at the target engineering is added into the original engineering, and the local variable indicates whether the target engineering is compiled simultaneously when the original engineering is compiled. When the native project and the target project need to be compiled simultaneously to find problems, the local variable can be adjusted to instruct to compile the target project, so that the native project and the target project can be compiled simultaneously to generate a running package of the hybrid project under the instruction of the local variable. When only the native project needs to be compiled to find a problem, the local variable may be adjusted to indicate that the target project is not compiled, so that only the native project may be compiled under the direction of the local variable, and the running package of the hybrid project may be generated in combination with the first compiled product of the target project that has completed compiling. Therefore, the native engineering and the target engineering are decoupled in the compiling stage by adding the local variable in the native engineering and adjusting the indication function of the local variable based on the compiling requirement, and whether the target engineering is compiled or not can be selectively determined in the compiling process of the native engineering, so that the compiling efficiency is effectively improved, the compiling resource consumption is reduced in some scenes, and the debugging cost is greatly reduced.
In the foregoing description, it was mentioned that it is possible to indicate whether or not the target project is compiled at the same time when the original project is compiled by setting different variable values for the local variables, through the difference of the variable values. In one possible implementation, the variable value of the local variable may include a first value or a second value.
When compiling the native project, it is determined whether to compile the target project at the same time. And acquiring a variable value of the local variable, and indicating whether to compile the target engineering according to the variable value of the local variable. Specifically, when the variable value is the first value, it may be determined that the local variable indicates the compiling target project; when the variable value is the second value, it is determined that the local variable indicates that the target project is not compiled.
The variable name of the local variable mentioned above may be set to "isBuildFlutter", for example. The specific variable names may be freely set by those skilled in the art, and are not limited herein. For the value of the variable, the value of the variable may be a set of values such as "true-false" or a set of values such as "0-1", and any other value of the set of values that can be used for variable distinction may be used, and any value of the above-mentioned set of values may be used as the first value or the second value. Taking a value manner as "true-false" as an example, when the variable name is "isBuildFlutter", when "isBuildFlutter =true", the current variable value can be considered as a first value, and then the value is used for indicating the compiling target project; meanwhile, when "isBuildFlutter =false", the current variable value may be regarded as the second value, and then this means that the target project is not compiled under the value. Taking the value of "0-1" as an example, when the variable name is "isBuildFlutter", when "isBuildFlutter =0", the current variable value can be considered as a first value, and then the value is used for indicating the compiling target project; meanwhile, when 'isBuildFlutter =1', the current variable value can be considered as the second value, then this means that the target project is not compiled under the value.
From the above description, it is understood that the specific manner of taking the variable values is not limited in the embodiments of the present application. When the variable values are different values, the corresponding operations performed on the target project are different. The variable values include two classes, one of which is used to indicate that the target project is compiled and the other of which is used to indicate that the target project is not compiled. In practical application, whether to compile the target project can be selectively determined when compiling the native project by changing the magnitude according to the adjustment requirement. The setting of the variable value can control the switching of two compiling modes, wherein one compiling mode is to compile the target engineering while compiling the original engineering, and the other compiling mode is to compile only the original engineering.
Through the above-mentioned value mode for the variable value of the local variable, whether compiling the target engineering can be correspondingly determined. Different compiling modes are corresponding to different values, and the values can be understood to correspond to different compiling scenes. The method can selectively determine whether to compile the target engineering or not when compiling the original engineering based on the indication effect of the targeted adjustment of the local variable of the current compiling requirement, thereby effectively improving the compiling efficiency.
In the aforementioned S203, it is mentioned that "the first compilation product obtained by the history compilation is acquired", specifically, when the compilation requirement is to compile only the native project, the target project is not required to be compiled. Although the target project is not compiled, it is also necessary to generate a running package of the hybrid project by compiling the native project and the target project. That is, the compiling product of the target project still needs to be obtained while the compiling of the target project is not performed. Then the compiled product obtained by utilizing the historical compilation of the target project can be combined with the compiled product of the original project to obtain the running package of the mixed project. In one possible implementation manner, the method for obtaining the first compiled product of the target engineering may be: and determining the first compiled product of the target version related to the compiling requirement from the first compiled products of the plurality of compiled versions obtained by historical compiling.
Specifically, before the target project is compiled this time, there may be a plurality of different compiled versions, and the different corresponding compiled versions of the target project are different. The latest compiling version refers to a version corresponding to the first compiling product obtained by compiling according to the latest target project. When only the original project needs to be compiled to find a problem, the target project is not compiled, but the compiled product of the target project still needs to be utilized. At this time, a first compiling product of historical compiling corresponding to the target engineering can be obtained, the first compiling product can be stored in a database, and the first compiling product can be obtained from the database by a server when the target engineering is needed to be used.
When a first compiling product obtained by historical compiling of a target project is obtained, the first compiling product matched with a second compiling product of a native project is required to be selected, so that the requirements of compiling and debugging can be met, and further the compiling efficiency is improved. The specific compiling and debugging requirement may be that when only the original engineering needs to be compiled and debugged, the first compiling product of the target engineering of the latest version needs to be obtained as the first compiling product of the mixed engineering which is combined with the second compiling product of the original engineering. Of course, other compiling requirements may be adopted, and according to different compiling requirements, the obtained first compiling products obtained by historical compiling are different.
For example, assume that a first compilation product resulting from historical compilation of a target project includes: version 1.0 of the first compilation product, version 2.0 of the first compilation product, and version 3.0 of the first compilation product. And determining a second compiling product obtained by the current compiling of the original engineering, wherein the adapted first compiling product is the first compiling product of version 2.0. Then when the target project is not compiled in response to the local variable indication, a version 2.0 of the first compiled product needs to be obtained from the three versions of the first compiled product obtained by the historical compilation as the first compiled product to be combined with the second compiled product of the native project.
By the method for acquiring the first compiled product, the first compiled product of the corresponding target project needs to be determined according to the compiling requirement. Therefore, the obtained first compiling product can be suitable for current compiling and debugging, the compiling efficiency can be improved, and the waste of compiling resources is reduced to a certain extent.
The foregoing description describes by way of example the case where the native project is windows project, mac project, ios project, and android project. The ios engineering and the android engineering are native engineering developed in a mobile terminal environment, and the windows engineering and the mac engineering are native engineering developed in a desktop terminal environment. It can be clear that the development environment of the native engineering in the data processing method provided by the embodiment of the application can be a desktop environment or a mobile environment. In the above examples, the ios engineering and the android engineering are mobile terminals, and the windows engineering and the mac engineering are desktop terminals.
The development environment of the original engineering is expanded from the mobile terminal environment to the desktop terminal environment, so that the application range of the data processing method provided by the embodiment of the application is wider. And meanwhile, the development environment of the original engineering is expanded to the desktop environment, so that the hybrid engineering of the desktop environment and the target engineering can be realized, namely, the target engineering is integrated in the desktop environment.
The foregoing mentions that the native project and the target project are application data developed under different development environments, specifically, the native project is application data under a first development environment, and the target project is application data under a second development environment. In order to realize the hybrid engineering of the original engineering and the target engineering, that is, to integrate the target engineering in the original engineering, the method can be realized by adding a code storage catalog related to the target engineering in the original engineering. When the target project is integrated into the original project, there is a need to implement an interactive function between the target project and the original project. In one possible implementation manner, a specific method for setting the interactive function may be: when compiling the native engineering, acquiring an adaptive target native function code through a code storage catalog; the interactive functions are then encapsulated into a second compiled product by compiling the target native function code.
The above-mentioned target native function code is a code that can be compiled in the first development environment, and is used to implement the interactive function of the target engineering and the native engineering. The target native function code may include function code corresponding to a variety of different development environments, for example, a desktop environment or a mobile environment such as windows/mac/android/ios may be included in the code storage directory. When the original project needs to be compiled, the target original function code adapted to the current original project type can be correspondingly acquired through the code storage catalog, so that the interactive function with the target project can be realized through the target original function code. After the adaptive target native function code is determined, the interactive function can be packaged into a second compiling product corresponding to the native project by compiling the target native function code.
For example, assume that the target project is flutter, with the target project flutter integrated in the native project. That is, the data of the target project flutter is configured in the native project. In practical application, the storage position of the data of the target project flutter can be declared to be flutterDir =/Users/samples/flutter _samples in the configuration file local. Properties of the original project, and meanwhile, the local variable is set to isBuildFlutter =true, so that the hybrid project of the original project and the target project is realized. The foregoing "flutter _sample" is a code storage directory, and fig. 7 is a schematic diagram of a code storage directory provided in an embodiment of the present application, as shown in fig. 7, where the flutter _sample includes target native function codes corresponding to windows/mac/android/ios. Code that implements the interactive functions between the target project and the native project may be included in the target native function code, and other routing, tool class, etc. code may also be included.
According to the method for realizing the interactive function between the target engineering and the original engineering, the code storage catalog related to the target engineering is added in the original engineering, and when the original engineering is compiled, the code storage catalog is used for acquiring the adaptive target original function code. By compiling the target native function code, it is possible to encapsulate the interactive function into a second compiled product of the native project, so as to enable the native project to interact with the target project based on the interactive function.
As shown in fig. 7, native function codes corresponding to different development environments in different folders in a code storage directory, the native function codes of the different development environments being codes that can be compiled under the corresponding development environments, are shown. Flutter in this figure is a target project, and the code storage directory indicated by flutter _sample illustratively includes four storage spaces: windows, mac (macos in the figure), android and ios correspond to the native function code of each of the four development environments in the four storage spaces, respectively. In order to implement the interactive function between the native project and the target project, it is required to acquire the adapted target native function code through the code storage directory when compiling the native project. In one possible implementation, the method for acquiring the adapted target native function code through the code storage directory may be: the corresponding memory space is accessed through the code storage directory first, and then target native function code adapted to the first development environment is determined in the memory space.
Specifically, after the native project is determined, the storage space under the code storage directory can be accessed through the code storage directory according to the type of the native project. Target native function code adapted to a first development environment corresponding to the native project is determined in the storage space. For example, when the native project is an android project, the corresponding storage space may be accessed through the code storage directory, and when the storage space includes target native function codes corresponding to various native projects, the native function code adapted to the android project needs to be acquired as the target native function code.
When the target project is flutter projects and the native projects are mac, android and other projects, the interaction between the target project and the native projects can be realized through a bridging layer (i.e. a code storage directory), and native function codes for different native projects can be included in the bridging layer. In the hybrid project formed between the target project and the native project, the native function code in the code storage directory related to the target project needs to be bridged with the corresponding native project through the bridging layer. The interaction between the original engineering and the target engineering is realized by acquiring the target original function code adapted to the first development environment from the code catalog so as to package the interaction function in the target original function code into a second compiled product corresponding to the original engineering through compiling.
The above-mentioned method for obtaining the adapted target native function code accesses a corresponding storage space through the code storage directory, and determines the target native function code adapted to the first development environment in the storage space. The storage space can comprise native function codes corresponding to various development environments, and interaction between a target project and corresponding native projects can be established by determining target native function codes adapted by the first development environment.
The above describes that the storage space pointed by the code storage directory stores the native function codes corresponding to different development environments. In one possible implementation, the storage space pointed to by the code storage directory may include functional scripts for different development environments. That is, the functional script and the storage space have a correspondence relationship, for example, the functional script for the first development environment is used to incorporate the first compilation product into the second compilation product in the first development environment. That is, the function script functions to merge the first compiled product corresponding to the target project into the second compiled product corresponding to the native project.
For example, when the target project is flutter projects, the storage space of the code storage directory related to flutter projects may include function scripts of different development environments in addition to the native function code of the different development environments. The function script can be used for inserting the first compiling product of the target project into the compiling process of the original project, so that the first compiling product and the second compiling product obtained by compiling the original project can be combined, and the running package of the mixed project can be obtained.
The aforementioned development environment may specifically include native function codes corresponding to the development environments such as windows, mac, android and ios. Different function scripts corresponding to the development environments are stored in a code storage catalog of the target project, and the first compiling product of the target project can be inserted into the compiling process of the original project of any one development environment (namely the first development environment) of windows, mac, android and ios through the function scripts. This enables the first compilation product to be incorporated into the second compilation product in the first development environment.
Taking flutter engineering as an example, the first development environment is assumed to be a windows environment, and the corresponding native engineering is assumed to be a windows engineering. The code storage catalog of flutter engineering comprises a storage space corresponding to windows engineering, and the storage space comprises a native function code and a function script. The function script is used for combining a first compiling product corresponding to the target project into a second compiling product corresponding to the original project. In practical application, in flutter engineering, there may be modules corresponding to each development environment (i.e. native engineering), such as: windows, mac, android and ios, which not only contain the code of the native engineering, but also contain the compiled function script. The method comprises the steps of calling the compiling flow of the native projects by using a hook (code for processing intercepted function calls, events and messages), inserting a functional script in the compiling flow, wherein the main function of the functional script is to insert flutter sdk products, and then completing the combination of a first compiling product and a second compiling product by only referencing the functional script to a corresponding module (native project) in an ided (integrated development environment) to obtain the running package of the hybrid project.
According to the method for storing the function script in the storage space, the compiling process of the target engineering can be invoked in the development environment through the function script, so that the first compiling product obtained by compiling the target engineering is combined into the second compiling product obtained by compiling the original engineering. And combining the first compiling product and the second compiling product to obtain the running package of the hybrid engineering.
In the aforementioned native engineering, a code storage directory related to the target engineering is added, and a native function code for implementing an interactive function between the target engineering and the native engineering is included in the code storage directory. Wherein the interactive function of the target project and the native project may include at least one of a page routing function, a communication function. In order to realize the interactive functions, the native function codes for realizing the corresponding interactive functions need to be correspondingly configured in the code storage catalogue. When compiling the native project, the corresponding interactive function with the target project can be realized based on the native function code.
For example, assuming that the target project is flutter projects, the native project may be any one of windows, mac, android and ios projects. In the foregoing description it was introduced that the interaction between the target project and the native project may be achieved through a bridging layer (i.e. code storage directory) in which native function code for different native projects may be included. It is also introduced that the code storage catalog includes functional scripts for different development environments, that is, flutter engineering can use the functional scripts to merge the first compiled product into the second compiled product corresponding to any one of the above-mentioned native engineering. When the first compilation product is merged to the second compilation product, it means that the native function code in the code storage directory of the target project is also integrated into the second compilation product of the native project. At this time, the operation package of the hybrid engineering obtained by combining the first compiling product and the second compiling product has the interactive function correspondingly realized by the native function code, and the specific interactive function can comprise a page routing function, a communication function and the like.
The interaction function provided by the method can be used for realizing interaction between the target engineering and the original engineering, and particularly can be used for realizing the corresponding interaction function by utilizing the corresponding original function code in the code storage catalog. The integration of the interactive engineering in the hybrid engineering can be realized through the compiling product merging process, so that the interaction between the target engineering and the original engineering in the hybrid engineering is realized.
After the operation package of the hybrid engineering is obtained, interaction between the target engineering and the original engineering in the hybrid engineering needs to be realized. The interactive functions can be realized by the native function codes stored in the code storage catalog, and the interactive functions which can be realized by the corresponding native function codes include: page routing functions, communication functions, etc. When the first compiling product and the second compiling product are combined to obtain the running package of the hybrid engineering, if the interactive function expected to be realized in the hybrid engineering is a page routing function, in one possible implementation manner, the specific implementation manner may be:
A1: and operating the hybrid engineering through the operation package.
In the foregoing description, a run-time package is introduced, the run-time package refers to an application package obtained under a development environment corresponding to a native project after integration by a first compiled product and a second compiled product, and the hybrid project refers to a native project in which a target project is integrated. Hybrid engineering can be run by a run-time package, which can be understood as a compilation process of the run-time package.
A2: and in the running process of the hybrid engineering, starting a page management process according to the page routing function.
In the process of running and compiling the hybrid engineering, corresponding native function codes in the code storage catalog can realize corresponding interactive functions. When the interactive function correspondingly realized by the original function code is a page routing function, compiling the original function code in the running process of the hybrid engineering, and running the page routing function to start a page management process through the compiling process. The specific page management may include realizing the presentation of the page corresponding to the target project and the native project, and may further include the skip of the page between the target project and the native project.
A3: and storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process.
In the embodiment of the application, the page management process can be realized by a page stack, and the page stack can be understood as the insertion and deletion of the corresponding display page at the stack top. Insertion of a presentation page refers to a process of entering the presentation page into the page stack, and deletion of the presentation page refers to a process of removing the presentation page from the page stack. In the page stack, a first type of page opened by the target project and a second type of page opened by the native project can be stored. In different processes of the page stack, the page stack can only comprise a first type page opened by the target engineering or a second type page opened by the original engineering, and can also comprise the first type page opened by the target engineering and the second type page opened by the original engineering.
A4: and responding to the display operation of the first target page of the hybrid engineering, and reading the first target page from the page stack to display.
The first target page is a first type page or a second type page. That is, when the page display operation is performed on the hybrid engineering, the corresponding page is read from the page stack to display. According to different display requirement objects corresponding to display operation, the page corresponding to the display requirement is read from the page stack to display. The page object corresponding to the display operation can be a first type page or a second type page, namely a page opened through the target engineering or a page opened through the native engineering.
A5: and deleting the second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page.
The second target page is a first type page or a second type page. And deleting the second target page to be deleted from the page stack when deleting the second target page. The specific deletion process needs to follow the pop sequence of the stack. The deleted second target page can be a first type page opened by the target engineering, and can also be a second type page opened by the original engineering.
For example, assuming that the target project is flutter projects, when the native projects and flutter projects are compiled and running packages corresponding to the hybrid projects are generated, there is a need to interact with the native projects and flutter projects. One of the interaction requirements is to implement page jumps corresponding to the native engineering and flutter engineering. It is therefore necessary to set the native function code related to the page routing function in the code storage directory related to flutter engineering added in the native engineering to implement the page routing interactive function of flutter engineering and the native engineering.
Fig. 8 is a schematic diagram of a page route management process provided by an embodiment of the present application, in which the page route management process is specifically shown, and as shown in the drawing, a native page corresponding to a native project and a flutter page corresponding to a flutter project may be included in a page stack at the same time. In the original page stack, there are stored a native page (i.e., a second type page) and flutter pages 1 (i.e., a first type page). Then, a push operation is performed, which can be understood as performing a display operation on a first target page of the hybrid engineering, where the corresponding first target page refers to flutter pages 2 (i.e. pages of a first type), and at this time, the page stack stores a native page, flutter pages 1 and flutter pages 2. And then carrying out twice pop operation, and executing the deleting operation of the second target page of one hybrid engineering by the single pop operation. The second target page is referred to as flutter page 1 and flutter page 2 in the figure, in which the first pop operation performs the delete operation on flutter page 2 and in which the second pop operation performs the delete operation on flutter page 1. After the two delete operations are completed, only the native pages are stored in the page stack. Finally, a push operation is performed, and at this time, the native page and flutter page 3 are stored in the page stack. The subsequent page management process is similar to the foregoing, and will not be described again here.
In one possible implementation, the native function code of flutter engineering for implementing the interactive function may be used as a page carrier for implementing the page routing function through a unified AppContainer container. When the actual page is opened, according to different page management processes and corresponding display operations aiming at the first target page and the second target page, appContainer are used for switching different pages. When the page jump between the target engineering and the original engineering is carried out, the page of the original engineering can be jumped to by adopting a flutter channel mode by adopting a unified schema route. The jump interface used for realizing the page jump between flutter engineering and native engineering can be: wkRouter. Build (url) WITHPARAM (PARAM). Navigation ().
By the method for realizing the page interaction function, the page management process is started in the running process of the hybrid engineering, and the second type of pages corresponding to the original engineering and the first type of pages corresponding to the target engineering can be displayed and deleted through the page management process. The page routing function between the target engineering and the original engineering can be realized by utilizing the original function code, the interaction of page management between the target engineering and the original engineering is completed, and the cost of page interaction between the target engineering and the original engineering is reduced.
The aforementioned interactive functions that the native function code correspondence can implement may include: page routing functions, communication functions, etc. When the first compiling product and the second compiling product are combined to obtain the running package of the hybrid engineering, if the interactive function expected to be implemented in the hybrid engineering is a communication function, in one possible implementation manner, a specific implementation manner may be: firstly, running the mixed engineering through the running package, and then constructing a unified communication interface for the target engineering according to the communication function in the running process of the mixed engineering. And finally, establishing a communication channel between the original project and the target project based on the communication interface.
The communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native project of different development environments. Specifically, in the embodiment of the application, a unified communication interface is constructed for the target engineering, and a communication channel between the original engineering and the target engineering can be established based on the communication interface. The unified setting of the communication interface can facilitate the communication between the target engineering and the original engineering under different development environments, and the communication efficiency is improved. For example, when the native project is android, the predetermined data format corresponding to the predetermined data format may be apk.
In practical application, the interface of each platform can be unified by a protobuf (method for serializing structural data), interface codes of each project are generated by protoc plugin (plug-in used for generating codes), and then the distribution of GRPC SERVER (remote procedure call service) end and the capability of processing requests are realized by each project. The native engineering is used as a server end only by realizing a corresponding interface.
Specifically, fig. 9 is a schematic diagram of an implementation process of a communication function provided by an embodiment of the present application, as shown in fig. 9, the implementation process is performed by an interface of grpc at the flutter engineering end (DART SERVICES), and only the transport channel required by the invocation is invoked in a PlatformChannel manner, by this way, all channel invocation interfaces are collected, and data distribution is performed by a single channel, so that a unified management is more convenient for all channel interfaces, and logic such as service discovery, security verification, unified log, etc. is implemented. The above-mentioned PlatformChannel can be understood as constructing a unified communication interface for the target engineering, and the above-mentioned communication channel between the native engineering and the target engineering is established based on the communication interface, which refers to the communication channel established between PlatformChannel to windows, mac, android corresponding to the target engineering and CHANNEL SERVICE corresponding to the ios engineering in the figure.
The specific calling mode of the channel interface is as follows:
FinalGovernRpcServiceApiservice=GovernRpcServiceApi(PlatformChannel());
final result = await service.getGovernMyReportListFromServer(req);
By the method for realizing the communication function, a unified communication interface is constructed for the target engineering according to the communication function, and a communication channel between the original engineering and the target engineering can be established based on the communication interface. The unified communication interface and the communication channel can realize unified distribution of data, improve communication efficiency, and simultaneously can facilitate unified management of the communication interface.
In the foregoing, the method for implementing the communication function between the native project and the target project is described, where the target project may be used as a server for data communication and the native project may be used as a client for data communication during the data communication. Referring to fig. 9, the project corresponds to DART SERVICES in the figure flutter, namely the server; in the native engineering, windows engineering corresponds to C++ Client, mac and ios engineering correspond to ObjectC Client, android engineering corresponds to Java/Kotlin Client, and clients are all used.
The reason for taking the target engineering as a server for data communication and the native engineering as a client for data communication is that the server needs to have the capability of processing different network protocols in order to communicate with various clients. The client then needs to follow the protocol accepted by the server to send requests and receive data. In the embodiment of the application, the communication function is realized based on the native function codes in the code storage catalog related to the target engineering, and the native function codes aiming at different development environments are stored in the storage space pointed by the code storage catalog. Therefore, the target engineering has communication capability with the native engineering under different development environments, and needs to be used as a server in the data communication of the embodiment of the application, and the native engineering is used as a client in the data communication of the embodiment of the application.
By accurately determining the identities of the target engineering and the original engineering in the data communication, the data communication between the target engineering and the original engineering can be smoothly performed.
Fig. 10 is a structural diagram of a hybrid engineering of a native engineering and flutter engineering according to an embodiment of the present application, as shown in fig. 10, including: fusion engineering, component layer, container, bridging layer and hardware layer. The fusion engineering includes a native engineering and flutter engineering. The component layer includes various application components, as shown, including a plurality of core components in the component layer, specifically: routing, communication, infrastructure, protobuf (mixed language data standard for structured data storage and RPC systems) and json (syntax for storing and exchanging text information). The container is flutter SDK, which in embodiments of the present application may be understood to be engineering, i.e., application data in a development environment. flutter SDK include: dart SDK (providing the necessary libraries and tools for developing applications), flutter Engine (the core engine of flutter, responsible for handling UI rendering and interactions of Flutter applications), skia (the cross-platform 2D graphics library that can be used to develop various applications), embadder (embedder for embedding flutter engines into host applications), and json. The bridging layer comprises Gradle (configuration script language for Android development), ruby (object-oriented programming language, which is widely applied in the construction of ios/mac application), batch processing and Dart (for flutter programming language, a plurality of platforms can be supported and can be compiled into machine codes of the respective platforms), and in the embodiment of the application, the bridging layer can realize the interaction function of native engineering and flutter engineering. Hardware and the development environments windows, mac, android and ios may be included in the hardware layer.
On the basis of the foregoing embodiments corresponding to fig. 1 to 10, fig. 11 is a schematic device diagram of a model determining device provided in an embodiment of the present application, where a model determining device 1100 includes: an acquisition module 1101, a first compiling module 1102, and a second compiling module 1103;
The obtaining module 1101 is configured to obtain, when compiling a native project, a local variable for a target project in the native project, where the native project and the target project are application data developed under different development environments, and the target project is used for being integrated into the native project;
The first compiling module 1102 is configured to obtain a first compiling product obtained by compiling the target project in response to the local variable indication, and combine the first compiling product with a second compiling product obtained by compiling the native project to obtain an operation package of a hybrid project, where the hybrid project is the native project integrated with the target project;
The second compiling module 1103 is configured to obtain the first compiled product obtained by historical compiling in response to the local variable indicating that the target project is not compiled, and combine the first compiled product with the second compiled product to obtain an operation package of the hybrid project.
In a possible implementation, the variable value of the local variable includes a first value or a second value, and the device is configured to:
acquiring variable values of the local variables when compiling the native engineering;
determining that the local variable indicates compiling the target project when the variable value is the first value;
When the variable value is the second value, determining that the local variable indicates that the target project is not compiled.
In one possible implementation manner, the second compiling module 1103 is configured to:
And determining the first compiling product of the target version related to the compiling requirement from the first compiling products of the plurality of compiling versions obtained through historical compiling.
In one possible implementation manner, the native project is application data developed in a first development environment, and a code storage catalog related to the target project is added in the native project; the device is used for:
When compiling the native project, acquiring an adaptive target native function code through the code storage catalog, wherein the target native function code is a code which can be compiled in the first development environment and is used for realizing the interaction function of the target project and the native project;
and compiling the target native function code, and packaging the interactive function into the second compiling product.
In one possible implementation manner, the storage space pointed by the code storage directory stores native function codes for different development environments, wherein the native function codes of the different development environments are codes which can be compiled under the corresponding development environments; the device is used for:
accessing a corresponding storage space through the code storage catalog;
the target native function code adapted to the first development environment is determined in the storage space.
In one possible implementation, the apparatus is configured to:
The storage space pointed by the code storage catalog stores function scripts for different development environments, and the function scripts for a first development environment are used for merging the first compiling product into the second compiling product in the first development environment.
In one possible implementation, the apparatus is configured to:
The interactive function includes at least one of a page routing function, a communication function.
In a possible implementation manner, when the interactive function includes a page routing function, after obtaining the running package of the hybrid engineering, the apparatus is configured to:
running the hybrid engineering through the running package;
In the running process of the hybrid engineering, starting a page management process according to the page routing function;
Storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process;
Responding to display operation of a first target page of the hybrid engineering, and reading the first target page from the page stack to display, wherein the first target page is the first type page or the second type page;
and deleting a second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page, wherein the second target page is the first type page or the second type page.
In a possible implementation, when the interactive function includes a communication function, after obtaining the running package of the hybrid engineering, the apparatus is configured to:
running the hybrid engineering through the running package;
In the running process of the hybrid engineering, a unified communication interface is built for the target engineering according to the communication function;
and establishing a communication channel between the native project and the target project based on the communication interface, wherein the communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native projects of different development environments.
In one possible implementation, the apparatus is configured to:
in the data communication, the target engineering is used as a service end of the data communication, and the native engineering is used as a client end of the data communication.
In one possible implementation, the apparatus is configured to:
The development environment of the original engineering is a desktop environment or a mobile environment.
With the above-provided data processing apparatus, when performing hybrid engineering development of a native engineering and a target engineering, a local variable for the target engineering is added to the native engineering, the local variable indicating whether the target engineering is also compiled at the same time when the native engineering is compiled. When the native project and the target project need to be compiled simultaneously to find problems, the local variable can be adjusted to instruct to compile the target project, so that the native project and the target project can be compiled simultaneously to generate a running package of the hybrid project under the instruction of the local variable. When only the native project needs to be compiled to find a problem, the local variable may be adjusted to indicate that the target project is not compiled, so that only the native project may be compiled under the direction of the local variable, and the running package of the hybrid project may be generated in combination with the first compiled product of the target project that has completed compiling. Therefore, the native engineering and the target engineering are decoupled in the compiling stage by adding the local variable in the native engineering and adjusting the indication function of the local variable based on the compiling requirement, and whether the target engineering is compiled or not can be selectively determined in the compiling process of the native engineering, so that the compiling efficiency is effectively improved, the compiling resource consumption is reduced in some scenes, and the debugging cost is greatly reduced.
The embodiment of the application also provides a computer device which can comprise a terminal device or a server, and the data processing device can be configured in the computer device. The computer device is described below with reference to the accompanying drawings.
If the computer device is a terminal device, please refer to fig. 12, an embodiment of the present application provides a terminal device, taking the terminal device as a mobile phone as an example:
Fig. 12 is a block diagram showing a part of the structure of a mobile phone according to an embodiment of the present application. Referring to fig. 12, the mobile phone includes: radio Frequency (RF) circuitry 1410, memory 1420, input unit 1430, display unit 1440, sensor 1450, audio circuitry 1460, wireless fidelity (WiFi) module 1470, processor 1480, and power supply 1490. Those skilled in the art will appreciate that the handset configuration shown in fig. 12 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 12:
The RF circuit 1410 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the downlink information is processed by the processor 1480; in addition, the data of the design uplink is sent to the base station.
The memory 1420 may be used to store software programs and modules, and the processor 1480 performs various functional applications and data processing of the cellular phone by executing the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 1430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 1430 may include a touch panel 1431 and other input devices 1432.
The display unit 1440 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
The handset can also include at least one sensor 1450, such as a light sensor, motion sensor, and other sensors.
Audio circuitry 1460, speaker 1461, microphone 1462 may provide an audio interface between the user and the handset.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1470, so that wireless broadband Internet access is provided for the user.
The processor 1480 is a control center of the handset, connects various parts of the entire handset using various interfaces and lines, performs various functions of the handset and processes data by running or executing software programs and/or modules stored in the memory 1420, and invoking data stored in the memory 1420.
The handset also includes a power supply 1490 (e.g., a battery) that provides power to the various components.
In this embodiment, the processor 1480 included in the terminal apparatus is also used to perform steps in the methods of the embodiments of the present application.
If the computer device is a server, as shown in fig. 13, fig. 13 is a block diagram of a server 1500 provided in the embodiment of the present application, where the server 1500 may have a relatively large difference due to different configurations or performances, and may include one or more central processing units (Central Processing Units, abbreviated as CPU) 1522 (e.g., one or more processors) and a memory 1532, one or more storage media 1530 (e.g., one or more mass storage devices) storing application programs 1542 or data 1544. Wherein the memory 1532 and the storage medium 1530 may be transitory or persistent storage. The program stored on the storage medium 1530 may include one or more modules (not shown), each of which may include a series of instruction operations on the server. Still further, the central processor 1522 may be configured to communicate with a storage medium 1530 and execute a series of instruction operations on the storage medium 1530 on the server 1500.
The Server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input/output interfaces 1558, and/or one or more operating systems 1541, such as a Windows Server TM,Mac OS XTM,UnixTM, LinuxTM,FreeBSDTM, and the like.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 13.
In addition, the embodiment of the application also provides a storage medium for storing a computer program for executing the method provided by the embodiment.
The present application also provides a computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method provided by the above embodiments.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, where the above program may be stored in a computer readable storage medium, and when the program is executed, the program performs steps including the above method embodiments; and the aforementioned storage medium may be at least one of the following media: read-only Memory (ROM), RAM, magnetic disk or optical disk, and the like, on which a computer program can be stored.
In the present embodiment, the term "module" or "unit" refers to a computer program or a part of a computer program having a predetermined function and working together with other relevant parts to achieve a predetermined object, and may be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Also, a processor (or multiple processors or memories) may be used to implement one or more modules or units. Furthermore, each module or unit may be part of an overall module or unit that incorporates the functionality of the module or unit.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment is mainly described in a different point from other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, with reference to the description of the method embodiments in part. The apparatus and system embodiments described above are merely illustrative, in which elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the technical scope of the present application should be included in the scope of the present application. Further combinations of the present application may be made to provide further implementations based on the implementations provided in the above aspects. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (17)

1. A method of data processing, the method comprising:
When compiling a native project, acquiring local variables aiming at a target project in the native project, wherein the native project and the target project are application data developed under different development environments, and the target project is used for being integrated into the native project; the variable value of the local variable comprises a first value or a second value; the first value is used for indicating that the target project is compiled, and the second value is used for indicating that the target project is not compiled; the native project is application data developed in a first development environment, and a code storage catalog related to the target project is added in the native project;
When the local variable is the first value, responding to the local variable to instruct compiling the target project, acquiring the target project to compile to obtain a first compiling product, and combining the first compiling product with a second compiling product obtained by compiling the original project to obtain an operation package of the hybrid project; the hybrid engineering is the native engineering integrating the target engineering;
When the local variable is the second value, responding to the local variable indicating that the target project is not compiled, acquiring the first compiling product obtained through historical compiling, and combining the first compiling product with the second compiling product to obtain an operation package of the hybrid project;
When compiling the native engineering, acquiring an adaptive target native function code through the code storage catalog, wherein the target native function code is a code which can be compiled in the first development environment and is used for realizing the interaction function of the target engineering and the native engineering; the interactive function comprises at least one of a page routing function and a communication function;
Encapsulating the interactive function into the second compiled product by compiling the target native function code;
When the interactive function includes a page routing function, after obtaining the running package of the hybrid engineering, the method further includes:
running the hybrid engineering through the running package;
In the running process of the hybrid engineering, starting a page management process according to the page routing function;
Storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process;
Responding to display operation of a first target page of the hybrid engineering, and reading the first target page from the page stack to display, wherein the first target page is the first type page or the second type page;
and deleting a second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page, wherein the second target page is the first type page or the second type page.
2. The method of claim 1, wherein the obtaining the first compiled product obtained by historical compilation comprises:
And determining the first compiling product of the target version related to the compiling requirement from the first compiling products of the plurality of compiling versions obtained through historical compiling.
3. The method of claim 1, wherein the code storage directory points to a storage space in which native function code for different development environments is stored, the native function code for the different development environments being code that is compilable under the corresponding development environment;
the obtaining the adapted target native function code through the code storage directory includes:
accessing a corresponding storage space through the code storage catalog;
the target native function code adapted to the first development environment is determined in the storage space.
4. The method of claim 1, wherein the code storage directory points to a storage space storing functional scripts for different development environments, the functional scripts for a first development environment being used to incorporate the first compilation product into the second compilation product in the first development environment.
5. The method of claim 1, wherein when the interactive function comprises a communication function, after obtaining the running package of the hybrid engineering, the method further comprises:
running the hybrid engineering through the running package;
In the running process of the hybrid engineering, a unified communication interface is built for the target engineering according to the communication function;
and establishing a communication channel between the native project and the target project based on the communication interface, wherein the communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native projects of different development environments.
6. The method of claim 5, wherein in the data communication, the target project is a server side of the data communication and the native project is a client side of the data communication.
7. The method of any of claims 1-6, wherein the development environment of the native project is a desktop environment or a mobile environment.
8. A data processing apparatus, the apparatus comprising: the system comprises an acquisition module, a first compiling module and a second compiling module;
The acquisition module is used for acquiring local variables aiming at a target project in the original project when compiling the original project, wherein the original project and the target project are application data developed under different development environments, and the target project is used for being integrated into the original project; the variable value of the local variable comprises a first value or a second value; the first value is used for indicating that the target project is compiled, and the second value is used for indicating that the target project is not compiled; the native project is application data developed in a first development environment, and a code storage catalog related to the target project is added in the native project;
The first compiling module is configured to, when the local variable is the first value, respond to the local variable indicating to compile the target project, obtain a first compiled product obtained by compiling the target project, and combine the first compiled product with a second compiled product obtained by compiling the native project to obtain an operation package of a hybrid project, where the hybrid project is the native project integrated with the target project;
The second compiling module is configured to obtain the first compiling product obtained by historical compiling in response to the local variable indicating that the target project is not compiled when the local variable is the second value, and combine the first compiling product with the second compiling product to obtain a running package of the hybrid project;
the device is used for:
When compiling the native project, acquiring an adaptive target native function code through the code storage catalog, wherein the target native function code is a code which can be compiled in the first development environment and is used for realizing the interaction function of the target project and the native project; the interactive function comprises at least one of a page routing function and a communication function;
Encapsulating the interactive function into the second compiled product by compiling the target native function code;
When the interactive function includes a page routing function, after obtaining the running package of the hybrid engineering, the apparatus is configured to:
running the hybrid engineering through the running package;
In the running process of the hybrid engineering, starting a page management process according to the page routing function;
Storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process;
Responding to display operation of a first target page of the hybrid engineering, and reading the first target page from the page stack to display, wherein the first target page is the first type page or the second type page;
and deleting a second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page, wherein the second target page is the first type page or the second type page.
9. The apparatus of claim 8, wherein the second compiling module is to:
And determining the first compiling product of the target version related to the compiling requirement from the first compiling products of the plurality of compiling versions obtained through historical compiling.
10. The apparatus of claim 8, wherein the code storage directory points to a storage space in which native function code for different development environments is stored, the native function code for different development environments being code that is compilable under the corresponding development environment; the device is used for:
accessing a corresponding storage space through the code storage catalog;
the target native function code adapted to the first development environment is determined in the storage space.
11. The apparatus of claim 8, wherein the apparatus is configured to:
The storage space pointed by the code storage catalog stores function scripts for different development environments, and the function scripts for a first development environment are used for merging the first compiling product into the second compiling product in the first development environment.
12. The apparatus of claim 8, wherein when the interactive function comprises a communication function, the apparatus is configured to, after obtaining the running package of the hybrid project:
running the hybrid engineering through the running package;
In the running process of the hybrid engineering, a unified communication interface is built for the target engineering according to the communication function;
and establishing a communication channel between the native project and the target project based on the communication interface, wherein the communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native projects of different development environments.
13. The apparatus of claim 12, wherein the apparatus is configured to:
in the data communication, the target engineering is used as a service end of the data communication, and the native engineering is used as a client end of the data communication.
14. The apparatus according to any one of claims 8-13, wherein the apparatus is configured to:
The development environment of the original engineering is a desktop environment or a mobile environment.
15. A computer device, the computer device comprising a processor and a memory:
The memory is used for storing a computer program;
the processor is configured to perform the method of any of claims 1-7 according to the computer program.
16. A computer readable storage medium for storing a computer program which, when executed by a computer device, implements the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method of any of claims 1-7.
CN202410164437.2A 2024-02-05 2024-02-05 Data processing method and related device Active CN117724726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410164437.2A CN117724726B (en) 2024-02-05 2024-02-05 Data processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410164437.2A CN117724726B (en) 2024-02-05 2024-02-05 Data processing method and related device

Publications (2)

Publication Number Publication Date
CN117724726A CN117724726A (en) 2024-03-19
CN117724726B true CN117724726B (en) 2024-05-28

Family

ID=90200077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410164437.2A Active CN117724726B (en) 2024-02-05 2024-02-05 Data processing method and related device

Country Status (1)

Country Link
CN (1) CN117724726B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750288A (en) * 2019-10-23 2020-02-04 广州华多网络科技有限公司 Native engineering configuration method and device, electronic equipment and storage medium
CN111694564A (en) * 2020-06-05 2020-09-22 百度在线网络技术(北京)有限公司 Compiling method, device, equipment and medium for Flutter mixed mode
CN111966396A (en) * 2019-05-20 2020-11-20 北京京东尚科信息技术有限公司 Data processing method and device, computer system and computer readable storage medium
CN112417337A (en) * 2020-11-27 2021-02-26 贝壳技术有限公司 Page jump implementation method and device, electronic equipment and storage medium
CN113467784A (en) * 2021-07-23 2021-10-01 腾讯科技(成都)有限公司 Application program processing method and device and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2517101A1 (en) * 2009-12-21 2012-10-31 Nokia Corp. A method, apparatuses and a system for compilation
CN115407977A (en) * 2021-05-28 2022-11-29 腾讯科技(深圳)有限公司 Information compiling method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966396A (en) * 2019-05-20 2020-11-20 北京京东尚科信息技术有限公司 Data processing method and device, computer system and computer readable storage medium
CN110750288A (en) * 2019-10-23 2020-02-04 广州华多网络科技有限公司 Native engineering configuration method and device, electronic equipment and storage medium
CN111694564A (en) * 2020-06-05 2020-09-22 百度在线网络技术(北京)有限公司 Compiling method, device, equipment and medium for Flutter mixed mode
CN112417337A (en) * 2020-11-27 2021-02-26 贝壳技术有限公司 Page jump implementation method and device, electronic equipment and storage medium
CN113467784A (en) * 2021-07-23 2021-10-01 腾讯科技(成都)有限公司 Application program processing method and device and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
安全编码实践:数据页面保护;褚诚云;程序员;20080301(03);全文 *

Also Published As

Publication number Publication date
CN117724726A (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN111399840B (en) Module development method and device
CN106294113B (en) creation method and device based on programmable test service
CN109933381B (en) Kernel loading method and device
CN111740948A (en) Data packet issuing method, dynamic updating method, device, equipment and medium
CN110928548B (en) Data processing method and device
CN114721719B (en) Method and system for containerized deployment of heterogeneous applications in cluster
CN112068903A (en) Application loading method, application loading device, medium and equipment
CN114168460A (en) Remote debugging method, device and storage medium for front-end code in hybrid development
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN113138768B (en) Application package generation method and device, electronic equipment and readable storage medium
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment
CN111683005B (en) Internet of things intelligent gateway equipment and construction method thereof
CN112612460A (en) Interface packaging and calling method, electronic device and storage medium
CN117724726B (en) Data processing method and related device
WO2023083071A1 (en) View interaction method and apparatus, electronic device, and computer readable medium
CN116755788A (en) On-line rule modification method, device, equipment and storage medium
CN114090070A (en) Application program installation package file processing method and electronic equipment
CN110502251B (en) Application installation method and device
CN113296781A (en) Application program installation package file compiling and constructing method and device and electronic equipment
CN111290746A (en) Object access method, device, equipment and storage medium
CN116991380B (en) Application program construction method and device, electronic equipment and storage medium
CN116820431B (en) Embedded application development and operation method with full function node. Js
CN115543351B (en) Application program installation method and electronic equipment
CN114047922B (en) Transcoding method, device, medium and equipment for precompiled device
CN115878282A (en) Cross-platform interaction method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant