CN112698868B - Unified error code method applied to multiple systems and storage device - Google Patents

Unified error code method applied to multiple systems and storage device Download PDF

Info

Publication number
CN112698868B
CN112698868B CN202110022228.0A CN202110022228A CN112698868B CN 112698868 B CN112698868 B CN 112698868B CN 202110022228 A CN202110022228 A CN 202110022228A CN 112698868 B CN112698868 B CN 112698868B
Authority
CN
China
Prior art keywords
error code
software
error
bits
version
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110022228.0A
Other languages
Chinese (zh)
Other versions
CN112698868A (en
Inventor
刘翊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rockchip Electronics Co Ltd
Original Assignee
Rockchip Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rockchip Electronics Co Ltd filed Critical Rockchip Electronics Co Ltd
Priority to CN202110022228.0A priority Critical patent/CN112698868B/en
Publication of CN112698868A publication Critical patent/CN112698868A/en
Application granted granted Critical
Publication of CN112698868B publication Critical patent/CN112698868B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of data processing, in particular to a unified error code method and storage equipment applied to multiple systems. The unified error code method applied to the multiple systems comprises the following steps: predefining a multi-system error code generation specification; responding to a code writing instruction, and adding error code information in a note of a place needing to return an error code; automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file. Through the steps, the problem of disordered error codes of multi-system multi-version software can be solved, and the speed of positioning problems of developers is greatly improved.

Description

Unified error code method applied to multiple systems and storage device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a unified error code method and storage device applied to multiple systems.
Background
Most companies currently have no standard on the definition of error codes used in software or systems, and there are huge differences in the definition of error codes between different software or systems, and even the definition of error codes varies between different versions of the same system or software. Error code definitions can increase the difficulty of late positioning problems and affect user experience too randomly. The main problem is that there is no convenient implementation tool for unified error codes.
Disclosure of Invention
Therefore, a unified error code method applied to multiple systems is needed to be provided, so as to solve the technical problem that no unified error code implementation method exists among multiple software of the existing multiple systems, so that different error code definitions cause problems in later positioning. The specific technical scheme is as follows:
a unified error code method applied to multiple systems comprises the following steps:
predefining a multi-system error code generation specification;
responding to a code writing instruction, and adding error code information in a note of a place needing to return an error code;
automatically extracting error code information in the annotation and generating an error code related file corresponding to the development voice, wherein the error code related file comprises: an error code definition file and/or an error code data file.
Further, the "automatically extracting error code information in the annotation and generating an error code related file corresponding to the development language" specifically includes the following steps:
reading all code files, and extracting error code information of each target, wherein each target comprises one or more of the following objects: software name, software version, methods, functions;
querying an error code background database through the software name and the software version to obtain corresponding codes of the current software and the version;
and traversing the error code information of each method and each function to generate a corresponding code definition.
Further, the method also comprises the following steps: and performing data warehousing on the software name, the software version and the error code information according to a preset rule to generate an error code data file.
In order to solve the technical problem, the storage device is further provided, and the specific technical scheme is as follows:
a storage device having stored therein a set of instructions for performing:
predefining a multi-system error code generation specification;
responding to a code writing instruction, and adding error code information in a note of a place needing to return an error code;
automatically extracting error code information in the comments and generating an error code related file corresponding to the development language, wherein the error code related file comprises: an error code definition file and/or an error code data file.
Further, the set of instructions is further for performing: the method comprises the steps of automatically extracting error code information in comments and generating an error code related file corresponding to a development language, and specifically comprises the following steps:
reading all code files, and extracting error code information of each target, wherein each target comprises one or more of the following objects: software name, software version, methods, functions;
acquiring corresponding codes of the current software and the version through a software name and software version error code background database;
and traversing the error code information of each method and each function to generate a corresponding code definition.
Further, the set of instructions is further for performing: and performing data warehousing on the software name, the software version and the error code information according to a preset rule to generate an error code data file.
The invention has the beneficial effects that: generating a specification by a predefined error code; responding to a code writing instruction, and adding error code information in a note returning to a place needing an error code; automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file. Through the steps, the problem of disordered error codes of multi-system multi-version software can be solved, and the speed of positioning problems of developers is greatly improved.
Drawings
FIG. 1 is a flow chart illustrating a unified error code method for multiple systems according to an embodiment;
FIG. 2 is a diagram illustrating a predefined error code generation specification according to an embodiment;
FIG. 3 is a diagram illustrating an exemplary format of a C error code definition file according to an embodiment;
FIG. 4 is a diagram illustrating a software name and a software version stored in a collection according to an embodiment;
FIG. 5 is a schematic structural diagram of the AllError set according to an embodiment;
fig. 6 is a block diagram of a storage device according to an embodiment.
Description of reference numerals:
600. a storage device.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1 to 5, in the present embodiment, a unified error code method applied to multiple systems can be applied to a storage device, including but not limited to: personal computers, servers, general purpose computers, special purpose computers, network devices, embedded devices, programmable devices, intelligent mobile terminals, etc. The method comprises the following specific steps:
step S101: a multi-system error code generation specification is predefined. In the present embodiment, the error code generation specification is shown in the following table:
the length of the error code is 32 bits, the upper 8 bits are used to indicate which system or software is, the next 8 bits are used to indicate the version number of the software or system, the next 12 bits are used to indicate the function or method corresponding to the error code, and the lower 4 bits are the specific cause of the error.
Figure BDA0002889058820000031
Step S102: error code information is added to the notes where the error code needs to be returned in response to code writing instructions. The method specifically comprises the following steps: and adding information for assisting error code generation in help notes for returning functions or methods needing error codes while writing software or system codes.
Taking C language development platform as an example, error code annotation is inserted in front of the function or method that needs to use error code, and the content is roughly shown in fig. 2. It should be noted that the technical solution can also be applied to various languages such as java and python and different platforms.
Step S103: automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file.
The method comprises the steps of automatically extracting error code information in comments and generating an error code related file corresponding to a development language, and specifically comprises the following steps:
reading all code files, and extracting error code information of each target, wherein each target comprises one or more of the following components: software name, software version, methods, functions;
inquiring an error code background database through the software name and the software version to obtain corresponding codes of the current software and the version;
and traversing the error code information of each method and each function to generate a corresponding code definition. The method specifically comprises the following steps:
1. and querying an error code data background through the software name and the software version, directly acquiring high 16-bit data of the error code if the software code and the version code of the high 16-bit of the error code are queried, inserting the current software version record into a Repo set if the software code and the version code of the high 16-bit of the error code are not queried, and returning the code generated during insertion.
2. And traversing error code information of all methods or functions to generate corresponding code definitions.
Wherein the C error code defines the file format as shown in fig. 3.
Further, the method also comprises the following steps: and performing data warehousing on the software name, the software version and the error code information according to a preset rule to generate an error code data file. The method specifically comprises the following steps:
1. as shown in fig. 4, the software name and the software version are stored in a set, and in the present embodiment, Repo is named.
2. And storing the error code name, the error code value and the error code description, the function name and the function code into an AllError set according to the structure shown in FIG. 5, and combining the error code set of each software version into a record.
Generating a specification by a predefined error code; responding to a code writing instruction, and adding error code information in a note returning to a place needing an error code; automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file. Through the steps, the problem of disordered error codes of multi-system multi-version software can be solved, and the speed of positioning problems of developers is greatly improved.
Referring to fig. 2 to fig. 6, in the present embodiment, an embodiment of a memory device 600 is as follows:
a storage device 600 having stored therein a set of instructions for performing:
a multi-system error code generation specification is predefined. In this embodiment, the multi-system error code generation specification is shown in the following table:
the length of the error code is 32 bits, the upper 8 bits are used to indicate which system or software is, the next 8 bits are used to indicate the version number of the software or system, the next 12 bits are used to indicate the function or method corresponding to the error code, and the lower 4 bits are the specific cause of the error.
Figure BDA0002889058820000051
Error code information is added to the notes where the error code needs to be returned in response to code writing instructions. The method specifically comprises the following steps: and adding information for assisting error code generation in help notes for returning functions or methods needing error codes while writing software or system codes.
Taking C language development platform as an example, error code annotation is inserted in front of the function or method that needs to use error code, and the content is roughly shown in fig. 2. It should be noted that the technical solution can also be applied to various languages such as java and python and different platforms.
Automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file.
Further, the set of instructions is further for performing: the method comprises the steps of automatically extracting error code information in comments and generating an error code related file corresponding to a development language, and specifically comprises the following steps:
reading all code files, and extracting error code information of each target, wherein each target comprises one or more of the following objects: software name, software version, methods, functions;
and querying an error code background database through the software name and the software version to obtain corresponding codes of the current software and the version. The method specifically comprises the following steps:
1. and querying an error code data background through the software name and the software version, directly acquiring high 16-bit data of the error code if the software code and the version code of the high 16-bit of the error code are queried, inserting the current software version record into a Repo set if the software code and the version code of the high 16-bit of the error code are not queried, and returning the code generated during insertion.
2. And traversing error code information of all methods or functions to generate corresponding code definitions.
Wherein the C error code defines the file format as shown in fig. 3.
Further, the set of instructions is further for performing: and performing data warehousing on the software name, the software version and the error code information according to a preset rule to generate an error code data file.
The method specifically comprises the following steps:
1. as shown in fig. 4, the software name and the software version are stored in a set, and in the present embodiment, Repo is named.
2. And storing the error code name, the error code value and the error code description, the function name and the function code into an AllError set according to the structure shown in FIG. 5, and combining the error code set of each software version into a record.
Performed by a set of instructions on the storage device 600: predefining error code generation specifications; responding to a code writing instruction, and adding error code information in a note returning to a place needing an error code; automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file. The problem of disordered error codes of multi-system multi-version software can be solved, and the speed of positioning problems of developers is greatly improved.
It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (6)

1. A unified error code method applied to multiple systems is characterized by comprising the following steps:
predefining a multi-system error code generation specification, wherein the error code generation specification is as follows: the length of the error code is 32 bits, the upper 8 bits are used for indicating which system or software is, the next 8 bits are used for indicating the version number of the software or the system, the next 12 bits are used for indicating the function or the method corresponding to the error code, and the lower 4 bits are used for indicating the specific reason of the error;
responding to a code writing instruction, and adding error code information in a note of a place needing to return an error code;
automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file.
2. The method according to claim 1, wherein the step of automatically extracting error code information in comments and generating an error code related file corresponding to a development language further comprises the steps of:
reading all code files, and extracting error code information of each target, wherein each target comprises one or more of the following objects: software name, software version, methods, functions;
querying an error code background database through the software name and the software version to obtain corresponding codes of the current software and the version;
and traversing the error code information of each method and each function to generate a corresponding code definition.
3. The method of claim 2, further comprising the steps of: and performing data warehousing on the software name, the software version and the error code information according to a preset rule to generate an error code data file.
4. A storage device having a set of instructions stored therein, the set of instructions being operable to perform:
predefining a multi-system error code generation specification, wherein the error code generation specification is as follows: the length of the error code is 32 bits, the upper 8 bits are used for indicating which system or software is, the next 8 bits are used for indicating the version number of the software or the system, the next 12 bits are used for indicating the function or the method corresponding to the error code, and the lower 4 bits are used for indicating the specific reason of the error;
responding to a code writing instruction, and adding error code information in a note of a place needing to return an error code;
automatically extracting error code information in the annotation and generating an error code related file corresponding to a development language, wherein the error code related file comprises: an error code definition file and/or an error code data file.
5. The storage device of claim 4, wherein the set of instructions is further configured to perform: the method comprises the steps of automatically extracting error code information in comments and generating an error code related file corresponding to a development language, and specifically comprises the following steps:
reading all code files, and extracting error code information of each target, wherein each target comprises one or more of the following objects: software name, software version, methods, functions;
inquiring an error code background database through the software name and the software version to obtain corresponding codes of the current software and the version;
and traversing the error code information of each method and each function to generate a corresponding code definition.
6. The storage device of claim 5, wherein the set of instructions is further configured to perform: and performing data warehousing on the software name, the software version and the error code information according to a preset rule to generate an error code data file.
CN202110022228.0A 2021-01-08 2021-01-08 Unified error code method applied to multiple systems and storage device Active CN112698868B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110022228.0A CN112698868B (en) 2021-01-08 2021-01-08 Unified error code method applied to multiple systems and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110022228.0A CN112698868B (en) 2021-01-08 2021-01-08 Unified error code method applied to multiple systems and storage device

Publications (2)

Publication Number Publication Date
CN112698868A CN112698868A (en) 2021-04-23
CN112698868B true CN112698868B (en) 2022-08-12

Family

ID=75513305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110022228.0A Active CN112698868B (en) 2021-01-08 2021-01-08 Unified error code method applied to multiple systems and storage device

Country Status (1)

Country Link
CN (1) CN112698868B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500304A (en) * 2021-12-30 2022-05-13 中国电信股份有限公司 Exception handling method and device, electronic equipment and readable storage medium
CN114546466A (en) * 2022-04-24 2022-05-27 广州易方信息科技股份有限公司 Error code generation method and device
CN117235107B (en) * 2023-11-10 2024-01-26 恒生电子股份有限公司 Data access processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874163A (en) * 2016-12-29 2017-06-20 广州华多网络科技有限公司 A kind of method and system for showing software error code information
CN110795148A (en) * 2019-10-28 2020-02-14 北京旷视科技有限公司 Method and device for generating layout file and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10409707B2 (en) * 2016-09-16 2019-09-10 Facebook, Inc. Methods and systems for analyzing annotated programming code
CN107357942A (en) * 2017-09-04 2017-11-17 山东达创网络科技股份有限公司 A kind of source code auxiliary Core Generator and its generation method
CN109146095A (en) * 2018-08-24 2019-01-04 深圳壹账通智能科技有限公司 The treating method and apparatus of multiservice system problem

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874163A (en) * 2016-12-29 2017-06-20 广州华多网络科技有限公司 A kind of method and system for showing software error code information
CN110795148A (en) * 2019-10-28 2020-02-14 北京旷视科技有限公司 Method and device for generating layout file and electronic equipment

Also Published As

Publication number Publication date
CN112698868A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
CN112698868B (en) Unified error code method applied to multiple systems and storage device
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN101763255B (en) Format conversion method and device of special interface tool
CN111339041A (en) File parsing and warehousing and file generating method and device
CN108334609B (en) Method, device, equipment and storage medium for realizing JSON format data access in Oracle
CN111159982B (en) Document editing method, device, electronic equipment and computer readable storage medium
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN110362630B (en) Data management method, device, equipment and computer readable storage medium
CN116644213A (en) XML file reading method, device, equipment and storage medium
CN110096541B (en) Method and device for data exchange between databases
CN115061990A (en) Log storage method, log retrieval method, log storage device, log retrieval device and log storage medium
CN104156373A (en) Coding format detection method and device
CN101739589A (en) Method and device for generating intelligent card data
CN105867886B (en) Method and device for writing table
CN104378362A (en) Method and device for carrying out conversion of message interfaces
CN111241096A (en) Text extraction method, system, terminal and storage medium for EXCEL document
CN111984591A (en) File storage method, file reading method, file storage device, file reading device, equipment and computer readable storage medium
CN115310127A (en) Data desensitization method and device
CN114661298A (en) Automatic public method generation method, system, device and medium
CN109509467B (en) Code generation method and device
CN116954622B (en) Method for associating abstract syntax tree with source code coordinates, electronic device and medium
CN113935289A (en) Document online processing method and device
CN113485682A (en) Method and equipment for generating configuration file based on demand information
CN117130618A (en) Incremental compiling method, device and equipment for executable file of intelligent card
CN113220782A (en) Method, device, equipment and medium for generating multivariate test data source

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant