An error code generation method and related equipment

By detecting and adjusting the differences in the error code base file, the problem of duplicate error codes in application development was solved, improving development efficiency and resource utilization.

CN114780274BActive Publication Date: 2025-11-11AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210415223.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2025-11-11
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

During application development, multiple developers and version management can lead to different error code generation times, which can easily result in duplicate error codes that are difficult to distinguish, thus reducing development efficiency.

Method used

By obtaining the first local error code base file and the second remote error code base file, it is detected whether there is a duplicate target error code, and the first local error code is adjusted according to the difference to generate the second local error code, ensuring that the error code is not duplicated.

Benefits of technology

It enables the overall arrangement and updating of error codes, improving application development efficiency and reducing maintenance costs and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780274B_ABST
    Figure CN114780274B_ABST
Patent Text Reader

Abstract

This disclosure provides an error code generation method and related equipment. By adding error codes to a first local error code base file and a second remote error code base file relative to the first remote error code base file, a duplicate target error code is found. Then, each first local error code in the first local error code base file corresponding to the target error code is adjusted to a second local error code. This ensures that the second local error codes in the first local error code base file do not duplicate the first remote error codes in the second remote error code base file, which is beneficial for overall error code arrangement and updating, and improves the overall development efficiency of the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to an error code generation method and related equipment. Background Technology

[0002] When people use software and hardware, errors may occur where the software or hardware malfunctions. Since there are many types of errors, error codes are designed for error responses during application development to differentiate between them. If an error occurs during software or hardware operation, a pre-designed judgment and identification process will determine the corresponding error code and display it to the operator, allowing the operator to quickly find the specific reason for the software or hardware malfunction.

[0003] Currently, in the application development process, default error codes are typically used as placeholders, and then uniformly arranged and replaced at the end. Using default error code placeholders is the most common non-registration approach. During application development, the application developer directly enters a default error code as a placeholder. After the application is completed, the default error code is found through code scanning and updated to the uniformly arranged error code through text replacement.

[0004] However, current application development often involves multiple developers collaborating on projects within a certain timeframe. Due to differences in development models and version management methods among project teams, the timing of error code generation may also differ, which can easily lead to duplicate and difficult-to-distinguish error codes, increasing the difficulty of error code rearrangement and replacement, and reducing the overall development efficiency of the application. Summary of the Invention

[0005] In view of the above problems, this disclosure provides an error code generation method and related equipment to overcome or at least partially solve the above problems. The technical solution is as follows:

[0006] An error code generation method, comprising:

[0007] Obtain a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one first local error code added relative to the first remote error code base file;

[0008] A second remote error code base file is obtained, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one first remote error code newly added relative to the first remote error code base file, and the at least one first remote error code includes at least one second error code base;

[0009] Detect whether there is a common target error code among the at least one first local error code and the at least one first remote error code; if so, determine the difference between the first error code base and the second error code base that are at the same error location as the target error code.

[0010] Based on the difference, each of the first local error codes at the location corresponding to the target error code is adjusted to generate a second local error code.

[0011] Optionally, obtaining the first local error code base file includes:

[0012] Obtain the first remote error code base file from a remote code server, wherein the first remote error code base file includes at least one of the first error code bases;

[0013] During the application development process based on the first remote error code base file, the first local error code is generated according to the first error code base.

[0014] After developing the application based on the first remote error code base file, a first local error code base file is obtained, which includes the first error code base and the first local error code.

[0015] Optionally, obtaining the second remote error code base file includes:

[0016] Obtain the second remote error code base file from the remote code server.

[0017] Optionally, after generating the second local error code, the method further includes:

[0018] The first local error code base file, which includes the second local error code, is merged with the second remote error code base file to generate a third local error code base file;

[0019] The third local error code base file is submitted to the remote code server.

[0020] An error code generation apparatus includes: a first obtaining unit, a second obtaining unit, a first detecting unit, a first determining unit, and a first generating unit.

[0021] The first obtaining unit is used to obtain a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one first local error code added relative to the first remote error code base file;

[0022] The second obtaining unit is used to obtain a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one first remote error code newly added relative to the first remote error code base file, and the at least one first remote error code includes at least one second error code base;

[0023] The first detection unit is used to detect whether there is a common target error code among the at least one first local error code and the at least one first remote error code; if so, the first determination unit is triggered.

[0024] The first determining unit is used to determine the difference between the first error code base and the second error code base, which are at the same location as the error corresponding to the target error code;

