CN113568834A - SDK code compatibility detection method, device, computer equipment and medium - Google Patents

SDK code compatibility detection method, device, computer equipment and medium Download PDF

Info

Publication number
CN113568834A
CN113568834A CN202110858212.3A CN202110858212A CN113568834A CN 113568834 A CN113568834 A CN 113568834A CN 202110858212 A CN202110858212 A CN 202110858212A CN 113568834 A CN113568834 A CN 113568834A
Authority
CN
China
Prior art keywords
sdk code
code
sdk
result
compiling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110858212.3A
Other languages
Chinese (zh)
Inventor
罗欢
徐律冠
余芸
萧展辉
姜唯
刘叶楠
彭钦青
陈文平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
Southern Power Grid Digital Grid Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Southern Power Grid Digital Grid Research Institute Co Ltd
Priority to CN202110858212.3A priority Critical patent/CN113568834A/en
Publication of CN113568834A publication Critical patent/CN113568834A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a method and a device for detecting compatibility of an SDK code, a computer device and a storage medium. The method comprises the following steps: acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server; when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the data center by the second SDK code; compiling the second SDK code to obtain a compiling result; when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result; and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result. By adopting the method, the code compatibility problem when the SDK code in the data center station is updated can be detected in time, so that the operation reliability of the data center station is improved.

Description

