Diagnostic component code publishing method and device, equipment and storage medium
Through automated compilation and verification processes, diagnostic component code is retrieved and published from the preset code base, solving the inefficiency problem caused by manual operations and achieving efficient automated release.
Patent Information
- Application Number
- CN202510081205.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-04-29
AI Technical Summary
During the server production process, the release of diagnostic component codes requires manual operation, resulting in high workload and low efficiency.
In response to the compilation operation of the diagnostic component, the code file associated with the diagnostic component is retrieved from the preset code base for compilation and verification. If it passes, the compilation result will be sent to the preset terminal.
No manual operation is required, which improves the release efficiency of diagnostic component code and reduces the possibility of manual errors.
Smart Images

Figure CN119902798A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of server technology, and in particular to a method, apparatus, device and storage medium for publishing a diagnostic component code. Background Art
[0002] During the server production process, it is usually necessary to perform a series of tests on each server, such as refreshing, checking, and stress testing. Generally, this is done based on a fixed production test system. The production test system includes multiple diagnostic components, and different diagnostic components have different code files. Different diagnostic components are required for testing in different test scenarios. However, when calling different diagnostic components, manual operations are required, which is labor-intensive and inefficient.
[0003] Therefore, there is an urgent need for a method for publishing diagnostic component codes that does not require manual operation, thereby improving the efficiency of publishing diagnostic component codes. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a method, apparatus, device and storage medium for publishing a diagnostic component code.
[0005] A first aspect of an embodiment of the present disclosure provides a method for publishing a diagnostic component code, the method comprising:
[0006] In response to the compiling operation of the diagnostic component, a code file associated with the diagnostic component is retrieved from a preset code library; wherein the preset code library is used to store code files of different diagnostic components;
[0007] Compile the code file according to preset rules to obtain a compilation result;
[0008] Retrieving a preset test case, verifying the compilation result, and obtaining a verification result;
[0009] If the verification result indicates that the compilation result is passed, the compilation result is sent to a preset terminal.
[0010] In one example, the compiling operation of the diagnostic component includes a compiling operation of the diagnostic component initiated by a user or a compiling operation of the diagnostic component in a scheduled task; if the compiling operation of the diagnostic component is a compiling operation of the diagnostic component initiated by a user, then in response to the compiling operation of the diagnostic component, the code file associated with the diagnostic component is retrieved from a preset code library, including:
[0011] In response to a compile operation of a diagnostic component initiated by a user, obtaining, in the preset code library, a file list of the diagnostic component corresponding to the compile operation of the diagnostic component initiated by the user;
[0012] Get the code file from the file list of the diagnostic component.
[0013] In one example, if the compilation operation of the diagnostic component is a compilation operation of the diagnostic component in a scheduled task, then in response to the compilation operation of the diagnostic component, the code file associated with the diagnostic component is retrieved from a preset code library, including:
[0014] In response to the compiling operation of the diagnostic component in the scheduled task, a code file associated with the diagnostic component is retrieved from the preset code library according to a preset time period.
[0015] In one example, compiling the code file according to a preset rule to obtain a compilation result includes:
[0016] Get historical compilation records;
[0017] If the historical compilation record indicates that the compilation is performed for the first time, the code file is compiled according to a preset rule to obtain the compilation result;
[0018] If the historical compilation record indicates that it is not the first compilation, the last compilation record is obtained, and the compilation result is determined according to the last compilation record.
[0019] In one example, determining the compilation result according to the last compilation record includes:
[0020] According to the last compilation record, searching for an update record of the last compilation record;
[0021] If there is an update record of the last compilation record, compile the code file according to a preset rule to obtain a compilation result;
[0022] If there is no update record of the last compilation record, the compilation result corresponding to the last compilation record is called.
[0023] In one example, calling a preset test case, verifying the compilation result, and obtaining a verification result includes:
[0024] Retrieve a preset test case and deploy a test environment according to the preset test case;
[0025] Based on the test environment, the compilation result is run to obtain a verification result.
[0026] In one example, sending the compilation result to a preset terminal includes:
[0027] The compilation result is sent to a configuration management system, and the compilation result is sent to a preset terminal based on the configuration management system.
[0028] A second aspect of an embodiment of the present disclosure provides a device for publishing a diagnostic component code, including:
[0029] A calling module, configured to call a code file associated with the diagnostic component from a preset code library in response to a compile operation of the diagnostic component; wherein the preset code library is used to store code files of different diagnostic components;
[0030] A compiling module, used to compile the code file according to preset rules to obtain a compilation result;
[0031] A verification module is used to call a preset test case, verify the compilation result, and obtain a verification result;
[0032] The sending module is used for sending the compilation result to a preset terminal if the verification result indicates that the compilation result is passed.
[0033] A third aspect of an embodiment of the present disclosure provides an electronic device, comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method of the first aspect above.
[0034] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.
[0035] The disclosed embodiment provides a method, apparatus, device and storage medium for publishing diagnostic component code, the method comprising: in response to the compilation operation of the diagnostic component, calling the code file associated with the diagnostic component from a preset code library; wherein the preset code library is used to store code files of different diagnostic components; compiling the code file according to preset rules to obtain a compilation result; calling preset test cases, verifying the compilation result, and obtaining a verification result; if the verification result indicates that the compilation result is passed, sending the compilation result to a preset terminal. The use of this technical solution can improve the publishing efficiency of the diagnostic component code without manual operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1a It is a flowchart of a method for publishing a diagnostic component code provided by an embodiment of the present disclosure;
[0039] Figure 1b What is shown is a schematic diagram of a system structure for publishing diagnostic component codes;
[0040] Figure 1c A schematic diagram of a management structure of a preset code library is shown;
[0041] Figure 2a It is a flowchart of a method for publishing a diagnostic component code provided by an embodiment of the present disclosure;
[0042] Figure 2b What is shown is a schematic diagram of a compilation process;
[0043] Figure 2c What is shown is a flow chart of a deployment procedure;
[0044] Figure 2d What is shown is a flow chart of a mis-injection procedure processing;
[0045] Figure 2e What is shown is a flow chart of a verification procedure process;
[0046] Figure 2f The figure shows a flow chart of a sign-off and release process;
[0047] Figure 3 It is a structural schematic diagram of a diagnostic component code publishing device provided by an embodiment of the present disclosure;
[0048] Figure 4 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0049] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0051] Figure 1a The present invention is a flowchart of a method for publishing a diagnostic component code provided by an embodiment of the present invention, and the method can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, etc. Figure 1b The diagram shows a schematic diagram of the system structure of a diagnostic component code release. Figure 1a As shown, the method provided in this embodiment includes the following steps:
[0052] S101. In response to a compile operation of a diagnostic component, a code file associated with the diagnostic component is retrieved from a preset code library; wherein the preset code library is used to store code files of different diagnostic components.
[0053] In one example, the execution entity is an automated verification platform. The diagnostic component is used to form a server production test system. Each diagnostic component includes multiple scripts and tools. Multiple diagnostic components are combined to perform production tests on the server during the server production process. In one example, the code of the diagnostic component is stored in a code server. In the specific execution, the preset code library is obtained from the code server through the automated verification platform. Different product lines are used as a code library, and the diagnostic components under the same product line are managed as a branch. In this embodiment, the preset code library includes several diagnostic component code files. Specifically, the preset code library adopts the mainstream git platform and deploys an independent code server to record detailed code submission information such as submitter, submission time, change point, etc., which makes it convenient to trace the code, facilitate problem troubleshooting and code rollback. In addition, the preset code library and user information are backed up regularly at dawn every day, and backed up to two different physical machines at the same time, which is more secure and reliable. For details, please refer to Figure 1c A schematic diagram of a management structure of a preset code library is shown.
[0054] S102: Compile the code file according to preset rules to obtain a compilation result.
[0055] In one example, the preset rule is a pre-configured rule. In this embodiment, the compilation server is called by the automated verification platform to compile the code file to obtain the compilation result. The compilation server is used to execute the code compilation action and to store the compilation version, version change record, and compilation record.
[0056] S103: Retrieve a preset test case, verify the compilation result, and obtain a verification result.
[0057] In one example, a test machine is called through an automated verification platform, a preset test case is called on the test machine, and the compilation result is verified to obtain a verification result.
[0058] In one example, the preset test cases are unit test cases, integration test cases, and system test cases, which correspond to the testing of single scripts, functional modules, and the entire system, respectively. Various test case design methods are used to simulate data anomalies, hardware anomalies, operating environment anomalies, etc. while verifying the basic functions of the software to examine the robustness and stability of the software. According to the use case design requirements, the test case database is maintained, and the test cases, test machines, test data, etc. are associated. At the same time, different test programs with a series of functions such as deployment, error annotation, recovery, and execution are developed to customize different test contents for different functions of the diagnostic components.
[0059] In an example, all test programs associated with the preset test cases are executed in sequence. When there is a test failure, an early warning email is automatically sent to the user. At the same time, all test results and test status are saved, and breakpoint retesting and fast debugging are supported. After all the test programs associated with the relevant use cases are executed and passed, the diagnostic components, checksum, code submission records, change information, compilation records, test records and other related content that have passed the test are automatically synchronized.
[0060] S104: If the verification result indicates that the compilation result is passed, the compilation result is sent to a preset terminal.
[0061] In one example, if the verification result indicates that the compilation result is passed, the sign-off process is automatically triggered, the user is automatically matched according to the release version, and a sign-off notification is sent to the user. After the sign-off, the automated verification platform synchronizes the release version from the R&D intranet to the preset terminal. After the factory cloud system detects it, it can be imported into the factory for use as needed. The benefit of this setting is that while ensuring code security and release rigor, it improves the timeliness and convenience of version release.
[0062] The disclosed embodiment provides a method for publishing diagnostic component code, the method comprising: in response to the compilation operation of the diagnostic component, calling the code file associated with the diagnostic component from a preset code library; wherein the preset code library is used to store code files of different diagnostic components; according to preset rules, compiling the code file to obtain a compilation result; calling a preset test case, verifying the compilation result, and obtaining a verification result; if the verification result indicates that the compilation result is passed, sending the compilation result to a preset terminal. The use of this technical solution can improve the publishing efficiency of the diagnostic component code without manual operation.
[0063] Figure 2a 1 is a flow chart of a method for publishing a diagnostic component code provided by an embodiment of the present disclosure, and the method can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, etc. Figure 2a As shown, the method provided in this embodiment includes the following steps:
[0064] S201. If the compilation operation of the diagnostic component is a compilation operation of the diagnostic component initiated by the user, in response to the compilation operation of the diagnostic component initiated by the user, obtain a file list of the diagnostic component corresponding to the compilation operation of the diagnostic component initiated by the user in a preset code library.
[0065] In one example, the preset code library is used to store code files of different diagnostic components. The compilation operation of the diagnostic component initiated by the user is generally an emergency compilation. Specifically, the implementation process of the emergency compilation is as follows: the user logs in to the automated verification platform and triggers the emergency compilation operation in the setting interface. According to the prompts, select the component to be urgently compiled, the version number to be released, the file list to be urgently compiled, the time range to obtain the change point, and the test range to be performed. After the setting is completed, click Run, and the platform starts to process the compilation task according to the setting information. The automated verification platform obtains the source code of the branch according to the set compilation component, and obtains the changes of each file in the corresponding time range according to the file list and the time range to obtain the change point. If one or more files cannot be obtained in the corresponding branch, exit and report an error. If the corresponding changes of one or more files cannot be obtained within the preset time range, such as within 1 day, 12 hours, and 1 hour, exit and report an error. When reporting an error, the automated verification platform obtains the user's mailbox and sends the specific error information to the user's mailbox.
[0066] S202: Obtain code files in a file list of a diagnostic component.
[0067] In one example, if there is no error, the previous version of the target component is backed up first, and then the latest code of each file in the file list of the corresponding diagnostic component is obtained in sequence according to the preset rules, and the specified files are compiled and updated based on the previous version of the target component, and the files are repackaged with the preset version number, and a compilation record is generated at the same time. The changes of each file in the list within the preset time range are obtained in sequence, and a change record is generated.
[0068] S203: If the compilation operation of the diagnostic component is a compilation operation of the diagnostic component in a scheduled task, in response to the compilation operation of the diagnostic component in the scheduled task, a code file associated with the diagnostic component is retrieved from a preset code library according to a preset time period.
[0069] In an example, the time points at which each component in a scheduled task needs to be compiled are obtained, such as component A is compiled at 5 pm every Monday, component B is compiled at 6 pm every Wednesday, component C is compiled at 5 pm every Thursday, etc.
[0070] In one example, the scheduled task includes the name of the preset component, the released version number, the test scope to be executed, etc.
[0071] S204: Obtain historical compilation records.
[0072] In one example, after reaching the time point of the compilation operation, the automated verification platform obtains the historical compilation record.
[0073] S205: If the historical compilation record indicates that the compilation is performed for the first time, the code file is compiled according to a preset rule to obtain a compilation result.
[0074] In an example, if the historical compilation record represents the first compilation, that is, there is no last_version file with commitID under the corresponding component of the corresponding task of the automated verification platform, it is determined to be the first compilation, and all the codes of the branch where the component is located are obtained, and the compilation and packaging are performed to obtain the compilation result, wherein the compilation result is packaged into a preset version number, a compilation record is generated, and the change record of the branch within one week is obtained.
[0075] S206: If the historical compilation record indicates that it is not the first compilation, obtain the last compilation record, and determine the compilation result according to the last compilation record.
[0076] In one example, determining the compilation result according to the last compilation record includes:
[0077] According to the last compilation record, find the update record of the last compilation record;
[0078] If there is an update record of the last compilation record, the code file is compiled according to the preset rules to obtain the compilation result;
[0079] If there is no update record of the last compilation record, the compilation result corresponding to the last compilation record is called.
[0080] If there is a previous compilation record, try to obtain the commit record between the commitID of the last compilation of the current branch and the latest commitID of the current branch. If there is a commit record between the two commitIDs, first back up the previous version of the target component, then obtain all the code of the branch where the component is located, recompile and package it into a preset version number, generate a compilation record, and obtain the change record between the commitID of the last compilation of the branch and this compilation. After the compilation is completed, record the commitID of this compilation, and update it to the compilation record after the official release for use in the next scheduled compilation. If there is no commit record between the two commitIDs, it means that there has been no update to the branch since the last compilation, and there is no need to recompile and release. A notification email will be sent when the task is completed. For details, please refer to Figure 2b Shown is a schematic diagram of a compilation process.
[0081] S207: Retrieve a preset test case and deploy a test environment according to the preset test case.
[0082] In one example, the preset test cases are developed and designed in Excel format. According to the use case maintenance specifications and design specifications, unit test cases, integration test cases and system test cases are designed, corresponding to the testing of single scripts, functional modules and the entire system respectively. Use equivalence classes, boundary values, error speculation, decision coverage, path coverage and other methods to design use cases. While verifying the basic functions of the diagnostic components, simulate data anomalies, hardware anomalies, operating environment anomalies, etc. to examine the robustness and stability of the software. At the same time, the dependencies between the preset test cases are written and maintained in the testcase.caselist in the database below to determine the execution order.
[0083] In an example, the test case information table caselist is maintained in the testcase library, which mainly maintains key fields such as the 8-digit test case code casenum, the test case type casetype, and the dependent case code casesdeps, which are mainly used to confirm which test cases are executed, the execution type, and the execution priority. The test item information table casescript is maintained in the testcase library, which mainly maintains key fields such as the case type casetype, the case-related file scripts, and the corresponding test item testitem, which are mainly used to retrieve which test cases and test items need to be executed for the changed files. The expected error information table caseerrinfo is maintained in the testcase library, which mainly maintains the case code casenum, the order number, where one order corresponds to one machine, the corresponding log name logname, and the expected error information experr, which is mainly used to confirm whether the error information meets expectations when the corresponding machine executes the corresponding case. All normal data such as the order number, machine code, BOM information, and component information related to all test machines are maintained in the diagnostic component database. Maintain the normal data corresponding to all test machines in the diagnostic component database, copy a copy of the correct-order number data, such as order number 20240625, and back up a copy of correct-20240625 to restore the original data before each execution of the use case. Maintain the BOM error data corresponding to all use cases in the diagnostic component database, marked with use case code-order number, such as PREC0002-202406251PREC0002, to identify and deploy the corresponding error data when executing the corresponding use case. Maintain the component information error data corresponding to all use cases in the diagnostic component database, and replace the last 8 digits of the component code in the normal BOM with the use case code as the error component code, such as V0023151PREC0002, to associate the corresponding error data when executing the corresponding use case. Set up a whitelist in testcase.machinelist, mainly maintaining fields such as machine model name, machine model serial number, and whitelist keywords. It supports setting up a whitelist for each test machine under the use case. Multiple whitelist keywords are separated by "," such as ecc, ac lost, and crc, so that some known problems in the test machine itself can be ignored during the test. If the incorrectly annotated data is a file, it is maintained in a fixed directory. The backup file used to restore the original data is named correct-20240625-03371.ini. The incorrectly annotated file is named with the use case code-order number-original normal file name, such as PRDD0011-20240625-03371.ini, which is used to identify and deploy the corresponding incorrectly annotated data when executing the corresponding use case.Maintain the order number, model, machine code, BMCIP, and MAC address of the relevant test machines in config.ini, and list them in the automated verification platform in a list format. By default, all test machines are used to perform verification, and some machines can also be selected as needed. In testcase.casestatus, set the key fields such as task name jobname, task number jobid, order number listid, machine code sn, case code casenum, execution status status, and execution time processtime. Only save the latest status for initialization, processing, and tracking of case execution progress. In testcase.case_exec_record, set the key fields such as task name jobname, task number jobid, order number listid, machine code sn, case code casenum, execution status status, and execution time processtime. Add a new record at each step of the case execution to save all case execution records.
[0084] S208. Based on the test environment, run the compilation result to obtain the verification result.
[0085] In one example, based on the test environment, the process of running the compilation result is as follows: the deployment program performs initialization actions according to whether to recompile and whether to execute preset test cases set by the user. If recompiling is selected, the tested diagnostic component and the change list are obtained in the result directory of the intelligent compilation module. When the tested diagnostic component contains files associated with the use case, the component is replaced in the fixed directory corresponding to the error-injected use case to ensure that the latest component is used during error injection and recovery. If the use case is selected to be executed, the test case code associated with the change is queried in the testcase according to the change list to generate a basic use case list. Query the error test item corresponding to the previous jobid under the same jobname. If there is, obtain the corresponding use case code A and its dependent use case code B, and write the dependent use case code B and use case code A into the execution use case list in sequence. Check whether there is a use case code that failed to execute last time in the basic use case list. If there is, remove it and do not repeat it. Obtain the dependent use case code corresponding to the use case code in the basic use case list in sequence, and write it into the execution use case list in sequence with the dependent use case in front and the basic use case in the back. If you choose not to compile again, obtain the tested diagnostic component, the change list and the use case list in the working directory of the previous jobid under the same jobname on the publishing platform. Determine whether the user chooses to retest at a breakpoint. If not, delete the records related to the task name jobname under testcase.casestatus and prepare to start the test from the beginning; otherwise, keep the original records for retesting at a breakpoint. Figure 2c Shown is a flow chart of a deployment procedure.
[0086] In an example, the automatic verification module handles the following aspects: recovery, error injection, verification, etc.
[0087] The data recovery program is called by the verification program before each execution of the use case or before the full test, and the correct information corresponding to all database-related use cases is restored to the original database, such as BOM information, component information, MAC information, Flash information, etc. All the information contained in the original database is copied from the correct data to the original data location through retrieval and update. The correct information corresponding to all file-related use cases is restored to the original file, such as BOARD information, configuration information, etc., and the information in the correct is replaced with the corresponding line item in the corresponding original file name through retrieval and replacement. There are regular decompression, deletion, and compression actions before and after the replacement. The above compressed components are transmitted to the Diag Server.
[0088] When the user chooses to execute a test case, the error-notification program is called in the test case execution phase of the automatic verification module: read the execution test case list. If it is empty, no test case to be executed is matched, and the execution is aborted. If it is not empty, obtain the latest record of the task name jobname, order number listid, and processtime in the machine code sn in testcase.casestatus, and obtain its test case code casenum and execution status status.
[0089] If no record is obtained, it means that it is the first execution. Set the first use case as current_case, query the use case type corresponding to the use case, enter the corresponding use case deployment function, call the use case data with the corresponding use case code as the prefix / suffix to execute the deployment action, and after successful deployment, insert a record of task name jobname, task number jobid, order number listid, machine code sn, use case code casenum, execution status status=deploy, and current execution time processtime into testcase.casestatus, and the deployment of the error-injected data is completed.
[0090] If the record is obtained and the status is pass or continue (fail-continue), then obtain the next line of case code of casenum in the execution case list, set it as current_case, query the case type corresponding to the case, enter the corresponding case deployment function, call the case data with the corresponding case as prefix / suffix to execute the deployment action, and after successful deployment, update the task name jobname, task number jobid, order number listid, machine code sn corresponding to the case code casenum = current_case, execution status status = deploy, current execution time processtime in testcase.casestatus, and the deployment of the error-noted data is completed.
[0091] If the record is obtained and casestatus is not pass or continue, determine whether the user chooses to retest at the breakpoint. If the breakpoint retest is not selected, execute the use cases in the list from the beginning: ① Set the first use case to current_case, query the use case type corresponding to the use case, enter the corresponding use case deployment function, call the use case data with the corresponding use case as the prefix / suffix to perform the deployment action, and after the deployment is successful, insert a record of the task name jobname, task number jobid, order number listid, machine code sn, use case code casenum = current_case, execution status status = deploy, and current execution time processtime in testcase.casestatus, and the deployment of the error-notified data is completed.
[0092] If you choose to retest at a breakpoint, the queried casenum will be deployed. After deployment is successful, a record of the task name jobname, task number jobid, order number listid, machine code sn, case code casenum = the above casenum, execution status status = deploy, and current execution time processtime will be inserted or updated in testcase.casestatus, and the deployment of the error data will be completed. The test cases will be executed in sequence until the last test case is judged to have passed. The execution status status of the last test case will be set to last, indicating that all test cases have been executed. See also Figure 2d The figure shows a flowchart of an injection error program processing.
[0093] In one example, after the automated verification platform calls the deployment program to complete the deployment operation, it calls the verification program. The verification program processing flow is as follows:
[0094] First, determine whether the user has chosen to skip verification. If so, the verification will be skipped and the verification platform will automatically call the version upload program. After processing various data, the compilation record, change record, diagnostic component release package, release notes, etc. will be uploaded to the corresponding directory on the FTP of the configuration management system. In order to distinguish different components and versions, the general naming format is .. / jobname / projectname / processname_version_time / . The verification platform calls the sign-off and release module.
[0095] If you do not choose to skip verification, first call the recovery program to restore all test data to normal. Then determine whether to choose to retest at breakpoints. If you do not choose to retest at breakpoints, reset all test machines. Determine whether to choose to execute use case testing. If not, perform full testing on all associated test machines. During the full testing process, if an error is reported, check whether the error information is in the whitelist. If so, change the test result of the test item to pass and continue with the subsequent tests. If it is not in the whitelist, determine whether it is in fail-continue mode. If so, continue with the subsequent tests (the diagnostic component itself will make test records, and there is no need to record them separately). If it is not judged in the previous item that the fail-continue mode is in place, an error is reported, the verification platform detects the error status, sends an error message to the user, and the entire process ends.
[0096] If you choose to execute the use case test, call the error injection program to inject the use case data. After the call is completed, check whether the status of the relevant record in the testcase.casestatus table is deploy. If it is, it means that the data injection is completed. Customize the current round of test projects according to the test content corresponding to the use case, start all related test machines to start the use case test, and set the status of the relevant records in the testcase.casestatus table to start, and add relevant records in testcase.case_exec_record. During the execution process, poll once every 10 minutes to query the use case execution status. After the execution is completed, determine whether the test results meet expectations (corresponding information in testcase.caseerrinfo). If they are consistent, the current use case is executed successfully, and the status is set to pass. Add relevant records in testcase.case_exec_record. Call up the recovery program, then call up the error injection program, and start the execution of the next use case.
[0097] If it does not meet expectations, check whether the error message is in the whitelist. If so, set the status to pass and add relevant records in testcase.case_exec_record. Call the recovery program, then call the error injection program, and determine whether the status is deploy. If so, continue to call the relevant test machine to start the next test case execution.
[0098] If it is not in the whitelist, it means that the current test case execution fails. Check whether it is in fail-continue mode. If so, set the status to continue and add relevant records in testcase.case_exec_record. Call the recovery program, then call the error injection program, and check whether the status is deploy. If so, continue to call the relevant test machine to start the next test case execution.
[0099] When status changes to last, it means that all test cases have been executed. Then call the recovery program to restore normal data, reset all test machine configuration information, and start full-scale testing. The subsequent operations are the same as i.
[0100] If it is not in the whitelist and is not in fail-continue mode, an error is reported. The verification platform detects the error status and sends an error message to the user, and the entire process ends.
[0101] When all tests are executed, determine whether it is in fail-continue mode. If so, check whether the status in the use case test process is in construct state, or whether there is an error record in the log record of the diagnostic component. If so, report an error, and the verification platform sends an error message to the user, and the whole process ends.
[0102] Otherwise, if the entire test passes, the verification platform automatically calls the version upload program, processes various data, and uploads the compilation records, change records, test records, diagnostic component release packages, etc. to the corresponding directory on the FTP of the configuration management system. In order to distinguish different components and versions, the general naming format is .. / jobname / projectname / processname_version_time / . The verification platform calls the sign-off and release module.
[0103] If breakpoint retest is selected, the last execution status of all associated test machines is obtained:
[0104] If you select to execute a test case, first determine the test case execution status, that is, query the latest status of the associated test machine under the task jobname in testcase.casestatus. If it is last, it means that all test cases were executed last time. Query the last test item in the full test, locate the test to the test item, and execute subsequent tests.
[0105] If the status of the previous query is not last, call up the data recovery program, call up the error injection program, and start executing the use case test.
[0106] If no execution case is selected, the last test item in the full test will be queried directly, the test will be located at the test item, and subsequent tests will be executed. The advantage of this setting is that in the scenario where the component is updated quickly, verification can be performed automatically, thereby improving the security of the component and reducing abnormal error reporting. Figure 2e Shown is a flowchart of a verification program process.
[0107] S209: If the verification result indicates that the compilation result is passed, the compilation result is sent to the configuration management system, and the configuration management system sends the compilation result to a preset terminal.
[0108] In one example, after the automated verification platform completes the upload action, it automatically triggers the review and release process, and at the same time passes the change record, compilation record, test report, release notes, diagnostic component release package, checksum, user and other information to the configuration management server. The configuration management server obtains the version storage path based on the above information and reads the relevant records to display the relevant information. The configuration management server obtains the user's mailbox based on the above information and sends a review reminder. The configuration management server checks whether it has been reviewed every 12 hours. If it has not been reviewed, a review reminder is sent to the user. When the user reviews, if the review fails, the user will be notified of the reason for the review rejection by email, and reprocessing is required if the review needs to be released. If the review passes, the configuration management server automatically transmits the change record, compilation record, test report, release notes, diagnostic component release package, checksum, etc. to the office network. The storage location of the published content on the configuration management page is displayed, and the version information, release notes, test records, review records and other information are displayed. Finally, a notification is sent to the user, and the diagnostic component is officially released for use. For details, please refer to Figure 2f The figure shows a flowchart of a sign-off and release process.
[0109] The embodiment of the present disclosure provides a method for publishing diagnostic component code, the method comprising: if the compilation operation of the diagnostic component is a compilation operation of the diagnostic component initiated by the user, in response to the compilation operation of the diagnostic component initiated by the user, obtaining a file list of the diagnostic component corresponding to the compilation operation of the diagnostic component initiated by the user in a preset code library. Obtaining code files in the file list of the diagnostic component. If the compilation operation of the diagnostic component is a compilation operation of the diagnostic component in a scheduled task, in response to the compilation operation of the diagnostic component in the scheduled task, calling the code file associated with the diagnostic component from the preset code library according to a preset time period. Obtaining historical compilation records. If the historical compilation record is characterized as the first compilation, compiling the code file according to preset rules to obtain a compilation result. If the historical compilation record is characterized as a non-first compilation, obtaining the last compilation record, and determining the compilation result according to the last compilation record. Retrieving a preset test case, and deploying a test environment according to the preset test case. Based on the test environment, running the compilation result, and obtaining a verification result. If the verification result indicates that the compilation result is passed, sending the compilation result to the configuration management system, and sending the compilation result to the preset terminal based on the configuration management system. This technical solution is adopted to improve the release timeliness, develop test cases to improve verification coverage, ensure the release quality, and meet the frequent, fast and stable update requirements of system diagnostic software.
[0110] Figure 3 1 is a schematic diagram of a structure of a diagnostic component code publishing device provided by an embodiment of the present disclosure. The diagnostic component code publishing device can be understood as the above-mentioned electronic device or a part of the functional modules in the above-mentioned electronic device. Figure 3 As shown, the diagnostic component code issuing device 30 includes:
[0111] The retrieval module 301 is used to retrieve the code file associated with the diagnostic component from a preset code library in response to the compilation operation of the diagnostic component; wherein the preset code library is used to store code files of different diagnostic components;
[0112] Compilation module 302, used to compile the code file according to preset rules to obtain a compilation result;
[0113] The verification module 303 is used to call a preset test case, verify the compilation result, and obtain a verification result;
[0114] The sending module 304 is configured to send the compilation result to a preset terminal if the verification result indicates that the compilation result is passed.
[0115] In one example, the compilation operation of the diagnostic component includes a compilation operation of the diagnostic component initiated by a user or a compilation operation of the diagnostic component in a scheduled task; if the compilation operation of the diagnostic component is a compilation operation of the diagnostic component initiated by a user, the module 301 is called, specifically for:
[0116] In response to a compilation operation of a diagnostic component initiated by a user, a file list of a diagnostic component corresponding to the compilation operation of the diagnostic component initiated by the user is obtained in a preset code library; and a code file in the file list of the diagnostic component is obtained.
[0117] In one example, if the compilation operation of the diagnostic component is the compilation operation of the diagnostic component in the scheduled task, the module 301 is called, specifically for:
[0118] In response to the compiling operation of the diagnostic component in the scheduled task, a code file associated with the diagnostic component is retrieved from a preset code library according to a preset time period.
[0119] In one example, the compiling module 302 is specifically used to: obtain a historical compilation record; if the historical compilation record indicates the first compilation, compile the code file according to a preset rule to obtain a compilation result;
[0120] If the historical compilation record indicates that it is not the first compilation, the last compilation record is obtained, and the compilation result is determined according to the last compilation record.
[0121] In one example, the compiling module 302 is specifically configured to:
[0122] According to the last compilation record, find the update record of the last compilation record;
[0123] If there is an update record of the last compilation record, the code file is compiled according to the preset rules to obtain the compilation result;
[0124] If there is no update record of the last compilation record, the compilation result corresponding to the last compilation record is called.
[0125] In one example, the verification module 303 is specifically configured to:
[0126] Retrieve preset test cases and deploy the test environment according to the preset test cases;
[0127] Based on the test environment, run the compilation results to obtain the verification results.
[0128] In one example, the sending module 304 is specifically configured to:
[0129] The compilation result is sent to the configuration management system, and the compilation result is sent to the preset terminal based on the configuration management system.
[0130] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0131] An embodiment of the present disclosure further provides an electronic device, which includes: a memory, in which a computer program is stored; and a processor, which is used to execute the computer program. When the computer program is executed by the processor, the method of any of the above embodiments can be implemented.
[0132] For example, Figure 4 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 4 , which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing the embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0133] like Figure 4 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0134] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0136] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0137] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0138] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0139] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to the compilation operation of the diagnostic component, retrieves a code file associated with the diagnostic component from a preset code library; wherein the preset code library is used to store code files of different diagnostic components;
[0140] According to the preset rules, the code file is compiled to obtain the compilation result; the preset test case is called to verify the compilation result to obtain the verification result; if the verification result indicates that the compilation result is passed, the compilation result is sent to the preset terminal.
[0141] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0143] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0144] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0145] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0146] The embodiments of the present disclosure also provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0147] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0148] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for publishing a diagnostic component code, characterized in that: include: In response to the compiling operation of the diagnostic component, a code file associated with the diagnostic component is retrieved from a preset code library; wherein the preset code library is used to store code files of different diagnostic components; Compile the code file according to preset rules to obtain a compilation result; Retrieving a preset test case, verifying the compilation result, and obtaining a verification result; If the verification result indicates that the compilation result is passed, the compilation result is sent to a preset terminal.
2. The method according to claim 1, characterized in that The compiling operation of the diagnostic component includes a compiling operation of the diagnostic component initiated by a user or a compiling operation of the diagnostic component in a scheduled task; if the compiling operation of the diagnostic component is a compiling operation of the diagnostic component initiated by a user, then in response to the compiling operation of the diagnostic component, the code file associated with the diagnostic component is retrieved from a preset code library, including: In response to a compile operation of a diagnostic component initiated by a user, obtaining, in the preset code base, a file list of the diagnostic component corresponding to the compile operation of the diagnostic component initiated by the user; Get the code file from the file list of the diagnostic component.
3. The method according to claim 1, characterized in that If the compilation operation of the diagnostic component is a compilation operation of the diagnostic component in a scheduled task, then in response to the compilation operation of the diagnostic component, the code file associated with the diagnostic component is retrieved from a preset code library, including: In response to the compiling operation of the diagnostic component in the scheduled task, a code file associated with the diagnostic component is retrieved from the preset code library according to a preset time period.
4. The method according to claim 3, characterized in that The code file is compiled according to the preset rules to obtain a compilation result, including: Get historical compilation records; If the historical compilation record indicates that the compilation is performed for the first time, the code file is compiled according to a preset rule to obtain the compilation result; If the historical compilation record indicates that it is not the first compilation, the last compilation record is obtained, and the compilation result is determined according to the last compilation record.
5. The method according to claim 4, characterized in that The determining the compilation result according to the last compilation record includes: According to the last compilation record, searching for an update record of the last compilation record; If there is an update record of the last compilation record, compile the code file according to a preset rule to obtain a compilation result; If there is no update record of the last compilation record, the compilation result corresponding to the last compilation record is called.
6. The method according to claim 1, characterized in that The calling of the preset test case and verifying the compilation result to obtain the verification result includes: Retrieve a preset test case and deploy a test environment according to the preset test case; Based on the test environment, the compilation result is run to obtain a verification result.
7. The method according to claim 1, characterized in that The sending the compilation result to a preset terminal includes: The compilation result is sent to a configuration management system, and the compilation result is sent to a preset terminal based on the configuration management system.
8. A device for issuing diagnostic component codes, characterized in that: include: A calling module, configured to call a code file associated with the diagnostic component from a preset code library in response to a compile operation of the diagnostic component; wherein the preset code library is used to store code files of different diagnostic components; A compiling module, used to compile the code file according to preset rules to obtain a compilation result; A verification module is used to call a preset test case, verify the compilation result, and obtain a verification result; The sending module is used for sending the compilation result to a preset terminal if the verification result indicates that the compilation result is passed.
9. An electronic device, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.