[0025] The first generation unit is used to adjust each of the first local error codes under the error location corresponding to the target error code according to the difference, and generate a second local error code.

[0026] Optionally, the first obtaining unit includes: a first obtaining subunit, a first generating subunit, and a second obtaining subunit.

[0027] The first obtaining subunit is configured to obtain the first remote error code base file from the remote code server, wherein the first remote error code base file includes at least one of the first error code bases;

[0028] The first generation subunit is used to generate the first local error code according to the first error code base during the application development process based on the first remote error code base file;

[0029] The second obtaining subunit is used to obtain a first local error code base file, which includes the first error code base and the first local error code, after application development based on the first remote error code base file.

[0030] Optionally, the second obtaining unit is specifically used to obtain a second remote error code base file from the remote code server.

[0031] Optionally, the device further includes: a first merging unit and a first submitting unit.

[0032] The first merging unit is configured to merge the first local error code base file, which includes the second local error code, as the second local error code base file with the second remote error code base file to generate a third local error code base file;

[0033] The first submission unit is used to submit the third local error code base file to the remote code server.

[0034] A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the error code generation method described in any of the preceding claims.

[0035] An electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the error code generation method described above.

[0036] Using the above technical solution, this disclosure provides an error code generation method and related equipment, which obtains a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one newly added first local error code relative to the first remote error code base file; obtains a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, and the second remote error code base file includes at least one newly added first remote error code relative to the first remote error code base file, and at least one first remote error code includes at least one second error code base; detects whether there is a common target error code among at least one first local error code and at least one first remote error code, and if so, determines the difference between the first error code base and the second error code base that are in the same error position corresponding to the target error code; and adjusts each first local error code under the error position corresponding to the target error code according to the difference to generate a second local error code. This disclosure identifies duplicate target error codes by adding error codes to the first local error code base file and the second remote error code base file relative to the first remote error code base file. It then adjusts each first local error code in the first local error code base file corresponding to the target error code to a second local error code, ensuring that the second local error codes in the first local error code base file do not overlap with the first remote error codes in the second remote error code base file. This facilitates the overall arrangement and updating of error codes and improves the overall development efficiency of the application.

[0037] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description

[0038] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this disclosure. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0039] Figure 1 A flowchart illustrating one implementation of the error code generation method provided in this disclosure is shown.

[0040] Figure 2 A flowchart illustrating another implementation of the error code generation method provided in this disclosure is shown.

[0041] Figure 3 A flowchart illustrating another implementation of the error code generation method provided in this disclosure is shown.

[0042] Figure 4 A schematic diagram of an error code generation apparatus provided in an embodiment of this disclosure is shown. Detailed Implementation

[0043] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0044] To define the basis for error code generation and arrangement, embodiments of this disclosure can pre-configure the generation and arrangement of error codes. Specifically, embodiments of this disclosure can configure the generation and arrangement of error codes before application development. Optionally, Table 1 shows a configuration rule for error code generation and arrangement provided by an embodiment of this disclosure.

[0045] Table 1

[0046]

[0047] Optionally, the configuration rules provided in this disclosure can be configured in the form of an XML configuration file, allowing for the addition or removal of configuration items, modification of character types, and changes in the configuration rules within the XML configuration file. This XML configuration file can be deployed to the application's code repository or distributed to the devices of various application developers.

[0048] The embodiments disclosed herein, through non-embedded and customizable configuration rules, can meet the customization needs of application developers in multiple scenarios and are easy to promote.

[0049] like Figure 1 The diagram shows a flowchart of one embodiment of the error code generation method provided in this disclosure. The error code generation method may include:

[0050] S100. Obtain a first local error code base file, wherein the first local error code base file is generated based on the first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one first local error code added relative to the first remote error code base file.

[0051] The error code base file can be a code repository containing multiple error codes. The error code base can be the last bit of the error code at the location of each error in the remote error code base file. For example, assuming the remote error code base file contains error codes MMOOYQ00000 to MMOOYQ00041, where "MMOOYQ" represents the location of the error, then the error code base at that location is "MMOOYQ00041".

[0052] The first local error code is generated sequentially based on the error code base corresponding to the location of the error when an error is discovered during application development on the local device. For example, assuming the error code base for any error location is "MMOOIZ00083", when a new error is discovered at the location "MMOOIZ", the first local error code mapped to that error is "MMOOIZ00084". When another new error is discovered at the location "MMOOIZ", the first local error code mapped to that error is "MMOOIZ00085", and so on.