SDK code compatibility detection method, device, computer equipment and medium
Technical Field
The present application relates to the field of code detection technologies, and in particular, to a method and an apparatus for detecting compatibility of an SDK code, a computer device, and a storage medium.
Background
Along with the rapid development of information technology, the popularity of government and enterprise digitalization is higher and higher. The data center platform is used for settling the business and data of each business unit in the process of government-enterprise digital transformation, constructing a data construction, management and use system comprising data technology, data management, data operation and the like, realizing data energization and is the core of a novel information application framework system.
As user needs change, the SDK (Software Development Kit, SDK) code in the data center platform needs to be updated to meet the user needs continuously. In the current technical solution, the SDK code in the data center station is updated by comparing whether the first SDK code currently running in the data center station is consistent with the second SDK code currently transmitted in the server, and if it is determined that the first SDK code and the second SDK code are inconsistent, using the second SDK code. However, in the process of updating the SDK code, there is often a problem of code compatibility, which may cause that the SDK code in the data center station cannot normally run after the SDK code is updated, and affect the running reliability of the data center station.
Therefore, how to detect the compatibility problem of the SDK code in the data center station and improve the operational reliability of the data center station is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for detecting compatibility of an SDK code in a station in data, which can detect the compatibility of the SDK code in the station in data and improve the operational reliability of the station in data.
A compatibility detection method for SDK codes, the method comprising:
acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server;
when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the station in the data with the second SDK code;
compiling the second SDK code to obtain a compiling result;
when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result;
and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
In one embodiment, the determining whether the first SDK code and the second SDK code are consistent comprises:
respectively acquiring a first version number of the first SDK code and a second version number of the second SDK code;
judging whether the first version number is consistent with the second version number;
if so, judging that the first SDK code is consistent with the SDK code, and ending the process;
if not, extracting a first function and a first calling relationship in the first SDK code, and extracting a second function and a second calling relationship of the second SDK code;
judging whether the first function is corresponding to the second function or not, and whether the first calling relation is corresponding to the second function or not;
if the first SDK code and the second SDK code are the same, judging that the first SDK code and the second SDK code are consistent, and ending the process;
and if not, judging that the first SDK code is inconsistent with the second SDK code.
In one embodiment, the compiling the second SDK code to obtain a compilation result includes:
and compiling the second SDK code, judging whether the compiling process has errors at the compiling level, and obtaining the compiling result according to the condition of whether the errors are reported.
In one embodiment, when the compiling is successful, the process of performing simulated scene operation by using the compiled second SDK code to obtain an operation result includes:
when the compiling is successful, simulating scene operation by using the compiled second SDK code, and judging whether the simulation operation process is interrupted;
if the interruption occurs, obtaining a first operation result;
if not, judging whether code abnormity error reporting exists in the simulation operation process;
if so, obtaining the first operation result;
if not, judging whether the simulation operation result is the same as the preset simulation result;
if not, obtaining a first operation result;
otherwise, the second operation result is obtained.
In one embodiment, when it is determined that there is an abnormal code error reporting in the simulation running process, the method further includes:
and positioning an error reporting position corresponding to the code abnormal error reporting.
In one embodiment, when the compiling is successful, the process of performing simulated scene operation by using the compiled second SDK code to obtain an operation result includes:
when the compiling is successful, acquiring simulation data of a plurality of groups of simulation scenes;
respectively carrying out simulated scene operation according to different simulated data by using the compiled second SDK code to obtain simulated operation results corresponding to each group of the simulated data;
and comprehensively judging according to the plurality of simulation operation results to obtain the operation result of the second SDK code.
In one embodiment, if it is determined that the second SDK code does not have a compatibility problem, the method further includes:
and recording the version information of the second SDK code in the current running folder to a log.
An apparatus for detecting compatibility of an SDK code, the apparatus comprising:
the acquisition module is used for acquiring a first SDK code which runs currently from a data center station and acquiring a second SDK code which is transmitted currently from a server;
a replacing module, configured to replace the first SDK code in the currently running folder of the station in the data with the second SDK code when the first SDK code and the second SDK code are inconsistent;
the first detection module is used for compiling the second SDK code to obtain a compiling result;
the second detection module is used for performing simulated scene operation by using the compiled second SDK code to obtain an operation result when the compiling is successful;
and the result determining module is used for obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server;
when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the station in the data with the second SDK code;
compiling the second SDK code to obtain a compiling result;
when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result;
and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server;
when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the station in the data with the second SDK code;
compiling the second SDK code to obtain a compiling result;
when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result;
and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
After replacing the first SDK code in the current operation folder in the data with the second SDK code, compiling the second SDK code, performing simulated scene operation by using the compiled second SDK code, and determining a compatibility detection result of the second SDK code according to a compiling result and an operation result; that is to say, the method carries out compatibility detection on the second SDK code in a compiling and simulation running mode, and can detect the code compatibility problem when the SDK code in the data center station is updated in time, so that the running reliability of the data center station is improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for detecting compatibility of an SDK code according to an embodiment;
FIG. 2 is a flowchart illustrating a method for detecting compatibility of an SDK code according to an embodiment;
FIG. 3 is a flowchart illustrating a method for detecting compatibility of an SDK code according to another embodiment;
FIG. 4 is a block diagram showing a compatibility detecting apparatus for an SDK code according to an embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for detecting the compatibility of the SDK code can be applied to the application environment shown in FIG. 1. The terminal 102 and the data center 104 communicate with each other through a network. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the like, and the specific type of the data center 104 is set according to actual needs of an enterprise, which is not limited in this embodiment. In addition, in some application scenarios, the compatibility detection method of the SDK code may also be implemented directly by using a controller in the data center 104.
In an embodiment, as shown in fig. 2, a method for detecting compatibility of an SDK code is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
step 202, obtaining the first SDK code currently running from the data console, and obtaining the second SDK code currently transmitted from the server.
It should be noted that the first SDK code currently running by the station in the data refers to a program code stored in a currently running folder of the station in the data, that is, the first SDK code currently running can be obtained from the currently running folder of the station in the data.
And building a framework on the bottom layer according to the requirements, and after developing a second SDK code, transmitting the second SDK code to the server through a broadband network, wherein the second SDK code currently transmitted in the server refers to a newly set program code. In this embodiment, the environment in which the second SDK code is set at the bottom layer is not limited, and for example, the second SDK code may be set by using an SDK in an operating environment based on a Windows operating system. Specifically, a code calling instruction is sent to the server, and after receiving the code calling instruction, the server calls a currently transmitted second SDK code and sends the second SDK code to the data center controller.
And step 204, when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the station in the data by using the second SDK code.
After the first SDK code and the second SDK code are obtained, whether the first SDK code and the second SDK code are consistent or not is judged. Specifically, when determining whether the first SDK code and the second SDK code are consistent, whether the first SDK code and the second SDK code are consistent may be determined according to a version number, a function type, a call relationship of the function of the first SDK code and the second SDK code, and whether characters in the first SDK code and the second SDK code are consistent.
If the first SDK code is consistent with the second SDK code, the first SDK code currently running in the data center station is represented as the program code of the latest version, so that updating operation is not needed, and the process is finished.
If the first SDK code and the second SDK code are determined to be inconsistent, it is indicated that the first SDK code currently running in the data center station is not the program code of the latest version, and therefore the second SDK code is needed to be used for updating the first SDK code in the data center station, specifically, the first SDK code in the current running folder in the data center station is deleted or moved to other storage positions, and then the second SDK code is stored in the current running folder, that is, the second SDK code is used for replacing the first SDK code in the current running folder in the data center station.
And step 206, compiling the second SDK code to obtain a compiling result.
Specifically, compiling refers to a process of converting program code into an executable program using a compiler. Because there may be errors in the second SDK code, there are two cases of compilation results that may be obtained when compiling the second SDK code: compilation success and compilation failure.
And step 208, when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result.
Specifically, this step is an operation performed in the case where the compilation is successful. When the second SDK code is compiled successfully, the second SDK code can be operated, so that simulation parameters corresponding to the simulation scene are further obtained, and the simulation parameters are executed by utilizing the second SDK code to realize the operation of the simulation scene. It will be appreciated that operational faults or operational errors may occur during operation and therefore different operational results will also be obtained.
And step 210, obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
In actual operation, when compiling is successful and an operation result consistent with a preset simulation result is obtained, the second SDK code has no compatibility problem; otherwise, when the compiling is failed or the running result consistent with the preset simulation result is not obtained, the second SDK code has the compatibility problem.
It should be noted that, if it is determined that the second SDK code has a compatibility problem, the abnormal information of the second SDK code is obtained, and further, the feedback information determined by the user according to the abnormal information is received, so that the abnormal information and the feedback information are analyzed and processed in the following process, and corresponding modification information is obtained, so that the operation and maintenance staff modify and adjust the second SDK code at the bottom layer according to the modification information.
According to the method for detecting the compatibility of the SDK codes, provided by the embodiment of the invention, after the second SDK code is used for replacing the first SDK code in the current running folder of the data center, the second SDK code is compiled, the compiled second SDK code is used for simulating scene running, and the compatibility detection result of the second SDK code is determined according to the compiling result and the running result; that is to say, the method carries out compatibility detection on the second SDK code in a compiling and simulation running mode, and can detect the code compatibility problem when the SDK code in the data center station is updated in time, so that the running reliability of the data center station is improved.
On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, the process of determining whether the first SDK code and the second SDK code are consistent includes:
respectively acquiring a first version number of the first SDK code and a second version number of the second SDK code;
judging whether the first version number is consistent with the second version number;
if so, judging that the first SDK code is consistent with the SDK code, and ending the process;
if not, extracting a first function and a first calling relation in the first SDK code, and extracting a second function and a second calling relation of the second SDK code;
judging whether the first function and the second function are the same as each other or not, and judging whether the first calling relation and the second calling relation are the same;
if the first SDK code and the second SDK code are the same, judging that the first SDK code and the second SDK code are consistent, and ending the process;
and if not, judging that the first SDK code is inconsistent with the second SDK code.
Specifically, in this embodiment, after a first SDK code currently running is obtained from a data console and a second SDK code currently transmitted is obtained from a server, version numbers of the first SDK code and the second SDK code are respectively obtained by using a version detection tool BootCamp; a version number (version number) is an identification number of a version of the SDK code, and the version number may be divided into two parts of a major version number and a minor version number; and the process of comparing whether the version numbers are consistent comprises the steps of comparing whether the main version number and the secondary version number are consistent, and if so, indicating that the first SDK code is consistent with the SDK code, so that updating operation is not needed, and the process is ended. In the programming, a function refers to a set of program codes which are combined together and can realize a function, and is also called a subprogram; often, some commonly used functional modules are written into functions and are placed in a function library for public selection; the SDK code is composed of a main function and a plurality of functions, the main function calls other functions, the other functions can also call each other, and the same function can be called by one or more functions for any number of times. In this embodiment, when it is determined that the version numbers of the first SDK code and the second SDK code are not consistent, further extracting a first function and a first call relationship in the first SDK code, extracting a second function and a second call relationship of the second SDK code, and determining that the first SDK code and the second SDK code are consistent if the first function and the second function, the first call relationship, and the second call relationship are corresponding to the same function, and ending the process; and if not, judging that the first SDK code is inconsistent with the second SDK code.
Therefore, whether the first SDK code and the second SDK code are consistent or not is determined according to the method of the embodiment, and the operation process is simple, convenient and quick.
As shown in fig. 3, another method of detecting compatibility of SDK codes is provided. On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, the process of compiling the second SDK code to obtain the compilation result includes:
and compiling the second SDK code, judging whether the compiling process has errors in compiling level, and obtaining a compiling result according to the condition of whether the errors are reported.
Specifically, the process of compiling the second SDK code generally includes: second SDK code (source code) → preprocessor → compiler → object code → Linker → executable program (executables). In the process of developing the second SDK code, errors such as file naming errors, wrong case of the code, wrong matching brackets, missing semicolons and the like may occur, and these errors all cause that compilation cannot be smoothly performed, that is, an error is reported. In the embodiment, whether the error report of the compiling level exists in the process of compiling the second SDK code is judged, if the error report exists, a result of compiling failure is obtained, that is, it indicates that the second SDK code has a compatibility problem, and the SDK code having the compatibility problem does not need to perform operation of simulating scene operation; otherwise, the second SDK code is shown to be correct, a result of successful compiling is obtained, and then the second SDK code which is successfully compiled is subjected to simulated scene operation so as to further detect the second SDK code.
It should be noted that, in actual operation, if there is an error in the compilation process, the nature of the compilation error and the place where the compilation error occurs should be determined, and the influence caused by the error is limited to the smallest possible range, so that the rest of the second SDK code can be compiled continuously. In addition, the compiler can be further configured to automatically correct the error according to the error reporting condition, so that the second SDK code can continue to be compiled.
Because the error reporting in the compiling process indicates that the second SDK code has the compatibility problem, and the mode of judging whether the second SDK code has the compatibility problem according to the compiling result is more convenient than the mode of determining whether the second SDK code has the compatibility problem through the mode of simulating scene operation.
On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, when the compiling is successful, the process of obtaining the running result by performing the simulation scene running by using the compiled second SDK code includes:
when the compiling is successful, simulating scene operation by using the compiled second SDK code, and judging whether the simulation operation process is interrupted or not;
if the interruption occurs, obtaining a first operation result;
if not, judging whether code abnormity error reporting exists in the simulation operation process;
if so, obtaining a first operation result;
if not, judging whether the simulation operation result is the same as the preset simulation result;
if not, obtaining a first operation result;
otherwise, a second operation result is obtained.
Specifically, firstly, acquiring simulation data corresponding to a simulation scene; acquiring a compiled second SDK code, running simulation data by using the compiled second SDK code, and detecting whether the simulation running process is interrupted; if the second SDK code is interrupted, obtaining a first operation result, wherein the first operation result represents that the second SDK code fails to operate, and then determining that the second SDK code has a compatibility problem; if the second SDK code is not interrupted, judging whether the code is abnormally reported or not in the simulation operation process, namely, the problem of abnormal operation exists although the second SDK code is compiled normally, and if the second SDK code is compiled normally, obtaining a first operation result, namely, the second SDK code fails to operate; if not, obtaining a simulation operation result according to the simulation scene operation, and judging whether the simulation operation result is the same as a preset simulation result; the preset simulation result refers to an ideal operation result obtained according to the operation of the simulation data, the preset simulation result is used as a reference of the simulation operation result, whether the simulation operation result is the same as the preset simulation result or not is compared, if the simulation operation result is the same as the preset simulation result, it is indicated that the correct operation result can be obtained by operating the second SDK code, and the second operation result is obtained after the operation is successful; otherwise, the second SDK code can run and obtain a simulation running result, but the second SDK code has a situation of an operation logic error and the like, so that the simulation running result is incorrect, and therefore it is determined that the second SDK code fails to run, and the first running result is obtained.
It should be noted that, in actual operation, a plurality of simulation scenes are generally used to perform simulation scene operation, specifically, when compiling is successful, the process of obtaining an operation result by performing simulation scene operation using the compiled second SDK code includes:
when the compiling is successful, acquiring simulation data of a plurality of groups of simulation scenes;
respectively carrying out simulated scene operation according to different simulated data by using the compiled second SDK code to obtain simulated operation results corresponding to each group of simulated data;
and comprehensively judging according to the plurality of simulation operation results to obtain the operation result of the second SDK code.
Specifically, in this embodiment, simulation data of a plurality of sets of simulation scenes are acquired, the compiled second SDK codes are used to perform simulation scene operations, and an operation result of the second SDK codes is determined according to each simulation operation result.
In addition, a plurality of processing threads may be preset, after acquiring a plurality of sets of simulation data of the simulation scene, each set of simulation data is distributed to different processing threads, and each processing thread operates independently, that is, each processing thread performs simulation scene operation on each set of simulation data, so as to obtain a simulation operation result corresponding to each set of simulation data. And then acquiring simulation operation results respectively obtained by each processing thread, comparing the simulation operation results with preset simulation results respectively, and judging whether each simulation operation result is the same as the preset simulation result or not.
In an embodiment, the second operation result may be determined under the condition that all the simulation operation results are the same as the preset simulation result; and determining the rest conditions as a first operation result, namely determining the operation result of the simulated scene as the first operation result as long as a simulation operation result different from the preset simulation result exists.
In another embodiment, a threshold of the accuracy is preset, after the simulation operation results are respectively compared with the preset simulation results, a first number of the simulation operation results, which is the same as the preset simulation results, is counted, then the current accuracy is determined according to the first number and the group number of the simulation scenes, the second operation result is determined only when the current accuracy is greater than the preset threshold of the accuracy, and otherwise, the first operation result is determined.
Therefore, the embodiment utilizes the simulation data of multiple sets of simulation scenes to simulate scene operation, can obtain the operation result more accurately, and further improves the accuracy of the compatibility detection result of the second SDK code.
As a preferred embodiment, when it is determined that there is a code exception error reporting in the simulation running process, the method further includes:
and positioning an error reporting position corresponding to the code abnormal error reporting.
It should be noted that if a code error occurs in the simulation operation process, that is, the second SDK code is compiled normally, but has an abnormal operation, the corresponding error reporting position needs to be further determined according to the code error. Specifically, after the code abnormal error reporting is determined, the reason for the code abnormal error reporting is analyzed according to the code abnormal error reporting, and the error reporting position is positioned according to the determined reason.
And, after confirming the error reporting position, can further set up corresponding error reporting identification information in the error reporting position, follow-up fortune dimension personnel can conveniently acquire corresponding error reporting position according to error reporting identification information to carry out the code modification according to the error reporting position.
Therefore, the error reporting position corresponding to the code exception error reporting is further positioned, and convenience in subsequent code modification is improved.
On the basis of the foregoing embodiment, this embodiment further describes and optimizes the technical solution, and specifically, in this embodiment, if it is determined that the second SDK code does not have a compatibility problem, the method further includes:
and recording the version information of the second SDK code in the current running folder to a log.
It should be noted that the currently running folder refers to a folder for storing the SDK code currently running in the data. In this embodiment, when the second SDK code is used to replace the first SDK code in the currently running folder, and it is determined that the second SDK code does not have a compatibility problem, the version information of the second SDK code in the currently running folder is further recorded to the log.
In actual operation, the version information and the update time of the second SDK code may be acquired and then recorded to the log. The version information includes information such as a version number and an update content digest, and the update time is a time when the second SDK code is stored in the currently running folder or a time when the second SDK code is developed. In addition, the record may be in the form of text, excel table, or database table, which is not limited in this embodiment and is selected according to actual requirements. More specifically, the log may be stored in a Memory bank, a hard disk, a TF (Trans-flash Card) Card, an sd (secure Digital Memory Card), or the like, and the selection is specifically performed according to actual requirements, which is not limited in this embodiment.
Therefore, in the embodiment, by further recording the version information of the second SDK code in the currently running folder to the log, subsequent operation and maintenance personnel can directly query the update condition of the SDK code of the station in the data according to the log, so that the use experience of the user is further improved.
It should be understood that, although the steps in the flowcharts related to the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in each flowchart related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in fig. 4, there is provided an apparatus for detecting compatibility of an SDK code, including: an obtaining module 401, a replacing module 402, a first detecting module 403, a second detecting module 404, and a result determining module 405, wherein:
an obtaining module 401, configured to obtain a first SDK code currently running from a data console, and obtain a second SDK code currently transmitted from a server;
a replacing module 402, configured to replace the first SDK code in the currently running folder in the data with the second SDK code when the first SDK code and the second SDK code are inconsistent;
the first detection module 403 is configured to compile the second SDK code to obtain a compilation result;
the second detection module 404 is configured to, when the compiling is successful, perform simulated scene operation by using the compiled second SDK code to obtain an operation result;
and a result determining module 405, configured to obtain a compatibility detection result of the second SDK code according to the compiling result and the running result.
The device for detecting the compatibility of the SDK code provided by the embodiment of the invention has the same beneficial effects as the method for detecting the compatibility of the SDK code.
As a preferred embodiment, the replacement module comprises:
the first obtaining submodule is used for respectively obtaining a first version number of the first SDK code and a second version number of the second SDK code; if the first judgment sub-module is consistent with the second judgment sub-module, the second judgment sub-module is called, and if the first judgment sub-module is inconsistent with the second judgment sub-module, the second execution sub-module is called;
the first judgment submodule is used for judging whether the first version number is consistent with the second version number;
the first execution submodule is used for judging that the first SDK code is consistent with the SDK code and ending the process;
the second execution submodule is used for extracting a first function and a first calling relation in the first SDK code and extracting a second function and a second calling relation of the second SDK code;
the second judgment submodule is used for judging whether the first function is corresponding to the second function or not and whether the first calling relation is corresponding to the second calling relation is the same as the second calling relation; if the first execution submodule and the second execution submodule are the same, calling a third execution submodule; if not, the fourth execution sub-module is called.
The third execution submodule is used for judging that the first SDK code is consistent with the second SDK code and ending the process;
and the fourth execution submodule is used for judging that the first SDK code is inconsistent with the second SDK code.
As a preferred embodiment, the first detection module comprises:
and the compiling submodule is used for compiling the second SDK code, judging whether the compiling process has errors at the compiling level, and obtaining a compiling result according to the condition of whether the errors are reported.
As a preferred embodiment, the second detection module comprises:
the first operation sub-module is used for performing simulation scene operation by using the compiled second SDK code and judging whether the simulation operation process is interrupted or not when the compiling is successful; if the interruption occurs, obtaining a first operation result; if not, calling a third judgment submodule;
the third judgment submodule is used for judging whether code abnormity error reporting exists in the simulation operation process;
if so, obtaining a first operation result; if the judgment result does not exist, calling a fourth judgment submodule;
the fourth judgment submodule is used for judging whether the simulation operation result is the same as the preset simulation result or not; if not, obtaining a first operation result; otherwise, a second operation result is obtained.
As a preferred embodiment, an apparatus for detecting compatibility of an SDK code further includes:
and the positioning module is used for positioning an error reporting position corresponding to the code abnormal error reporting when the code abnormal error reporting exists in the simulation operation process.
As a preferred embodiment, the second detection module comprises:
the second obtaining submodule is used for obtaining a plurality of groups of simulation data of the simulation scene when the compiling is successful;
the compiling submodule is used for respectively carrying out simulation scene operation according to different simulation data by utilizing the compiled second SDK code to obtain simulation operation results corresponding to each group of simulation data;
and the comprehensive sub-module is used for carrying out comprehensive judgment according to the plurality of simulation operation results to obtain the operation result of the second SDK code.
As a preferred embodiment, an apparatus for detecting compatibility of an SDK code further includes:
and if the second SDK code is determined to have no compatibility problem, recording the current version information of the second SDK code in the current operating folder to the log.
For the specific definition of the SDK code compatibility detection device, reference may be made to the above definition of the SDK code compatibility detection method, which is not described herein again. The modules in the device for detecting compatibility of the SDK code may be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a compatibility detection method for SDK code. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server;
when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the data center by the second SDK code;
compiling the second SDK code to obtain a compiling result;
when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result;
and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
The computer equipment provided by the embodiment of the invention has the same beneficial effects as the SDK code compatibility detection method.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server;
when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the data center by the second SDK code;
compiling the second SDK code to obtain a compiling result;
when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result;
and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
The computer-readable storage medium provided by the embodiment of the invention has the same beneficial effects as the SDK code compatibility detection method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for detecting compatibility of an SDK code, the method comprising:
acquiring a first SDK code currently running from a data center, and acquiring a second SDK code currently transmitted from a server;
when the first SDK code is inconsistent with the second SDK code, replacing the first SDK code in the current running folder of the station in the data with the second SDK code;
compiling the second SDK code to obtain a compiling result;
when the compiling is successful, simulating scene operation by using the compiled second SDK code to obtain an operation result;
and obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
2. The method of claim 1, wherein the determining whether the first SDK code and the second SDK code are consistent comprises:
respectively acquiring a first version number of the first SDK code and a second version number of the second SDK code;
judging whether the first version number is consistent with the second version number;
if so, judging that the first SDK code is consistent with the SDK code, and ending the process;
if not, extracting a first function and a first calling relationship in the first SDK code, and extracting a second function and a second calling relationship of the second SDK code;
judging whether the first function is corresponding to the second function or not, and whether the first calling relation is corresponding to the second function or not;
if the first SDK code and the second SDK code are the same, judging that the first SDK code and the second SDK code are consistent, and ending the process;
and if not, judging that the first SDK code is inconsistent with the second SDK code.
3. The method of claim 1, wherein compiling the second SDK code to obtain a compilation result comprises:
and compiling the second SDK code, judging whether the compiling process has errors at the compiling level, and obtaining the compiling result according to the condition of whether the errors are reported.
4. The method of claim 3, wherein when the compiling is successful, performing a simulation scenario running by using the compiled second SDK code to obtain a running result, comprising:
when the compiling is successful, simulating scene operation by using the compiled second SDK code, and judging whether the simulation operation process is interrupted;
if the interruption occurs, obtaining a first operation result;
if not, judging whether code abnormity error reporting exists in the simulation operation process;
if so, obtaining the first operation result;
if not, judging whether the simulation operation result is the same as the preset simulation result;
if not, obtaining a first operation result;
otherwise, the second operation result is obtained.
5. The method of claim 4, wherein upon determining that there is a code exception error reporting during the simulation run, the method further comprises:
and positioning an error reporting position corresponding to the code abnormal error reporting.
6. The method of claim 4, wherein when the compiling is successful, performing a simulation scenario running by using the compiled second SDK code to obtain a running result, comprising:
when the compiling is successful, acquiring simulation data of a plurality of groups of simulation scenes;
respectively carrying out simulated scene operation according to different simulated data by using the compiled second SDK code to obtain simulated operation results corresponding to each group of the simulated data;
and comprehensively judging according to the plurality of simulation operation results to obtain the operation result of the second SDK code.
7. The method of any of claims 1 to 6, wherein if it is determined that the second SDK code does not have a compatibility problem, the method further comprises:
and recording the version information of the second SDK code in the current running folder to a log.
8. An apparatus for detecting compatibility of an SDK code, the apparatus comprising:
the acquisition module is used for acquiring a first SDK code which runs currently from a data center station and acquiring a second SDK code which is transmitted currently from a server;
a replacing module, configured to replace the first SDK code in the currently running folder of the station in the data with the second SDK code when the first SDK code and the second SDK code are inconsistent;
the first detection module is used for compiling the second SDK code to obtain a compiling result;
the second detection module is used for performing simulated scene operation by using the compiled second SDK code to obtain an operation result when the compiling is successful;
and the result determining module is used for obtaining a compatibility detection result of the second SDK code according to the compiling result and the running result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110858212.3A 2021-07-28 2021-07-28 SDK code compatibility detection method, device, computer equipment and medium Pending CN113568834A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110858212.3A CN113568834A (en) 2021-07-28 2021-07-28 SDK code compatibility detection method, device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110858212.3A CN113568834A (en) 2021-07-28 2021-07-28 SDK code compatibility detection method, device, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN113568834A true CN113568834A (en) 2021-10-29

