Application processing method, device and system and related equipment
Through dynamic instrumentation technology, the value sequence of function parameters is automatically tracked between different architectural platforms, which solves the problem of inefficient manual code addition, improves migration efficiency and supports automatic repair and performance optimization.
Patent Information
- Application Number
- CN202310979897.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-06-08
- Filing Date
- 2023-08-03
- Publication Date
- 2024-12-10
AI Technical Summary
During the cross-instruction set migration application, users need to manually add custom output code to track the difference in value of function parameters, which is inefficient and prone to errors, resulting in low migration efficiency.
Through the dynamic instrumentation tool, architecture-specific executable code is automatically inserted into the executable file, generating a sequence of value for function parameters without the need for user manual code addition, improving efficiency and reducing errors.
It has achieved the improvement of application migration efficiency between different architectural platforms, reduced the number of source code modifications, improved the efficiency of user positioning problems, and supported automatic repair and performance optimization.
Smart Images

Figure CN119105796A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 8, 2023, with application number 202310679863.5 and application name “A Method for Processing Instructions Sets”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to an application processing method, device, system and related equipment. Background Art
[0003] When building the software ecosystem of a platform, users (such as software developers) often migrate applications from other architecture platforms to this platform. For example, users can migrate applications on the X86 (a general term for a series of CPU instruction set architectures based on Intel 8086 and backward compatible) platform to the advanced reduced instruction set computing machines (ARM) platform to build and enrich the software ecosystem of the ARM platform. In the process of migrating applications across instruction sets, it is usually necessary to compare whether the running results of the application on different architecture platforms match to verify whether the application can run correctly on the new platform. When it is determined that there is a running error in the application on the new platform (that is, the running results of the application on the two platforms do not match), the user will promptly modify and repair the application migrated to the new platform.
[0004] Typically, users will manually add custom output codes (for outputting the values of parameters in the functions) before and after multiple functions in the source code of the application to track the value sequences of the parameters in the multiple functions when the application is running, thereby comparing the differences between the value sequences of the same function parameters when the application is running on two architecture platforms to determine whether the application needs to be modified and repaired when migrating to the new platform. However, it is inefficient for users to manually add custom output codes for multiple functions in the source code, and it is easy to have errors when manually adding codes, which will lead to low overall efficiency in migrating applications between platforms with different architectures.
[0005] Therefore, there is an urgent need for a method to improve the efficiency of migrating applications between platforms with different architectures. Summary of the invention
[0006] The present application provides an application processing method to improve the efficiency of migrating applications between platforms of different architectures. In addition, the present application also provides a corresponding application processing device, an application processing system, a computing device, a computer-readable storage medium, and a computer program product.
[0007] In a first aspect, the present application provides an application processing method, which can be executed by a corresponding application processing device, and the application processing device may use a dynamic instrumentation tool, etc.; in a specific implementation, the application processing device obtains a first executable file and a second executable file corresponding to the application, wherein the first executable file is obtained by compiling the source code of the application based on an instruction set of a first architecture (such as an X86 architecture), and the second executable file is obtained by compiling the source code of the application based on an instruction set of a second architecture (such as an ARM architecture), and obtains a first function file, the first function file includes an identifier of a first function in the source code, and the first function may refer to one function or multiple functions; then, in the process of executing the first executable file, the application processing device inserts the first function file into the first executable file according to the first function file. An executable code is provided to obtain a first value sequence corresponding to a parameter in a first function, wherein the first executable code is a code under an instruction set of a first architecture, and is used to output the value of the parameter in the first function. Since the first function is usually called multiple times during the execution of the first executable file, the value of the parameter outputted by the first executable code can form a sequence according to the output timing, i.e., the first value sequence; similarly, during the execution of the second executable file, the application processing device inserts a second executable code into the second executable file according to the first function file, and obtains a second value sequence corresponding to the parameter in the first function, wherein the second executable code is a code under an instruction set of a second architecture, and is used to output the value of the parameter in the first function; thereby, the application processing device outputs the first value sequence and the second value sequence.
[0008] In this way, in the process of executing each executable file, the application processing device can automatically insert the executable code under the corresponding architecture into each executable file according to the function identifier in the first function file, so as to obtain the first value sequence and the second value sequence corresponding to the parameters in the first function under the two architectures, respectively, without the need for the user to manually add the custom output code in the source code of the application, thereby avoiding the errors caused by manually adding the program code and improving the efficiency of obtaining the value sequence corresponding to the parameters in the first function. In this way, the user can complete the modification and repair of the application in a shorter period of time, thereby improving the overall efficiency of the application migration between platforms of different architectures. In addition, when the function parameters need to be modified (that is, modifying the value sequence corresponding to the function parameters required to be output), it is only necessary to modify the function identifier in the first function file, without modifying the source code of the application, thereby avoiding multiple compilations of the source code, thereby further improving the overall efficiency of the application migration between platforms of different architectures.
[0009] In a possible implementation, the application processing device also compares the first value sequence and the second value sequence, and when there is a difference between the first value sequence and the second value sequence, indicating that there are inconsistent values of some parameters in the first function, the application processing device can also output first information corresponding to the first value that has a difference between the first value sequence and the second value sequence, and the first information includes an identifier of the first function. Furthermore, the first information can also include parameters in the first function that have value differences between the two value sequences. In this way, the user can quickly locate the problematic first function and the problematic parameters in the first function based on the output first information, thereby improving the efficiency of the user in locating the problem.
[0010] In a possible implementation, the application processing device may also modify the first function file to obtain a second function file, the second function file including an identifier of the first function and an identifier of a second function in the source code, the second function being other functions in the source code whose function parameter values are not tracked, which may be one function or multiple functions; in the process of executing the first executable file, the application processing device inserts a third executable code into the first executable file according to the second function file to obtain a third value sequence corresponding to the parameters in the first function and the parameters in the second function, the third executable code being a code under the instructions of the first architecture, and being used to output the values of the parameters in the first function and the values of the parameters in the second function; similarly, in the execution of the second executable file In the process, the application processing device inserts a fourth executable code into the second executable file according to the second function file, obtains a fourth value sequence corresponding to the parameters in the first function and the parameters in the second function, and the fourth executable code is a code under the instruction set of the second architecture, which is used to output the values of the parameters in the first function and the values of the parameters in the second function; thereby, the application processing device compares the third value sequence and the fourth value sequence, obtains the second information corresponding to the first value that has a difference between the third value sequence and the fourth value sequence, and the second information includes the identifier of the function to which the first value that has a difference between the third value sequence and the fourth value sequence belongs, which may further include the parameter with a problem in the function; finally, the application processing device outputs the second information. In this way, the application processing device determines whether the inconsistent parameter values in the second function lead to the inconsistent parameter values in the first function, or whether the inconsistent parameter values in the first function lead to the inconsistent parameter values in the second function, by further comparing the difference between the two sequences including the parameter values in the first function and the second function, so as to judge whether the first function is the root cause of the data error, so as to repair the source code of the application based on the root cause. Furthermore, when adjusting a function, it is only necessary to change the function identifier included in the function file without modifying the source code of the application, thereby avoiding multiple compilations of the source code and further improving the overall efficiency of migrating applications between platforms of different architectures.
[0011] In a possible implementation, when there is no difference between the first value sequence and the second value sequence, the application processing device may further modify the first function file to obtain a third function file, wherein the third function file includes an identifier of a third function in the source code, and the third function is other functions in the source code that do not track function parameter values, and may be one function or multiple functions; in the process of executing the first executable file, the application processing device inserts a fifth executable code into the first executable file according to the third function file to obtain a fifth value sequence corresponding to the parameters in the third function, and the fifth executable code is a code under the instruction set of the first architecture, which is used to output The value of the parameter in the third function; similarly, in the process of executing the second executable file, the application processing device also inserts the sixth executable code into the second executable file according to the third function file, obtains the sixth value sequence corresponding to the parameter in the third function, and the sixth executable code is the code under the instruction set of the second architecture, which is used to output the value of the parameter in the third function; so that the application processing device can also compare the fifth value sequence and the sixth value sequence, and when there is a difference between the fifth value sequence and the sixth value sequence, output the third information corresponding to the first value between the fifth value sequence and the sixth value sequence, and the third information includes the identifier of the fourth function. Further, the third information can also include the parameter whose value is inconsistent between the two sequences in the fourth function. In this way, by checking the parameter values in other functions, it can be determined whether there is a problem of parameter value error in other functions, so as to achieve problem location. Moreover, when adjusting the function, it is only necessary to change the function identifier included in the function file, without modifying the source code of the application, so as to avoid multiple compilations of the source code, thereby further improving the overall efficiency of application migration between platforms of different architectures.
[0012] In a possible implementation, the application processing device may also determine a target rule from multiple rules based on the first information corresponding to the first value that differs between the first value sequence and the second value sequence, and modify the source code of the application based on the target rule. The target rule may be pre-configured by a technician, or automatically generated by the application processing device through self-learning or other methods. In this way, the application processing device may automatically modify the source code of the application based on the modification method for the source code defined in the target rule to achieve automatic repair of the application, thereby further improving the overall efficiency of migrating applications between platforms of different architectures and providing user experience.
[0013] In a possible implementation, when the application processing device obtains the first function file, it may specifically obtain an initial file first, the initial file includes the identifiers of multiple functions in the source code, and the initial file is obtained by extracting functions from the source code of the application, for example, it may be extracted from the source code by the compiler during the process of compiling the source code, and then, the application processing device generates the first function file in response to the user's screening operation for the identifiers of multiple functions in the initial file. In this way, the user can specify that the application processing device track the values of parameters in a specific function, which facilitates the user's manual intervention in the process and improves the user experience.
[0014] In a possible implementation, the first function file also includes the parameters in the first function; or the first function file also includes the length threshold of the input array corresponding to the first function, or the structure corresponding to the parameters in the first function. In this way, the input array and parameters of the first function can be configured in the first function file to achieve finer-grained control.
[0015] In a possible implementation, the first executable file is obtained by compiling the source code of the first version of the application, then the application processing device can also obtain a third executable file corresponding to the application, the third executable file is obtained by compiling the source code of the second version of the application based on the instruction set of the first architecture, and the difference between the source code of the first version and the source code of the second version includes the algorithm in the first function; then, in the process of executing the third executable file, the application processing device inserts the seventh executable code into the third executable file according to the first function file, obtains the seventh value sequence corresponding to the parameter in the first function, the seventh executable code is the code under the instruction set of the first architecture, and is used to output the value of the parameter in the first function; then, the application processing device can compare the first value sequence and the seventh value sequence, obtain a first comparison result, and output the first comparison result. The user can evaluate the performance advantages and disadvantages of different algorithms used in the first function in the two versions of the source code according to the comparison result output by the application processing device, so that the user can design a higher performance algorithm for the first function in the application.
[0016] In a possible implementation, the application processing device inserts a first executable code into the first executable file according to the first function file in the process of executing the first executable file based on the first floating-point operation precision (such as 64-bit floating-point operation precision), and obtains the eighth value sequence corresponding to the parameter in the first function; and inserts the first executable code into the second executable file according to the first function file in the process of executing the second executable file based on the second floating-point operation precision (such as 64-bit + 32-bit mixed floating-point operation precision), and obtains the ninth value sequence corresponding to the parameter in the first function; so that the application processing device can compare the eighth value sequence and the ninth value sequence, obtain the second comparison result, and output the second comparison result. In this way, the user can analyze the difference between the running results generated by the application when running based on two different floating-point operation precisions according to the second comparison result, so that the user can determine whether to adjust the floating-point operation precision used when the application is running according to the difference, such as migrating the application to a platform that executes executable files based on a lower floating-point operation precision, thereby increasing the throughput of the application and improving the efficiency of the application processing business.
[0017] In a second aspect, the present application provides an application processing device, which includes various modules for executing the application processing method in the first aspect or any possible implementation of the first aspect.
[0018] In a third aspect, the present application provides an application processing system, which includes a compiler and an application processing device; wherein the compiler is used to compile the source code of the application based on the instruction set of the first architecture to obtain a first executable file, and compile the source code of the application based on the instruction set of the second architecture to obtain a second executable file, and provide the first executable file and the second executable file to the application processing device; the application processing device is used to execute the application processing method described in the first aspect or any possible implementation of the first aspect.
[0019] In a fourth aspect, the present application provides a computing device, which includes a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory so that the computing device executes the application processing method in the first aspect or any implementation of the first aspect. It should be noted that the memory can be integrated into the processor or can be independent of the processor. The computing device may also include a bus. The processor is connected to the memory via the bus. The memory may include a readable memory and a random access memory.
[0020] In a fifth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computing device, the computing device executes the operating steps of the application processing method described in the first aspect or any one of the implementations of the first aspect.
[0021] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device, enables the computing device to execute the operating steps of the application processing method described in the first aspect or any one of the implementations of the first aspect.
[0022] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of the structure of an exemplary application processing system provided by the present application;
[0024] Figure 2 A flowchart of an application processing method provided for this application;
[0025] Figure 3 A schematic diagram of an exemplary submission interface provided for this application;
[0026] Figure 4 A schematic diagram of the structure of an application processing device provided in this application;
[0027] Figure 5 A schematic diagram of the hardware structure of a computing device provided for this application;
[0028] Figure 6 A schematic diagram of the structure of a computing device cluster provided in this application. DETAILED DESCRIPTION
[0029] In order to improve the overall efficiency of migrating applications between platforms of different architectures, the present application provides an application processing method, which can output the value sequence of parameters in the function under the instruction sets of multiple architectures by automatically inserting corresponding executable code for a function in an executable file (executable file, such as an assembly language file, a binary file, etc.), without the need for users to manually add custom output code in the source code of the application, thereby improving the efficiency of obtaining the value sequence corresponding to the parameters in the function, thereby improving the overall efficiency of migrating applications between platforms of different architectures.
[0030] To facilitate understanding of the technical solution of the present application, the relevant technical terms involved in the present application are explained below.
[0031] An application, also known as an application program, usually refers to a program written for a specific application purpose for the user, such as a browser, media player, aviation flight simulator, image editor, etc.
[0032] The instruction set, also known as instruction set architecture (ISA), is the content of computer architecture related to basic data types, instructions, registers, addressing modes, storage systems, interrupts, exception handling, and external input / output (IO). Typically, the instruction set contains a series of opcodes and basic commands executed by the processor.
[0033] Source code, also known as source program, refers to an uncompiled text file written in accordance with certain programming language specifications, including a series of computer language instructions, such as program code written in C language or Java language.
[0034] An executable file refers to a file that can be loaded and executed by an operating system, such as an assembly language file, a binary file, etc.
[0035] Compilation refers to converting source code written in a certain programming language into another programming language, such as converting source code written in C language into machine language or assembly language.
[0036] Executable code refers to code that can be directly executed by a machine, such as assembly language code, binary code, etc.
[0037] A function file, in this application, refers to a file including an identifier of a function, and the identifier may be, for example, the name of the function.
[0038] In this application, a value sequence refers to a sequence of values of one or more parameters in different time periods. For example, assuming that parameter A takes values of 1, 3, 5, 2, 9, 7, 4, 5 in different time periods, the value sequence of parameter A can be {1, 3, 5, 2, 9, 7, 4, 5}.
[0039] Floating point calculation precision refers to the precision used by the numerical value involved in floating point calculation in this application. The precision depends on the number of bits used to describe the numerical value. The more bits used, the greater the precision of the numerical value. In practical applications, the numerical value can be described by 8 bits, 16 bits, 32 bits, or 64 bits.
[0040] See also Figure 1 , showing a schematic diagram of the structure of an application processing system provided by the present application. Figure 1 As shown, the application processing system 10 may include a client 201, a compiler 102, and an application processing device 200, and the client 201, the compiler 102, and the application processing device 200 may be interconnected via a network. The compiler 102 and the application processing device 200 may be deployed in the cloud to provide cloud services for processing applications for users (such as software developers or testers, etc.).
[0041] The client 101 is used to interact with the user, such as receiving the source code of the application provided by the user, etc. Exemplarily, the client 101 may be an application running on a user-side device, or may be a network browser provided by the application processing system 10 to the outside.
[0042] The compiler 102 is used to convert source code based on a high-level programming language into an executable file of a low-level programming language. The high-level programming language may be, for example, a process-oriented or object-oriented language such as Java, C, C++, or Python. The low-level programming language may be, for example, a machine language or an assembly language.
[0043] The application processing device 200 is used to execute the executable file obtained by the compiler 102 compiling the source code of the application, and track the value changes of the parameters in the function included in the source code.
[0044] In actual application scenarios, users may migrate applications that run stably on the X86 platform to the ARM platform to enrich the software ecosystem of the ARM platform. Generally, there are differences in the floating-point calculation accuracy between the X86 platform and the ARM platform. For example, the floating-point calculation accuracy of the X86 platform is 80 bits, while the floating-point calculation accuracy of the ARM platform is 64 bits. Therefore, before migrating the application, the user can use the application processing system 10 to make corresponding changes and restore the source code of the application so that after migrating the application to the ARM platform, the running state of the application can meet the user's expectations.
[0045] In specific implementation, the user may submit the source code of the application on the client 101 , and the client 101 sends the source code to the compiler 102 .
[0046] The compiler 102 compiles the received source code based on the instruction set of the X86 architecture to obtain an executable file 1, and compiles the source code based on the instruction set of the ARM architecture to obtain an executable file 2. In addition, the compiler 102 can also extract the identifier of at least one function in the source code. Taking the extraction of the identifier of function A as an example, the compiler 102 can generate a file including the identifier of function A. Thus, the compiler 102 can send the executable file 1, the executable file 2, and the file including the identifier of function A to the application processing device 200 together.
[0047] The application processing device 200 obtains executable file 1, executable file 2, and a file including a function A identifier, and executes executable file 1 and executable file 2 according to the file. In the process of executing executable file 1, when function A is executed, the application processing device 200 inserts executable code under the X86 architecture into executable file 1, and the executable code is used to output the values of parameters in function A (such as input parameters or output parameters of function A, etc., input parameters refer to parameters input to the function, and output parameters refer to function return values). In addition, in the process of executing executable file 2, the application processing device 200 inserts executable code under the ARM architecture into executable file 2, and the executable code is used to output the values of parameters in function A. Since function A may be called multiple times during the execution process, after executing executable file 1, the value sequence 1 of the parameters in function A can be obtained; after executing executable file 2, the value sequence 2 of the parameters in function A can be obtained. Among them, the value sequence 1 includes multiple values, and the multiple values are the values of the parameter in sequence during the process of the application processing device 200 executing the executable file 1. Similarly, the value sequence 2 records the values of the parameter in sequence during the process of the application processing device 200 executing the executable file 2. Further, the application processing device 200 can also compare the value sequence 1 and the value sequence 2, so as to automatically repair the source code of the application when there is a difference between the two value sequences; or, the application processing device 200 can feedback the value sequence 1 and the value sequence 2 to the user through the client 101, and the user can modify and repair the source code of the application.
[0048] In this way, during the execution of the executable file, the application processing system 10 can obtain the value sequence 1 and the value sequence 2 corresponding to the parameters in function A in the two architectures by automatically inserting the executable code under the corresponding architecture in the executable files 1 and 2 according to the function A identifier in the file, without the need for the user to manually add custom output code in the source code of the application, thereby avoiding errors caused by manually adding program code and improving the efficiency of obtaining the value sequence corresponding to the parameters in function A. In this way, the source code of the application can be modified and repaired in a shorter period of time, thereby improving the overall efficiency of migrating the application between platforms of different architectures.
[0049] Furthermore, when it is necessary to modify the function parameters that need to be tracked, the application processing system 10 only needs to modify the identifier of the function in the file without modifying the source code of the application, thereby avoiding multiple compilations of the source code, thereby effectively improving the overall efficiency of migrating applications between platforms of different architectures by reducing the number of times the source code is compiled.
[0050] For example, the number of functions included in the source code may be large, such as 1,000 functions. In this case, the application processing system 10 may execute executable file 1 and executable file 2 multiple times. Moreover, each time the application processing system 10 executes executable file 1 and executable file 2, it may only output the value sequences corresponding to the parameters in 100 functions. When there is no difference between the value sequence 1 and the value sequence 2 corresponding to the parameters in the 100 functions, the application processing system 10 may modify the function identifier in the file to the identifier of the next batch of 100 functions, and output the value sequence 1 and the value sequence 2 corresponding to the parameters in the next 100 functions by executing executable file 1 and executable file 2 again. Repeat the above process until the two value sequences corresponding to the parameters in all functions are output. During this process, the application processing system 10 only needs to modify the function identifier in the file, and there is no need to insert program code for outputting parameter values at different function locations in the source code. This can avoid recompiling the source code due to inserting new program code, that is, it can reduce the number of source code compilations (such as only compiling the source code once), thereby avoiding the high latency caused by multiple compilations of the source code affecting the overall efficiency of the application migration.
[0051] Exemplarily, the application processing device 200 may be implemented by software or hardware.
[0052] In the first example, when implemented by software, the application processing device 200 can be implemented by program code in a computing device, for example, by at least one of a virtual machine, a container, a bare metal server (BMS), and a computing engine. At this time, the application processing device 200 can be deployed on devices that support instruction sets of different architectures, so that the application processing device 200 uses different devices to execute different executable files.
[0053] In the second example, when implemented by hardware, the application processing device 200 can be implemented by at least one physical device including a processor, such as a server, etc. Among them, the processor can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a system on chip (SoC), a software-defined infrastructure (SDI) chip, an artificial intelligence (AI) chip, a data processing unit (DPU), and any processor core or any combination thereof. In addition, the number of processors included in the application processing device 200 can be one or more, and the type of processors included can be one or more. The number and type of processors can be set according to the business requirements of the actual application, and this embodiment does not limit this. Among them, the application processing device 200 can control devices that support instruction sets of different architectures to execute executable files (in this case, it is still regarded as the application processing device 200 executing the executable file); or, the application processing device 200 can include multiple devices that support instruction sets of different architectures, so that the devices can be used to execute executable files compiled based on instruction sets of different architectures.
[0054] It is worth noting that the above Figure 1The application processing system 10 shown as being capable of providing application processing cloud services is only used as an exemplary illustration. In other possible application processing systems, the application processing system 10 may also include other devices, such as a database 103 storing one or more rules for modifying source code, so that the application processing device 200 can automatically modify and repair the source code according to the rules in the database 103. Alternatively, in other possible implementations, the application processing system may be deployed on a terminal device on the user side. In this case, the application processing system can provide users with localized service for processing applications. In this case, the application processing system may not include a client, so that users can directly provide the source code of the application on the local terminal device, and the compiler and the application processing device in the application processing system can collaboratively complete the above-mentioned processing process for the application. The specific architecture of the application processing system and its deployment method are not limited in this application.
[0055] Next, the application processing method provided by the present application is described in conjunction with the accompanying drawings.
[0056] See also Figure 2 , Figure 2 A schematic diagram of an application processing method provided in this application, which can be applied to Figure 1 The application processing system shown in the figure may be applied to other applicable application processing systems. Figure 1 The application processing system 10 shown is taken as an example for illustrative description.
[0057] in, Figure 2 The application processing method shown may specifically include:
[0058] S201: The client 101 obtains the source code of the application submitted by the user, and sends the source code to the compiler 102.
[0059] In this embodiment, the user can submit the source code of the application to the application processing system 10 through the client 101 to request the application processing system 10 to analyze whether the running results of the application on different architecture platforms are consistent.
[0060] As an implementation example, the client 101 may present the following to the user: Figure 3 The submission interface shown in the figure is displayed, so that the client 101 can obtain the application name, the file name and file path of the source code of the application input by the user in the submission interface. Then, the client 101 can respond to the user's click operation on the import button in the submission interface and access the source code file of the application according to the file path input by the user. When the user clicks the submit button in the submission interface, the client 101 can send the source code of the application to the compiler 102.
[0061] S202: The compiler 102 compiles the received source code based on the instruction set of the first architecture to obtain executable file 1, and compiles the source code based on the instruction set of the second architecture to obtain executable file 2, and provides executable file 1 and executable file 2 to the application processing device 200.
[0062] Among them, the first architecture and the second architecture can be different types of architectures. For example, the first architecture can specifically be an X86 architecture, and the second architecture can be an ARM architecture, or a microprocessor without interlocked pipeline stages (MIPS) architecture, etc. Alternatively, the first architecture and the second architecture can be architectures of the same type but different versions, for example, the first architecture is Pentium II under the X86 architecture, and the second architecture is Pentium III under the X86 architecture (introducing a new SSE instruction set), etc. This embodiment does not limit the specific implementation methods of the first architecture and the second architecture. In actual application scenarios, the application can run stably on the platform of the first architecture, and the user needs to migrate the application from the platform of the first architecture to the platform of the second architecture.
[0063] After receiving the source code, the compiler 102 can compile the source code into an executable file based on a low-level programming language, which can be a binary file or a file including assembly language, etc., because the source code is usually written in a high-level programming language and is difficult to be directly recognized by a machine.
[0064] In a specific implementation, the compiler 102 can compile the source code based on the instruction set of the first architecture to obtain an executable file 1. In this way, the executable file 1 can be recognized and executed by a device that supports the instruction set of the first architecture. In addition, the compiler 102 also compiles the source code based on the instruction set of the second architecture to obtain an executable file 2, which can be recognized and executed by a device that supports the instruction set of the second architecture. Among them, the process of the compiler 102 compiling the source code and obtaining the executable file has been related to the actual application scenario, and will not be elaborated here.
[0065] After compiler 102 compiles executable file 1 and executable file 2 based on instruction sets of different architectures, it can send them to application processing device 200 .
[0066] S203: The compiler 102 generates a first function file according to the source code, and sends the first function file to the application processing device 200, wherein the first function file includes an identifier of the first function.
[0067] Exemplarily, the identifier of the first function may be, for example, the name of the function.
[0068] During the process of compiling the source code, the compiler 102 may extract the identifier of at least one function included in the source code, for example, the identifiers of all functions in the source code may be extracted. Then, the compiler 102 may record the identifier of at least one function obtained in the first function file. For the convenience of distinction and description, in this embodiment, the identifier of the function recorded in the first function file is referred to as the identifier of the first function.
[0069] As an implementation example, when the identifier of the first function recorded in the first function file is the identifier of some functions in the source code, the compiler 102 can extract functions from the source code of the application to obtain an initial file, which includes the identifiers of multiple functions (e.g., all functions) in the source code. In actual application scenarios, the generated initial file can also be called a "rawinfo" file.
[0070] Furthermore, while extracting a function, the compiler 102 may also extract parameters in the function. The extracted parameters may be input parameters, output parameters, etc., so that the resulting initial file may also include a parameter list corresponding to each function, each parameter list including one or more parameters.
[0071] Usually, there are many functions in the source code. If the parameter values of all functions in the initial file are tracked at the same time, a large amount of data will be generated in the subsequent execution of the executable file, which will consume a large amount of memory and computing resources at the same time. Therefore, each time the application processing device 200 executes the executable file, it can choose to track the parameter values of some functions, and the identifiers of the selected functions can be recorded in the first function file. In actual application scenarios, the generated first function file can also be called an "info" file.
[0072] In this embodiment, the following two implementation methods for generating the first function file according to the initial file are provided.
[0073] In a first implementation, before generating the first function file, the compiler 102 may obtain a quantity threshold, which may be pre-configured by a technician, etc. In this way, the compiler 102 may divide the identifiers of all functions in the initial file according to the quantity threshold to obtain a plurality of different groups, wherein the number of function identifiers included in each group does not exceed the quantity threshold, so that the compiler 102 may select the function identifiers in one of the groups to generate the first function file. When the initial file also includes the parameters of the function, the first function file may also include the parameters in the function. When adjusting the identifiers of the functions in the first function file later, the function identifiers in other groups may be added to the first function file.
[0074] In a second implementation, the compiler 102 may output the generated initial file, for example, the compiler 102 may output the initial file to the client 101 so that the client 101 presents the initial file to the user. The user may select the identifiers of some functions from the identifiers of the multiple functions presented by the client 101, so that the compiler 102 may generate a first function file according to the user's screening operation on the identifiers of the multiple functions. When the initial file also includes function parameters, the first function file may also include the parameters in the function selected by the user.
[0075] Furthermore, the user may make other configurations when filtering the identifier of the function on the client 101. The following provides implementation examples of several configurations.
[0076] Example 1: The user can configure the parameters to be tracked in the screened function on the client 101. That is, not all parameters in the function will have their values tracked, but only some parameters configured by the user will have their values tracked. In specific implementation, for the selected function, the user can configure the structure corresponding to the parameters in the function. Among them, the structure is a structural data composed of multiple data. In this embodiment, the structure is specifically a combination of multiple parameters configured by the user. Accordingly, the subsequent application processing device 200 can only track the values of the parameters in the structure, without tracking the values of other parameters in the function.
[0077] Example 2: The user can configure the length threshold of the input array for the selected function on the client 101. The length threshold is used to limit the number of data included in the array used as the function input each time. For example, when the length threshold is 10, the number of data input to the function each time does not exceed 10. Accordingly, the value of the parameter tracked by the subsequent application processing device 200 is calculated based on the input array that does not exceed the length threshold.
[0078] Example three, the user can configure the output method of the values of multiple parameters in the function on the client 101. Among them, the output method of the values of multiple parameters can include a discrete method and an aggregate method. The discrete method refers to outputting the value of each parameter separately, so that the subsequent user can know the specific value of each parameter. The aggregate method refers to aggregating the values of multiple parameters and outputting the aggregated value. For example, the application processing device 200 can perform a hash operation on the values of multiple parameters, and output the calculated hash value as the aggregated value; or, the application processing device 200 can use the MD5 message-digest algorithm to calculate the MD5 value corresponding to the values of multiple parameters, and output the MD5 value as the aggregated value. In this way, the amount of data that the application processing device 200 needs to output can be reduced, and the consumption of storage resources can be reduced.
[0079] After generating the first function file, the compiler 102 may provide it to the application processing device 200 so that the application processing device 200 can track the values of the parameters in the function indicated by the first function file.
[0080] S204: The application processing device 200 executes the executable file 1 and the executable file 2 respectively.
[0081] In specific implementation, the application processing device 200 can send executable file 1 and executable file 2 to devices supporting instruction sets of different architectures, and instruct the devices to execute the received executable files. Device A supporting the instruction set of the first architecture is used to execute executable file 1, and device B supporting the instruction set of the second architecture is used to execute executable file 2.
[0082] S205: During the execution of executable file 1, the application processing device 200 inserts a first executable code into executable file 1 according to the first function file, obtains a value sequence 1 corresponding to the parameters in the first function, and the inserted first executable code is used to output the values of the parameters in the first function; and, during the execution of executable file 2, the application processing device 200 inserts a second executable code into executable file 2 according to the first function file, obtains a value sequence 2 corresponding to the parameters in the first function, and the inserted second executable code is used to output the values of the parameters in the first function.
[0083] The first executable code is used to output the value of the parameter in the first function, that is, to record the value of the parameter in the first function in the application processing device 200 (the rest of the executable codes are similar).
[0084] It can be understood that the inserted first executable code is a code under the instruction set of the first architecture, and the inserted second executable code is a code under the instruction set of the second architecture.
[0085] S206: The application processing device 200 outputs the value sequence 1 and the value sequence 2.
[0086] In this embodiment, the application processing device 200 may have a program instrumentation function. Program instrumentation refers to inserting new program code into a program on the basis of ensuring the original logical integrity of the program. In this embodiment, the program code inserted by the application processing device 200 into each executable file is specifically an executable code. For example, when the executable file is an assembly language file, the executable code inserted by the application processing device 200 is an assembly language code. For the convenience of distinction and description, the executable code inserted into the first executable file for the first function is referred to as the first executable code, and the executable code inserted into the second executable file for the first function is referred to as the second executable code. Exemplarily, when the application processing device 200 is implemented by software, the application processing device 200 can be obtained by adding a plug-in to an existing dynamic binary instrumentation (DBI) tool, which is used to read the identifier of the first function in the first function file and instruct the DBI tool to insert corresponding executable codes for outputting the values of the parameters in the first function in different executable files.
[0087] In the process of executing the executable file 1, the application processing device 200 can detect whether the function to be called currently is the first function indicated in the first function file. If so, the application processing device 200 can insert a first executable code for outputting the values of all input parameters in the first function into the executable file 1 before calling the first function. In this way, when the application processing device 200 executes the first executable code, it will output the value of the input parameter. In addition, before ending the call to the first function (that is, before the function exits), the application processing device 200 can insert a first executable code for outputting the values of all output parameters in the first function into the executable file 1. In this way, when the application processing device 200 executes the first executable code, it will output the value of the output parameter. In this way, each time the first function is called, the application processing device 200 can record the values of the parameters (including input parameters and output parameters) in the first function.
[0088] Generally, during the execution of the executable file 1, the first function may be called multiple times, for example, the average function may be called multiple times to calculate the averages of multiple sets of data, etc. Therefore, by recording the values of the parameters in the first function each time the first function is called, multiple values of the parameters in the first function can be obtained after the executable file 1 is executed. The multiple values form a sequence in time sequence, which is referred to as the value sequence 1 below.
[0089] Furthermore, when the first function file also specifies a structure corresponding to the parameters in the first function, the first executable code inserted into the executable file 1 by the application processing device 200 can be used only to output the values of the parameters included in the structure, and there is no need to output the values of the parameters not included in the structure.
[0090] Similarly, during the execution of executable file 2, the application processing device 200 can also obtain a sequence of parameter values in the first function by inserting a second executable code under the instruction set of the second architecture into executable file 2, which is referred to as value sequence 2 below.
[0091] Finally, the application processing device 200 may output the value sequence 1 and the value sequence 2. Exemplarily, the application processing device 200 may output the value sequence 1 and the value sequence 2 to the client 101 so that the client 101 presents them to the user. In this way, the user can compare whether there is a difference between the value sequence 1 and the value sequence 2, that is, compare whether there is a difference between the value sequences of the same function parameter when the application is run on devices under the two architectures.
[0092] If there is a difference between the value sequence 1 and the value sequence 2, it indicates that after the application is migrated from the platform of the first architecture to the platform of the second architecture, the application is prone to data errors during operation, so the user needs to make corresponding changes and repairs to the source code of the application so that the application can run correctly on the platform of the second architecture. For example, when the difference between the value of parameter X in the value sequence 1 and the value of parameter X in the value sequence 2 is caused by different floating-point operation precisions, the user can modify the source code of the application and use the floating-point operation precision of the platform of the second architecture to simulate the floating-point operation precision of the platform of the first architecture, so that the floating-point operation precision of the application when running on the platform of the second architecture is consistent with the floating-point operation precision when running on the platform of the first architecture.
[0093] Further, the application processing device 200 can also automatically compare whether there is a difference between the value sequence 1 and the value sequence 2, specifically, the values of the same parameter in the same function between the two value sequences are compared in sequence. In addition, when there is a difference between the value sequence 1 and the value sequence 2, the application processing device 200 can also output the first information corresponding to the first value that has a difference between the two value sequences, and the first information at least includes the identifier of the first function to which the first value belongs, which is used to indicate that when the application runs on the platform of the two architectures, the parameters in the first function will have data inconsistency. When the identifier recorded in the first function file is the identifier of multiple functions, the identifier of the function included in the first information is the identifier of the function to which the first value belongs. In actual application, since the first function usually includes multiple parameters, such as multiple input parameters or multiple output parameters, and there may be differences between the values of some parameters in the two value sequences, and the values of another part of the parameters are consistent in the two value sequences. Therefore, the first information can also include the parameter with the value error, so as to indicate which or which parameters in the first function have inconsistent values. Then, the application processing device 200 may output the first information to assist the user in quickly locating the problematic first function (and the problematic parameter in the first function) according to the first information.
[0094] If there is no difference between the value sequence 1 and the value sequence 2, the values of the parameters in the first function can be consistent when the source code representing the application runs on the two architecture platforms. At this time, if the identifier of the first function recorded in the first function file is the identifier of all functions in the source code, the user can determine that the application can run correctly on the platform of the second architecture, so that the user can migrate the application from the platform of the first architecture to the platform of the second architecture to enrich the software ecosystem of the platform of the second architecture.
[0095] In actual application, when the first function recorded in the first function file is a partial function included in the source code of the application, regardless of whether there is a difference between the value sequence 1 and the value sequence 2, the application processing device 200 can continue to verify whether there is a difference between the value sequences of parameters in other functions when the application is running on devices under the two architectures.
[0096] Next, the process of the application processing device 200 checking whether there is a difference between two value sequences corresponding to parameters in other functions is described for the case where there is a difference between value sequence 1 and value sequence 2 and the case where there is no difference.
[0097] 1. There is a difference between value sequence 1 and value sequence 2.
[0098] At this time, the difference in the values of the parameters in the first function in the two value sequences may be affected by the values of the parameters in other functions. For example, assuming that the output of other functions in the source code is used as the input of the first function, if there is a difference between the two value sequences corresponding to the parameters in the other functions, there will also be a difference between the value sequence 1 and the value sequence 2 corresponding to the parameters in the first function. At this time, the application processing device 200 can determine the root cause of the data error by continuing to check whether there is a difference between the two value sequences corresponding to the parameters in the other functions.
[0099] In this embodiment, the following two implementation examples for determining the root cause location are provided.
[0100] In a first implementation example, the application processing device 200 may modify the first function file to obtain a second function file, wherein the second function file includes the identifier of the first function and the identifier of the second function in the source code, and the second function is another function different from the first function among the multiple functions included in the source code. Wherein, when the first function includes multiple functions, such as function M and function N, and there is a difference between only two value sequences corresponding to the parameters in function N, the generated second function file may only include the identifier of function N and the identifier of the second function, and no longer need to include the identifier of function M. Exemplarily, the application processing device 200 may automatically modify the identifier of the function in the first function file; or, the application processing device 200 may present the first function file to the user through the client 101, thereby modifying the identifier of the function in the first function file according to the user's modification operation on the first function file. For the convenience of distinction, the file containing the identifier of the second function is referred to as the second function file in this embodiment.
[0101] Then, the application processing device 200 can re-execute executable file 1 and executable file 2. In the process of executing executable file 1, the application processing device 200 inserts the third executable code for the first function and the second function in executable file 1 according to the identifier of the first function and the identifier of the second function recorded in the second function file, wherein the third executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function, and the third executable code is the code under the instruction set of the first architecture. In this way, after executing executable file 1, the application processing device 200 can obtain the value sequence 3 corresponding to the parameters in the first function and the parameters in the second function, that is, the value sequence 3 includes the values of the parameters in the first function and the parameters in the second function at the same time. Similarly, in the process of executing executable file 2, the application processing device 200 inserts the fourth executable code for the first function and the second function in executable file 2 according to the identifier of the first function and the identifier of the second function recorded in the second function file, wherein the fourth executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function, and the fourth executable code is the code under the instruction set of the second architecture. In this way, after executing executable file 2, the application processing device 200 can obtain the value sequence 4 corresponding to the parameters in the first function and the parameters in the second function, that is, the value sequence 4 includes the values of the parameters in the first function and the parameters in the second function at the same time. Among them, each time the application processing device 200 records the values of the parameters in the function, it can record the values of the parameters in multiple functions at the same time.
[0102] Next, the application processing device 200 can compare whether there is a difference between the value sequence 3 and the value sequence 4. When there is a difference between the value sequence 3 and the value sequence 4, the application processing device 200 can further determine the second information corresponding to the first value with the difference, and the second information at least includes the identifier of the function to which the first value belongs. For example, when the parameter values in the first function are inconsistent, resulting in inconsistent parameter values in the second function, the first function that represents the first data error is the first function, and the second information can specifically include the identifier of the first function; conversely, when the parameter values in the second function are inconsistent, resulting in inconsistent parameter values in the first function, the first function that represents the first data error is the second function, and the second information can specifically include the identifier of the second function. Further, the second information can include the parameters in the function to which the first value belongs, which are used to indicate the parameters in the function where the value error occurs. At this time, the application processing device 200 can output the second information to assist the user in quickly locating the problematic function (and the problematic parameters in the first function) based on the second information.
[0103] It can be understood that when there are still parameters in some functions in the source code that have not completed the difference comparison between the two corresponding value sequences, then in the case where the second information includes the identifier of the second function, the application processing device 200 can add the identifier of the part of the function in the second function file, delete the identifier of the first function, and re-execute the executable file 1 and the executable file 2 based on the modified second function file to determine whether the second function is the root cause of the data error. Conversely, in the case where the second information includes the identifier of the first function, the application processing device 200 can delete the identifier of the second function in the second function file, add the identifier of the new function, and re-execute the executable file 1 and the executable file 2 based on the modified second function file to determine whether the first function is the root cause of the data error. The application processing device 200 can repeat the above iterative process until the two value sequences corresponding to the parameters in all functions in the source code are compared, and the final root cause position is output, that is, the function (and the parameters in the function) that ultimately causes the data inconsistency problem when the application runs on two architecture platforms is determined.
[0104] In the second implementation example, the application processing device 200 may modify the first function file to obtain a second function file. In this case, the second function file may only include the identifier of the second function in the source code, and the second function is another function different from the first function among the multiple functions included in the source code. Exemplarily, the application processing device 200 may actively modify the first function file; or, the application processing device 200 may modify the first function file according to the user's modification operation on the first function file. For the sake of distinction, in this implementation example, the modified first function file is referred to as the second function file.
[0105] Then, the application processing device 200 can re-execute the executable file 1 and the executable file 2. Moreover, in the process of executing the executable file 1, the application processing device 200 inserts the third executable code for the second function according to the identifier of the second function recorded in the second function file, wherein the third executable code is used to output the value of the parameter in the second function, and the third executable code is the code under the instruction set of the first architecture. In this way, after executing the executable file 1, the application processing device 200 can obtain the value sequence 3 corresponding to the parameter in the second function. In the process of executing the executable file 2, the application processing device 200 inserts the fourth executable code for the second function according to the identifier of the second function recorded in the second function file, wherein the fourth executable code is used to output the value of the parameter in the second function, and the fourth executable code is the code under the instruction set of the second architecture. In this way, after executing the executable file 2, the application processing device 200 can obtain the value sequence 4 corresponding to the parameter in the second function. Each time when the application processing device 200 records the value of a parameter in a function, it may also record the function call sequence number of the function during the code execution process (ie, record that the function is called at the Xth function call).
[0106] Next, the application processing device 200 can compare whether there is a difference between the value sequence 3 and the value sequence 4. When there is a difference between the value sequence 3 and the value sequence 4, the application processing device 200 can further determine the function call sequence number 2 corresponding to the first value with a difference, and determine the function call sequence number 1 corresponding to the first value with a difference between the above value sequence 1 and the value sequence 2 in a similar manner. Then, the application processing device 200 can compare the size of the two function call sequence numbers, that is, compare the timing of being called when there is a parameter value error between the first function and the second function, specifically, it can be compared whether the function call sequence number 2 corresponding to the second function is smaller than the function call sequence number 1 corresponding to the first function. When the function call number 2 corresponding to the second function is less than the function call number 1 corresponding to the first function, it indicates that the parameter value error in the second function leads to the parameter value error in the first function. At this time, the application processing device 200 can output the second information including the identifier of the second function (and the parameters in the second function) to assist the user to quickly locate the problematic function as the second function (and the problematic parameters in the second function) according to the second information, so as to further determine whether the second function is the root cause of the data error. On the contrary, when the function call number 2 corresponding to the second function is greater than the function call number 1 corresponding to the first function, it indicates that the parameter value error in the first function leads to the parameter value error in the second function. Then the second information output by the application processing device 200 may include the identifier of the first function, so as to further determine whether the first function is the root cause of the data error.
[0107] When there are still parameters in some functions in the source code that have not completed the difference comparison between the two corresponding value sequences, the application processing device 200 adds the identifier of the new function to the second function file, deletes the identifier of the second function, and re-executes the executable file 1 and the executable file 2 based on the modified second function file to determine whether the first function or the second function is the root cause of the data error. Repeat the above iterative process until the two value sequences corresponding to the parameters in all functions in the source code are compared, and the final root cause position is output.
[0108] 2. There is no difference between value sequence 1 and value sequence 2.
[0109] At this time, the application processing device 200 may continue to check whether the two value sequences corresponding to the parameters in the remaining functions are different.
[0110] In specific implementation, the application processing device 200 may modify the first function file, specifically by deleting the identifier of the first function in the first function file, and adding the identifier of the third function to the first function file, thereby obtaining the third function file, where the third function is another function different from the first function among the multiple functions included in the source code. Exemplarily, the application processing device 200 may actively modify the first function file; or, the application processing device 200 may present the first function file to the user through the client 101, thereby modifying the first function file according to the user's modification operation on the first function file.
[0111] Then, the application processing device 200 can re-execute the executable file 1 and the executable file 2. In the process of executing the executable file 1, the application processing device 200 can insert the fifth executable code for the third function in the executable file 1 according to the identifier of the third function recorded in the third function file, and the fifth executable code is a code under the instruction set of the first architecture. In this way, after executing the executable file 1, the application processing device 200 can obtain the value sequence 5 corresponding to the parameter in the third function. Similarly, in the process of executing the executable file 2, the application processing device 200 can insert the sixth executable code for the third function in the executable file 2 according to the identifier of the third function recorded in the third function file, and the sixth executable code is a code under the instruction set of the second architecture. In this way, after executing the executable file 2, the application processing device 200 can obtain the value sequence 6 corresponding to the parameter in the third function.
[0112] Next, the application processing device 200 can compare whether there is a difference between the value sequence 5 and the value sequence 6. If there is still no difference between the two value sequences, the application processing device 200 can replace the identifier of the third function in the third function file with the identifier of other functions, and re-execute the executable file 1 and the executable file 2 according to the modified third function file to verify whether there is a difference between the two value sequences corresponding to the parameters in the other functions. Repeat the above process until it is determined that there is no difference between the two value sequences corresponding to the parameters of all functions in the source code. At this time, the user can determine that the application can run correctly on the platform of the second architecture, so that the user can migrate the application from the platform of the first architecture to the platform of the second architecture to enrich the software ecosystem of the platform of the second architecture.
[0113] When there is a difference between value sequence 5 and value sequence 6, it indicates that when the application is running on two platforms with different architectures, there is a data inconsistency problem in the parameters of the third function. The application processing device 200 can further determine and output the third information corresponding to the first value with the difference, and the third information at least includes the identifier of the third function to which the first value belongs. In this way, the application processing device 200 can refer to the above method to further determine the root cause position that causes the difference between the two value sequences, and output the root cause position to the user through the client 101, so that the user can make corresponding changes and repairs to the source code of the application according to the root cause position to achieve cross-platform migration of the application.
[0114] In actual application, users can not only use the application processing system 10 to execute the above Figure 2 The process shown is used to implement cross-platform migration of applications. Furthermore, the application processing system 10 can also be used to implement cross-architecture mixed precision experiments to test whether the application can achieve the same or similar operating results when running on platforms with different architectures based on different floating-point operation precisions.
[0115] Taking the compiler 102 compiling the source code of the application based on the instruction set of the first architecture and obtaining the executable file 1 as an example, the application processing device 200 can obtain the first function file including the identifier of the first function, and can respectively execute the executable file 1 based on different floating-point operation precisions according to the first function file. In the process of executing the executable file 1 based on the first floating-point operation precision (such as 64-bit floating-point operation precision), the application processing device 200 can insert the above-mentioned first executable code into the executable file 1 to obtain the value sequence 8 corresponding to the parameter in the first function. And, in the process of executing the executable file 1 based on the second floating-point operation precision (such as 64-bit + 32-bit mixed floating-point operation precision), the application processing device 200 can insert the above-mentioned first executable code into the executable file 1 to obtain the value sequence 9 corresponding to the parameter in the first function. In this way, the application processing device 200 or the user can compare the value sequence 8 and the value sequence 9, obtain the comparison result and output it. In this way, the user can analyze the difference between the running results (i.e., the values of the parameters in the first function) generated when the application is running based on the second floating-point operation precision (i.e., mixed floating-point operation precision) and the running results generated when the application is running based on the first floating-point operation precision based on the comparison result. If the running results generated by the application when running based on the two floating-point operation precisions are the same or similar, the user can directly migrate the application to a platform that executes executable files based on mixed floating-point operation precision. At this time, if the first floating-point operation precision is higher than the second floating-point operation precision, running the application based on the lower floating-point operation precision can effectively increase the throughput of the application and improve the efficiency of the application in processing business.
[0116] Furthermore, the application processing device 200 may also support automatic modification of the source code of the application so that the modified application can run correctly on the platform of the second architecture (ie, the platform after migration).
[0117] In a possible implementation, the application processing device 200 may be configured as follows: Figure 1The database 103 shown in the figure, and the database 103 includes one or more rules for indicating the modification of the source code of the application. In this way, when it is determined that there is a difference between the two value sequences corresponding to the parameters in the first function (or other functions), the application processing device 200 can find the target rule matching the function from the database 103 according to the function (root cause position) to which the first value with a difference between the two value sequences belongs. For example, the rules in the database 103 may include information such as the function name (or function type), the parameters in the function, and the modification method for the source code. Then, the application processing device 200 can match the name of the function to which the first value with a difference between the two value sequences belongs, and the parameters in the function with the information included in each rule in the database 103 to determine the target rule. In this way, the application processing device 200 can automatically modify the source code of the application according to the modification method for the source code defined in the target rule to achieve automatic repair of the application.
[0118] The rules in the database 103 may be pre-configured by a technician. For example, the technician may create one or more rules based on the modification experience of the source code of the application, and configure the rules in the database 103 .
[0119] Alternatively, the rules in the database 103 can be automatically generated by the application processing system 10 through self-learning or other methods. For example, the user can migrate other applications on the platform of the first architecture to the platform of the second architecture in the past period of time, and before migrating other applications, use the application processing system 10 to modify the source code of other applications so that other applications can run correctly on the platform of the second architecture. In this process, the application processing system 10 can record the user's modification method and modification content for the source code of other applications, and the modification content can include function names, parameters and other information, so that the application processing system 10 can generate corresponding rules based on the modification method and modification content, and configure the rules in the database 103 created for the application processing device 200.
[0120] In addition, the application processing system 10 can also provide other functions for the user. For example, the application processing system 10 can also support the user to test the source code of the application to test the performance of different algorithms related to the same function in the source code of the application.
[0121] As an implementation example, an application may include a first version of source code and a second version of source code, and the two versions of source code have the same processing logic and function names. The difference is that some functions in the two versions of source code use different algorithms. For ease of explanation, this embodiment assumes that the partial function is specifically the first function mentioned above.
[0122] Then, the compiler 102 can compile the source code of the first version and the source code of the second version respectively based on the instruction set of the first architecture, obtain the executable file 1 corresponding to the source code of the first version and the executable file 3 corresponding to the source code of the second version, and generate a first function file including the identifier of the first function. Then, the compiler 102 can provide the executable file 1, the executable file 3 and the first function file to the application processing device 200.
[0123] The application processing device 200 can respectively execute the executable file 1 and the executable file 3 using the device under the first architecture. In the process of executing the executable file 1, the application processing device 200 inserts the first executable code into the executable file 1 according to the first function file to output the value sequence 1 corresponding to the parameter in the first function in the executable file 1; and in the process of executing the executable file 3, the seventh executable code is inserted into the executable file 1 according to the first function file to output the value sequence 7 corresponding to the parameter in the first function in the executable file 3, and the seventh executable code is a code under the instruction set of the first architecture, which is used to output the value of the parameter in the first function. Then, the application processing device 200 can compare the value sequence 1 and the value sequence 7, obtain the corresponding comparison result and output it, for example, the comparison result can be output to the user through the client 101, and the value sequence 1 and the value sequence 7 can also be output together. Exemplarily, the output comparison result can indicate whether the value sequence 1 is consistent with the value sequence 7, and the comparison result can also indicate the acquisition time of the value sequence 1 and the value sequence 7. In this way, the user can evaluate the performance advantages and disadvantages of different algorithms adopted for the first function in the two versions of the source code based on the comparison results presented by the client 101 and the two value sequences. For example, when the value sequence 1 is consistent with the value sequence 7, if the collection time of the value sequence 1 is shorter, it can indicate that the performance of the algorithm adopted by the first function in the executable file 1 is higher.
[0124] It is worth noting that the above Figure 2 The method embodiments shown are only used to illustrate the process of processing applications and are not intended to be limiting. Figure 2In the illustrated embodiment, the compiler 102 generates the first function file as an example for explanation, while in other possible embodiments, the first function file may be generated by other devices according to the source code of the application. In addition, after the user completes the modification of the source code of the application according to the output value sequence 1 and the value sequence 2, the user may recompile the modified source code, and refer to the above process to recheck whether there is a difference when the modified source code is running on two platforms with different architectures, etc., so as to achieve migration of the application between platforms with different architectures by iteratively modifying the source code of the application.
[0125] In this embodiment, since the application processing system 10 automatically inserts the executable code under the corresponding architecture into the executable files 1 and 2 according to the function identifier in the file during the execution of the executable file, the value sequence 1 and the value sequence 2 corresponding to the parameters in the first function under the two architectures can be obtained, and the user does not need to manually add the custom output code in the source code of the application, thereby avoiding the errors caused by manually adding program code and improving the efficiency of obtaining the value sequence corresponding to the parameters in the function. In this way, the source code of the application can be modified and repaired in a shorter period of time, thereby improving the overall efficiency of the application in migrating between platforms of different architectures.
[0126] Moreover, when it is necessary to modify the function parameters that need to be tracked, the application processing system 10 only needs to modify the function identifier in the file without modifying the source code of the application, thereby avoiding multiple compilations of the source code, thereby further improving the overall efficiency of migrating applications between platforms of different architectures.
[0127] It is worth noting that other reasonable step combinations that can be thought of by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be familiar with the fact that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.
[0128] Combination of the above Figures 1 to 3 The application processing method provided in the embodiment of the present application is introduced. Next, the functions of the application processing device provided in the embodiment of the present application and the computing device and computing device cluster that implement the application processing device are introduced in conjunction with the accompanying drawings.
[0129] See also Figure 4 , shows a schematic diagram of the structure of an application processing device. Figure 4 As shown, the device 400 includes:
[0130] The acquisition module 401 is used to acquire a first executable file and a second executable file corresponding to the application, wherein the first executable file is obtained by compiling the source code of the application based on the instruction set of the first architecture, and the second executable file is obtained by compiling the source code of the application based on the instruction set of the second architecture; and acquire a first function file, wherein the first function file includes an identifier of a first function in the source code;
[0131] Insertion module 402 is used to insert a first executable code into the first executable file according to the first function file during the execution of the first executable file, obtain a first value sequence corresponding to the parameter in the first function, and the first executable code is used to output the value of the parameter; in the process of executing the second executable file, insert a second executable code into the second executable file according to the first function file, obtain a second value sequence corresponding to the parameter in the first function, and the second executable code is used to output the value of the parameter;
[0132] The output module 403 is used to output the first value sequence and the second value sequence.
[0133] In a possible implementation manner, the application processing device 400 further includes:
[0134] A comparison module 404, configured to compare the first value sequence and the second value sequence;
[0135] The output module 403 is further configured to output first information corresponding to a first value that is different between the first value sequence and the second value sequence when there is a difference between the first value sequence and the second value sequence, wherein the first information includes an identifier of the first function.
[0136] In a possible implementation manner, the application processing device 400 further includes:
[0137] A file modification module 405, used to modify the first function file to obtain a second function file, where the second function file includes an identifier of the first function and an identifier of the second function in the source code;
[0138] The inserting module 402 is further used to insert a third executable code into the first executable file according to the second function file during the execution of the first executable file, so as to obtain a third value sequence corresponding to the parameters in the first function and the parameters in the second function, and the third executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function; and to insert a fourth executable code into the second executable file according to the second function file during the execution of the second executable file, so as to obtain a fourth value sequence corresponding to the parameters in the first function and the parameters in the second function, and the fourth executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function;
[0139] The comparison module 404 is further configured to compare the third value sequence and the fourth value sequence to obtain second information corresponding to a first value that is different between the third value sequence and the fourth value sequence, wherein the second information includes an identifier of a function to which the first value that is different between the third value sequence and the fourth value sequence belongs;
[0140] The output module 403 is further used to output the second information.
[0141] In a possible implementation, the file modification module 405 is further configured to modify the first function file to obtain a third function file when there is no difference between the first value sequence and the second value sequence, where the third function file includes an identifier of the third function in the source code;
[0142] The inserting module 402 is further used to insert a fifth executable code into the first executable file according to the third function file during the execution of the first executable file, so as to obtain a fifth value sequence corresponding to the parameter in the third function, and the fifth executable code is used to output the value of the parameter in the third function; and to insert a sixth executable code into the second executable file according to the third function file during the execution of the second executable file, so as to obtain a sixth value sequence corresponding to the parameter in the third function, and the sixth executable code is used to output the value of the parameter in the third function;
[0143] The comparison module 404 is further used to compare the fifth value sequence and the sixth value sequence;
[0144] The output module 403 is further configured to output third information corresponding to a first value that is different between the fifth value sequence and the sixth value sequence when there is a difference between the fifth value sequence and the sixth value sequence, wherein the third information includes an identifier of the fourth function.
[0145] In a possible implementation manner, the application processing device 200 further includes:
[0146] A determination module 406, configured to determine a target rule from a plurality of rules according to first information corresponding to a first value that is different between the first value sequence and the second value sequence;
[0147] The code modification module 407 is used to modify the source code of the application according to the target rule.
[0148] In a possible implementation, the acquisition module 401 is used to:
[0149] Obtaining an initial file, the initial file including identifiers of multiple functions in the source code, the initial file being obtained by extracting functions from the source code of the application;
[0150] In response to a user's screening operation for identification of a plurality of functions in the initial file, a first function file is generated.
[0151] In a possible implementation manner, the first function file also includes parameters in the first function;
[0152] Alternatively, the first function file also includes a length threshold of an input array corresponding to the first function, or a structure corresponding to a parameter in the first function.
[0153] In a possible implementation, the first executable file is obtained by compiling source code of a first version of the application;
[0154] The acquisition module 401 is further used to acquire a third executable file corresponding to the application, where the third executable file is obtained by compiling the source code of the second version of the application based on the instruction set of the first architecture, and the difference between the source code of the first version and the source code of the second version includes the algorithm in the first function;
[0155] The inserting module 402 is further used to insert a seventh executable code into the third executable file according to the first function file during the execution of the third executable file, so as to obtain a seventh value sequence corresponding to the parameters in the first function, wherein the seventh executable code is used to output the values of the parameters in the first function;
[0156] The comparison module 404 is further used to compare the first value sequence and the seventh value sequence to obtain a first comparison result;
[0157] The output module 403 is further configured to output the first comparison result.
[0158] In a possible implementation, the inserting module 402 is further configured to, in a process of executing the first executable file based on the first floating-point operation precision, insert the first executable code into the first executable file according to the first function file to obtain an eighth value sequence corresponding to the parameter in the first function; in a process of executing the second executable file based on the second floating-point operation precision, insert the first executable code into the second executable file according to the first function file to obtain a ninth value sequence corresponding to the parameter in the first function;
[0159] The comparison module 404 is further used to compare the eighth value sequence and the ninth value sequence to obtain a second comparison result;
[0160] The output module 403 is further configured to output the second comparison result.
[0161] because Figure 4 The application processing device 400 shown corresponds to Figure 2 The method shown, therefore Figure 4The specific implementation method of the application processing device 400 shown and its technical effects can be found in the relevant descriptions of the aforementioned embodiments, and will not be repeated here.
[0162] Above Figure 2 as well as Figure 4 In the illustrated embodiment, the application processing device involved in the application processing process may be software configured on a computing device or a computing device cluster, and by running the software on the computing device or the computing device cluster, the computing device or the computing device cluster may implement the functions of the above-mentioned application processing device 200. Below, based on the perspective of hardware device implementation, the application processing device 200 involved in the application processing process is described in detail.
[0163] Figure 5 The schematic diagram of the structure of a computing device is shown. The above-mentioned application processing device 200 can be deployed on the computing device. The computing device can be a computing device in a cloud environment (such as a server), or a computing device in an edge environment, or a terminal device, etc., which can be specifically used to implement the above-mentioned Figure 2 The functions of the application processing device 200 in the illustrated embodiment.
[0164] like Figure 5 As shown, computing device 500 includes processor 510, memory 520, communication interface 530 and bus 540. Processor 510, memory 520 and communication interface 530 communicate through bus 540. Bus 540 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The communication interface 530 is used to communicate with the outside, for example, to receive configuration information and batch information provided by the user.
[0165] Among them, the processor 510 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits. The processor 510 can also be an integrated circuit chip with signal processing capabilities. In the implementation process, the functions of each module in the application processing device 200 can be completed by the hardware integrated logic circuit or software instructions in the processor 510. The processor 510 can also be a general processor, a digital signal process (DSP), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. Among them, the general processor can be a microprocessor or the processor can also be any conventional processor, etc., and the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 520 , and the processor 510 reads the information in the memory 520 and completes part or all of the functions in the application processing device 200 in combination with its hardware.
[0166] The memory 520 may include a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a HDD, or a SSD.
[0167] The memory 520 stores executable codes, and the processor 510 executes the executable codes to execute the method executed by the aforementioned application processing device 200 .
[0168] Specifically, in implementing Figure 2 In the case of the embodiment shown, and Figure 2 In the case where the application processing device 200 described in the illustrated embodiment is implemented by software, the execution Figure 2The software or program code required for the functions of the application processing device 200 is stored in the memory 520. The interaction between the application processing device 200 and other devices is realized through the communication interface 530. The processor is used to execute the instructions in the memory 520 to implement the method executed by the above-mentioned application processing device 200.
[0169] Figure 6 A schematic diagram of the structure of a computing device cluster is shown. Figure 6 The computing device cluster 60 shown includes multiple computing devices, and the application processing apparatus 200 can be deployed on multiple computing devices in the computing device cluster 60 in a distributed manner. Figure 6 As shown, the computing device cluster 60 includes multiple computing devices 600 , each computing device 600 includes a memory 620 , a processor 610 , a communication interface 630 and a bus 640 , wherein the memory 620 , the processor 610 , and the communication interface 630 are communicatively connected to each other via the bus 640 .
[0170] The processor 610 may be a CPU, a GPU, an ASIC, or one or more integrated circuits. The processor 610 may also be an integrated circuit chip with signal processing capabilities. In the implementation process, some functions of the application processing device 200 may be completed by the hardware integrated logic circuit or software instructions in the processor 610. The processor 610 may also be a DSP, an FPGA, a general processor, other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and may implement or execute some methods, steps, and logic block diagrams disclosed in the embodiments of the present application. Among them, the general processor may be a microprocessor or the processor may also be any conventional processor, etc., and the steps of the method disclosed in the embodiments of the present application may be directly embodied as a hardware decoding processor for execution, or may be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 620. In each computing device 600, the processor 610 reads the information in the memory 620, and in combination with its hardware, some functions of the application processing device 200 may be completed.
[0171] The memory 620 may include ROM, RAM, static storage device, dynamic storage device, hard disk (such as SSD, HDD), etc. The memory 620 may store program codes, for example, part of the program codes for implementing the application processing device 200, etc. For each computing device 600, when the program codes stored in the memory 620 are executed by the processor 610, the processor 610 executes part of the method executed by the application processing device 200 based on the communication interface 630, such as one part of the computing devices 600 may be used to execute the method described in steps S203 to S204, and another part of the computing devices 600 may be used to execute the method described in steps S204 to S206. The memory 620 may also store data, for example: intermediate data or result data generated by the processor 610 during the execution process, for example, the first function file, the second function file, each value sequence, the comparison result, etc.
[0172] The communication interface 630 in each computing device 600 is used for external communication, such as interacting with other computing devices 600 .
[0173] The bus 640 may be a peripheral component interconnect standard bus or an extended industry standard architecture bus. For ease of representation, Figure 6 The bus 640 in each computing device 600 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.
[0174] The plurality of computing devices 600 establish communication paths through a communication network to implement the functions of the application processing apparatus 200. Any computing device may be a computing device in a cloud environment (eg, a server), or a computing device in an edge environment, or a terminal device.
[0175] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned application processing method.
[0176] The embodiment of the present application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0177] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0178] The computer program product may be a software installation package, and when any of the aforementioned application processing methods is required, the computer program product may be downloaded and executed on a computing device.
[0179] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0180] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An application processing method, It is characterized in that The method comprises: Obtaining a first executable file and a second executable file corresponding to the application, wherein the first executable file is obtained by compiling the source code of the application based on an instruction set of a first architecture, and the second executable file is obtained by compiling the source code of the application based on an instruction set of a second architecture; Obtaining a first function file, wherein the first function file includes an identifier of a first function in the source code; During the execution of the first executable file, according to the first function file, a first executable code is inserted into the first executable file to obtain a first value sequence corresponding to the parameters in the first function, and the first executable code is used to output the values of the parameters; During the execution of the second executable file, according to the first function file, a second executable code is inserted into the second executable file to obtain a second value sequence corresponding to the parameters in the first function, and the second executable code is used to output the values of the parameters; Output the first value sequence and the second value sequence.
2. The method according to claim 1, It is characterized in that The method further comprises: Comparing the first value sequence and the second value sequence; When there is a difference between the first value sequence and the second value sequence, first information corresponding to a first value that is different between the first value sequence and the second value sequence is output, where the first information includes an identifier of the first function.
3. The method according to claim 2, It is characterized in that The method further comprises: Modifying the first function file to obtain a second function file, wherein the second function file includes an identifier of the first function and an identifier of the second function in the source code; During the execution of the first executable file, according to the second function file, a third executable code is inserted into the first executable file to obtain a third value sequence corresponding to the parameters in the first function and the parameters in the second function, wherein the third executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function; In the process of executing the second executable file, according to the second function file, a fourth executable code is inserted into the second executable file to obtain a fourth value sequence corresponding to the parameters in the first function and the parameters in the second function, and the fourth executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function; Compare the third value sequence and the fourth value sequence to obtain second information corresponding to a first value that is different between the third value sequence and the fourth value sequence, wherein the second information includes an identifier of a function to which the first value that is different between the third value sequence and the fourth value sequence belongs; The second information is output.
4. The method according to claim 2 or 3, It is characterized in that The method further comprises: When there is no difference between the first value sequence and the second value sequence, modify the first function file to obtain a third function file, wherein the third function file includes an identifier of the third function in the source code; During the execution of the first executable file, according to the third function file, a fifth executable code is inserted into the first executable file to obtain a fifth value sequence corresponding to the parameters in the third function, wherein the fifth executable code is used to output the values of the parameters in the third function; In the process of executing the second executable file, according to the third function file, a sixth executable code is inserted into the second executable file to obtain a sixth value sequence corresponding to the parameters in the third function, wherein the sixth executable code is used to output the values of the parameters in the third function; Comparing the fifth value sequence with the sixth value sequence; When there is a difference between the fifth value sequence and the sixth value sequence, third information corresponding to a first value that is different between the fifth value sequence and the sixth value sequence is output, where the third information includes an identifier of the third function.
5. The method according to any one of claims 2 to 4, It is characterized in that The method further comprises: Determine a target rule from multiple rules according to first information corresponding to a first value that is different between the first value sequence and the second value sequence; According to the target rule, the source code of the application is modified.
6. The method according to any one of claims 1 to 5, It is characterized in that The obtaining of the first function file comprises: Acquire an initial file, the initial file including identifiers of multiple functions in the source code, the initial file being obtained by extracting functions from the source code of the application; In response to a user's screening operation for identifying the plurality of functions in the initial file, the first function file is generated.
7. The method according to any one of claims 1 to 6, It is characterized in that The first function file also includes parameters in the first function; Alternatively, the first function file also includes a length threshold of an input array corresponding to the first function, or a structure corresponding to a parameter in the first function.
8. The method according to any one of claims 1 to 7, It is characterized in that The first executable file is obtained by compiling source code of the first version of the application, and the method further includes: Obtaining a third executable file corresponding to the application, where the third executable file is obtained by compiling source code of a second version of the application based on an instruction set of the first architecture, where a difference between the source code of the first version and the source code of the second version includes an algorithm in the first function; In the process of executing the third executable file, according to the first function file, a seventh executable code is inserted into the third executable file to obtain a seventh value sequence corresponding to the parameters in the first function, and the seventh executable code is used to output the values of the parameters in the first function; Comparing the first value sequence and the seventh value sequence to obtain a first comparison result; The first comparison result is outputted.
9. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: In a process of executing the first executable file based on the first floating-point operation precision, inserting the first executable code into the first executable file according to the first function file to obtain an eighth value sequence corresponding to the parameters in the first function; In the process of executing the second executable file based on the second floating-point operation precision, inserting the first executable code into the second executable file according to the first function file to obtain a ninth value sequence corresponding to the parameters in the first function; Comparing the eighth value sequence with the ninth value sequence to obtain a second comparison result; The second comparison result is outputted.
10. An application processing device, It is characterized in that The device comprises: an acquisition module, configured to acquire a first executable file and a second executable file corresponding to an application, wherein the first executable file is obtained by compiling the source code of the application based on an instruction set of a first architecture, and the second executable file is obtained by compiling the source code of the application based on an instruction set of a second architecture; and acquire a first function file, wherein the first function file includes an identifier of a first function in the source code; an insertion module, configured to, during the execution of the first executable file, insert a first executable code into the first executable file according to the first function file, obtain a first value sequence corresponding to the parameter in the first function, and the first executable code is used to output the value of the parameter; during the execution of the second executable file, insert a second executable code into the second executable file according to the first function file, obtain a second value sequence corresponding to the parameter in the first function, and the second executable code is used to output the value of the parameter; An output module is used to output the first value sequence and the second value sequence.
11. The device according to claim 10, It is characterized in that The device also includes: A comparison module, used for comparing the first value sequence and the second value sequence; The output module is further configured to output first information corresponding to a first value that is different between the first value sequence and the second value sequence when there is a difference between the first value sequence and the second value sequence, wherein the first information includes an identifier of the first function.
12. The device according to claim 11, It is characterized in that The device also includes: a file modification module, used for modifying the first function file to obtain a second function file, wherein the second function file includes an identifier of the first function and an identifier of the second function in the source code; The insertion module is further used to, during the execution of the first executable file, insert a third executable code into the first executable file according to the second function file, so as to obtain a third value sequence corresponding to the parameters in the first function and the parameters in the second function, and the third executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function; during the execution of the second executable file, insert a fourth executable code into the second executable file according to the second function file, so as to obtain a fourth value sequence corresponding to the parameters in the first function and the parameters in the second function, and the fourth executable code is used to output the values of the parameters in the first function and the values of the parameters in the second function; The comparison module is further used to compare the third value sequence and the fourth value sequence to obtain second information corresponding to a first value that is different between the third value sequence and the fourth value sequence, wherein the second information includes an identifier of a function to which the first value that is different between the third value sequence and the fourth value sequence belongs; The output module is further used to output the second information.
13. The device according to claim 11 or 12, It is characterized in that The file modification module is further used to modify the first function file to obtain a third function file when there is no difference between the first value sequence and the second value sequence, wherein the third function file includes an identifier of the third function in the source code; The insertion module is further used to, during the execution of the first executable file, insert a fifth executable code into the first executable file according to the third function file, so as to obtain a fifth value sequence corresponding to the parameters in the third function, wherein the fifth executable code is used to output the values of the parameters in the third function; during the execution of the second executable file, insert a sixth executable code into the second executable file according to the third function file, so as to obtain a sixth value sequence corresponding to the parameters in the third function, wherein the sixth executable code is used to output the values of the parameters in the third function; The comparison module is further used to compare the fifth value sequence and the sixth value sequence; The output module is further configured to output third information corresponding to a first value that is different between the fifth value sequence and the sixth value sequence when there is a difference between the fifth value sequence and the sixth value sequence, wherein the third information includes an identifier of the third function.
14. The device according to any one of claims 11 to 13, It is characterized in that The device also includes: a determination module, configured to determine a target rule from a plurality of rules according to first information corresponding to a first value that is different between the first value sequence and the second value sequence; A code modification module is used to modify the source code of the application according to the target rule.
15. The device according to any one of claims 10 to 14, It is characterized in that The acquisition module is used to: Acquire an initial file, the initial file including identifiers of multiple functions in the source code, the initial file being obtained by extracting functions from the source code of the application; In response to a user's screening operation for identifying the plurality of functions in the initial file, the first function file is generated.
16. The device according to any one of claims 10 to 15, It is characterized in that The first function file also includes parameters in the first function; Alternatively, the first function file also includes a length threshold of an input array corresponding to the first function, or a structure corresponding to a parameter in the first function.
17. The device according to any one of claims 11 to 16, It is characterized in that The first executable file is obtained by compiling source code of the first version of the application; The acquisition module is further used to acquire a third executable file corresponding to the application, where the third executable file is obtained by compiling source code of a second version of the application based on an instruction set of the first architecture, where a difference between the source code of the first version and the source code of the second version includes an algorithm in the first function; The insertion module is further used to insert a seventh executable code into the third executable file according to the first function file during the execution of the third executable file, so as to obtain a seventh value sequence corresponding to the parameters in the first function, wherein the seventh executable code is used to output the values of the parameters in the first function; The comparison module is further configured to compare the first value sequence and the seventh value sequence to obtain a first comparison result; The output module is further used to output the first comparison result.
18. The device according to any one of claims 11 to 17, It is characterized in that The insertion module is further configured to, during the process of executing the first executable file based on the first floating-point operation precision, insert the first executable code into the first executable file according to the first function file to obtain an eighth value sequence corresponding to the parameters in the first function; during the process of executing the second executable file based on the second floating-point operation precision, insert the first executable code into the second executable file according to the first function file to obtain a ninth value sequence corresponding to the parameters in the first function; The comparison module is further used to compare the eighth value sequence and the ninth value sequence to obtain a second comparison result; The output module is further used to output the second comparison result.
19. An application processing system, It is characterized in that The application processing system comprises a compiler and an application processing device according to any one of claims 1 to 9; The compiler is used to compile the source code of the application based on the instruction set of the first architecture to obtain a first executable file, and to compile the source code of the application based on the instruction set of the second architecture to obtain a second executable file, and to provide the first executable file and the second executable file to the application processing device.
20. A computing device, It is characterized in that Including processor and memory; The processor is configured to execute instructions stored in the memory so as to enable the computing device to perform the steps of the method according to any one of claims 1 to 9.
21. A computer-readable storage medium, It is characterized in that The method comprises instructions which, when executed on a computing device, cause the computing device to perform the steps of the method according to any one of claims 1 to 9.
22. A computer program product comprising instructions, It is characterized in that When the method is executed on at least one computing device, the at least one computing device is caused to execute the method according to any one of claims 1 to 9.