[0053] Optional, based on Figure 1 The method shown is as follows: Figure 2 As shown, this is a flowchart illustrating another implementation of the error code generation method provided in this disclosure. Step S100 may include:

[0054] S110. Obtain a first remote error code base file from a remote code server, wherein the first remote error code base file includes at least one first error code base.

[0055] The remote code server can store remote error code base files with different generation times. Typically, in this embodiment of the disclosure, the remote error code base file whose generation time is closest to the current time is determined as the first remote error code base file in the remote code server.

[0056] The remote code server can record, in text line format, the CommitHash of the remote error code base file and a list of the latest incrementing error codes belonging to the same error location. Colons are used to describe the relationship between the CommitHash and the error code base, and error codes are separated by commas. The CommitHash is a long string of letters and numbers generated by performing a SHA-1 hash algorithm on a code version commit using the distributed control system (Git), containing information about the commit; it can be considered a unique ID for the commit. The distributed control system allows developers to clone a complete code repository onto their local machine.

[0057] The embodiments of this disclosure can parse the remote error code base file to determine the submission record of each time the remote error code base file was generated in history, thereby using cursor-based updates to obtain the error code base at any error position, which facilitates the rearrangement of error codes.

[0058] This disclosure embodiment registers the CommitHash of the remote error code base file, forming a traceable error code rearrangement mechanism that can establish the association between the error codes in the production environment and their Commit Hash values.

[0059] S120. During the application development process based on the first remote error code base file, a first local error code is generated according to the first error code base.

[0060] Specifically, in this embodiment of the disclosure, when an application code segment at any location of an error is found to require the insertion of an error code, an error code generation component is invoked to obtain an error code insertion statement for insertion into the application code segment. This error code insertion statement includes a first local error code calculated based on the error code base at the location of the error. At this point, the first local error code can be used in a local test scenario. The error code insertion statement has a certain unique matching attribute. For example, a unique application code file and its code text for error code insertion can be locked through pattern matching.

[0061] The error code generation component can be a non-embedded Java application device for an application project under development or maintenance. It can run independently on any application developer's device. The component can read and store XML configuration files related to error code generation and orchestration, read error code base files, obtain the location of errors in the currently edited code segment by the application developer, calculate the next error code based on the corresponding error code base, and provide this information back to the application developer.

[0062] Typically, before an application is developed, the configuration rules for error code generation and arrangement only need to be predefined once. If, during application development, the application developer changes the error code configuration items and values ​​in the configuration rules, or modifies or upgrades the error code insertion statements, the error code generation component can rearrange the error codes in the read error code base file according to the new configuration rules, generate error codes that conform to the new configuration rules, and subsequently generate error codes based on the new configuration rules.

[0063] This disclosure embodiment, through an error code generation component, can instantly generate and use local error codes in a first remote error code base file copied locally. This eliminates the problem of indistinguishable duplicate default error codes during development and testing. At the same time, the error code generation component, based on a serial lock-free error code generation mechanism, can reduce the maintenance costs required for compiling and generating error codes, shorten the time cycle from coding to completing the entire application error code generation for deployment, and avoid errors that may be caused by maintaining and updating error codes. Compared with centralized generation, it has a significant performance advantage and can save environmental and human resources.

[0064] S130. After developing the application based on the first remote error code base file, a first local error code base file including the first error code base and the first local error code is obtained.

[0065] This embodiment of the disclosure uses CommitHash as the commit ID of remote error code base files with different generation times to obtain the first remote error code base file whose generation time is closest to the current time. Based on the first error code base in the first remote error code base file, the error code generation component can generate the corresponding first local error code in real time according to actual needs, which facilitates application developers to perform relevant tests on the application locally.

[0066] S200. Obtain a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one first remote error code newly added relative to the first remote error code base file, and at least one first remote error code includes at least one second error code base.

[0067] Optionally, embodiments of this disclosure may obtain a second remote error code base file from a remote code server.

[0068] It is understandable that during the process of obtaining the first local error code base file, the first remote error code base file in the remote code server has been updated to the second remote error code base file. In this embodiment of the disclosure, after obtaining the first local error code base file, the second remote error code base file is read again from the remote code server. This embodiment of the disclosure can determine the code commit records of each code version based on the CommitHash, thereby determining the error codes added to the second remote error code base file relative to the first remote error code base file.