Family

ID=78168517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110858212.3A Pending CN113568834A (en) 2021-07-28 2021-07-28 SDK code compatibility detection method, device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN113568834A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791809A (en) * 2021-11-11 2021-12-14 腾讯科技(深圳)有限公司 Application exception handling method and device and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103618645A (en) * 2013-11-28 2014-03-05 武汉虹旭信息技术有限责任公司 Complex network environment test system and method with intelligent simulation function
CN104461858A (en) * 2013-09-23 2015-03-25 财团法人资讯工业策进会 Software Compatibility Pre-testing Method and System
CN106951228A (en) * 2017-02-21 2017-07-14 腾讯科技(深圳)有限公司 The treating method and apparatus of difference in version iteration
CN109783366A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 APP edition upgrading compatibility test method, device, equipment and storage medium
CN111352853A (en) * 2020-05-25 2020-06-30 南京领行科技股份有限公司 Compatibility testing method, device, server and storage medium
CN111382070A (en) * 2020-03-03 2020-07-07 腾讯科技(深圳)有限公司 Compatibility testing method and device, storage medium and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461858A (en) * 2013-09-23 2015-03-25 财团法人资讯工业策进会 Software Compatibility Pre-testing Method and System
CN103618645A (en) * 2013-11-28 2014-03-05 武汉虹旭信息技术有限责任公司 Complex network environment test system and method with intelligent simulation function
CN106951228A (en) * 2017-02-21 2017-07-14 腾讯科技(深圳)有限公司 The treating method and apparatus of difference in version iteration
CN109783366A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 APP edition upgrading compatibility test method, device, equipment and storage medium
CN111382070A (en) * 2020-03-03 2020-07-07 腾讯科技(深圳)有限公司 Compatibility testing method and device, storage medium and computer equipment
CN111352853A (en) * 2020-05-25 2020-06-30 南京领行科技股份有限公司 Compatibility testing method, device, server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791809A (en) * 2021-11-11 2021-12-14 腾讯科技(深圳)有限公司 Application exception handling method and device and computer readable storage medium
CN113791809B (en) * 2021-11-11 2022-03-04 腾讯科技(深圳)有限公司 Application exception handling method and device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN110569035B (en) Code compiling method, device, equipment and storage medium of software development project
CN109902005B (en) Automatic testing method and system
US10579513B2 (en) Test run control method and apparatus
US20140208169A1 (en) Domain scripting language framework for service and system integration
CN108170465B (en) Version information management method, electronic equipment and readable storage medium
US20140208294A1 (en) Domain scripting language framework for service and system integration
CN109032631A (en) Application program service packs acquisition methods, device, computer equipment and storage medium
CN110032505B (en) Software quality determination apparatus and method, and non-transitory computer readable medium
CN113568834A (en) SDK code compatibility detection method, device, computer equipment and medium
CN106909434B (en) Method and device for detecting undefined function in executable program
US11169829B2 (en) Determining candidate patches for a computer software
KR101252358B1 (en) Apparatus and method for testing plc command
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN112241370B (en) API interface class checking method, system and device
CN114003250A (en) Software deployment method and device
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN113094052A (en) Application construction method and device, computer equipment and storage medium
CN116225966B (en) Application evaluation method and system based on intelligent watch
KR102111392B1 (en) Test unified administration system and Controlling Method for the Same
CN116149707B (en) Method and device for detecting and avoiding upgrading risk of distributed system
CN113407438B (en) Module testing method, computer device, and storage medium
US20040176087A1 (en) Method for updating code stored in a memory of a portable device
CN111506299B (en) Front-end data verification method and device and computer equipment
CN116701189A (en) Music application program code detection method, computer device, and storage medium
CN118035072A (en) Automatic acceptance method and system based on multi-version upgrading

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230801

Address after: 518000 building 501, 502, 601, 602, building D, wisdom Plaza, Qiaoxiang Road, Gaofa community, Shahe street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: China Southern Power Grid Digital Platform Technology (Guangdong) Co.,Ltd.

Address before: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province

Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

TA01 Transfer of patent application right