A method for testing satellite algorithms
By performing the plug-in format checksum containerization of the satellite algorithm corresponding to the interface, a testable satellite algorithm service is formed, which solves the problems of diversity and management difficulty of satellite algorithms in the existing technology, and realizes unified interface standards and performance optimization.
Patent Information
- Application Number
- CN202210366313.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-04-08
AI Technical Summary
In the prior art, there are many ways to implement satellite algorithms, which leads to increased difficulty in development and management, and lacks unified specifications, which affects the reuse and performance optimization of algorithms.
Provide a method to test satellite algorithms. By obtaining the satellite algorithm file submitted by the user, checking the plug-in format corresponding to the interface, containerizing it after passing the verification, forming a testable satellite algorithm service, and loading the performance test file to evaluate The operation performance of the algorithm.
It realizes a unified interface standard for satellite algorithms, simplifies development and management, improves the visibility and performance comparison of algorithms, reduces interaction delays and improves overall performance.
Smart Images

Figure CN114780063B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of satellite communication technology, and more particularly to a method for testing a satellite algorithm. Background Art
[0002] There are many types of satellite algorithms involved in the field of satellite communications, which usually require algorithms such as satellite orbit data, atmospheric data, signal attenuation, and coordinate conversion, and there are many ways to implement satellite algorithms for each purpose. In the absence of standardized standards, different users may choose different standard implementations for satellite algorithms for the same purpose, such as different function names and / or different parameter types for satellite algorithms for the same purpose, resulting in a messy format for several satellite algorithms for the same purpose, which is not conducive to the application of the corresponding satellite algorithms by the server. In addition, in traditional satellite toolkits, these algorithms are hard-coded by the developer when the software is delivered, making the implementation and operation of the satellite algorithms completely invisible to users.
[0003] Based on the above analysis, there are the following problems in implementing satellite algorithms and calling them:
[0004] First, there are many different methods to implement satellite algorithms for each purpose, which is not conducive to the centralized development and management of multiple satellite algorithms, nor is it conducive to the reuse of satellite algorithms or their partial code; second, it is difficult to formulate unified specifications for satellite algorithms for different purposes because they perform different tasks. Therefore, it is necessary to improve the existing technology. Summary of the invention
[0005] Therefore, the object of the present invention is to overcome the defects of the prior art and provide a method for testing satellite algorithms.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] According to a first aspect of the present invention, a method for testing a satellite algorithm is provided, comprising: obtaining a satellite algorithm file submitted from a corresponding interface, wherein the interface corresponds to the purpose of the satellite algorithm; verifying the satellite algorithm file according to a predetermined verification rule, wherein the verification rule includes verifying whether the satellite algorithm file conforms to a plug-in format corresponding to the interface to which it is submitted, and satellite algorithms for different purposes are provided with corresponding plug-in formats; containerizing the verified qualified satellite algorithm file to obtain a containerized satellite algorithm service; and testing the containerized satellite algorithm service in response to a test request.
[0008] In some embodiments of the present invention, the verification of the plug-in format includes: verifying whether the function name, return value, number of parameters and parameter type of the satellite algorithm file conform to the function name, return value, number of parameters and parameter type specified by the interface to which it is submitted.
[0009] In some embodiments of the present invention, the testing of the containerized satellite algorithm service includes loading corresponding test files for testing performance indicators of the satellite algorithm service during operation on the satellite algorithm service to perform the test, wherein the performance indicators include: whether the satellite algorithm service operates correctly, the time overhead indicator of testing the satellite algorithm, and the memory usage indicator of the satellite algorithm during operation.
[0010] In some embodiments of the present invention, the time overhead indicator includes: the sub-time overhead of completing each test item in the test file, the total time overhead of completing all test items, whether the time overhead of completing each test item in the test file exceeds the sub-time overhead threshold of the test item specified by the interface to which it is submitted, whether the total time overhead of completing all test items exceeds the total time overhead threshold specified by the interface to which it is submitted, or a combination thereof.
[0011] In some embodiments of the present invention, for satellite algorithms of different purposes, the sub-time cost thresholds of each test item corresponding to the test file and the total time cost threshold for completing all test items can be set independently.
[0012] In some embodiments of the present invention, the memory usage indicator of the satellite algorithm service during operation includes: the real-time memory usage of the satellite algorithm service during the test, the peak value of the memory usage, whether the memory usage exceeds the memory usage threshold specified by the interface to which it is submitted, or a combination thereof.
[0013] In some embodiments of the present invention, for satellite algorithms of different purposes, the corresponding memory occupancy thresholds can be set independently.
[0014] In some embodiments of the present invention, the method further includes: charting various performance indicators of the satellite algorithm service during operation, and presenting them in the form of charts.
[0015] In some embodiments of the present invention, for different versions of satellite algorithm files for the same purpose submitted by users at different times, various performance indicators of different versions of each satellite algorithm file are saved.
[0016] In some embodiments of the present invention, the containerization method includes: performing different containerization methods for satellite algorithm files of different file types, the file types including source code file types and dynamic library file types, wherein the source code file types include compiled language types and interpreted language types.
[0017] In some embodiments of the present invention, different containerization methods are used for satellite algorithm files of different file types, including: directly deploying satellite algorithm files of dynamic library files or interpreted language source code file types as corresponding satellite algorithm services.
[0018] In some embodiments of the present invention, different containerization methods are performed for satellite algorithm files of different file types, including: compiling a satellite algorithm file of a source code file type of a compiled language type into a satellite algorithm file of a dynamic library file type to obtain a compilation result; and deploying the successfully compiled satellite algorithm file as a corresponding satellite algorithm service according to the compilation result.
[0019] In some embodiments of the present invention, when the file type of the satellite algorithm file includes a third-party dependent library file type, the satellite algorithm file of the third-party dependent library file type is directly containerized to obtain a corresponding satellite algorithm service.
[0020] An electronic device comprises: one or more processors; and a memory, wherein the memory is used to store executable instructions; the one or more processors are configured to implement the steps of any one of the methods described in the first aspect of the present invention by executing the executable instructions.
[0021] Compared with the prior art, the advantages of the present invention are:
[0022] 1. The present invention first obtains a satellite algorithm file submitted by a user from a corresponding interface. The interface corresponds to the purpose of the satellite algorithm and supports user-defined implementation of the corresponding algorithm; the satellite algorithm file is verified according to a predetermined verification rule. The verification rule includes verification of whether the satellite algorithm file conforms to the plug-in format corresponding to the interface to which it is submitted. Satellite algorithms for different purposes are provided with corresponding plug-in formats. Through the interface verification in the verification rule, a unified standard interface is realized, and the algorithm plug-in is performed. The satellite algorithm file that has passed the verification is containerized to obtain a satellite algorithm service, and the algorithm service is performed, thereby reducing interaction delay and improving overall performance.
[0023] 2. The present invention loads the corresponding test files on the satellite algorithm service to test the various performance indicators of the satellite algorithm service during operation, so as to help users compare and improve the performance of the satellite algorithm. For satellite algorithms of different purposes, the sub-time overhead of each test item corresponding to the test file and the total time overhead for completing all test items are set with thresholds and can be set independently; and the corresponding memory occupancy is set with thresholds and can be set independently. Through this test method, not only a restriction range that is more appropriate in time and space is set for each satellite algorithm, but also the algorithm program can be terminated in time when an error occurs in the algorithm program or when the threshold is exceeded, saving computing resources and service resources, and avoiding more serious consequences such as algorithm program crashes.
[0024] 3. The satellite algorithm files of the present invention can be of different file types, such as satellite algorithm files whose source codes are in different language types. After the containerization of the satellite algorithm service, the server can directly call and run the corresponding satellite algorithm service, supporting efficient interaction between different languages, which reflects the good compatibility and extensibility of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0026] Figure 1 A flow chart of a method for testing a satellite algorithm according to an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of a log file formed by recording verification, containerization and testing of a satellite algorithm file according to an embodiment of the present invention;
[0028] Figure 3 The figure is a flow chart of a method for testing a satellite algorithm according to another embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0030] As mentioned in the background technology section, firstly, there are currently a variety of methods for implementing satellite algorithms for each purpose, which is not conducive to the centralized development and management of multiple satellite algorithms, nor is it conducive to the reuse of satellite algorithms or their local algorithm codes; secondly, it is difficult to formulate unified specifications for satellite algorithms for different purposes because they perform different tasks.
[0031] In view of the above problems, the present invention provides a method for testing a satellite algorithm, comprising: obtaining a satellite algorithm file submitted by a user from a corresponding interface, wherein the interface corresponds to the purpose of the satellite algorithm to support the user to customize the corresponding satellite algorithm, and at the same time, by corresponding the interface to the purpose of the satellite algorithm, a number of satellite algorithms with the same purpose are concentrated together, which is conducive to the centralized development and management of multiple satellite algorithms; verifying the satellite algorithm file according to a predetermined verification rule, wherein the verification rule includes verifying whether the satellite algorithm file conforms to the plug-in format corresponding to the interface to which it is submitted, satellite algorithms for different purposes are provided with corresponding plug-in formats, and through the plug-in format verification of the interface in the verification rule, the algorithms for the same purpose have a unified interface standard rule, thereby performing algorithm plug-inization to improve the testing efficiency; containerizing the qualified satellite algorithm file to obtain a satellite algorithm service, and performing algorithm serviceization, the containerized satellite algorithm service can be consistently moved and run on any environment and any infrastructure, and has strong compatibility; finally, by testing the containerized satellite algorithm service, the running status visibility of the satellite algorithm is achieved, so as to help users compare and improve the performance of the satellite algorithm, thereby improving the scalability.
[0032] Furthermore, satellite algorithm files can be of different file types, such as satellite algorithm files with source code in different language types, and users can customize the use of different types of languages to write corresponding satellite algorithms. In addition, through testing, the algorithm program can be terminated in time when an error occurs, saving computing resources and service resources, avoiding resource waste or even more serious consequences such as algorithm program crashes; finally, users can make multiple improvements to the satellite algorithm for the same purpose and submit them for testing until user needs are met.
[0033] Based on the above research, according to an embodiment of the present invention, a method for testing a satellite algorithm is provided. Figure 1 , including steps S1, S2, S3 and S4. In order to better understand the present invention, each step is described in detail below in conjunction with specific embodiments.
[0034] Step S1: Acquire a satellite algorithm file submitted from a corresponding interface, wherein the interface corresponds to the purpose of the satellite algorithm.
[0035] According to an embodiment of the present invention, the specific use of the satellite algorithm can be set according to the needs of the user. For example, satellite algorithms for different purposes include: a satellite algorithm for calculating orbital data, a satellite algorithm for calculating atmospheric data, a satellite algorithm for calculating signal data, a satellite algorithm for calculating coordinate data, or a combination thereof. The present invention does not impose any limitation on this.
[0036] For the interface, an automatic identification method can be used. According to one embodiment of the present invention, each satellite algorithm for each purpose is provided with a corresponding function name, and the function names of satellite algorithms for different purposes are different. The interface corresponding to the satellite algorithm is determined by the function name. For example, the function name of the satellite algorithm for calculating orbital data is uniformly set to guidao_al, and the function name of the satellite algorithm for calculating atmospheric data is uniformly set to daqi_al, etc. The user can directly submit the corresponding satellite algorithm file. After submission, the function name of the satellite algorithm file and the function name of each interface are automatically identified to determine which satellite algorithm the submitted satellite algorithm file is for and which interface it corresponds to, so as to automatically identify the interface corresponding to the satellite algorithm file.
[0037] For the interface, a manual matching method can also be adopted. According to another embodiment of the present invention, satellite algorithms for different purposes are provided with corresponding interfaces. Preferably, a satellite algorithm for each purpose corresponds to an interface; satellite algorithms for different purposes correspond to different interfaces. A corresponding interface is provided for each satellite algorithm for each purpose, and each interface corresponds to a satellite algorithm file submission interface for a purpose. When submitting a corresponding satellite algorithm file, the user can select the satellite algorithm file submission interface for the corresponding purpose according to the purpose of the satellite algorithm file to submit it, so as to realize the correspondence between the satellite algorithm file for the corresponding purpose and the corresponding interface, so as to obtain the satellite algorithm file submitted by the user from the corresponding interface.
[0038] When the user submits the corresponding satellite algorithm file, the file type of the satellite algorithm file can be diverse, including source code file type, dynamic library file type and third-party dependent library file type, wherein the source code file type includes compiled language type and interpreted language type. When the code in the satellite algorithm file of the source code file type is of compiled language type, it needs to be submitted according to the corresponding rules to avoid the problem of man-made compilation errors and operation errors caused by the mismatch between the file reference order and the submission order when compiling the corresponding code. Therefore, according to one embodiment of the present invention, the user needs to submit the satellite algorithm file of the source code file type with the code of the compiled language type in sequence, and the submission order is: the header file of the same name is submitted before the source code file, and the header file and the source code file of different names are submitted according to the order in which they call each other. For example, the satellite algorithm file written by the user in C++ compiled language includes a header file orbit.h, two source code files orbit.cpp and time.cpp. Among them, orbit.cpp includes time.cpp. Then the order of submitting files can be: orbit.h, time.cpp, orbit.cpp, or: time.cpp, orbit.h, orbit.cpp. In general, files with the suffix .h are header files, and files with the suffix .cpp are source code files. Third-party dependent library files only need to be compressed into files with the suffix .zip before submission, such as Eigen library files or Opencv library files, and other file types can be submitted directly.
[0039] Step S2: Verify the satellite algorithm file according to a predetermined verification rule, wherein the verification rule includes verifying whether the satellite algorithm file conforms to the plug-in format corresponding to the interface to which it is submitted, and satellite algorithms for different purposes are provided with corresponding plug-in formats.
[0040] Since there are many types of satellite algorithms and various implementation methods, there is a lack of a unified interface standard for satellite algorithms of the same purpose. When the back-end performs algorithm calls, problems such as slow operation and low interaction efficiency will occur. Therefore, according to one embodiment of the present invention, satellite algorithms of different purposes are provided with corresponding plug-in formats. At the same time, it is necessary to verify whether the satellite algorithm file submitted by the user conforms to the plug-in format corresponding to the interface to which it is submitted, wherein the verification of the plug-in format includes: verifying whether the function name, return value, number of parameters and parameter type of the satellite algorithm file conform to the function name, return value, number of parameters and parameter type specified by the interface to which it is submitted. If not, the user needs to adjust to a unified plug-in format and submit it again. In this way, satellite algorithms of the same purpose are implemented as the same interface, which is convenient for users to call the corresponding algorithm according to the interface and improve the interaction efficiency.
[0041] According to an embodiment of the present invention, the plug-in format corresponding to the interface mainly sets the function name, return value, number of parameters and parameter type. For the plug-in format of the interface corresponding to each satellite algorithm, first, the function name indicates which satellite algorithm the interface corresponds to;
[0042] According to an embodiment of the present invention, first, the function names of satellite algorithm files for the same purpose are uniformly set, such as the function names of satellite algorithms for calculating orbital data are uniformly set to guidao_al, and the function names of satellite algorithms for calculating atmospheric data are uniformly set to daqi_al, etc. Secondly, the number of parameters is set to one, two or more, and the parameter types include integer type, floating point type, array type and / or string type, etc. Among them, the interface of the satellite algorithm for the corresponding purpose of the present invention, the number of parameters of the plug-in format of the interface should be set as little as possible, and the parameter type should be set as simply as possible. For example, on the surface of a sphere, a point can be determined by both two-dimensional coordinates and three-dimensional coordinates. For simplicity, two-dimensional coordinates can be used. At this time, only two parameters need to be set. For another example, a polygon includes a vertex set and a side length, and the side length can be calculated by the vertex coordinates. Therefore, only the vertex set parameters need to be set, and there is no need to set the side length parameters. Finally, the data type. On the one hand, the calculation of floating point types in computers is much more complicated than that of integer types, so it is set to integer type as much as possible. On the other hand, it is the container class in the standard container library, such as dynamic arrays and static arrays. Generally speaking, the latter is faster. At this time, using static arrays is more conducive to performance. In general, the more parameters are passed and the more complex their types are, the worse the performance will be. The setting of the plug-in format of the interface involved in the present invention not only ensures the simplicity and clarity of the parameters, but also improves the performance.
[0043] According to one embodiment of the present invention, the plug-in format verification is performed for the satellite algorithm file submitted by the user. First, the function name of the algorithm file is matched with the function name in the plug-in format of the interface. If there is no match, it is equivalent to the non-existence of the function. Otherwise, the return value, number of parameters and parameter type of the satellite algorithm file are further verified to be consistent with the return value, number of parameters and parameter type set in the plug-in format of the interface to which it is submitted. When the satellite algorithm file conforms to the plug-in format corresponding to the interface to which it is submitted, the verification is qualified.
[0044] Step S3: Containerize the verified qualified satellite algorithm file to obtain a containerized satellite algorithm service. In the prior art, although the compiled language depends on the compiler and has poor cross-platform performance, it only needs to be compiled once for multiple executions, has a fast running speed, and has high program execution efficiency. Therefore, in order to pursue the high efficiency of the algorithm, compiled languages are often used to implement satellite algorithms. The server side mostly uses interpreted languages, which results in the server side using interpreted languages being unable to directly call and run the satellite algorithm implemented using compiled languages, making it impossible for different types of languages to interact efficiently. Therefore, the satellite algorithm file is containerized to obtain a containerized satellite algorithm service that can be directly called by the server side. And the containerized satellite algorithm service can be consistently moved and run in any environment and any infrastructure, with strong compatibility, which not only overcomes the problem of inefficient interaction between different types of languages, but also solves the problem of more time required to repair vulnerabilities, errors, and failures in satellite algorithms.
[0045] According to an embodiment of the present invention, the containerization method includes: performing different containerization methods for satellite algorithm files of different file types.
[0046] According to an embodiment of the present invention, different containerization methods are performed, including: directly deploying a satellite algorithm file of a source code file type of a dynamic library file or an interpreted language type as a corresponding satellite algorithm service. For example, a satellite algorithm written in the interpreted language Java can be directly deployed as a corresponding satellite algorithm service as long as the obtained satellite algorithm file is verified to be qualified. Usually, the satellite algorithm file written in the interpreted language Java source code has a suffix of .java; the dynamic library file has a suffix of .dll or .so, etc.
[0047] According to an embodiment of the present invention, different containerization methods are performed, including: compiling a satellite algorithm file of a source code file type of a compiled language type into a satellite algorithm file of a dynamic library file type to obtain a compilation result; and deploying the successfully compiled satellite algorithm file as a corresponding satellite algorithm service according to the compilation result. For example, a satellite algorithm written in the compiled language C++, the obtained satellite algorithm file needs to be compiled to generate a dynamic library file, and then the generated dynamic library file is deployed as a corresponding satellite algorithm service.
[0048] According to one embodiment of the present invention, the file type of the satellite algorithm file includes a third-party dependent library file type, and the satellite algorithm file of the third-party dependent library file type is directly containerized to obtain a corresponding satellite algorithm service. The satellite algorithm file of the third-party dependent library file type does not require any verification and can be directly deployed as a corresponding satellite algorithm service.
[0049] Step S4: In response to the test request, test the containerized satellite algorithm service.
[0050] According to one embodiment of the present invention, testing a containerized satellite algorithm service includes loading corresponding test files for testing various performance indicators of the satellite algorithm service during operation on the containerized satellite algorithm service to perform the test. Among them, various performance indicators include: whether the satellite algorithm service is running correctly, the time overhead indicator for testing the satellite algorithm, and the memory usage indicator when the satellite algorithm is running. For example, a satellite algorithm service after containerizing several satellite algorithm files for different purposes can be stored in a satellite communication platform, and the corresponding test files can be loaded in the corresponding satellite algorithm service on the satellite communication platform to test various performance indicators of the satellite algorithm service during operation.
[0051] The time cost index of executing the test can be used to judge the quality of the algorithm. According to an embodiment of the present invention, the time cost index includes: the sub-time cost of completing each test item in the test file, the total time cost of completing all test items, whether the time cost of completing each test item in the test file exceeds the sub-time cost threshold of the test item specified by the interface to which it is submitted, whether the total time cost of completing all test items exceeds the total time cost threshold specified by the interface to which it is submitted, or a combination thereof. The technical scheme of this embodiment can at least achieve the following beneficial technical effects: the present invention observes the local performance of the algorithm in different sub-items through the sub-time cost of each test item in the test file, and observes the overall performance of the algorithm through the total time cost of completing all test items, so as to understand the quality of the tested algorithm from different aspects, and facilitate users to make judgments and improvements; in addition, the present invention can also allow users to quickly and intuitively obtain whether the operation of the algorithm meets the pre-set minimum requirements by whether the time cost of completing each test item in the test file exceeds the sub-time cost threshold of the test item specified by the interface to which it is submitted, and whether the total time cost of completing all test items exceeds the total time cost threshold specified by the interface to which it is submitted.
[0052] At the same time, there are great differences in the amount of calculation corresponding to different satellite algorithms. For example, the IO (Input & Output) time overhead is considered in the calculation time, which is divided into disk IO time overhead and network IO time overhead. Among them, the disk IO time overhead is: the time it takes for the user's code to read data from the disk. For example, if the user generates millions of coordinate points and needs to read several coordinate points for calculation or rendering, then these coordinate points are all in the hard disk, which will require hard disk reading time. The network IO time overhead is: the time it takes for data to communicate and transmit on the network, such as several coordinate points may need to be transmitted over the network, or the algorithm service needs to communicate on different machines. Therefore, different algorithms have different requirements for time at runtime. According to one embodiment of the present invention, for satellite algorithms with different purposes, the sub-time overhead thresholds of each test item corresponding to the test file and the total time overhead threshold for completing all test items can be set independently. The present invention can set a time-appropriate limit range for each satellite algorithm in combination with the actual satellite algorithm, and the sub-time overhead threshold and the total time overhead threshold are set independently, so that it can be clearly and quickly discovered which test items in the test file have problems such as excessive time overhead, so as to make targeted improvements. For example, the sub-time overhead threshold of the satellite algorithm used to calculate orbital data can be limited to within 10s, and the total time overhead threshold can be set to within 60s.
[0053] The memory overhead index of the execution test can also be used to judge the pros and cons of the algorithm. When the corresponding test file is loaded on the satellite communication platform for operation, if the code submitted by the user occupies a large amount of computer memory during operation, adverse effects such as response delay or system crash may occur. According to one embodiment of the present invention, the memory occupancy index of the satellite algorithm service during operation includes: the real-time memory occupancy of the satellite algorithm service during the test, the peak value of the memory occupancy, whether the memory occupancy exceeds the memory occupancy threshold specified by the interface to which it is submitted, or a combination thereof. The technical scheme of this embodiment can at least achieve the following beneficial technical effects: the present invention observes the performance of the algorithm at different times through the real-time memory occupancy of the satellite algorithm service during the test, and observes the maximum demand of the algorithm for memory through the peak value of the memory occupancy during the test, so as to understand the pros and cons of the tested algorithm from different aspects, which is convenient for users to make judgments and improvements; in addition, the present invention can also allow users to quickly and intuitively obtain whether the operation of the algorithm meets the pre-set minimum requirements through the real-time memory occupancy of the satellite algorithm service during the test, the peak value of the memory occupancy, and whether the memory occupancy exceeds the memory occupancy threshold specified by the interface to which it is submitted.
[0054] At the same time, the memory requirements of different satellite algorithms at runtime are also different. For example, loading corresponding test files for running simulations and calling various processes all require the use of processor CPUs and memory. Therefore, different algorithms have different memory requirements at runtime. According to one embodiment of the present invention, for satellite algorithms with different purposes, their corresponding memory occupancy thresholds can be set independently. A more appropriate memory restriction range can be set for each satellite algorithm in combination with the actual satellite algorithm. For example, the memory occupancy threshold for the satellite algorithm used to calculate atmospheric data is limited to 1GB.
[0055] According to one embodiment of the present invention, the method further includes: charting various performance indicators of the satellite algorithm service during operation, and outputting them to a display device for display in the form of a chart. For example, different versions of the satellite algorithm service after containerization of the same purpose satellite algorithm file can be stored in the satellite communication platform, and the corresponding test file can be loaded on the satellite communication platform to test various performance indicators of multiple different versions of the satellite algorithm service for the same purpose during operation, and the various performance indicators of multiple different versions of the satellite algorithm service for the same purpose are counted and presented in the form of a chart to compare the performance advantages and disadvantages of each version of the satellite algorithm.
[0056] After testing the corresponding satellite algorithm service, some relatively abstract data are obtained, and the results cannot be seen intuitively, and the satellite itself cannot be seen directly. Therefore, it is more intuitive to display the data obtained by scene demonstration calculation. According to one embodiment of the present invention, the method also includes: visualizing the results after the satellite algorithm service is completed, and outputting them to the display device for display in the form of an image. For example, a satellite motion trajectory algorithm obtains a number of ordered coordinate data after the operation is completed. All coordinate data are connected in sequence to form the possible motion trajectory of the satellite. At this time, the several ordered coordinate data after the satellite motion trajectory algorithm service is completed can be displayed in the form of an image, including: drawing a number of ordered coordinate data into a trajectory, marking the coordinate data one by one on the trajectory, drawing the relevant satellite image and moving the satellite on the trajectory, and setting the scene and simulating the movement of the satellite on the trajectory in a dynamic way. The satellite's motion trajectory is intuitively displayed, fully meeting the diverse needs of users.
[0057] According to an embodiment of the present invention, the method further includes recording the verification results, containerization process and test results of the satellite algorithm file submitted by the user, see Figure 2 The log files recorded include the verification results of whether the format of the code in the satellite algorithm file is correct when it is submitted, whether there are compilation errors when the code is compiled during the containerization process, whether there are running errors when the code is running, whether the running exceeds the time limit, whether the running exceeds the memory limit, and other test results.
[0058] According to an embodiment of the present invention, for different versions of satellite algorithm files for the same purpose submitted by users at different times, various performance indicators of different versions of each satellite algorithm file are saved for user query and call.
[0059] According to one embodiment of the present invention, the method for testing satellite algorithms of the present invention can be deployed on a simulation test platform, such as deployed on a simulated satellite communication platform. The user can submit the corresponding satellite algorithm file to the satellite communication platform to execute the corresponding method for testing the satellite algorithm. At the same time, the platform is embedded with satellite algorithm services after containerization of satellite algorithm files for different purposes and different versions of satellite algorithm services after containerization of satellite algorithm files for the same purpose. For algorithms for the same purpose, various performance indicators of satellite algorithm services after containerization of different versions of satellite algorithm files submitted by users at different times are saved. At the same time, the user can continuously modify and submit the satellite algorithm for the same purpose, and then modify and submit it again according to various performance indicators until a state that the user is relatively satisfied with is reached. In addition, based on the satellite algorithm services after containerization of different versions of satellite algorithm files for the same purpose already on the platform, the user can choose to call the satellite algorithm service after containerization of the first submitted version of the satellite algorithm file or the satellite algorithm service after containerization of the later submitted version of the satellite algorithm file through a standardized interface. It is also possible to call the corresponding version of the satellite algorithm service according to the various performance indicators of different versions of each satellite algorithm service and the performance requirements of the user. When calling, the specific version of the same purpose is not specified, and the satellite algorithm service with the highest efficiency can be called by default.
[0060] According to an embodiment of the present invention, algorithm performance is sorted based on various performance indicators of different versions of each satellite algorithm file; wherein the algorithm performance sorting includes: performing weighted summation on various performance indicators of the corresponding version of each satellite algorithm file to obtain a corresponding algorithm performance value, and performing performance sorting on different versions of satellite algorithm files for the same purpose according to the algorithm performance value.
[0061] According to one embodiment of the present invention, a weighted sum is performed on each performance index corresponding to each satellite algorithm file, including setting a weight parameter for whether the satellite algorithm service runs correctly, a time overhead index for testing the satellite algorithm, and a memory occupancy index when the satellite algorithm runs, and performing weighted summation to obtain the corresponding algorithm performance value. In addition, the weight parameter can be preset, or the weight parameter can be set by the user according to the time demand and memory demand to sort and call the satellite algorithm service that meets the demand.
[0062] Furthermore, before the present invention containerizes and tests the corresponding satellite algorithm file, it only performs plug-in format verification without considering whether the code of the satellite algorithm file submitted by the user can be run, which may lead to many operational problems in the subsequent test results. Therefore, according to an embodiment of the present invention, a code correctness check can be added before the code is containerized and tested.
[0063] According to another embodiment of the present invention, another method for testing a satellite algorithm is provided, comprising steps A1, A2, A3 and A4, see Figure 3 , wherein steps A1, A3 and A4 are respectively the same as the above-mentioned steps S1, S3 and S4, and a correctness check of the code is added to the check rule of step A2, as follows.
[0064] Step A1: Acquire a satellite algorithm file submitted from a corresponding interface, wherein the interface corresponds to the purpose of the satellite algorithm.
[0065] Step A2: Verify the satellite algorithm file according to predetermined verification rules, wherein the verification rules include verifying whether the satellite algorithm file conforms to the plug-in format corresponding to the interface to which it is submitted, and performing correctness verification on the satellite algorithm file that conforms to the plug-in format. Satellite algorithms for different purposes are provided with corresponding plug-in formats.
[0066] According to another embodiment of the present invention, the verification rule specifically includes: first, verifying whether the function name, return value, number of parameters and parameter type of the satellite algorithm file conform to the function name, return value, number of parameters and parameter type specified by the interface to which it is submitted in the same manner as described above. Secondly, performing a correctness check on the satellite algorithm file that conforms to the plug-in format, wherein the correctness check includes verifying whether the satellite algorithm file can be correctly compiled and run correctly. The correctness check can terminate the program in time when an error occurs in the compilation or operation of the program in the satellite algorithm file, saving computing resources and service resources. When the satellite algorithm file conforms to the plug-in format corresponding to the interface to which it is submitted, and meets the correct compilation and correct operation conditions of the correctness check, the verification is qualified.
[0067] Step A3: Containerize the verified satellite algorithm file to obtain a containerized satellite algorithm service.
[0068] Step A4: In response to the test request, testing the containerized satellite algorithm service.
[0069] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0070] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0071] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0072] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for testing a satellite algorithm, characterized in that: include: Obtaining a satellite algorithm file submitted from a corresponding interface, wherein the interface corresponds to the purpose of the satellite algorithm; Verifying the satellite algorithm file according to a predetermined verification rule, wherein the verification rule includes verifying whether the satellite algorithm file conforms to a plug-in format corresponding to the interface to which it is submitted, and satellite algorithms for different purposes are provided with corresponding plug-in formats; Containerize the verified satellite algorithm files to obtain containerized satellite algorithm services; In response to a test request, test the containerized satellite algorithm service.
2. The method according to claim 1, characterized in that The verification of the plug-in format includes: verifying whether the function name, return value, number of parameters and parameter type of the satellite algorithm file conform to the function name, return value, number of parameters and parameter type specified by the interface to which it is submitted.
3. The method according to claim 1, characterized in that: The testing of the containerized satellite algorithm service includes loading a corresponding test file for testing the performance indicators of the satellite algorithm service during operation on the satellite algorithm service to perform the test; Among them, the performance indicators include: whether the satellite algorithm service runs correctly, the time overhead indicator of testing the satellite algorithm, the memory occupancy indicator when the satellite algorithm is running, or a combination thereof.
4. The method according to claim 3, characterized in that: The time cost indicators include: The sub-time cost of completing each test item in the test file, the total time cost of completing all test items, whether the time cost of completing each test item in the test file exceeds the sub-time cost threshold of the test item specified by the interface to which it is submitted, whether the total time cost of completing all test items exceeds the total time cost threshold specified by the interface to which it is submitted, or a combination thereof.
5. The method according to claim 4, characterized in that For satellite algorithms of different purposes, the sub-time cost threshold of each test item corresponding to the test file and the total time cost threshold for completing all test items can be set independently.
6. The method according to claim 3, characterized in that The memory usage indicators of the satellite algorithm service during operation include: During the test, the real-time memory usage of the satellite algorithm service, the peak memory usage, whether the memory usage exceeds the memory usage threshold specified by the interface to which it is submitted, or a combination thereof.
7. The method according to claim 6, characterized in that For satellite algorithms with different purposes, the corresponding memory usage thresholds can be set independently.
8. The method according to any one of claims 1 to 7, characterized in that: The method also includes: charting various performance indicators of the satellite algorithm service during operation, and displaying them in the form of charts.
9. The method according to any one of claims 1 to 7, characterized in that: For different versions of satellite algorithm files for the same purpose submitted at different times, various performance indicators of different versions of each satellite algorithm file are saved.
10. The method according to any one of claims 1 to 7, characterized in that: The containerization method includes: performing different containerization methods for satellite algorithm files of different file types, wherein the file types include source code file types and dynamic library file types, wherein the source code file types include compiled language types and interpreted language types.
11. The method according to claim 10, characterized in that The different containerization methods for satellite algorithm files of different file types include: The satellite algorithm file of the file type of a dynamic library file or a source code file of an interpreted language type is directly deployed as the corresponding satellite algorithm service.
12. The method according to claim 10, characterized in that The different containerization methods for satellite algorithm files of different file types include: Compile a satellite algorithm file of a source code file type of a compiled language type into a satellite algorithm file of a dynamic library file type to obtain a compilation result; According to the compilation result, the successfully compiled satellite algorithm file is deployed as the corresponding satellite algorithm service.
13. The method according to claim 10, characterized in that When the file type of the satellite algorithm file includes a third-party dependent library file type, the satellite algorithm file of the third-party dependent library file type is directly containerized to obtain a corresponding satellite algorithm service.
14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method according to any one of claims 1 to 13.
15. An electronic device, characterized in that: include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1-13 by executing the executable instructions.