[0069] For example: Suppose the latest error code base in the code commit record corresponding to the first remote error code base file with a CommitHash value of "7253b7fe7101bf2b74c2e9d721fe21b3915f09d7" is "MMOOIZ00083", and the latest error code base in the code commit record corresponding to the second remote error code base file with a CommitHash value of "84094ad275c73964cbc2aeca9251e1026f1cfe80" is "MM If we find "MMOOIZ00088", then we know that the second remote error code base file has added 5 error codes under the error location "MMOOIZ" compared to the first remote error code base file. These are "MMOOIZ00084", "MMOOIZ00085", "MMOOIZ00086", "MMOOIZ00087" and "MMOOIZ00088". At this time, the second error code base in the second remote error code base file under the error location "MMOOIZ" is "MMOOIZ00088".

[0070] S300: Detect whether there is a common target error code among at least one first local error code and at least one first remote error code. If so, proceed to step S400.

[0071] S400, Determine the difference between the first error code base and the second error code base, which are at the same error location as the target error code.

[0072] To facilitate understanding, an example is provided below: Assume the first error code base in the first remote error code base file is "MMOOYQ00041", and the second remote error code base file adds "MMOOYQ00042" and "MMOOYQ00043" to the first remote error code base file relative to the first remote error code base file. Then the second error code base is "MMOOYQ00043". If the first local error code base file adds "MMOOYQ00042" to the first remote error code base file relative to the first local error code base file, then there exists a common target error code "MMOOYQ00042". In this case, it can be determined that the difference between the second error code base "MMOOYQ00043" and the first error code base in the first local error code base file "MMOOYQ00041" is 2.

[0073] Understandably, if the target error code does not exist, and the first local error code and the first remote error code do not have duplicate error codes, the first local error code base file can be directly merged with the second remote error code base file.

[0074] S500. Based on the difference, adjust each of the first local error codes under the error location corresponding to the target error code to generate the second local error code.

[0075] To facilitate understanding, an example is provided here: Assume the difference between the second error code base "MMOOYQ00043" and the first error code base in the first local error code base file "MMOOYQ00041" is 2, and the first local error codes added to the first local error code base file relative to the first remote error code base file are "MMOOYQ00042" and "MMOOYQ00043", then based on the difference of 2, "MMOOYQ00042" in the first remote error code base file is adjusted to "MMOOYQ00044", and based on "MMOOYQ00044", "MMOOYQ00043" in the first remote error code base file is incremented and adjusted to "MMOOYQ00045", finally generating the second local error codes "MMOOYQ00044" and "MMOOYQ00045".

[0076] Optional, based on Figure 1 The method shown is as follows: Figure 3 As shown in the flowchart of another embodiment of the error code generation method provided in this disclosure, after step S500, the method may further include:

[0077] S600: The first local error code base file, which includes the second local error code, is merged with the second remote error code base file to generate a third local error code base file.

[0078] S700, Submit the third local error code base file to the remote code server.

[0079] Specifically, in this embodiment of the disclosure, a CommitHash corresponding to a third local error code base file can be generated, and the file can be submitted to a remote code server based on the CommitHash corresponding to the third local error code base file. This allows the remote code server to determine the third local error code base file as the latest remote error code base file based on its submission history, making it available for use by other application developers. It is understood that when the third local error code base file is submitted to the remote code server based on the CommitHash, the corresponding submission information includes the specific text content of the changes in the third local error code base file relative to the second remote error code base file, the submission author information, the submission time, the branch where the submission occurred, and the submission hash value, etc.

[0080] It is understandable that in an overall application development project, steps S100 to S700 can be repeated multiple times among different application developers. Each time, the remote error code base file obtained from the remote code server is the remote error code base file most recent to the current time, which is the latest remote error code base file.

[0081] This disclosure provides a multi-local online collaborative development function through a remote code server. By combining code scanning of the remote error code base file in the remote code server, it solves the problem that it is impossible to form a unified arrangement and re-arrangement of error codes in a multi-local development scenario. It can merge the local error code base file with the remote error code base file, realize real-time collaboration between different application developers, and facilitate multiple application developers to jointly edit the error codes of the same application.

[0082] This disclosure provides an error code generation method, which involves obtaining a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base from the first remote error code base file and at least one newly added first local error code relative to the first remote error code base file; obtaining a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, and the second remote error code base file includes at least one newly added first remote error code relative to the first remote error code base file, and at least one first remote error code includes at least one second error code base; detecting whether there is a common target error code among at least one first local error code and at least one first remote error code, and if so, determining the difference between the first error code base and the second error code base that are at the same error location corresponding to the target error code; and adjusting each first local error code under the error location corresponding to the target error code according to the difference to generate a second local error code. This disclosure identifies duplicate target error codes by adding error codes to the first local error code base file and the second remote error code base file relative to the first remote error code base file. It then adjusts each first local error code in the first local error code base file corresponding to the target error code to a second local error code, ensuring that the second local error codes in the first local error code base file do not overlap with the first remote error codes in the second remote error code base file. This facilitates the overall arrangement and updating of error codes and improves the overall development efficiency of the application.

[0083] Although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous.

[0084] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0085] Corresponding to the above method embodiments, this disclosure also provides an error code generation apparatus, the structure of which is as follows: Figure 4 As shown, it may include: a first obtaining unit 100, a second obtaining unit 200, a first detecting unit 300, a first determining unit 400, and a first generating unit 500.

[0086] The first obtaining unit 100 is used to obtain a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one first local error code added relative to the first remote error code base file.

[0087] The second obtaining unit 200 is used to obtain a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one first remote error code newly added relative to the first remote error code base file, and at least one first remote error code includes at least one second error code base.

[0088] The first detection unit 300 is used to detect whether there is a common target error code among at least one first local error code and at least one first remote error code. If so, the first determination unit 400 is triggered.

[0089] The first determining unit 400 is used to determine the difference between the first error code base and the second error code base, which are at the same error location as the target error code.

[0090] The first generation unit 500 is used to adjust each of the first local error codes under the error location corresponding to the target error code according to the difference, and generate the second local error code.

[0091] Optionally, the first obtaining unit 100 includes: a first obtaining subunit, a first generating subunit, and a second obtaining subunit.

[0092] The first obtaining subunit is used to obtain a first remote error code base file from a remote code server, wherein the first remote error code base file includes at least one first error code base.

[0093] The first generation subunit is used to generate a first local error code based on the first error code base during the application development process based on the first remote error code base file.

[0094] The second obtaining subunit is used to obtain a first local error code base file, which includes the first error code base and the first local error code, after application development based on the first remote error code base file.

[0095] Optionally, the second obtaining unit 200 is specifically used to obtain a second remote error code base file from a remote code server.

[0096] Optionally, the error code generation device may further include: a first merging unit and a first submission unit.

[0097] The first merging unit is used to merge the first local error code base file, which includes the second local error code, with the second remote error code base file to generate a third local error code base file.

[0098] The first submission unit is used to submit the third local error code base file to the remote code server.

[0099] This disclosure provides an error code generation apparatus that obtains a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, the first local error code base file includes a first error code base from the first remote error code base file and at least one newly added first local error code relative to the first remote error code base file; obtains a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one newly added first remote error code relative to the first remote error code base file, and at least one first remote error code includes at least one second error code base; detects whether there is a common target error code among at least one first local error code and at least one first remote error code, if so, determines the difference between the first error code base and the second error code base that are at the same error location corresponding to the target error code; and adjusts each first local error code under the error location corresponding to the target error code according to the difference to generate a second local error code. This disclosure identifies duplicate target error codes by adding error codes to the first local error code base file and the second remote error code base file relative to the first remote error code base file. It then adjusts each first local error code in the first local error code base file corresponding to the target error code to a second local error code, ensuring that the second local error codes in the first local error code base file do not overlap with the first remote error codes in the second remote error code base file. This facilitates the overall arrangement and updating of error codes and improves the overall development efficiency of the application.

[0100] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0101] The error code generation device includes a processor and a memory. The first obtaining unit 100, the second obtaining unit 200, the first detection unit 300, the first determining unit 400, and the first generation unit 500 are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.

[0102] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, duplicate target error codes can be found by using newly added error codes in the first local error code base file and the second remote error code base file relative to the first remote error code base file. This allows the first local error codes in the first local error code base file corresponding to the target error code to be adjusted to second local error codes. This ensures that the second local error codes in the first local error code base file do not duplicate the first remote error codes in the second remote error code base file, facilitating overall error code organization and updates, and improving the overall development efficiency of the application.

[0103] This disclosure provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the error code generation method.

[0104] This disclosure provides a processor for running a program, wherein the program executes the error code generation method during runtime.

[0105] This disclosure provides an electronic device, including at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the above-described error code generation method. The electronic device described herein may be a server, PC, PAD, mobile phone, etc.

[0106] This disclosure also provides a computer program product that, when executed on an electronic device, is adapted to execute a program with initialization steps for generating error codes.

[0107] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, electronic devices (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0108] In a typical configuration, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input / output interfaces, network interfaces, etc.

[0109] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.

[0110] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0111] In the description of this disclosure, it should be understood that if the terms "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the position or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure.

[0112] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0113] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0114] The above are merely embodiments of this disclosure and are not intended to limit the scope of this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of the claims of this disclosure.

Claims

1. An error code generation method, characterized in that, include: Obtain a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one first local error code added relative to the first remote error code base file; A second remote error code base file is obtained, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one first remote error code newly added relative to the first remote error code base file, and the at least one first remote error code includes at least one second error code base; Detect whether there is a common target error code among the at least one first local error code and the at least one first remote error code; if so, determine the difference between the first error code base and the second error code base that are at the same error location as the target error code. Based on the difference, each of the first local error codes at the location corresponding to the target error code is adjusted to generate a second local error code.

2. The method according to claim 1, characterized in that, The process of obtaining the first local error code base file includes: Obtain the first remote error code base file from a remote code server, wherein the first remote error code base file includes at least one of the first error code bases; During the application development process based on the first remote error code base file, the first local error code is generated according to the first error code base. After developing the application based on the first remote error code base file, a first local error code base file is obtained, which includes the first error code base and the first local error code.

3. The method according to claim 2, characterized in that, The process of obtaining the second remote error code base file includes: Obtain the second remote error code base file from the remote code server.

4. The method according to claim 3, characterized in that, After generating the second local error code, the method further includes: The first local error code base file, which includes the second local error code, is merged with the second remote error code base file to generate a third local error code base file; The third local error code base file is submitted to the remote code server.

5. An error code generation device, characterized in that, include: The system comprises a first obtaining unit, a second obtaining unit, a first detecting unit, a first determining unit, and a first generating unit. The first obtaining unit is used to obtain a first local error code base file, wherein the first local error code base file is generated based on a first remote error code base file, and the first local error code base file includes a first error code base in the first remote error code base file and at least one first local error code added relative to the first remote error code base file; The second obtaining unit is used to obtain a second remote error code base file, wherein the second remote error code base file is generated later than the first remote error code base file, the second remote error code base file includes at least one first remote error code newly added relative to the first remote error code base file, and the at least one first remote error code includes at least one second error code base; The first detection unit is used to detect whether there is a common target error code among the at least one first local error code and the at least one first remote error code; if so, the first determination unit is triggered. The first determining unit is used to determine the difference between the first error code base and the second error code base, which are at the same location as the error corresponding to the target error code; The first generation unit is used to adjust each of the first local error codes under the error location corresponding to the target error code according to the difference, and generate a second local error code.

6. The apparatus according to claim 5, characterized in that, The first obtaining unit includes: a first obtaining subunit, a first generating subunit, and a second obtaining subunit. The first obtaining subunit is configured to obtain the first remote error code base file from the remote code server, wherein the first remote error code base file includes at least one of the first error code bases; The first generation subunit is used to generate the first local error code according to the first error code base during the application development process based on the first remote error code base file; The second obtaining subunit is used to obtain a first local error code base file, which includes the first error code base and the first local error code, after application development based on the first remote error code base file.

7. The apparatus according to claim 6, characterized in that, The second obtaining unit is specifically used to obtain a second remote error code base file from the remote code server.

8. The apparatus according to claim 7, characterized in that, Also includes: The first merging unit and the first submission unit, The first merging unit is configured to merge the first local error code base file, which includes the second local error code, as the second local error code base file with the second remote error code base file to generate a third local error code base file; The first submission unit is used to submit the third local error code base file to the remote code server.

9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the error code generation method as described in any one of claims 1 to 4.

10. An electronic device, the electronic device comprising at least one processor, and at least one memory and a bus connected to the processor; wherein, The processor and the memory communicate with each other via the bus; The processor is used to invoke program instructions in the memory to execute the error code generation method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Error code information maintenance method and device

    CN107993707A

  • Software system error code management method and device, electronic equipment and storage medium

    CN113485939A